Skip to content

Commit

Permalink
Merge pull request #313 from LLNL/feature/bassett4/nodelist-index
Browse files Browse the repository at this point in the history
Added NodeList index to DataBase
  • Loading branch information
brbass authored Dec 12, 2024
2 parents e282594 + 3de3310 commit 721c079
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/DataBase/DataBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,20 @@ haveNodeList(const NodeList<Dimension>& nodeList) const {
return itr != nodeListEnd();
}

//------------------------------------------------------------------------------
// Get the NodeList index for the given NodeList
//------------------------------------------------------------------------------
template<typename Dimension>
int
DataBase<Dimension>::
nodeListIndex(const NodeList<Dimension>& nodeList) const {
ConstNodeListIterator itr = find(nodeListBegin(),
nodeListEnd(),
&nodeList);
VERIFY(itr != nodeListEnd());
return std::distance(nodeListBegin(), itr);
}

//------------------------------------------------------------------------------
// Return the const list of NodeList pointers.
//------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/DataBase/DataBase.hh
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public:
void deleteNodeList(NodeList<Dimension>& nodeList);

bool haveNodeList(const NodeList<Dimension>& nodeList) const;
int nodeListIndex(const NodeList<Dimension>& nodeList) const;

// Allow const access to the list of NodeList pointers.
const std::vector<NodeList<Dimension>*>& nodeListPtrs() const;
Expand Down
2 changes: 2 additions & 0 deletions src/Distributed/fakempi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
MIN = -1
MAX = -2
SUM = -3
MINLOC = -4
MAXLOC = -5

def is_fake_mpi():
return True
Expand Down
2 changes: 2 additions & 0 deletions src/Distributed/mpi_mpi4py.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
MIN = MPI.MIN
MAX = MPI.MAX
SUM = MPI.SUM
MINLOC = MPI.MINLOC
MAXLOC = MPI.MAXLOC

#-------------------------------------------------------------------------------
# Prepare files to keep the stdout and stderr streams in.
Expand Down

0 comments on commit 721c079

Please sign in to comment.