Commit 56b12ca2 authored by Philip Carns's avatar Philip Carns

Merge remote-tracking branch 'origin/master' into dev-modular

Conflicts:
	ChangeLog
	darshan-log-format.h
	darshan-runtime/Makefile.in
	darshan-runtime/configure
	darshan-runtime/configure.in
	darshan-runtime/lib/darshan-mpi-io.c
	darshan-runtime/lib/darshan-posix.c
	darshan-util/configure
	darshan-util/configure.in
	darshan-util/darshan-logutils.c
parents 8f85fd08 2eae92a3
......@@ -5,16 +5,38 @@ Darshan Release Change Log
Darshan-3.0.0-pre1
=============
darshan-2.3.1-pre1
darshan-2.3.1-pre2
=============
* added documentation and example configuration files for using the -profile
or $MPICC_PROFILE hooks to add instrumentation to MPICH-based MPI
implementations without generating custom wrapper scripts
* Add wrappers for mkstemp(), mkostemp(), mkstemps(), and mkostemps()
(reported by Tom Peterka)
* Change OPEN_TIMESTAMP field to report timestamp right before open() is
invoked rather than after timestamp after open is completed
invoked rather than after timestamp after open is completed.
NOTE: updated log format version to 2.06 to reflect this change.
* Change start_time and end_time fields in job record to use min and max
(respectively) across all ranks
* Fix bug in write volume data reported in file system table in
darshan-job-summary.pl (reported by Matthieu Dorier)
TODO: bump log version number and add warnings about semantic changes
* Clean up autoconf test for zlib and make zlib mandatory (reported by Kalyana
Chadalavada)
* add --start-group and --end-group notation to Darshan libraries for Cray PE
2.x environment to fix link-time corner cases (Yushu Yao)
* improve y axis labels on time interval graphs in darshan-job-summary.pl
(reported by Tom Peterka)
* misc. improvements to darshan-parser --perf output (reported by Shane
Snyder)
- indicate which rank was slowest in unique file results
- label I/O vs. meta time more clearly
- include unique file meta time in agg_perf_by_slowest calculation
* added regression test script framework in darshan-test/regression/
- workstation-static and workstation-dynamic test environments supported
* update darshan-gen-fortran.pl and darshan-gen-cxx.pl to support new library
naming conventions in MPICH 3.1.1 and higher
* update documentation to reflect known issues with some versions of MPICH
* modify darshan-runtime so that link-time instrumentation options are only used
when statically linking via Libs.private. (reported by Kalyana Chadalavada)
darshan-2.3.0
=============
......
......@@ -82,6 +82,10 @@ install:: all
# install -m 755 share/craype-1.x/darshan-module $(datarootdir)/craype-1.x/modulefiles/darshan/$(DARSHAN_VERSION)
# install -d $(datarootdir)/craype-2.x/modulefiles/darshan
# install -m 755 share/craype-2.x/darshan-module $(datarootdir)/craype-2.x/modulefiles/darshan/$(DARSHAN_VERSION)
# install -d $(datarootdir)/mpi-profile
# install -m 755 share/mpi-profile/darshan-cc.conf $(datarootdir)/mpi-profile/darshan-cc.conf
# install -m 755 share/mpi-profile/darshan-cxx.conf $(datarootdir)/mpi-profile/darshan-cxx.conf
# install -m 755 share/mpi-profile/darshan-f.conf $(datarootdir)/mpi-profile/darshan-f.conf
# install -d $(libdir)/pkgconfig
# install -m 644 lib/pkgconfig/darshan-runtime.pc $(libdir)/pkgconfig/darshan-runtime.pc
......
This diff is collapsed.
......@@ -188,7 +188,7 @@ CFLAGS="$old_cflags"
AC_CHECK_HEADERS(mntent.h sys/mount.h)
# libc functions wrapped by darshan
#CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
#CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64,-wrap,mkstemp,-wrap,mkostemp,-wrap,mkstemps,-wrap,mkostemps"
CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,open,-wrap,open64,-wrap,close"
......@@ -287,6 +287,14 @@ AC_CHECK_TYPE([MPIO_Request],
AC_DEFINE(__D_MPI_REQUEST, MPI_Request, Generalized request type for MPI-IO)
,[#include <mpi.h>])
# attempt to detect librarly naming convention in mpi compiler script
AC_MSG_CHECKING(for old (pre-3.1.1) style MPICH library naming convention)
AS_IF([$CC -show foo.c -o foo |grep lmpich >& /dev/null],
AC_MSG_RESULT(yes)
MPICH_LIB_OLD=1,
AC_MSG_RESULT(no)
MPICH_LIB_OLD=0)
DARSHAN_VERSION="AC_PACKAGE_VERSION"
AC_SUBST(darshan_lib_path)
......@@ -296,6 +304,7 @@ AC_SUBST(__CP_LOG_PATH)
AC_SUBST(CP_WRAPPERS)
AC_SUBST(DISABLE_LDPRELOAD)
AC_SUBST(DARSHAN_VERSION)
AC_SUBST(MPICH_LIB_OLD)
AC_OUTPUT(Makefile
darshan-mk-log-dirs.pl
darshan-gen-cc.pl
......@@ -305,4 +314,7 @@ darshan-config
share/craype-1.x/darshan-module
share/craype-2.x/darshan-module
lib/pkgconfig/darshan-runtime.pc
share/mpi-profile/darshan-cc.conf
share/mpi-profile/darshan-cxx.conf
share/mpi-profile/darshan-f.conf
)
......@@ -274,10 +274,14 @@ print OUTPUT<<"EOF";
if [ \$? -eq 0 ] ; then
CXXMPICH=-lcxxmpich
fi
grep -E cxxmpich\\.cnk.a \$tmpfile >& /dev/null
grep -E cxxmpich\\.cnk\\.a \$tmpfile >& /dev/null
if [ \$? -eq 0 ] ; then
CXXMPICH=-lcxxmpich.cnk
fi
grep -E mpicxx\\.a \$tmpfile >& /dev/null
if [ \$? -eq 0 ] ; then
CXXMPICH=-lmpicxx
fi
rm \$tmpfile >& /dev/null
......
......@@ -275,13 +275,20 @@ print OUTPUT<<"EOF";
grep -E \\(PMPI_File_\\)\\|\\(PMPI_Init\\)\\|\\(PMPI_Finalize\\) \$tmpfile | grep -v -E \\(mpich.*\\.a\\) |grep \\(PMPI >& /dev/null
rc_pmpi=\$?
# normal or cnk libraries?
grep -E mpich\\.cnk \$tmpfile >& /dev/null
# find appropriate fortran library name for profiling
grep -E libmpifort \$tmpfile >& /dev/null
rc_cnk_check=\$?
if [ \$rc_cnk_check -eq 0 ] ; then
FMPICH=-lfmpich.cnk
FMPICH=-lmpifort
else
FMPICH=-lfmpich
grep -E mpich\\.cnk \$tmpfile >& /dev/null
rc_cnk_check=\$?
if [ \$rc_cnk_check -eq 0 ] ; then
FMPICH=-lfmpich.cnk
else
FMPICH=-lfmpich
fi
fi
rm \$tmpfile >& /dev/null
......
......@@ -143,13 +143,17 @@ for details if you intend to force one mode or the other.
== Instrumenting statically-linked applications
Statically linked executables must be instrumented at compile time. The
simplest way to do this is to generate an MPI compiler script (e.g. `mpicc`)
that includes the link options and libraries needed by Darshan. Once this
is done, Darshan instrumentation is transparent; you simply compile
applications using the darshan-enabled MPI compiler scripts.
Statically linked executables must be instrumented at compile time.
The simplest methods to do this are to either generate a customized
MPI compiler script (e.g. `mpicc`) that includes the link options and
libraries needed by Darshan, or to use existing profiling configuration
hooks for existing MPI compiler scripts. Once this is done, Darshan
instrumentation is transparent; you simply compile applications using
the darshan-enabled MPI compiler scripts.
For MPICH-based MPI libraries, such as MPICH1, MPICH2, or MVAPICH, these
=== Using customized compiler wrapper scripts
For MPICH-based MPI libraries, such as MPICH1, MPICH2, or MVAPICH, custom
wrapper scripts can be generated automatically. The following example
illustrates how to produce wrappers for C, C++, and Fortran compilers:
......@@ -160,6 +164,40 @@ darshan-gen-fortran.pl `which mpif77` --output mpif77.darshan
darshan-gen-fortran.pl `which mpif90` --output mpif90.darshan
-----
=== Using a profile configuration
The MPICH MPI implementation supports the specification of a profiling library
configuration, then it can be used to insert Darshan instrumentation without
modifying the existing MPI compiler script. Example profiling configuration
files are installed with Darshan 2.3.1 and later. You can enable a profiling
configuration using environment variables or command line arguments to the
compiler scripts:
Example for MPICH 3.1.1 or newer:
----
export MPICC_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-cc
export MPICXX_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-cxx
export MPIFORT_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-f
----
Example for MPICH 3.1 or earlier:
----
export MPICC_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-cc
export MPICXX_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-cxx
export MPICF77_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-f
export MPICF90_PROFILE=$DARSHAN_PREFIX/share/mpi-profile/darshan-f
----
Examples for command line use:
----
mpicc -profile=$DARSHAN_PREFIX/share/mpi-profile/darshan-c <args>
mpicxx -profile=$DARSHAN_PREFIX/share/mpi-profile/darshan-cxx <args>
mpif77 -profile=$DARSHAN_PREFIX/share/mpi-profile/darshan-f <args>
mpif90 -profile=$DARSHAN_PREFIX/share/mpi-profile/darshan-f <args>
----
=== Other configurations
Please see the Cray recipe in this document for instructions on
instrumenting statically-linked applications on that platform.
......@@ -379,12 +417,30 @@ http://software.intel.com/en-us/forums/showthread.php?t=103447&o=a&s=lr
=== Linux clusters using MPICH
Follow the generic instructions provided at the top of this document. The
only modification is to make sure that the `CC` used for compilation is
Follow the generic instructions provided at the top of this document. For MPICH versions 3.1 and
later, MPICH uses shared libraries by default, so you may need to consider the dynamic linking
instrumentation approach.
The static linking method can be used if MPICH is configured to use static
linking by default, or if you are using a version prior to 3.1.
The only modification is to make sure that the `CC` used for compilation is
based on a GNU compiler. Once Darshan has been installed, it should be
capable of instrumenting executables built with GNU, Intel, and PGI
compilers.
[NOTE]
Darshan is not capable of instrumenting Fortran applications build with MPICH versions 3.1.1, 3.1.2,
or 3.1.3 due to a library symbol name compatibility issue. Consider using a newer version of
MPICH if you wish to instrument Fortran applications. Please see
http://trac.mpich.org/projects/mpich/ticket/2209 for more details.
[NOTE]
MPICH versions 3.1, 3.1.1, 3.1.2, and 3.1.3 may produce link-time errors when building static
executables (i.e. using the -static option) if MPICH is built with shared library support.
Please see http://trac.mpich.org/projects/mpich/ticket/2190 for more details. The workaround if you
wish to use static linking is to configure MPICH with `--enable-shared=no --enable-static=yes` to
force it to use static MPI libraries with correct dependencies.
=== Linux clusters using Open MPI
Follow the generic instructions provided at the top of this document for
......@@ -413,4 +469,5 @@ behavior at runtime:
in which files that were accessed by all ranks are collapsed into a single
cumulative file record at rank 0. This option retains more per-process
information at the expense of creating larger log files.
* DARSHAN_LOGPATH: specifies the path to write Darshan log files to. Note that this directory needs to be formatted using the darshan-mk-log-dirs script.
* DARSHAN_LOGFILE: specifies the path (directory + Darshan log file name) to write the output Darshan log to. This overrides the default Darshan behavior of automatically generating a log file name and adding to a log file directory formatted using darshan-mk-log-dirs script.
......@@ -11,8 +11,8 @@ Requires.private:
darshan_prefix=@prefix@
darshan_includedir=
darshan_libdir= -L${darshan_prefix}/lib
darshan_linkopts="-Wl,-u,MPI_Init,-u,MPI_Wtime,-u,__wrap_H5Fcreate,-u,__wrap_ncmpi_create,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
darshan_linkopts="-Wl,-u,MPI_Init,-u,MPI_Wtime,-u,__wrap_H5Fcreate,-u,__wrap_ncmpi_create,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64,-wrap,mkstemp,-wrap,mkostemp,-wrap,mkstemps,-wrap,mkostemps"
Cflags:
Libs: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -ldarshan-mpi-io -ldarshan-posix -ldarshan-stubs
Libs.private:
Libs:
Libs.private: ${darshan_linkopts} ${darshan_libdir} -lfmpich -lmpichcxx -Wl,--start-group -ldarshan-mpi-io -ldarshan-posix -ldarshan-stubs -Wl,--end-group
......@@ -55,7 +55,7 @@ prepend-path CRAY_LD_LIBRARY_PATH $root/lib
# initial link options for Darshan
setenv DARSHAN_POST_LINK_OPTS " -L$root/lib -ldarshan-mpi-io -lz -Wl,-u,__wrap_fopen,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64 -lfmpich -lmpichcxx -ldarshan-posix -ldarshan-mpi-io -lz "
setenv DARSHAN_POST_LINK_OPTS " -L$root/lib -ldarshan-mpi-io -lz -Wl,-u,__wrap_fopen,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64,-wrap,mkstemp,-wrap,mkostemp,-wrap,mkstemps,-wrap,mkostemps -lfmpich -lmpichcxx -ldarshan-posix -ldarshan-mpi-io -lz "
# Add Darshan to the PE_PRODUCT_LIST variable. This will cause the
# compiler scripts to insert DARSHAN_POST_LINK_OPTS into the link command
......
#!/bin/bash
# Example Darshan profiling configuration file for MPICH.
DARSHAN_PREFIX=@prefix@
# Libraries (and paths) to include before the MPI library
export PROFILE_PRELIB=`$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
# /usr/local/myprof/lib to the link step, you could create the file myprof.conf with the
# lines
# PROFILE_INCPATHS
#!/bin/bash
# Example Darshan profiling configuration file for MPICH.
DARSHAN_PREFIX=@prefix@
MPICH_LIB_OLD=@MPICH_LIB_OLD@
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lmpichcxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpicxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
# /usr/local/myprof/lib to the link step, you could create the file myprof.conf with the
# lines
# PROFILE_INCPATHS
#!/bin/bash
# Example Darshan profiling configuration file for MPICH.
DARSHAN_PREFIX=@prefix@
MPICH_LIB_OLD=@MPICH_LIB_OLD@
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lfmpich `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpifort `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
# /usr/local/myprof/lib to the link step, you could create the file myprof.conf with the
# lines
# PROFILE_INCPATHS
......@@ -20,8 +20,13 @@ Notes on how to release a new version of Darshan
pushed to origin/master
- make a tag for the release according to instructions at
http://git-scm.com/book/en/Git-Basics-Tagging
- example (annotated tag, pushed to repo):
git tag -a darshan-2.3.1-pre2 -m 'Darshan 2.3.1-pre2'
git push origin darshan-2.3.1-pre2
- TESTING
- export the tag (TODO: document recommended method) and tar gzip it
- export the tag and tar gzip it
- easiest method is to do a fresh checkout and remove the .git
subdirectory
- upload .tar.gz file to /mcs/ftp/pub/darshan/releases
- generate web documentation from asciidoc by running make in
darshan-util/doc/ and darshan-runtime/doc/ directories
......
This directory contains regression tests for both the runtime and util
components of Darshan, assuming that Darshan is already compiled and
installed in a known path.
The master script must be executed with three arguments:
1) path to darshan installation
2) path to temporary directory (for building executables, collecting logs,
etc. during test)
3) platform type; options include:
- ws (for a standard workstation)
The platform type should map to a subdirectory containing scripts
that describe how to perform platform-specific tasks (like loading or
generating darshan wrappers and executing jobs).
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "Usage: run-all.sh <darshan_install_path> <tmp_path> <platform>" 1>&2
echo "Example: ./run-all.sh ~/darshan-install /tmp/test ws" 1>&2
exit 1
fi
# set variables for use by other sub-scripts
export DARSHAN_PATH=$1
export DARSHAN_TMP=$2
export DARSHAN_PLATFORM=$3
# number of procs that most test jobs will use
export DARSHAN_DEFAULT_NPROCS=4
DARSHAN_TESTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export DARSHAN_TESTDIR
# check darshan path
if [ ! -x $DARSHAN_PATH/bin/darshan-parser ]; then
echo "Error: $DARSHAN_PATH doesn't contain a valid Darshan install." 1>&2
exit 1
fi
# check and/or create tmp path
if [ ! -d $DARSHAN_TMP ]; then
mkdir -p $DARSHAN_TMP
fi
if [ ! -d $DARSHAN_TMP ]; then
echo "Error: unable to find or create $DARSHAN_TMP" 1>&2
exit 1
fi
if [ ! -w $DARSHAN_TMP ]; then
echo "Error: unable to write to $DARSHAN_TMP" 1>&2
exit 1
fi
# make sure that we have sub-scripts for the specified platform
if [ ! -d $DARSHAN_TESTDIR/$DARSHAN_PLATFORM ]; then
echo "Error: unable to find scripts for platform $DARSHAN_PLATFORM" 1>&2
exit 1
fi
# set up environment for tests according to platform
source $DARSHAN_TESTDIR/$DARSHAN_PLATFORM/env.sh
for i in `ls $DARSHAN_TESTDIR/test-cases/*.sh`; do
echo Running ${i}...
$i
if [ $? -ne 0 ]; then
echo "Error: failed to execute test case $i"
exit 1
fi
echo Done.
done
exit 0
#!/bin/bash
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_CXX $DARSHAN_TESTDIR/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 [ $? -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 [ $? -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 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"x != ""x ]; then
echo "Error: Found unexpected POSIX open count of $POSIX_OPENS" 1>&2
exit 1
fi
exit 0
#!/bin/bash
PROG=fperf-f77
# set log file path; remove previous log if present
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz
rm -f ${DARSHAN_LOGFILE}
# compile
$DARSHAN_F77 $DARSHAN_TESTDIR/test-cases/src/fperf.f -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} -fname $DARSHAN_TMP/${PROG}.tmp.dat
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 [ $? -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_COLL_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
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 -gt 0 ]; then
echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
exit 1
fi
exit 0
#!/bin/bash
PROG=fperf-f90
# set log file path; remove previous log if present
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz
rm -f ${DARSHAN_LOGFILE}
# compile
$DARSHAN_F90 $DARSHAN_TESTDIR/test-cases/src/fperf.f -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} -fname $DARSHAN_TMP/${PROG}.tmp.dat
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 [ $? -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_COLL_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
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 -gt 0 ]; then
echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
exit 1
fi
exit 0
#!/bin/bash
PROG=mpi-io-test
# set log file path; remove previous log if present
export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz
rm -f ${DARSHAN_LOGFILE}
# compile
$DARSHAN_CC $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -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 [ $? -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 [ $? -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 -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 -gt 0 ]; then
echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
exit 1
fi
exit 0
/* -*- 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;
}
! -*- Mode: Fortran; -*-
!
! (C) 2001 by Argonne National Laboratory.
! See COPYRIGHT in top-level directory.
!
program main
implicit none
include 'mpif.h'
! Fortran equivalent of perf.c
integer SIZE
parameter (SIZE=1048576*4)
! read/write size per node in bytes
integer buf(SIZE/4), j, mynod, nprocs, ntimes, flag, foo
double precision stim, read_tim, write_tim, new_read_tim
double precision new_write_tim, min_read_tim, min_write_tim
double precision read_bw, write_bw
integer fh, status(MPI_STATUS_SIZE), ierr, argc, iargc, i
character*1024 str ! used to store the filename
integer*8 offset
ntimes = 5
min_read_tim = 10000000.0D0
min_write_tim = 10000000.0D0
call MPI_INIT(ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, foo, ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr)
! process 0 takes the file name as a command-line argument and
! broadcasts it to other processes
if (mynod .eq. 0) then
argc = iargc()
i = 0
call getarg(i,str)
do while ((i .lt. argc) .and. (str .ne. '-fname'))
i = i + 1
call getarg(i,str)
end do
if (i .ge. argc) then
print *