fixed a bug when mem is negative
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 10 Apr 2006 20:10:49 +0000 (20:10 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 10 Apr 2006 20:10:49 +0000 (20:10 +0000)
examples/ampi/alltoall/alltoall_VPtest.c

index 8b7d7295410c76e81da6659bb007ba40e700e372..eab61d740e9379cc4814b676a773bc26a74f7f29 100644 (file)
@@ -114,6 +114,7 @@ main(int argc, char **argv){
 
   memory_after = CmiMemoryUsage();
   local_memory_max = CmiMaxMemoryUsage() - memory_before;
+  if (local_memory_max < 0) local_memory_max = 0;
 
   // Reduce MAX here
   assert(MPI_SUCCESS==MPI_Reduce(&local_memory_max, &memory_max, 1, MPI_UNSIGNED_LONG, MPI_MAX, 0, MPI_COMM_WORLD));