[Darshan-commits] [Darshan] branch, trac-150-regression, updated. darshan-2.3.1-pre1-8-gffc2ef6

Service Account git at mcs.anl.gov
Tue Feb 3 16:39:43 CST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, trac-150-regression has been updated
       via  ffc2ef63e93ea0766e9f16754c2bbba3a584a1e4 (commit)
      from  4831753da8baf87b57d11f47b9d0d123632c0982 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ffc2ef63e93ea0766e9f16754c2bbba3a584a1e4
Author: Phil Carns <carns at mcs.anl.gov>
Date:   Tue Feb 3 17:39:17 2015 -0500

    add cxx test case
    
    -  also fix misc. bash comparison operator goofs

-----------------------------------------------------------------------

Summary of changes:
 darshan-test/regression/run-all.sh                 |   15 ++++-
 .../test-cases/{mpi-io-test.sh => cxxpi.sh}        |   22 +++----
 darshan-test/regression/test-cases/mpi-io-test.sh  |   10 ++--
 darshan-test/regression/test-cases/src/cxxpi.cxx   |   63 ++++++++++++++++++++
 darshan-test/regression/ws/setup-cc.sh             |    2 +-
 .../regression/ws/{setup-cc.sh => setup-cxx.sh}    |   16 +++---
 6 files changed, 98 insertions(+), 30 deletions(-)
 copy darshan-test/regression/test-cases/{mpi-io-test.sh => cxxpi.sh} (55%)
 create mode 100644 darshan-test/regression/test-cases/src/cxxpi.cxx
 copy darshan-test/regression/ws/{setup-cc.sh => setup-cxx.sh} (60%)


Diff of changes:
diff --git a/darshan-test/regression/run-all.sh b/darshan-test/regression/run-all.sh
index 987f238..47f159b 100755
--- a/darshan-test/regression/run-all.sh
+++ b/darshan-test/regression/run-all.sh
@@ -41,24 +41,33 @@ fi
 
 # set up c compiler for this platform
 DARSHAN_CC=`$DARSHAN_PLATFORM/setup-cc.sh`
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     exit 1
 fi
 export DARSHAN_CC
 
+# set up c++ compiler for this platform
+DARSHAN_CXX=`$DARSHAN_PLATFORM/setup-cxx.sh`
+if [ $? -ne 0 ]; then
+    exit 1
+fi
+export DARSHAN_CXX
+
 # set up job execution wrapper for this platform
 DARSHAN_RUNJOB=`$DARSHAN_PLATFORM/setup-runjob.sh`
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     exit 1
 fi
 export DARSHAN_RUNJOB
 
 for i in `ls test-cases/*.sh`; do
+    echo Running ${i}...
     $i
-    if [ $? != 0 ]; then
+    if [ $? -ne 0 ]; then
         echo "Error: failed to execute test case $i"
         exit 1
     fi
+    echo Done.
 done
 
 exit 0
diff --git a/darshan-test/regression/test-cases/mpi-io-test.sh b/darshan-test/regression/test-cases/cxxpi.sh
similarity index 55%
copy from darshan-test/regression/test-cases/mpi-io-test.sh
copy to darshan-test/regression/test-cases/cxxpi.sh
index f2291c9..cb49b7b 100755
--- a/darshan-test/regression/test-cases/mpi-io-test.sh
+++ b/darshan-test/regression/test-cases/cxxpi.sh
@@ -1,42 +1,38 @@
 #!/bin/bash
 
-PROG=mpi-io-test
+PROG=cxxpi
 
 # set log file path; remove previous log if present
 export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz
 rm -f ${DARSHAN_LOGFILE}
 
 # compile
-$DARSHAN_CC test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
-if [ $? != 0 ]; then
+echo $DARSHAN_CXX test-cases/src/${PROG}.cxx -o $DARSHAN_TMP/${PROG}
+$DARSHAN_CXX test-cases/src/${PROG}.cxx -o $DARSHAN_TMP/${PROG}
+if [ $? -ne 0 ]; then
     echo "Error: failed to compile ${PROG}" 1>&2
     exit 1
 fi
 
 # execute
 $DARSHAN_RUNJOB $DARSHAN_TMP/${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to execute ${PROG}" 1>&2
     exit 1
 fi
 
 # parse log
 $DARSHAN_PATH/bin/darshan-parser $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}.darshan.txt
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2
     exit 1
 fi
 
 # check results
-# in this case we want to confirm that both the MPI and POSIX open counters were triggered
-MPI_OPENS=`grep CP_INDEP_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
-if [ ! $MPI_OPENS > 0 ]; then
-    echo "Error: MPI open count of $MPI_OPENS is incorrect" 1>&2
-    exit 1
-fi
+# in this case we want to confirm that the open counts are zero; cxxpi does not do any IO
 POSIX_OPENS=`grep CP_POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
-if [ ! $POSIX_OPENS > 0 ]; then
-    echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
+if [ $POSIX_OPENS != "" ]; then
+    echo "Error: Found unexpected POSIX open count of $POSIX_OPENS" 1>&2
     exit 1
 fi
 
diff --git a/darshan-test/regression/test-cases/mpi-io-test.sh b/darshan-test/regression/test-cases/mpi-io-test.sh
index f2291c9..a2c7651 100755
--- a/darshan-test/regression/test-cases/mpi-io-test.sh
+++ b/darshan-test/regression/test-cases/mpi-io-test.sh
@@ -8,21 +8,21 @@ rm -f ${DARSHAN_LOGFILE}
 
 # compile
 $DARSHAN_CC test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to compile ${PROG}" 1>&2
     exit 1
 fi
 
 # execute
 $DARSHAN_RUNJOB $DARSHAN_TMP/${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to execute ${PROG}" 1>&2
     exit 1
 fi
 
 # parse log
 $DARSHAN_PATH/bin/darshan-parser $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}.darshan.txt
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2
     exit 1
 fi
@@ -30,12 +30,12 @@ fi
 # check results
 # in this case we want to confirm that both the MPI and POSIX open counters were triggered
 MPI_OPENS=`grep CP_INDEP_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
-if [ ! $MPI_OPENS > 0 ]; then
+if [ ! $MPI_OPENS -gt 0 ]; then
     echo "Error: MPI open count of $MPI_OPENS is incorrect" 1>&2
     exit 1
 fi
 POSIX_OPENS=`grep CP_POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
-if [ ! $POSIX_OPENS > 0 ]; then
+if [ ! $POSIX_OPENS -gt 0 ]; then
     echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
     exit 1
 fi
diff --git a/darshan-test/regression/test-cases/src/cxxpi.cxx b/darshan-test/regression/test-cases/src/cxxpi.cxx
new file mode 100644
index 0000000..b7c28a6
--- /dev/null
+++ b/darshan-test/regression/test-cases/src/cxxpi.cxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; c-basic-offset:4 ; -*- */
+/*  
+ *  (C) 2004 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include <iostream>
+using namespace std;
+#include <math.h>
+
+double f(double);
+
+double f(double a)
+{
+    return (4.0 / (1.0 + a*a));
+}
+
+int main(int argc,char **argv)
+{
+    int n, myid, numprocs, i;
+    double PI25DT = 3.141592653589793238462643;
+    double mypi, pi, h, sum, x;
+    double startwtime = 0.0, endwtime;
+    int  namelen;
+    char processor_name[MPI_MAX_PROCESSOR_NAME];
+
+    MPI::Init(argc,argv);
+    numprocs = MPI::COMM_WORLD.Get_size();
+    myid     = MPI::COMM_WORLD.Get_rank();
+    MPI::Get_processor_name(processor_name,namelen);
+
+    cout << "Process " << myid << " of " << numprocs << " is on " <<
+	processor_name << endl;
+
+    n = 10000;			/* default # of rectangles */
+    if (myid == 0)
+	startwtime = MPI::Wtime();
+
+    MPI::COMM_WORLD.Bcast(&n, 1, MPI_INT, 0);
+
+    h   = 1.0 / (double) n;
+    sum = 0.0;
+    /* A slightly better approach starts from large i and works back */
+    for (i = myid + 1; i <= n; i += numprocs)
+    {
+	x = h * ((double)i - 0.5);
+	sum += f(x);
+    }
+    mypi = h * sum;
+
+    MPI::COMM_WORLD.Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0);
+
+    if (myid == 0) {
+	endwtime = MPI::Wtime();
+	cout << "pi is approximately " << pi << " Error is " <<
+	    fabs(pi - PI25DT) << endl;
+	cout << "wall clock time = " << endwtime-startwtime << endl;
+    }
+
+    MPI::Finalize();
+    return 0;
+}
diff --git a/darshan-test/regression/ws/setup-cc.sh b/darshan-test/regression/ws/setup-cc.sh
index 2d40d77..37bb231 100755
--- a/darshan-test/regression/ws/setup-cc.sh
+++ b/darshan-test/regression/ws/setup-cc.sh
@@ -17,7 +17,7 @@
 # subsequent tests should be generated from this using darshan-gen-cc.pl.
 
 $DARSHAN_PATH/bin/darshan-gen-cc.pl `which mpicc` --output $DARSHAN_TMP/mpicc
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
     echo "Error: failed to generate c compiler." 1>&2
     exit 1
 fi
diff --git a/darshan-test/regression/ws/setup-cc.sh b/darshan-test/regression/ws/setup-cxx.sh
similarity index 60%
copy from darshan-test/regression/ws/setup-cc.sh
copy to darshan-test/regression/ws/setup-cxx.sh
index 2d40d77..7b75091 100755
--- a/darshan-test/regression/ws/setup-cc.sh
+++ b/darshan-test/regression/ws/setup-cxx.sh
@@ -2,9 +2,9 @@
 
 # General notes
 #######################
-# Script to set up the C compiler to use for subsequent test cases.  This
+# Script to set up the C++ compiler to use for subsequent test cases.  This
 # script may load optional modules (as in a Cray PE), set LD_PRELOAD
-# variables (as in a dynamically linked environment), or generate mpicc
+# variables (as in a dynamically linked environment), or generate mpicxx
 # wrappers (as in a statically linked environment).
 
 # The script should produce a single string to stdout, which is the command
@@ -12,15 +12,15 @@
 
 # Notes specific to this platform (ws)
 ########################
-# This particular version of the setup-cc script assumes that mpicc is
-# present in the path already, and that the C compiler to use for
-# subsequent tests should be generated from this using darshan-gen-cc.pl.
+# This particular version of the setup-cxx script assumes that mpicxx is
+# present in the path already, and that the C++ compiler to use for
+# subsequent tests should be generated from this using darshan-gen-cxx.pl.
 
-$DARSHAN_PATH/bin/darshan-gen-cc.pl `which mpicc` --output $DARSHAN_TMP/mpicc
-if [ $? != 0 ]; then
+$DARSHAN_PATH/bin/darshan-gen-cxx.pl `which mpicxx` --output $DARSHAN_TMP/mpicxx
+if [ $? -ne 0 ]; then
     echo "Error: failed to generate c compiler." 1>&2
     exit 1
 fi
 
-echo $DARSHAN_TMP/mpicc
+echo $DARSHAN_TMP/mpicxx
 exit 0


hooks/post-receive
--



More information about the Darshan-commits mailing list