From abedc94c53562c7acba40b902c1cb057951b4beb Mon Sep 17 00:00:00 2001 From: Brody Richard Bassett Date: Wed, 6 Nov 2024 14:03:06 -0800 Subject: [PATCH 1/4] Added NodeList index to DataBase --- src/DataBase/DataBase.cc | 14 ++++++++++++++ src/DataBase/DataBase.hh | 1 + 2 files changed, 15 insertions(+) diff --git a/src/DataBase/DataBase.cc b/src/DataBase/DataBase.cc index 3ad7073e8..cc134f5df 100644 --- a/src/DataBase/DataBase.cc +++ b/src/DataBase/DataBase.cc @@ -841,6 +841,20 @@ haveNodeList(const NodeList& nodeList) const { return itr != nodeListEnd(); } +//------------------------------------------------------------------------------ +// Get the NodeList index for the given NodeList +//------------------------------------------------------------------------------ +template +int +DataBase:: +nodeListIndex(const NodeList& nodeList) const { + ConstNodeListIterator itr = find(nodeListBegin(), + nodeListEnd(), + &nodeList); + ASSERT(itr != nodeListEnd()); + return std::distance(nodeListBegin(), itr); +} + //------------------------------------------------------------------------------ // Return the const list of NodeList pointers. //------------------------------------------------------------------------------ diff --git a/src/DataBase/DataBase.hh b/src/DataBase/DataBase.hh index b9edc1d20..d3d7739a2 100644 --- a/src/DataBase/DataBase.hh +++ b/src/DataBase/DataBase.hh @@ -198,6 +198,7 @@ public: void deleteNodeList(NodeList& nodeList); bool haveNodeList(const NodeList& nodeList) const; + int nodeListIndex(const NodeList& nodeList) const; // Allow const access to the list of NodeList pointers. const std::vector*>& nodeListPtrs() const; From d6e87876a86af4434a0643012b61587e69a0a1c4 Mon Sep 17 00:00:00 2001 From: Brody Richard Bassett Date: Mon, 11 Nov 2024 12:58:42 -0800 Subject: [PATCH 2/4] Changed assert to verify --- src/DataBase/DataBase.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataBase/DataBase.cc b/src/DataBase/DataBase.cc index cc134f5df..c6e1c0d29 100644 --- a/src/DataBase/DataBase.cc +++ b/src/DataBase/DataBase.cc @@ -851,7 +851,7 @@ nodeListIndex(const NodeList& nodeList) const { ConstNodeListIterator itr = find(nodeListBegin(), nodeListEnd(), &nodeList); - ASSERT(itr != nodeListEnd()); + VERIFY(itr != nodeListEnd()); return std::distance(nodeListBegin(), itr); } From 919283c59eca6c655d799fa0b949e8cc8ca4f116 Mon Sep 17 00:00:00 2001 From: Brody Richard Bassett Date: Tue, 12 Nov 2024 13:47:07 -0800 Subject: [PATCH 3/4] Added additional MPI operations --- src/Distributed/mpi_mpi4py.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Distributed/mpi_mpi4py.py b/src/Distributed/mpi_mpi4py.py index 5f99f1755..3b4e168af 100644 --- a/src/Distributed/mpi_mpi4py.py +++ b/src/Distributed/mpi_mpi4py.py @@ -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. From 3de33103a8ecf02ce4c57ba40a7f24a422526352 Mon Sep 17 00:00:00 2001 From: Brody Richard Bassett Date: Wed, 11 Dec 2024 14:33:45 -0800 Subject: [PATCH 4/4] Added minloc and maxloc to fakempi --- src/Distributed/fakempi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Distributed/fakempi.py b/src/Distributed/fakempi.py index 11d0eaa62..e5dcfa822 100644 --- a/src/Distributed/fakempi.py +++ b/src/Distributed/fakempi.py @@ -7,6 +7,8 @@ MIN = -1 MAX = -2 SUM = -3 +MINLOC = -4 +MAXLOC = -5 def is_fake_mpi(): return True