[PATCH] fix fftm-par.cpp under LAM.

Nathan (Jasper) Myers ncm at codesourcery.com
Sun Sep 18 01:49:04 UTC 2005


I have checked in the patch below to make fftm-par.cpp run correctly
in parallel under mpich-1.2.7 "ch_p4" mode on my x86, and under LAM 
on sethra.

(I still don't know why comm.barrier() has no apparent effect, for me, 
both in LAM on sethra and in mpich-shmem, here.)

Nathan Myers
ncm

Index: ChangeLog
===================================================================
RCS file: /home/cvs/Repository/vpp/ChangeLog,v
retrieving revision 1.257
diff -u -p -r1.257 ChangeLog
--- ChangeLog	17 Sep 2005 21:52:22 -0000	1.257
+++ ChangeLog	18 Sep 2005 01:44:37 -0000
@@ -1,3 +1,8 @@
+2005-09-17  Nathan Myers  <ncm at codesourcery.com>
+
+	* tests/fftm-par.cpp: robustify against mysterious behavior
+	  in sethra lam mpi.
+	
 2005-09-17  Mark Mitchell  <mark at codesourcery.com>
 
 	* doc/quickstart/quickstart.xml: Mention FFTW, IPP, MKL, and
Index: tests/fftm-par.cpp
===================================================================
RCS file: /home/cvs/Repository/vpp/tests/fftm-par.cpp,v
retrieving revision 1.1
diff -u -p -r1.1 fftm-par.cpp
--- tests/fftm-par.cpp	10 Sep 2005 10:18:43 -0000	1.1
+++ tests/fftm-par.cpp	18 Sep 2005 01:44:37 -0000
@@ -197,7 +197,10 @@ error_db(
   int size = comm.size();
 
   if (rank != 0)
+  {
     comm.buf_send(0, &refmax, 1);
+    comm.recv(0, &refmax, 1);
+  }
   else
   {
     for (int i = 1; i < size; ++i)
@@ -207,6 +210,8 @@ error_db(
       if (refmax < otherefmax)
 	refmax = otherefmax;
     }
+    for (int i = 1; i < size; ++i)
+      comm.buf_send(i, &refmax, 1);
   }
 
 
@@ -226,7 +231,10 @@ error_db(
     }
 
   if (rank != 0)
+  {
     comm.buf_send(0, &maxsum, 1);
+    comm.recv(0, &maxsum, 1);
+  }
   else
   {
     for (int i = 1; i < size; ++i)
@@ -236,6 +244,8 @@ error_db(
       if (maxsum < othersum)
 	maxsum = othersum;
     }
+    for (int i = 1; i < size; ++i)
+      comm.buf_send(i, &maxsum, 1);
     return maxsum;
   }
 
@@ -718,7 +728,8 @@ main(int argc, char** argv)
        << endl;
 
   // Stop each process, allow debugger to be attached.
-  if (comm.rank() == 0) getchar();
+  char c;
+  if (comm.rank() == 0) read(0,&c,1);
   comm.barrier();
 #endif
 
@@ -744,4 +755,5 @@ main(int argc, char** argv)
   test_real<float>(242);
   test_real<float>(16);
 #endif
+  return 0;
 }



More information about the vsipl++ mailing list