[MOAB-dev] r2227 - MOAB/trunk/parallel

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Wed Nov 12 20:45:19 CST 2008


Author: kraftche
Date: 2008-11-12 20:45:19 -0600 (Wed, 12 Nov 2008)
New Revision: 2227

Modified:
   MOAB/trunk/parallel/parallel_unit_tests.cpp
Log:
fix bug: need to set array values before passing to MPI_Allgatherv

Modified: MOAB/trunk/parallel/parallel_unit_tests.cpp
===================================================================
--- MOAB/trunk/parallel/parallel_unit_tests.cpp	2008-11-12 20:12:04 UTC (rev 2226)
+++ MOAB/trunk/parallel/parallel_unit_tests.cpp	2008-11-13 02:45:19 UTC (rev 2227)
@@ -642,6 +642,18 @@
                    owned_displs(pcomm->proc_config().proc_size()),
                    ghost_counts(pcomm->proc_config().proc_size()),
                    ghost_displs(pcomm->proc_config().proc_size());
+  error = MPI_Allgather( counts, 1, MPI_INT, &owned_counts[0], 1, MPI_INT,
+                         pcomm->proc_config().proc_comm() );
+  PCHECK(!error);
+  error = MPI_Allgather( counts+1, 1, MPI_INT, &ghost_counts[0], 1, MPI_INT,
+                         pcomm->proc_config().proc_comm() );
+  PCHECK(!error);
+  owned_displs[0] = ghost_displs[0] = 0;
+  for (unsigned i = 1; i < pcomm->proc_config().proc_size(); ++i) {
+    owned_displs[i] = owned_displs[i-1] + owned_counts[i-1];
+    ghost_displs[i] = ghost_displs[i-1] + ghost_counts[i-1];
+  }
+  
   error = MPI_Allgatherv( &my_ent_ids[0], my_ent_ids.size(), MPI_INT,
                           &all_owned[0], &owned_counts[0], &owned_displs[0],
                           MPI_INT, pcomm->proc_config().proc_comm() );




More information about the moab-dev mailing list