[MOAB-dev] r2240 - in MOAB/trunk: parallel tools/iMesh

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Nov 13 15:01:59 CST 2008


Author: kraftche
Date: 2008-11-13 15:01:59 -0600 (Thu, 13 Nov 2008)
New Revision: 2240

Modified:
   MOAB/trunk/parallel/MBParallelComm.cpp
   MOAB/trunk/tools/iMesh/iMeshP_unit_tests.cpp
Log:
fix more bugs: all implemented iMeshP unit tests except one now pass when running on 4 processors

Modified: MOAB/trunk/parallel/MBParallelComm.cpp
===================================================================
--- MOAB/trunk/parallel/MBParallelComm.cpp	2008-11-13 20:01:51 UTC (rev 2239)
+++ MOAB/trunk/parallel/MBParallelComm.cpp	2008-11-13 21:01:59 UTC (rev 2240)
@@ -1522,6 +1522,9 @@
                                             int num_ents,
                                             int other_proc) 
 {
+  if (0 == num_ents)
+    return MB_SUCCESS;
+
     // NOTE: THIS IMPLEMENTATION IS JUST LIKE THE RANGE-BASED VERSION, NO REUSE
     // AT THIS TIME, SO IF YOU FIX A BUG IN THIS VERSION, IT MAY BE IN THE
     // OTHER VERSION TOO!!!
@@ -4208,7 +4211,8 @@
     rval = get_sharing_parts( *i, curr, n );
     if (MB_SUCCESS != rval)
       return rval;
-    std::sort( parts, parts+n );
+    std::sort( curr, curr+n );
+    assert( num_neighbors_out < MAX_SHARING_PROCS );
     int* k = std::set_union( parts[j], parts[j]+num_neighbors_out,
                              curr, curr + n, parts[1-j] );
     j = 1-j;

Modified: MOAB/trunk/tools/iMesh/iMeshP_unit_tests.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMeshP_unit_tests.cpp	2008-11-13 20:01:51 UTC (rev 2239)
+++ MOAB/trunk/tools/iMesh/iMeshP_unit_tests.cpp	2008-11-13 21:01:59 UTC (rev 2240)
@@ -333,10 +333,10 @@
 #endif
       // loop forever on requested processor, giving the user time
       // to attach a debugger.  Once the debugger in attached, user
-      // can change 'stop'.  E.g. on gdb do "set var stop = 1"
+      // can change 'stop'.  E.g. on gdb do "set var pause = 0"
     if (atoi(argv[2]) == rank) {
-      volatile int stop = 0;
-      while (!stop);
+      volatile int pause = 1;
+      while (pause);
     }
     MPI_Barrier(MPI_COMM_WORLD);
   }
@@ -344,7 +344,7 @@
   if (rank == 0) {
     ierr = create_mesh( FILENAME, size );
   }
-  MPI_Scatter( &ierr, 1, MPI_INT, &ierr, 1, MPI_INT, 0, MPI_COMM_WORLD );
+  MPI_Bcast( &ierr, 1, MPI_INT, 0, MPI_COMM_WORLD );
   if (ierr) {
     if (rank == 0) {
       std::cerr << "Failed to create input test file on root processor.  Aborting."
@@ -517,10 +517,10 @@
   for (int i = 0; i < num_parts; ++i) {
     iMeshP_PartHandle part;
     iMeshP_createPart( imesh, partition, &part, &ierr ); CHKERR;
-    iBase_EntityHandle quads[] = { elements[i/2  ][2*(i%2)  ],
-                                   elements[i/2+1][2*(i%2)  ],
-                                   elements[i/2  ][2*(i%2)+1],
-                                   elements[i/2+1][2*(i%2)+1] };
+    iBase_EntityHandle quads[] = { elements[2*(i/2)  ][2*(i%2)  ],
+                                   elements[2*(i/2)+1][2*(i%2)  ],
+                                   elements[2*(i/2)  ][2*(i%2)+1],
+                                   elements[2*(i/2)+1][2*(i%2)+1] };
     iBase_EntitySetHandle set = part;
     iMesh_addEntArrToSet( imesh, quads, 4, &set, &ierr ); CHKERR;
     assert(set == part);




More information about the moab-dev mailing list