Commit ced68298 authored by Kevin Harms's avatar Kevin Harms

Merge trac5 to trunk


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@320 3b7491f3-a168-0410-bf4b-c445ed680a29
parents 233d64e9 cbd1535c
all: checkpath lib/libdarshan-posix.a lib/libdarshan-mpi-io.a darshan-parser darshan-diff darshan-analyzer test/gztest test/gz-bench darshan-log-params
all: checkpath lib/libdarshan-posix.a lib/libdarshan-mpi-io.a darshan-parser darshan-diff darshan-analyzer darshan-log-params
DESTDIR =
srcdir = @srcdir@
......@@ -32,7 +32,7 @@ ifneq ($(darshan_lib_path),$(libdir))
endif
mklibdir::
mkdir -p lib
@mkdir -p $@
mktestdir::
mkdir -p test
......@@ -59,16 +59,16 @@ test/gztest: test/gztest.c mktestdir
test/gz-bench: test/gz-bench.c mktestdir
gcc $(CFLAGS) -lz $< -o $@
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-log-format.h mklibdir
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-log-format.h | mklibdir
$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h mklibdir
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h | mklibdir
$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-log-format.h mklibdir
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-log-format.h | mklibdir
$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h mklibdir
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h | mklibdir
$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
lib/lookup3.o: lib/lookup3.c
......@@ -91,7 +91,6 @@ install:: all
install -m 755 lib/libdarshan-posix.a $(libdir)
install -m 755 lib/libdarshan-mpi-io.a $(libdir)
install -d $(bindir)
install -d $(bindir)/fast
install -m 755 darshan-parser $(bindir)
install -m 755 darshan-diff $(bindir)
install -m 755 darshan-analyzer $(bindir)
......@@ -99,42 +98,11 @@ install:: all
install -m 755 darshan-gen-cc.pl $(bindir)
install -m 755 darshan-gen-cxx.pl $(bindir)
install -m 755 darshan-gen-fortran.pl $(bindir)
install -m 755 compilers/mpicc-trace-bgp-V1R4 $(bindir)/mpicc
install -m 755 compilers/mpicxx-trace-bgp-V1R4 $(bindir)/mpicxx
install -m 755 compilers/mpif77-trace-bgp-V1R4 $(bindir)/mpif77
install -m 755 compilers/mpif90-trace-bgp-V1R4 $(bindir)/mpif90
install -m 755 compilers/mpixlc-trace-bgp-V1R4 $(bindir)/mpixlc
install -m 755 compilers/mpixlcxx-trace-bgp-V1R4 $(bindir)/mpixlcxx
install -m 755 compilers/mpixlf2003-trace-bgp-V1R4 $(bindir)/mpixlf2003
install -m 755 compilers/mpixlf77-trace-bgp-V1R4 $(bindir)/mpixlf77
install -m 755 compilers/mpixlf90-trace-bgp-V1R4 $(bindir)/mpixlf90
install -m 755 compilers/mpixlf95-trace-bgp-V1R4 $(bindir)/mpixlf95
install -m 755 compilers/mpixlc_r-trace-bgp-V1R4 $(bindir)/mpixlc_r
install -m 755 compilers/mpixlcxx_r-trace-bgp-V1R4 $(bindir)/mpixlcxx_r
install -m 755 compilers/mpixlf2003_r-trace-bgp-V1R4 $(bindir)/mpixlf2003_r
install -m 755 compilers/mpixlf77_r-trace-bgp-V1R4 $(bindir)/mpixlf77_r
install -m 755 compilers/mpixlf90_r-trace-bgp-V1R4 $(bindir)/mpixlf90_r
install -m 755 compilers/mpixlf95_r-trace-bgp-V1R4 $(bindir)/mpixlf95_r
install -m 755 compilers/mpicc-trace-bgp-V1R4 $(bindir)/fast/mpicc
install -m 755 compilers/mpicxx-trace-bgp-V1R4 $(bindir)/fast/mpicxx
install -m 755 compilers/mpif77-trace-bgp-V1R4 $(bindir)/fast/mpif77
install -m 755 compilers/mpif90-trace-bgp-V1R4 $(bindir)/fast/mpif90
install -m 755 compilers/mpixlc-trace-bgp-V1R4 $(bindir)/fast/mpixlc
install -m 755 compilers/mpixlcxx-trace-bgp-V1R4 $(bindir)/fast/mpixlcxx
install -m 755 compilers/mpixlf2003-trace-bgp-V1R4 $(bindir)/fast/mpixlf2003
install -m 755 compilers/mpixlf77-trace-bgp-V1R4 $(bindir)/fast/mpixlf77
install -m 755 compilers/mpixlf90-trace-bgp-V1R4 $(bindir)/fast/mpixlf90
install -m 755 compilers/mpixlf95-trace-bgp-V1R4 $(bindir)/fast/mpixlf95
install -m 755 compilers/mpixlc_r-trace-bgp-V1R4 $(bindir)/fast/mpixlc_r
install -m 755 compilers/mpixlcxx_r-trace-bgp-V1R4 $(bindir)/fast/mpixlcxx_r
install -m 755 compilers/mpixlf2003_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf2003_r
install -m 755 compilers/mpixlf77_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf77_r
install -m 755 compilers/mpixlf90_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf90_r
install -m 755 compilers/mpixlf95_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf95_r
clean::
rm -f *.o *.a lib/*.o lib/*.a darshan-parser darshan-diff darshan-analyzer darshan-log-params
distclean:: clean
rm -f darshan-config.h darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-gen-cc.pl darshan-mk-log-dirs.pl aclocal.m4 autom4te.cache/* config.status config.log Makefile
rm -f compilers/*-V1R4 compilers/fast/*-V1R4 compilers/*-pcarns
rmdir autom4te.cache
......@@ -16,6 +16,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@";
my $input_file = "";
my $output_file = "";
my $trim_exe_path = 0;
process_args();
......@@ -44,15 +45,33 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
chomp($compile_cmd);
chomp($link_cmd);
#
# Incomprehensible re to eat the leading path of the compiler command
# and only give the basename.
#
# /cmd -> cmd
# cmd -> cmd
# /x/y/x/z/cmd -> cmd
#
if ($trim_exe_path)
{
$compile_cmd =~ s/\/*([^\/ ]+\/)*//;
$link_cmd =~ s/\/*([^\/ ]+\/)*//;
}
open (OUTPUT, ">$output_file") || die("Error opening output file: $!");
# substitute arguments and darshan options into commands
$base_link_cmd = $link_cmd;
$base_link_cmd =~ s/foo.o -o foo/"\$\{allargs\[\@\]\}"/g;
$link_cmd =~ s/foo.o -o foo/\$\{newallargs\} -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/foo.o -o foo/"\$\{newallargs\[\@\]\}" -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/$/ -L$DARSHAN_LIB_PATH -ldarshan-posix/g;
$compile_cmd =~ s/-c foo.c/"\$\{allargs\[\@\]\}"/g;
# create link cmd with noshrargs variable
$link_cmd_no_shared = $base_link_cmd;
$link_cmd_no_shared =~ s/allargs/noshrargs/;
print OUTPUT<<'EOF';
#!/bin/bash
#
......@@ -105,7 +124,21 @@ print OUTPUT<<"EOF";
# if allargs includes any libraries, then we need to get
# -ldarshan-mpi-io in there first
newallargs=`echo \${allargs[@]} | sed 's/ -l/ -ldarshan-mpi-io -l/'`
argno=0;
once=0;
newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`;
if [ \$res -gt 0 -a \$once -lt 1 ]; then
newallargs[\$argno]=-ldarshan-mpi-io
argno=`expr \$argno + 1`
newallargs[\$argno]=\$arg;
once=1;
else
newallargs[\$argno]=\$arg;
fi
argno=`expr \$argno + 1`
done
used_darshan=0
......@@ -113,8 +146,16 @@ print OUTPUT<<"EOF";
tmpfile=`mktemp`
# generate a map of the symbol names
# don't use -shared for this step
stock_link_cmd_no_shared=`echo $base_link_cmd | sed 's/ -shared / /g'`
\$stock_link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
argno=0
noshrargs=\("\$\{allargs\[\@\]\}");
for arg in "\$\{noshrargs\[\@\]\}"; do
if [ "\$arg" = "-shared" ]; then
unset noshrarg[\$argno];
fi
argno=`expr \$argno + 1`
done
$link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI \$tmpfile >& /dev/null
rc_mpi=\$?
......@@ -155,11 +196,12 @@ exit(0);
sub process_args
{
use vars qw( $opt_help $opt_output );
use vars qw( $opt_help $opt_output $opt_trim);
Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help",
"output=s");
"output=s",
"trim");
if($opt_help)
{
......@@ -167,6 +209,11 @@ sub process_args
exit(0);
}
if($opt_trim)
{
$trim_exe_path=1;
}
if($opt_output)
{
$output_file = $opt_output;
......@@ -197,6 +244,7 @@ Usage: $PROGRAM_NAME <stock mpicc> --output <modified mpicc>
--help Prints this help message
--output Specifies name of output script
--trim Trim the compilers path
Purpose:
......
......@@ -44,15 +44,33 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
chomp($compile_cmd);
chomp($link_cmd);
#
# Incomprehensible re to eat the leading path of the compiler command
# and only give the basename.
#
# /cmd -> cmd
# cmd -> cmd
# /x/y/x/z/cmd -> cmd
#
if($trim_exe_path)
{
$compile_cmd =~ s/\/*([^\/ ]+\/)*//;
$link_cmd =~ s/\/*([^\/ ]+\/)*//;
}
open (OUTPUT, ">$output_file") || die("Error opening output file: $!");
# substitute arguments and darshan options into commands
$base_link_cmd = $link_cmd;
$base_link_cmd =~ s/foo.o -o foo/"\$\{allargs\[\@\]\}"/g;
$link_cmd =~ s/foo.o -o foo/\$\{newallargs\} -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -lmpichcxx -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/foo.o -o foo/"\$\{newallargs\[\@\]\}" -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/$/ -L$DARSHAN_LIB_PATH -ldarshan-posix/g;
$compile_cmd =~ s/-c foo.c/"\$\{allargs\[\@\]\}"/g;
# create link cmd with noshrargs variable
$link_cmd_no_shared = $base_link_cmd;
$link_cmd_no_shared =~ s/allargs/noshrargs/;
print OUTPUT<<'EOF';
#!/bin/bash
#
......@@ -105,7 +123,21 @@ print OUTPUT<<"EOF";
# if allargs includes any libraries, then we need to get
# -ldarshan-mpi-io in there first
newallargs=`echo \${allargs[@]} | sed 's/ -l/ -ldarshan-mpi-io -l/'`
argno=0;
once=0;
newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`;
if [ \$res -gt 0 -a \$once -lt 1 ]; then
newallargs[\$argno]=-ldarshan-mpi-io
argno=`expr \$argno + 1`
newallargs[\$argno]=\$arg;
once=1;
else
newallargs[\$argno]=\$arg;
fi
argno=`expr \$argno + 1`
done
used_darshan=0
......@@ -113,8 +145,16 @@ print OUTPUT<<"EOF";
tmpfile=`mktemp`
# generate a map of the symbol names
# don't use -shared for this step
stock_link_cmd_no_shared=`echo $base_link_cmd | sed 's/ -shared / /g'`
\$stock_link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
argno=0
noshrargs=\("\$\{allargs\[\@\]\}");
for arg in "\$\{noshrargs\[\@\]\}"; do
if [ "\$arg" = "-shared" ]; then
unset noshrarg[\$argno];
fi
argno=`expr \$argno + 1`
done
$link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI \$tmpfile >& /dev/null
rc_mpi=\$?
......@@ -127,9 +167,13 @@ print OUTPUT<<"EOF";
grep -E mpich\\.cnk\\.a \$tmpfile >& /dev/null
rc_cnk_check=\$?
if [ \$rc_cnk_check -eq 0 ] ; then
script_link_cmd=`echo $link_cmd | sed 's/-lmpichcxx/-lcxxmpich.cnk/g'`
else
script_link_cmd="$link_cmd"
argno=0
for arg in "\$\{newallargs\[\@\]\}"; do
if [ "\$arg" = "-lcxxmpich" ]; then
newallargs[\$argno]=-lcxxmpich.cnk;
fi
argno=`expr \$argno + 1`
done
fi
rm \$tmpfile >& /dev/null
......@@ -140,7 +184,7 @@ print OUTPUT<<"EOF";
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] ; then
\$Show \$script_link_cmd
\$Show $link_cmd
used_darshan=1
fi
fi
......@@ -166,11 +210,12 @@ exit(0);
sub process_args
{
use vars qw( $opt_help $opt_output );
use vars qw( $opt_help $opt_output $opt_trim );
Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help",
"output=s");
"output=s",
"trim");
if($opt_help)
{
......@@ -178,6 +223,11 @@ sub process_args
exit(0);
}
if($opt_trim)
{
$trim_exe_path=1;
}
if($opt_output)
{
$output_file = $opt_output;
......@@ -208,6 +258,7 @@ Usage: $PROGRAM_NAME <stock mpicxx> --output <modified mpicc>
--help Prints this help message
--output Specifies name of output script
--trim Trim the compilers path
Purpose:
......
......@@ -16,6 +16,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@";
my $input_file = "";
my $output_file = "";
my $trim_exe_path=0;
process_args();
......@@ -44,15 +45,33 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
chomp($compile_cmd);
chomp($link_cmd);
#
# Incomprehensible re to eat the leading path of the compiler command
# and only give the basename.
#
# /cmd -> cmd
# cmd -> cmd
# /x/y/x/z/cmd -> cmd
#
if($trim_exe_path)
{
$compile_cmd =~ s/\/*([^\/ ]+\/)*//;
$link_cmd =~ s/\/*([^\/ ]+\/)*//;
}
open (OUTPUT, ">$output_file") || die("Error opening output file: $!");
# substitute arguments and darshan options into commands
$base_link_cmd = $link_cmd;
$base_link_cmd =~ s/foo.o -o foo/"\$\{allargs\[\@\]\}"/g;
$link_cmd =~ s/foo.o -o foo/\$\{newallargs\} -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -lfmpich -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/foo.o -o foo/"\$\{newallargs\[\@\]\}" -L$DARSHAN_LIB_PATH $CP_ZLIB_LINK_FLAGS -lfmpich -ldarshan-mpi-io -lz $CP_WRAPPERS/g;
$link_cmd =~ s/$/ -L$DARSHAN_LIB_PATH -ldarshan-posix/g;
$compile_cmd =~ s/-c foo.c/"\$\{allargs\[\@\]\}"/g;
# create link cmd with noshrargs variable
$link_cmd_no_shared = $base_link_cmd;
$link_cmd_no_shared =~ s/allargs/noshrargs/;
print OUTPUT<<'EOF';
#!/bin/bash
#
......@@ -105,7 +124,21 @@ print OUTPUT<<"EOF";
# if allargs includes any libraries, then we need to get
# -ldarshan-mpi-io in there first
newallargs=`echo \${allargs[@]} | sed 's/ -l/ -ldarshan-mpi-io -l/'`
argno=0;
once=0;
newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`;
if [ \$res -gt 0 -a \$once -lt 1 ]; then
newallargs[\$argno]=-ldarshan-mpi-io
argno=`expr \$argno + 1`
newallargs[\$argno]=\$arg;
once=1;
else
newallargs[\$argno]=\$arg;
fi
argno=`expr \$argno + 1`
done
used_darshan=0
......@@ -113,8 +146,16 @@ print OUTPUT<<"EOF";
tmpfile=`mktemp`
# generate a map of the symbol names
# don't use -shared for this step
stock_link_cmd_no_shared=`echo $base_link_cmd | sed 's/ -shared / /g'`
\$stock_link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
argno=0
noshrargs=\("\$\{allargs\[\@\]\}");
for arg in "\$\{noshrargs\[\@\]\}"; do
if [ "\$arg" = "-shared" ]; then
unset noshrarg[\$argno];
fi
argno=`expr \$argno + 1`
done
$link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI \$tmpfile >& /dev/null
rc_mpi=\$?
......@@ -127,9 +168,13 @@ print OUTPUT<<"EOF";
grep -E mpich\\.cnk\\.a \$tmpfile >& /dev/null
rc_cnk_check=\$?
if [ \$rc_cnk_check -eq 0 ] ; then
script_link_cmd=`echo $link_cmd | sed 's/-lfmpich/-lfmpich.cnk/g'`
else
script_link_cmd="$link_cmd"
argno=0
for arg in "\$\{newallargs\[\@\]\}"; do
if [ "\$arg" = "-lfmpich" ]; then
newallargs[\$argno]=-lfmpich.cnk;
fi
argno=`expr \$argno + 1`
done
fi
rm \$tmpfile >& /dev/null
......@@ -140,7 +185,7 @@ print OUTPUT<<"EOF";
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] ; then
\$Show \$script_link_cmd
\$Show $link_cmd
used_darshan=1
fi
fi
......@@ -166,11 +211,12 @@ exit(0);
sub process_args
{
use vars qw( $opt_help $opt_output );
use vars qw( $opt_help $opt_output $opt_trim );
Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help",
"output=s");
"output=s",
"trim");
if($opt_help)
{
......@@ -178,6 +224,11 @@ sub process_args
exit(0);
}
if($opt_trim)
{
$trim_exe_path=1;
}
if($opt_output)
{
$output_file = $opt_output;
......@@ -208,6 +259,7 @@ Usage: $PROGRAM_NAME <stock mpi fortran script> --output <modified mpi fortran s
--help Prints this help message
--output Specifies name of output script
--trim Trim the compilers path
Purpose:
......
#!/bin/bash
#
# Generates compiler scripts for all BG compilers
#
PREFIX=/home/harms/darshan/test
#PREFIX=/soft/apps/darshan-2.0.0
BGPATH=/bgsys/drivers/ppcfloor/comm/xxx/bin
for compiler_type in default fast xl;
do
compiler_path=${BGPATH/xxx/$compiler_type}
compiler_opt=""
for compiler in $(ls $compiler_path);
do
if [ $compiler != "mpich2version" -a \
$compiler != "parkill" ]; then
mkdir -p $PREFIX/bin/$compiler_type
if [ $(expr match $compiler ".*xl.*") -gt 0 -o \
$compiler_type = "fast" -o \
$compiler_type = "xl" ]; then
compiler_opt="--trim";
fi
if [ $(expr match $compiler ".*cxx") -gt 0 ]; then
$PREFIX/bin/darshan-gen-cxx.pl $compiler_opt --output=$PREFIX/bin/$compiler_type/$compiler $compiler_path/$compiler
elif [ $(expr match $compiler ".*f77") -gt 0 -o \
$(expr match $compiler ".*f90") -gt 0 -o \
$(expr match $compiler ".*f95") -gt 0 -o \
$(expr match $compiler ".*f2003") -gt 0 ]; then
$PREFIX/bin/darshan-gen-fortran.pl $compiler_opt --output=$PREFIX/bin/$compiler_type/$compiler $compiler_path/$compiler
else
$PREFIX/bin/darshan-gen-cc.pl $compiler_opt --output=$PREFIX/bin/$compiler_type/$compiler $compiler_path/$compiler
fi
fi
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment