Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added NodeList index to DataBase #313

Merged
merged 7 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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