[cig-commits] [commit] master: Fix block data distribution for non-MPI (138626f)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Oct 2 10:01:44 PDT 2014
Repository : https://github.com/geodynamics/vc
On branch : master
Link : https://github.com/geodynamics/vc/compare/4b8e057e647aa7046125d23d38e0b1b2a848624c...23464fca3efa2b6ad7ee0ce8f60c225b18b49741
>---------------------------------------------------------------
commit 138626f65862543ee8c5e827e702cc8ccf0e1ec1
Author: Eric Heien <emheien at ucdavis.edu>
Date: Thu Oct 2 10:01:31 2014 -0700
Fix block data distribution for non-MPI
Confirmed all single processor tests pass with MPI disabled
>---------------------------------------------------------------
138626f65862543ee8c5e827e702cc8ccf0e1ec1
src/core/VCSimulation.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/core/VCSimulation.cpp b/src/core/VCSimulation.cpp
index 2b42b64..8daf4ea 100644
--- a/src/core/VCSimulation.cpp
+++ b/src/core/VCSimulation.cpp
@@ -530,9 +530,10 @@ void VCSimulation::distributeUpdateField(void) {
Distributes a list of blocks among all processors. Used for determining failed blocks in a sweep.
*/
void VCSimulation::distributeBlocks(const BlockIDSet &local_id_list, BlockIDProcMapping &global_id_list) {
+ BlockIDSet::const_iterator it;
+
#ifdef MPI_C_FOUND
int i, n, p;
- BlockIDSet::const_iterator it;
int *proc_block_count = new int[world_size];
int *proc_block_disps = new int[world_size];
BlockID *local_block_ids = new BlockID[local_id_list.size()];
@@ -589,7 +590,11 @@ void VCSimulation::distributeBlocks(const BlockIDSet &local_id_list, BlockIDProc
delete block_ids;
delete proc_block_count;
delete proc_block_disps;
-
+#else // MPI_C_FOUND
+ // Copy the local IDs into the global list just for the single processor
+ for (it=local_id_list.begin();it!=local_id_list.end();++it) {
+ global_id_list.insert(std::make_pair(*it, 0));
+ }
#endif
}
More information about the CIG-COMMITS
mailing list