missing initialization of total_pes when +wp is not present
authorGengbin Zheng <gzheng@illinois.edu>
Sun, 30 Oct 2011 22:32:04 +0000 (17:32 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Sun, 30 Oct 2011 22:32:04 +0000 (17:32 -0500)
src/arch/mpi/machine.c

index 1f67fcbc4dd9cc1495f63f28febf54f638d97133..11f28a39d0440d85a88ee986e44c3ae327662319 100644 (file)
@@ -1097,11 +1097,11 @@ static void MachineInitForMPI(int *argc, char ***argv, int *numNodes, int *myNod
        CmiAssert(num_workpes <= *numNodes);
        total_pes = *numNodes;
        *numNodes = num_workpes;
-       if (*myNodeID == 0)
-           CmiPrintf("Charm++> FT using %d processors and %d spare processors.\n", num_workpes, total_pes-num_workpes);
     }
     else
-       num_workpes = *numNodes;
+       total_pes = num_workpes = *numNodes;
+    if (*myNodeID == 0)
+       CmiPrintf("Charm++> FT using %d processors and %d spare processors.\n", num_workpes, total_pes-num_workpes);
     petorank = (int *)malloc(sizeof(int) * num_workpes);
     for (i=0; i<num_workpes; i++)  petorank[i] = i;
     nextrank = num_workpes;
@@ -1572,7 +1572,7 @@ void mpi_end_spare()
 int find_spare_mpirank(int pe)
 {
     if (nextrank == total_pes) {
-      CmiAbort("Charm++> ran out of spare processors");
+      CmiAbort("Charm++> No spare processor available.");
     }
     petorank[pe] = nextrank;
     nextrank++;