darshan-module.in 3.39 KB
Newer Older
1
#%Module
2 3 4 5 6 7 8 9 10
##

## Required internal variables

set		name		darshan
set		version		@DARSHAN_VERSION@
set		root		@prefix@

## List conflicting modules here
11

12
conflict $name
13

14
## List prerequisite modules here
15

16
# prereq
17

18 19 20 21 22 23 24
set		fullname	Darshan
set		externalurl	http://www.mcs.anl.gov/research/projects/darshan
set		maincategory	applications
set		subcategory	debugging
set		description	"A lightweight IO profiler"

## Required for "module help ..."
25 26

proc ModulesHelp { } {
27 28 29 30 31 32 33 34 35 36 37 38 39 40
  global description externalurl
  puts stderr "Description - $description"
  puts stderr "Other Docs  - $externalurl"
}

## Required for "module display ..." 

module-whatis			"$description"

## Software-specific settings exported to user environment

setenv CRAY_DARSHAN_VERSION              $version
setenv CRAY_DARSHAN_DIR                  $root

41
# Put darshan utilities and libraries in system paths
42
prepend-path PATH $root/bin
43 44
prepend-path CRAY_LD_LIBRARY_PATH           $root/lib

45 46 47 48 49 50 51 52 53 54
# NOTE: The following example shows how to enable Darshan for dynamically linked
#       executables if your environment allows you to load modules from
#       within a scheduler script.
# 
#if [info exists env(PBS_JOBID)] {
#    module load xt-lgdb
#    setenv LD_PRELOAD  $path/lib/libdarshan.so	
#}


55 56 57 58 59 60 61 62 63 64 65 66 67 68
# 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  -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
# line.
prepend-path PE_PRODUCT_LIST $product

# IMPORTANT: In addition to the DARSHAN_POST_LINK_OPTS option shown above,
# we must also add -ldarshan-mpi-io to the CNL_LIBS_LIST variable in
# the compiler scripts. This enables the linker to make a final pass to
# resolve darshan symbols if an application library is indirectly using a
# high level library like hdf5 or pnetcdf.
#
69
# There are two options:
70
#
71 72 73
# a) Modify the linux-cc, linux-f90, linux-CC, craycc, crayftn,
# and crayc++ scripts to include a new variable (for example, LIBDARSHAN) at
# the end of the CNL_LIBS_LIST, and set that variable below:
74
#setenv LIBDARSHAN "-ldarshan-mpi-io"
75 76 77 78 79 80 81 82
#
# b) For testing purposes, you can re-use an existing variable from another
# software project that is already present in CNL_LIBS_LIST but is not
# defined within directly within the compiler script.  Two examples are
# shown below.  Note that the scripts for the Cray compiler (craycc,
# crayftn, and crayc++) use different linker arguments and are more
# sensitive to library ordering.  The following examples may only work for
# the GNU, PGI, Pathscale, and Intel compilers:
83 84 85 86 87 88 89 90
# 
# this one adds on to a variable normally used by trilinos:
#setenv LIBTRILINOS "$LIBTRILINOS -ldarshan-mpi-io"
#
# this one adds on to a variable normally used by trilinos:
#setenv LIBSCIFFT "$LIBSCIFFT -ldarshan-mpi-io"
#

91