Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] MPI/Pro on mercury, potential fix for benchmark wrap-around


  • To: VSIPL++ Developers List <vsipl++@xxxxxxxxxxxxxxxx>
  • Subject: [patch] MPI/Pro on mercury, potential fix for benchmark wrap-around
  • From: Jules Bergmann <jules@xxxxxxxxxxxxxxxx>
  • Date: Tue, 14 Feb 2006 08:44:12 -0500

Woo-hoo! Last night I was able to configure the library with MPI and run the distributed-block.cpp test with 2 processors. A simpler corner-turn test ran fine too on 1, 2, and 4 processors.

I'll update the wiki, but to run an mpi program using mpirun, it is necessary to first run sysmc as follows (assume you are using CEs 2,3,4,5 with -np 4):

	sysmc -ce 2 init 3-5
	mpirun -np 4 job.exe
	sysmc -ce 2 reset 3-5

The 'sysmc -ce 2 init 3-5' establishes a communication cluster of the specified CEs.

The patch below updates configure to work with MPI/Pro. Because the MPI/Pro headers don't have any distinguishing defines, the user must enable mpi as '--enable-mpi=mpipro'. MPI/Pro on the mercury doesn't have an mpicxx, so this patch avoids doing the showme probe.

This patch also updates the benchmark loop driver to use doubles instead of size_t's as intermediate values when computing the ops/sec. On 32-bit machines (such as the GTRI cluster), I've seen wrap-around with large sample times (i.e. (big loop count) * (ops/point) * (points) > 2^32 -> number wraps around).

Don, I'm hoping this will fix the funny drops you were seeing in SAL performance at 128 points and 2048 points.

Patch applied.

				-- Jules

Index: ChangeLog
===================================================================
RCS file: /home/cvs/Repository/vpp/ChangeLog,v
retrieving revision 1.394
diff -u -r1.394 ChangeLog
--- ChangeLog	10 Feb 2006 22:23:41 -0000	1.394
+++ ChangeLog	14 Feb 2006 13:41:58 -0000
@@ -1,3 +1,11 @@
+2006-02-14  Jules Bergmann  <jules@xxxxxxxxxxxxxxxx>
+
+	* configure.ac (--enable-mpi=mpipro): Configure for MPI/Pro on
+	  MCOE.
+	* benchmarks/loop.hpp: Force use of double to accumulate
+	  intermediate product for {pts,ops,iob}/sec metrics.  Avoid
+	  wrap around on 32-bit machines with large sample times.
+
 2006-02-03  Jules Bergmann  <jules@xxxxxxxxxxxxxxxx>
 
 	* configure.ac (--with-complex=FORMAT): New option to set complex
Index: configure.ac
===================================================================
RCS file: /home/cvs/Repository/vpp/configure.ac,v
retrieving revision 1.79
diff -u -r1.79 configure.ac
--- configure.ac	10 Feb 2006 22:23:41 -0000	1.79
+++ configure.ac	14 Feb 2006 13:41:58 -0000
@@ -752,17 +752,27 @@
     # Both MPICH 1 and 2 define MPICH_NAME.
     AC_CHECK_DECL([MPICH_NAME], [vsipl_lib_style=mpich],,
                   [#include VSIP_IMPL_MPI_H])
+
+    # LAM/MPI defines LAM_MPI
     if test $vsipl_lib_style = unknown; then
       AC_CHECK_DECL([LAM_MPI], [vsipl_lib_style=lam],,
       	   	    [#include VSIP_IMPL_MPI_H])
     fi
 
+    # MPI/Pro does not have any identifying macros.
+    # Require user to specify --enable-mpi=mpipro
+    if test $vsipl_lib_style = "unknown" -a "$enable_mpi" == "mpipro"; then
+      AC_MSG_RESULT([configured with --enable-mpi=mpipro, assume MPI/Pro])
+      vsipl_lib_style=mpipro
+    fi
+
     case $vsipl_lib_style in
       unknown)
         AC_MSG_ERROR([unrecognized MPI implementation])
         ;;
 
       mpich)
+	check_mpicxx="yes"
         if test -n "$with_mpi_prefix"; then
           MPICXX="$with_mpi_prefix/bin/mpicxx -show"
         else
@@ -771,6 +781,7 @@
       ;;
 
       lam)
+	check_mpicxx="yes"
         if test -n "$with_mpi_prefix"; then
           MPICXX="$with_mpi_prefix/bin/mpiCC -showme"
         else
@@ -778,8 +789,16 @@
         fi
 	vsip_impl_avoid_posix_memalign=yes
       ;;
+
+      mpipro)
+	check_mpicxx="no"
+        MPI_CPPFLAGS=""
+        MPI_LIBS="-lmpipro"
+      ;;
     esac
 
+    if test "$check_mpicxx" == "yes"; then
+
 changequote(<<, >>)dnl
     MPI_CPPFLAGS="$MPI_CPPFLAGS\
                   `$MPICXX -c conftest.cc | sed -e \"s|^[^ \t]*||\"\
@@ -789,6 +808,8 @@
                                        -e \"s|-DHAVE_MPI_CXX||\"`"
 changequote([, ])dnl
 
+    fi
+
     AC_MSG_CHECKING([for MPI build instructions])
 
     save_CPPFLAGS="$CPPFLAGS"
Index: benchmarks/loop.hpp
===================================================================
RCS file: /home/cvs/Repository/vpp/benchmarks/loop.hpp,v
retrieving revision 1.9
diff -u -r1.9 loop.hpp
--- benchmarks/loop.hpp	27 Jan 2006 13:13:23 -0000	1.9
+++ benchmarks/loop.hpp	14 Feb 2006 13:41:58 -0000
@@ -100,17 +100,18 @@
 {
   if (m == pts_per_sec)
   {
-    float pts = M * loop;
+    double pts = (double)M * loop;
     return pts / (time * 1e6);
   }
   else if (m == ops_per_sec)
   {
-    float ops = M * fcn.ops_per_point(M) * loop;
+    double ops = (double)M * fcn.ops_per_point(M) * loop;
     return ops / (time * 1e6);
   }
   else if (m == iob_per_sec)
   {
-    float ops = M * (fcn.riob_per_point(M) + fcn.wiob_per_point(M)) * loop;
+    double ops = (double)M * (fcn.riob_per_point(M) + fcn.wiob_per_point(M))
+                           * loop;
     return ops / (time * 1e6);
   }
   else