├── .gitignore ├── LICENSE ├── Makefile.am ├── Makefile.common ├── README.md ├── acinclude ├── ax_cxx_compile_stdcxx_11.m4 ├── ax_mpiversion.m4 ├── check_bg.m4 ├── check_const.m4 ├── check_cpp11.m4 ├── check_enabled_features.m4 ├── check_fortran.m4 ├── check_instrumentation.m4 ├── check_mpi_version.m4 ├── check_mpiio.m4 ├── check_otf2.m4 ├── check_papi.m4 ├── check_posix_timers.m4 ├── check_pthreads.m4 ├── check_sdk.m4 ├── clean_config ├── clean_constants ├── clean_ops ├── clean_types ├── config_buffers.m4 ├── mpiconfigs.m4 ├── mpiconstants.m4 ├── mpio.m4 ├── mpiops.m4 ├── mpitypes.m4 ├── oldmpiconfigs.m4 ├── oldmpiconstants.m4 ├── oldmpiops.m4 ├── oldmpitypes.m4 └── sanity_check_mpicc.m4 ├── bin └── check_const ├── bootstrap.sh ├── configure.ac ├── data ├── combiner.pl ├── constants.pl ├── datatypes.pl ├── dumpi.conf ├── mpifuncs.h └── ops.pl ├── docs ├── compiling.dox ├── design-notes.txt ├── doxygen.cfg.in ├── dumpi.dox ├── issues.dox ├── oaq.dox ├── tools.dox ├── traceformat.dox └── user.dox ├── dumpi ├── Makefile.am ├── bin │ ├── Makefile.am │ ├── ascii2dumpi.c │ ├── comm.h │ ├── dumpi2ascii-callbacks.c │ ├── dumpi2ascii-callbacks.h │ ├── dumpi2ascii-defs.h │ ├── dumpi2ascii.c │ ├── dumpi2dumpi-callbacks.c │ ├── dumpi2dumpi-help.c │ ├── dumpi2dumpi-meta.c │ ├── dumpi2dumpi-opts.c │ ├── dumpi2dumpi.c │ ├── dumpi2dumpi.h │ ├── dumpi2otf.cc │ ├── dumpi2otf2-callbacks.cc │ ├── dumpi2otf2-defs.h │ ├── dumpi2otf2.cc │ ├── dumpistats-binbase.cc │ ├── dumpistats-binbase.h │ ├── dumpistats-callbacks.cc │ ├── dumpistats-callbacks.h │ ├── dumpistats-gatherbin.cc │ ├── dumpistats-gatherbin.h │ ├── dumpistats-handlers.cc │ ├── dumpistats-handlers.h │ ├── dumpistats-timebin.cc │ ├── dumpistats-timebin.h │ ├── dumpistats.cc │ ├── group.h │ ├── metadata.cc │ ├── metadata.h │ ├── otfcomplete.cc │ ├── otfcomplete.h │ ├── otfwriter.cc │ ├── otfwriter.h │ ├── sharedstate-commconstruct.cc │ ├── sharedstate-commconstruct.h │ ├── sharedstate.cc │ ├── sharedstate.h │ ├── test_dumpi2ascii.sh │ ├── test_dumpi2dumpi.sh │ ├── timeutils.h │ ├── trace.cc │ ├── trace.h │ └── type.h ├── common │ ├── Makefile.am │ ├── argtypes.h │ ├── byteswap.h │ ├── constants.c │ ├── constants.h │ ├── debugflags.c │ ├── debugflags.h │ ├── dumpiio.c │ ├── dumpiio.h │ ├── funclabels.c │ ├── funclabels.h │ ├── funcs.c │ ├── funcs.h │ ├── gettime.c │ ├── gettime.h │ ├── hashmap.h │ ├── io.c │ ├── io.h │ ├── iodefs.c │ ├── iodefs.h │ ├── perfctrs.c │ ├── perfctrs.h │ ├── perfctrtags.c │ ├── perfctrtags.h │ ├── settings.h │ ├── types.c │ └── types.h ├── dumpiconfig.h ├── libdumpi │ ├── Makefile.am │ ├── callprofile-addrset.c │ ├── callprofile-addrset.h │ ├── callprofile.c │ ├── callprofile.h │ ├── data.c │ ├── data.h │ ├── fromf77.f │ ├── fromf90.f90 │ ├── fused-bindings.h │ ├── init.c │ ├── init.h │ ├── libdumpi.c │ ├── libdumpi.h │ ├── mpibindings-maps.c │ ├── mpibindings-maps.h │ ├── mpibindings-utils.c │ ├── mpibindings-utils.h │ ├── mpibindings.h │ ├── mpibindings2.c │ ├── mpibindings3.c │ ├── tof77.c │ └── tof77.h ├── libotf2dump │ ├── Makefile.am │ ├── otf2deftable.cc │ ├── otf2writer-defs.h │ ├── otf2writer.cc │ └── otf2writer.h ├── libundumpi │ ├── Makefile.am │ ├── bindings.c │ ├── bindings.h │ ├── callbacks.c │ ├── callbacks.h │ ├── dumpistate.c │ ├── dumpistate.h │ ├── freedefs.h │ ├── libundumpi.c │ └── libundumpi.h └── test │ ├── Makefile.am │ ├── apps │ └── test_conversion.c │ ├── coll.c │ ├── coll.h │ ├── manip.c │ ├── manip.h │ ├── p2p.c │ ├── p2p.h │ ├── probe.h │ ├── run_testf77.sh │ ├── run_testf90.sh │ ├── run_testmpi.sh │ ├── testf77.f │ ├── testf90.f90 │ ├── testmpi.c │ ├── testthreads-funneled.c │ ├── testthreads-multiple.c │ ├── testthreads-serialized.c │ └── testthreads.c ├── rsq.sh ├── scripts ├── cost.pl ├── delta.pl ├── timings.pl ├── timings2.pl ├── timings3.pl └── tstamps.pl ├── tests ├── Makefile.am └── traces │ ├── callcounts-batch.txt │ ├── callcounts-single.txt │ ├── testtrace-0000.bin │ ├── testtrace-0000.txt │ ├── testtrace-0001.bin │ ├── testtrace-0002.bin │ ├── testtrace-0003.bin │ └── testtrace.meta ├── todo └── xcode ├── dumpi.xcodeproj └── project.pbxproj ├── dumpi ├── dumpi-Info.plist └── en.lproj │ └── InfoPlist.strings └── scripts ├── build └── copy_headers /.gitignore: -------------------------------------------------------------------------------- 1 | # http://www.gnu.org/software/automake 2 | 3 | Makefile.in 4 | 5 | # http://www.gnu.org/software/autoconf 6 | 7 | /autom4te.cache 8 | /autoscan.log 9 | /autoscan-*.log 10 | /aclocal.m4 11 | /compile 12 | /config.h.in 13 | /configure 14 | /configure.scan 15 | /depcomp 16 | /install-sh 17 | /missing 18 | /stamp-h1 19 | 20 | autom4te.cache 21 | acinclude/libtool.m4 22 | acinclude/ltoptions.m4 23 | acinclude/ltsugar.m4 24 | acinclude/ltversion.m4 25 | acinclude/lt~obsolete.m4 26 | aclocal.m4 27 | bin/config.guess 28 | bin/config.sub 29 | bin/depcomp 30 | bin/install-sh 31 | bin/ltmain.sh 32 | bin/missing 33 | bin/py-compile 34 | bin/ar-lib 35 | bin/compile 36 | bin/test-driver 37 | 38 | tests/reference/upd 39 | dumpi/dumpiconfig-generated.h.in 40 | dumpi/dumpiconfig-generated.h.in~ 41 | 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 2 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 3 | retains certain rights in this software. 4 | 5 | Sandia National Laboratories is a multimission laboratory managed and operated 6 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 7 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 8 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 9 | 10 | Copyright (c) 2009-2023, NTESS 11 | 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the following 22 | disclaimer in the documentation and/or other materials provided 23 | with the distribution. 24 | 25 | * Neither the name of the copyright holder nor the names of its 26 | contributors may be used to endorse or promote products derived 27 | from this software without specific prior written permission. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | 12 | EXTRA_DIST = LICENSE 13 | 14 | SUBDIRS = dumpi tests 15 | ACLOCAL_AMFLAGS = -I acinclude 16 | 17 | .PHONEY: doc 18 | doc: 19 | cd docs && doxygen doxygen.cfg 20 | 21 | #doc-install: doc 22 | # $(INSTALL) -d docs/sst-macroscale @docdir@ 23 | 24 | if WITH_LIBDUMPI 25 | libdumpi: 26 | cd dumpi/common && make 27 | cd dumpi/libdumpi && make 28 | 29 | libdumpi-install: libdumpi 30 | cd dumpi/libdumpi && make install 31 | endif 32 | 33 | if WITH_LIBUNDUMPI 34 | libundumpi: 35 | cd dumpi/common && make 36 | cd dumpi/libundumpi && make 37 | 38 | libundumpi-install: libundumpi 39 | cd dumpi/libundumpi && make install 40 | endif 41 | 42 | if WITH_OTF2 43 | libotf2dump: 44 | cd dumpi/libotf2dump && make 45 | 46 | libotf2dump-install: libotf2dump 47 | cd dumpi/libotf2dump && make install 48 | endif 49 | 50 | if WITH_BIN 51 | dumpi2ascii: 52 | cd dumpi/libundumpi && make 53 | cd dumpi/bin && make dumpi2ascii 54 | 55 | dumpi2otf2: libotf2dump 56 | cd dumpi/libundumpi && make 57 | cd dumpi/bin && make dumpi2otf2 58 | endif 59 | 60 | if WITH_TEST 61 | testmpi: 62 | cd dumpi/libdumpi && make 63 | cd dumpi/bin && make testmpi 64 | endif 65 | 66 | superclean: distclean 67 | rm -rf configure autom4te.cache aclocal.m4 68 | rm -f acinclude/ltsugar.m4 acinclude/libtool.m4 acinclude/ltversion.m4 acinclude/lt~obsolete.m4 acinclude/ltoptions.m4 69 | rm -f bin/depcomp bin/missing bin/config.guess bin/config.sub bin/ltmain.sh bin/install-sh 70 | find . -name Makefile.in | xargs rm -f 71 | rm -f dumpi/dumpiconfig.h.in 72 | -------------------------------------------------------------------------------- /Makefile.common: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) 2 | 3 | if HAVE_MACSDK 4 | AM_CFLAGS = $(MACSDK_CFLAGS) 5 | AM_CXXFLAGS = $(MACSDK_CXXFLAGS) 6 | endif 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![SST](http://sst-simulator.org/img/sst-logo-small.png) 2 | 3 | # Structural Simulation Toolkit (SST) DUMPI Trace Library 4 | 5 | #### Copyright (c) 2009-2023, National Technology and Engineering Solutions of Sandia, LLC (NTESS) 6 | 7 | --- 8 | The DUMPI library provides trace collection and trace replay tools for MPI applications. 9 | The collection (dumpi) and replay (undumpi) tools can be enable in configure using: 10 | ```` 11 | --enable-libdumpi 12 | --enable-libundumpi 13 | ```` 14 | 15 | To get started from a release, simply configure DUMPI using an MPI compiler. 16 | 17 | To get started from a git download, run 18 | ```` 19 | ./bootstrap.sh 20 | ```` 21 | You can then configure using any MPI compiler. 22 | 23 | Once installed, simply add 24 | ```` 25 | -L$(PATH_TO_DUMPI) -ldumpi 26 | ```` 27 | to the LDFLAGS for your project. This will automatically embed DUMPI hooks into every MPI call. 28 | Run your application as normal, and DUMPI will generate a file for each MPI rank containing the trace 29 | in that folder. Trace collection is simple! 30 | 31 | For trace replay, you will require the SST/macro tool. See the sst-macro repo and PDF manual for details on trace replay. 32 | 33 | ##### [LICENSE](https://github.com/sstsimulator/sst-dumpi/blob/devel/LICENSE) 34 | 35 | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) 36 | 37 | Under the terms of Contract DE-NA0003525 with NTESS, 38 | the U.S. Government retains certain rights in this software. 39 | 40 | -------------------------------------------------------------------------------- /acinclude/ax_mpiversion.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AX_MPIVERSION], [ 2 | AC_MSG_CHECKING(mpi version) 3 | AC_CACHE_VAL(ac_cv_mpi_version, [ 4 | AC_RUN_IFELSE( 5 | [AC_LANG_PROGRAM([#include ], 6 | [return MPI_VERSION == 2;] 7 | )], 8 | [ac_cv_mpi_version=3], 9 | [ac_cv_mpi_version=2], 10 | [] 11 | ) ] 12 | ) 13 | 14 | 15 | AC_MSG_RESULT($ac_cv_mpi_version) 16 | 17 | AS_IF([test "X$ac_cv_mpi_version" == "X2"], 18 | [$1], 19 | [$2] 20 | ) 21 | 22 | ]) 23 | -------------------------------------------------------------------------------- /acinclude/check_bg.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_BG], [ 2 | 3 | AC_ARG_WITH([arch], 4 | [AS_HELP_STRING([--with-arch], [Give an architecture hint to help compilation. Currently supported are bgp and bgq.])], 5 | [ 6 | arch_hint=$withval 7 | ], 8 | [ 9 | arch_hint="none" 10 | ] 11 | ) 12 | 13 | AH_TEMPLATE([DUMPI_ON_BGQ], 14 | [BGQ does odd stuff with grid position and timers]) 15 | if test "X$arch_hint" = "Xbgq"; then 16 | AC_DEFINE(DUMPI_ON_BGQ, [1]) 17 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor" 18 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor/firmware/include " 19 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor/spi/include/kernel" 20 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk" 21 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor/hwi/include" 22 | AC_MSG_RESULT([Adding extra options for BGQ system]) 23 | fi 24 | 25 | AH_TEMPLATE([DUMPI_ON_BGP], 26 | [BGP does odd stuff with grid position and timers]) 27 | if test "X$arch_hint" = "Xbgp"; then 28 | AC_DEFINE(DUMPI_ON_BGP, [1]) 29 | CPPFLAGS="$CPPFLAGS -I/bgsys/drivers/ppcfloor/arch/include" 30 | AC_MSG_RESULT([Adding extra options for BGP system]) 31 | fi 32 | 33 | ]) 34 | -------------------------------------------------------------------------------- /acinclude/check_const.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_CONST_QUALIFIERS], [ 2 | 3 | AH_TEMPLATE([DUMPI_CONST], [whether MPI 2 functions are const]) 4 | AH_TEMPLATE([DUMPI_DEPRECATED_CONST], [whether deprecated MPI functions are const]) 5 | 6 | if test "$enable_libdumpi" = "yes"; then 7 | 8 | constType=`$srcdir/bin/check_const $CXX` 9 | 10 | 11 | if test "X$constType" = "Xnone"; then 12 | AC_MSG_CHECKING([whether MPI uses const qualifier]) 13 | AC_MSG_RESULT([no]) 14 | AC_DEFINE(DUMPI_CONST, []) 15 | AC_DEFINE(DUMPI_DEPRECATED_CONST, []) 16 | else 17 | if test "X$constType" = "XnoDeprecated"; then 18 | AC_MSG_CHECKING([whether MPI uses const qualifier]) 19 | AC_MSG_RESULT([not for deprecated]) 20 | AC_DEFINE(DUMPI_CONST, [const]) 21 | AC_DEFINE(DUMPI_DEPRECATED_CONST, []) 22 | else 23 | #all have const 24 | AC_MSG_CHECKING([whether MPI uses const qualifier]) 25 | AC_MSG_RESULT([yes]) 26 | AC_DEFINE(DUMPI_CONST, [const]) 27 | AC_DEFINE(DUMPI_DEPRECATED_CONST, [const]) 28 | fi 29 | fi 30 | 31 | fi #enable libdumpi 32 | 33 | 34 | ]) 35 | 36 | 37 | -------------------------------------------------------------------------------- /acinclude/check_cpp11.m4: -------------------------------------------------------------------------------- 1 | 2 | 3 | AC_DEFUN([CHECK_CPP11], [ 4 | 5 | AH_TEMPLATE([HAVE_CPP11], 6 | [Define to use C++11 language features]) 7 | 8 | #make sure if needed C++11 flags are automatically configured 9 | AX_CXX_COMPILE_STDCXX_11(noext, optional) 10 | 11 | ]) 12 | 13 | 14 | -------------------------------------------------------------------------------- /acinclude/check_enabled_features.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_ENABLED_FEATURES], [ 2 | 3 | # Options to turn off building different parts. 4 | AC_ARG_ENABLE(bin, 5 | [ --disable-bin Don't build dumpi2ascii (trace file converter)], 6 | [ 7 | if test "$enableval" = "no"; then 8 | disable_bin="yes" 9 | fi 10 | ], 11 | disable_bin="" 12 | ) 13 | 14 | AC_ARG_ENABLE(libdumpi, 15 | [ --enable-libdumpi Build libdumpi (the trace library)], 16 | [ 17 | enable_libdumpi="$enableval" 18 | ], 19 | disable_libdumpi="" 20 | ) 21 | 22 | AC_ARG_ENABLE(test, 23 | [ --enable-test Build testmpi (coverage testing)], 24 | [ 25 | enable_test="$enableval" 26 | ], 27 | enable_test="no" 28 | ) 29 | 30 | AC_ARG_ENABLE(libundumpi, 31 | [ --disable-libundumpi Don't build libundumpi (the trace file reader)], 32 | [ 33 | if test "$enableval" = "no"; then 34 | disable_libundumpi="yes" 35 | disable_bin="yes" 36 | fi 37 | ], 38 | disable_libundumpi="" 39 | ) 40 | 41 | AM_CONDITIONAL([WITH_BIN], [test "$disable_bin" != "yes"]) 42 | AM_CONDITIONAL([WITH_TEST], [test "$enable_test" = "yes"]) 43 | AM_CONDITIONAL([WITH_LIBDUMPI], [test "$enable_libdumpi" = "yes"]) 44 | AM_CONDITIONAL([WITH_LIBUNDUMPI], [test "$disable_libundumpi" != "yes"]) 45 | 46 | if test "$enable_libdumpi" = "yes"; then 47 | DUMPI_FUNCTIONS 48 | DUMPI_TYPES 49 | DUMPI_OPS 50 | DUMPI_CONSTANTS 51 | fi 52 | 53 | ]) 54 | -------------------------------------------------------------------------------- /acinclude/check_fortran.m4: -------------------------------------------------------------------------------- 1 | 2 | AC_DEFUN([CHECK_FORTRAN_ENABLED], [ 3 | 4 | AC_ARG_ENABLE(f77, 5 | [ --enable-f77[=path] Build fortran77 bindings for libdumpi], 6 | [ 7 | if test "$enableval" != "no"; then 8 | if test "$enableval" != "yes"; then 9 | F77="$enableval" 10 | fi 11 | enable_f77="yes" 12 | MPIF77="$F77" 13 | fi 14 | ], 15 | enable_f77="no" 16 | ) 17 | 18 | AC_ARG_ENABLE(f90, 19 | [ --enable-f90[=path] Build fortran90 bindings for libdumpi], 20 | [ 21 | if test "$enableval" != "no"; then 22 | if test "$enableval" != "yes"; then 23 | FC="$enableval" 24 | F77="$enableval" 25 | #use for both f90 and f77 26 | MPIF90="$FC" 27 | fi 28 | enable_f90="yes" 29 | enable_f77="yes" 30 | fi 31 | ], 32 | enable_f90="no" 33 | ) 34 | 35 | # print messages 36 | AC_MSG_CHECKING([Fortran 77 bindings]) 37 | if test "$enable_f77" != "yes"; then 38 | AC_MSG_RESULT([not enabled]) 39 | else 40 | AC_MSG_RESULT([enabled]) 41 | fi 42 | 43 | AC_MSG_CHECKING([Fortran 90 bindings]) 44 | if test "$enable_f90" != "yes"; then 45 | AC_MSG_RESULT([not enabled]) 46 | else 47 | AC_MSG_RESULT([enabled]) 48 | fi 49 | 50 | AM_CONDITIONAL([WITH_MPIF77], [test "$MPIF77" != "" -a "$enable_f77" == "yes"]) 51 | AM_CONDITIONAL([WITH_MPIF90], [test "$MPIF90" != "" -a "$enable_f90" == "yes"]) 52 | 53 | ]) 54 | 55 | AC_DEFUN([SANITY_CHECK_F90], [ 56 | AC_MSG_CHECKING([Fortran 90 compiler]) 57 | if test "$FC" == ""; then 58 | AC_MSG_ERROR([no F90 compiler found]) 59 | else 60 | AC_MSG_RESULT([found $FC]) 61 | F77="$FC" 62 | fi 63 | AC_FC_WRAPPERS 64 | AC_MSG_CHECKING([whether $FC can compile and link an MPI program]) 65 | AC_LANG_PUSH([Fortran]) 66 | AC_LINK_IFELSE( 67 | [AC_LANG_PROGRAM( 68 | [], 69 | [ 70 | use mpi 71 | implicit none 72 | integer ierr 73 | call mpi_init(ierr) 74 | call mpi_barrier(mpi_comm_world, ierr) 75 | call mpi_finalize(ierr) 76 | ] 77 | )], 78 | [ 79 | dnl Well, at least it compiles and links 80 | AC_MSG_RESULT([yes]) 81 | ],[ 82 | AC_MSG_RESULT([no]) 83 | AC_MSG_ERROR([Please ensure that the FC variable points to an MPI-enabled Fortran90 compiler]) 84 | ] 85 | ) 86 | AC_LANG_POP([Fortran]) 87 | ]) 88 | 89 | AC_DEFUN([SANITY_CHECK_F77], [ 90 | AC_MSG_CHECKING([Fortran77 compiler]) 91 | if test "$F77" == ""; then 92 | AC_MSG_ERROR([no F77 compiler found]) 93 | else 94 | AC_MSG_RESULT([found $F77]) 95 | fi 96 | AC_F77_WRAPPERS 97 | AC_MSG_CHECKING([whether $F77 can compile and link an MPI program]) 98 | AC_LANG_PUSH([Fortran 77]) 99 | AC_LINK_IFELSE( 100 | [AC_LANG_PROGRAM( 101 | [], 102 | [ 103 | implicit none 104 | include 'mpif.h' 105 | integer ierr 106 | call mpi_init(ierr) 107 | call mpi_barrier(mpi_comm_world, ierr) 108 | call mpi_finalize(ierr) 109 | ] 110 | )], 111 | [ 112 | dnl Well, at least it compiles and links 113 | AC_MSG_RESULT([yes]) 114 | ],[ 115 | AC_MSG_RESULT([no.]) 116 | AC_MSG_ERROR([Please ensure that the F77 variable points to an MPI-enabled Fortran77 compiler]) 117 | ] 118 | ) 119 | AC_LANG_POP([Fortran 77]) 120 | ]) 121 | 122 | -------------------------------------------------------------------------------- /acinclude/check_instrumentation.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_INSTRUMENTATION], [ 2 | 3 | # Instrumentation functions. 4 | AH_TEMPLATE([DUMPI_ENABLE_INSTRUMENTATION], [Use instrumentation functions]) 5 | AH_TEMPLATE([DUMPI_SKIP_INSTRUMENTING], [Don't instrument this function]) 6 | AH_TEMPLATE([DUMPI_WEAK_SYMBOL], [Declare function as a weak symbol]) 7 | AH_TEMPLATE([DUMPI_DLADDR_WORKS], [We can use dladdr to get function names]) 8 | 9 | AC_DEFUN([AC_TEST_INSTRUMENTATION], 10 | [ 11 | dnl First, test whether the basic pattern and attributes compile. 12 | AC_LINK_IFELSE( 13 | [AC_LANG_PROGRAM( 14 | [ 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif /* ! __cplusplus */ 18 | void __attribute__((__no_instrument_function__)) 19 | __cyg_profile_func_enter(void *fn, void *site); 20 | void __attribute__((__no_instrument__function__)) 21 | __cyg_profile_func_exit(void *fn, void *site); 22 | #ifdef __cplusplus 23 | } /* end of extern "C" block */ 24 | #endif /* ! __cplusplus */ 25 | void __cyg_profile_func_enter(void *fn, void *site) { 26 | (void)fn; 27 | (void)site; 28 | } 29 | void __cyg_profile_func_exit(void *fn, void *site) { 30 | (void)fn; 31 | (void)site; 32 | } 33 | int func() { return 0; } 34 | ],[ 35 | return func(); 36 | ] 37 | )], 38 | [ 39 | dnl Well, at least it compiles. 40 | instrumentation_works="yes" 41 | AC_DEFINE(DUMPI_ENABLE_INSTRUMENTATION) 42 | AC_DEFINE_UNQUOTED(DUMPI_SKIP_INSTRUMENTING, 43 | [__attribute__((__no_instrument_function__))]) 44 | ],[ 45 | instrumentation_works="no" 46 | AC_DEFINE_UNQUOTED(DUMPI_SKIP_INSTRUMENTING, []) 47 | ] 48 | ) 49 | dnl Next, test whether we can safely request weak symbols 50 | AC_LINK_IFELSE( 51 | [AC_LANG_PROGRAM( 52 | [ 53 | int __attribute__((__weak__)) weakfun(); 54 | int weakfun() { return 0; } 55 | ],[ 56 | if(weakfun) { 57 | return weakfun(); 58 | } 59 | else { 60 | return 0; 61 | } 62 | ] 63 | )], 64 | [ 65 | # That compiles. 66 | attribute_weak_works="yes" 67 | AC_DEFINE_UNQUOTED(DUMPI_WEAK_SYMBOL, [__attribute__((__weak__))]) 68 | ],[ 69 | # no compile. 70 | attribute_weak_works="no" 71 | ] 72 | ) 73 | dnl Now, test whether we can use libdl to extract function names. 74 | if test "$instrumentation_works" = "yes"; then 75 | old_cflags="$CFLAGS" 76 | old_ldflags="$LDFLAGS" 77 | CFLAGS="$CFLAGS -rdynamic" 78 | LDFLAGS="$LDFLAGS -ldl" 79 | AC_LINK_IFELSE( 80 | [AC_LANG_PROGRAM( 81 | [ 82 | #include 83 | #define _GNU_SOURCE 1 84 | #define __USE_GNU 1 85 | #include 86 | #ifdef __cplusplus 87 | extern "C" { 88 | #endif /* ! __cplusplus */ 89 | void __attribute__((__no_instrument_function__)) 90 | __cyg_profile_func_enter(void *fn, void *site); 91 | #ifdef __cplusplus 92 | } /* end of extern "C" block */ 93 | #endif /* ! __cplusplus */ 94 | void __cyg_profile_func_enter(void *fn, void *site) { 95 | Dl_info din; 96 | assert(dladdr(fn, &din) != 0); 97 | } 98 | int func() { return 0; } 99 | ],[ 100 | return func(); 101 | ] 102 | )], 103 | [ 104 | # that compiles 105 | AC_DEFINE([DUMPI_DLADDR_WORKS]) 106 | dladdr_works="yes" 107 | ],[ 108 | # no compilo 109 | dladdr_works="no" 110 | CFLAGS="$old_cflags" 111 | LDFLAGS="$old_ldflags" 112 | ] 113 | ), 114 | fi 115 | ] 116 | ) 117 | 118 | AC_MSG_CHECKING([instrumentation settings]) 119 | AC_ARG_ENABLE(instrumenting, 120 | [ -enable-instrumenting Provide instrumentation functions], 121 | [ 122 | if test "$enableval" = "yes"; then 123 | AC_MSG_RESULT([instrumentation enabled]) 124 | AC_MSG_CHECKING([instrumentation works]) 125 | AC_TEST_INSTRUMENTATION 126 | if test "$instrumentation_works" = "yes"; then 127 | AC_MSG_RESULT([instrumentation works]) 128 | else 129 | AC_MSG_ERROR([instrumentation requested but not working.]) 130 | fi 131 | fi 132 | ], [ 133 | AC_MSG_RESULT([instrumentation not enabled]) 134 | AC_DEFINE_UNQUOTED(DUMPI_SKIP_INSTRUMENTING, []) 135 | ] 136 | ) 137 | 138 | ]) 139 | 140 | -------------------------------------------------------------------------------- /acinclude/check_mpi_version.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_MPI_VERSION], [ 2 | 3 | AC_ARG_WITH(mpi-version, 4 | [ --with-mpi-version[=2,3,etc] The MPI verstion to compile for], 5 | [ 6 | mpiversion="$withval" 7 | ],[ 8 | mpiversion=2 9 | ] 10 | ) 11 | 12 | AH_TEMPLATE([IS_MPI_TWO], 13 | [Define to indicate which mpibindings to use]) 14 | if test "X$mpiversion" = "X2"; then 15 | AC_DEFINE(IS_MPI_TWO, [1]) 16 | AM_CONDITIONAL([WITH_MPI_TWO], true) 17 | AM_CONDITIONAL([WITH_MPI_THREE], false) 18 | fi 19 | if test "X$mpiversion" = "X3"; then 20 | AM_CONDITIONAL([WITH_MPI_TWO], false) 21 | AM_CONDITIONAL([WITH_MPI_THREE], true) 22 | fi 23 | 24 | ]) 25 | -------------------------------------------------------------------------------- /acinclude/check_mpiio.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_MPIIO], [ 2 | 3 | AC_ARG_ENABLE(mpio, 4 | [ --disable-mpio Disable support for MPIO], 5 | [ 6 | if test "$enableval" = "no"; then 7 | DUMPI_DISABLE_MPIO 8 | fi 9 | ], [ 10 | DUMPI_DISABLE_MPIO 11 | ] 12 | ) 13 | 14 | ]) 15 | 16 | -------------------------------------------------------------------------------- /acinclude/check_otf2.m4: -------------------------------------------------------------------------------- 1 | 2 | AC_DEFUN([CHECK_OTF2], [ 3 | 4 | SAVE_CPPFLAGS="$CPPFLAGS" 5 | SAVE_LDFLAGS="$LDFLAGS" 6 | SAVE_LIBS="$LIBS" 7 | 8 | AC_ARG_ENABLE(otf2, 9 | [AS_HELP_STRING( 10 | [--(dis|en)able-otf2], 11 | [Enable otf2 supported trace replay], 12 | )], 13 | [ enable_otf2=$enableval ], 14 | [ enable_otf2=no ] 15 | ) 16 | 17 | #either $enableval is yes,no if yes, then system install of otf2 18 | #if custom, folder specified then add to cppflags and ldflags 19 | if test "X$enable_otf2" = "Xyes"; then 20 | should_have_otf2=yes 21 | LIBS="-lotf2" 22 | else 23 | if test "X$enable_otf2" != "Xno"; then 24 | should_have_otf2=yes 25 | LDFLAGS="-L$enable_otf2/lib" 26 | LIBS="-lotf2" 27 | CPPFLAGS="-I$enable_otf2/include" 28 | else 29 | should_have_otf2=no 30 | fi 31 | fi 32 | 33 | #check header 34 | AC_CHECK_HEADER([otf2/otf2.h], 35 | [have_otf2=yes], 36 | [have_otf2=no] 37 | ) 38 | 39 | # test for dumpi-to-otf2 converter 40 | if test "$disable_bin" != "yes" -a "$have_otf2" = "yes"; then 41 | LIBS="-lotf2 -lz" 42 | AC_MSG_CHECKING([whether OTF2 library and header files can be found]) 43 | AC_LINK_IFELSE( 44 | [AC_LANG_PROGRAM( 45 | [ 46 | #include 47 | #include 48 | ],[ 49 | return EXIT_SUCCESS; 50 | ] 51 | )], 52 | [ 53 | AC_MSG_RESULT([yes]) 54 | have_otf2="yes" 55 | ],[ 56 | AC_MSG_RESULT([no]) 57 | have_otf2="no" 58 | ] 59 | ) 60 | fi 61 | 62 | if test "X$should_have_otf2" = "Xyes" -a "X$have_otf2" != "Xyes"; then 63 | AC_MSG_ERROR([OTF2 libraries required by --enable-otf2 not found]) 64 | fi 65 | 66 | if test "X$should_have_otf2" = "Xyes" -a "X$have_otf2" = "Xyes"; then 67 | build_otf2=yes 68 | AC_DEFINE([OTF2_ENABLED],,[Define OTF2 support as enabled]) 69 | else 70 | build_otf2=no 71 | fi 72 | 73 | AM_CONDITIONAL([WITH_OTF2], [test "$build_otf2" = "yes"]) 74 | 75 | #check lib - try this later 76 | OTF2_CPPFLAGS=$CPPFLAGS 77 | OTF2_LDFLAGS=$LDFLAGS 78 | OTF2_LIBS=$LIBS 79 | 80 | AC_SUBST([OTF2_CPPFLAGS]) 81 | AC_SUBST([OTF2_LDFLAGS]) 82 | AC_SUBST([OTF2_LIBS]) 83 | 84 | CPPFLAGS="$SAVE_CPPFLAGS" 85 | LDFLAGS="$SAVE_LDFLAGS" 86 | LIBS="$SAVE_LIBS" 87 | 88 | ]) 89 | 90 | -------------------------------------------------------------------------------- /acinclude/check_papi.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_PAPI], [ 2 | 3 | # Check whether we have PAPI installed. 4 | AH_TEMPLATE([DUMPI_HAVE_PAPI], [PAPI support is provided.]) 5 | AC_MSG_CHECKING([papi support]) 6 | AC_ARG_ENABLE(papi, 7 | [ --enable-papi[=PATH] Grab PAPI files relative to PATH.], 8 | [ 9 | if test "$enableval" = "no"; then 10 | AC_MSG_RESULT([papi support disabled.]) 11 | else 12 | AC_MSG_RESULT([papi support enabled.]) 13 | AC_DEFINE(DUMPI_HAVE_PAPI) 14 | if test "$enableval" != "yes"; then 15 | CFLAGS="$CFLAGS -I$enableval/include" 16 | LDFLAGS="$LDFLAGS -L$enableval/lib" 17 | fi 18 | LDFLAGS="$LDFLAGS -lpapi" 19 | fi 20 | ], [ 21 | AC_LINK_IFELSE( 22 | [AC_LANG_PROGRAM( 23 | [ 24 | #include 25 | #include 26 | ],[ 27 | char *errstr = (char*)malloc(PAPI_MAX_STR_LEN); 28 | int ret = PAPI_library_init(PAPI_VER_CURRENT); 29 | if(ret != PAPI_VER_CURRENT) { 30 | PAPI_perror(ret, errstr, PAPI_MAX_STR_LEN); 31 | return EXIT_FAILURE; 32 | } 33 | return EXIT_SUCCESS; 34 | ] 35 | )], 36 | [ 37 | AC_MSG_RESULT([yes]) 38 | LDFLAGS="$LDFLAGS -lpapi" 39 | AC_DEFINE(DUMPI_HAVE_PAPI) 40 | ],[ 41 | AC_MSG_RESULT([no]) 42 | ] 43 | ) 44 | ] 45 | ) 46 | 47 | ]) 48 | -------------------------------------------------------------------------------- /acinclude/check_posix_timers.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_TIMERS], [ 2 | 3 | # We allow the caller to suppress high-resoultion timers. 4 | # The reason is that librt sometimes (GNU) brings in pthreads, and certain 5 | # MPI implementations (e.g. MPICH-1) cannot work correctly with pthreads. 6 | AH_TEMPLATE([DUMPI_DISABLE_POSIX_TIMERS], [Skip high resolution timers]) 7 | AC_MSG_CHECKING([whether POSIX timers should be used]) 8 | AC_ARG_ENABLE(posix-timers, 9 | [ --disable-posix-timers Disable POSIX high-resolution timers)], 10 | [ 11 | if test "$enableval" = "no"; then 12 | disable_posix_timers="yes", 13 | AC_DEFINE(DUMPI_DISABLE_POSIX_TIMERS, [1]) 14 | AC_MSG_RESULT([POSIX timers turned off]) 15 | fi 16 | ],[ 17 | disable_posix_timers="no" 18 | # Test whether librt is found (hack hack). 19 | AC_LINK_IFELSE( 20 | [AC_LANG_PROGRAM( 21 | [#include ], 22 | [clock_getres((clockid_t)0, NULL);] 23 | )], 24 | [ 25 | AC_MSG_RESULT([available without linking -lrt]) 26 | ],[ 27 | oldlibs="$LIBS" 28 | LIBS="$LIBS -lrt" 29 | AC_LINK_IFELSE( 30 | [AC_LANG_PROGRAM( 31 | [#include ], 32 | [clock_getres((clockid_t)0, NULL);] 33 | )], 34 | [ 35 | AC_MSG_RESULT([available when linked with -lrt]) 36 | ],[ 37 | LIBS="$oldlibs" 38 | AC_DEFINE(DUMPI_DISABLE_POSIX_TIMERS, [1]) 39 | AC_MSG_RESULT([POSIX timers not available]) 40 | ] 41 | ) 42 | ] 43 | ) 44 | ] 45 | ) 46 | 47 | # Check for non-POSIX timers 48 | AC_CHECK_FUNCS([gettimeofday getrusage]) 49 | 50 | ]) 51 | 52 | -------------------------------------------------------------------------------- /acinclude/check_pthreads.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CHECK_PTHREADS], [ 2 | 3 | AH_TEMPLATE([DUMPI_USE_PTHREADS], 4 | [Put a unique index in thread-local storage.]) 5 | 6 | AC_ARG_ENABLE(pthreads, 7 | [ --disable-pthreads Disable support for multithreaded programs], 8 | [ 9 | if test "$enableval" = "no"; then 10 | enable_pthreads=no 11 | else 12 | enable_pthreads=yes 13 | fi 14 | ], [ 15 | enable_pthreads=yes 16 | ] 17 | ) 18 | 19 | if test "$enable_pthreads" = "yes"; then 20 | if test "$enable_libdumpi" = "yes"; then 21 | # Test whether the system supports pthread thread-local storage. 22 | AC_MSG_CHECKING([whether pthreads provide thread-local storage]) 23 | AC_LINK_IFELSE( 24 | [AC_LANG_PROGRAM( 25 | [ 26 | #include 27 | #include 28 | ],[ 29 | pthread_key_t the_key; 30 | void *the_value = NULL; 31 | pthread_key_create(&the_key, NULL); 32 | pthread_setspecific(the_key, the_value); 33 | return EXIT_SUCCESS; 34 | ] 35 | ) 36 | ], [ 37 | AC_MSG_RESULT([yes]) 38 | AC_DEFINE(DUMPI_USE_PTHREADS) 39 | ],[ 40 | AC_MSG_RESULT([no]) 41 | ]) 42 | fi 43 | fi 44 | 45 | ]) 46 | 47 | -------------------------------------------------------------------------------- /acinclude/check_sdk.m4: -------------------------------------------------------------------------------- 1 | 2 | AC_DEFUN([CHECK_SDK], [ 3 | 4 | SAVE_CPPFLAGS="$CPPFLAGS" 5 | 6 | AC_ARG_WITH(sdk, 7 | [AS_HELP_STRING( 8 | [--with-sdk], 9 | [Mac SDK include location], 10 | )], 11 | [ enable_sdk=$withval ], 12 | [ enable_sdk=no ] 13 | ) 14 | 15 | if test "X$enable_sdk" = "Xyes"; then 16 | AC_MSG_ERROR([Must provide a path for the Mac SDK]) 17 | else 18 | if test "X$enable_sdk" != "Xno"; then 19 | MACSDK_CXXFLAGS="-isysroot $enable_sdk" 20 | MACSDK_CFLAGS="-isysroot $enable_sdk" 21 | fi 22 | fi 23 | 24 | CPPFLAGS="$MACSDK_CFLAGS" 25 | #check header 26 | AC_CHECK_HEADER([string.h], 27 | [HAVE_MACSDK=yes], 28 | [HAVE_MACSDK=no] 29 | ) 30 | CPPFLAGS="$SAVE_CPPFLAGS" 31 | 32 | AM_CONDITIONAL([HAVE_MACSDK], [test "x$HAVE_MACSDK" = "xyes" -a "X$enable_sdk" != "X$no"]) 33 | AC_SUBST([MACSDK_CFLAGS]) 34 | AC_SUBST([MACSDK_CXXFLAGS]) 35 | 36 | ]) 37 | 38 | -------------------------------------------------------------------------------- /acinclude/clean_config: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import re 4 | text = open("oldmpiconfigs.m4").read() 5 | 6 | regexp = re.compile("AH_TEMPLATE.*?DUMPI_SKIP_([_A-Z\d]+).*?AC_DEFINE",re.DOTALL) 7 | matches = regexp.findall(text) 8 | 9 | initial_test = """ 10 | dnl Test whether mpi.h is found 11 | AC_LANG_PUSH(C) 12 | AC_MSG_CHECKING([whether mpi.h is found]) 13 | AC_LINK_IFELSE( 14 | [AC_LANG_PROGRAM( 15 | [ 16 | #include 17 | #include 18 | ], [ 19 | int *ac; char ***av; 20 | MPI_Init(ac, av); 21 | MPI_Finalize(); 22 | return EXIT_SUCCESS; 23 | ] 24 | )], 25 | AC_MSG_RESULT([yes]), 26 | AC_MSG_FAILURE([no]) 27 | ) 28 | """ 29 | 30 | extras = """ 31 | AH_TEMPLATE(DUMPI_HAVE_MPI_WIN, [if MPI_WIN functions are available]) 32 | AC_DEFINE(DUMPI_HAVE_MPI_WIN, [1]) 33 | """ 34 | 35 | str_arr = ["AC_DEFUN([DUMPI_FUNCTIONS], ["] 36 | str_arr.append(initial_test) 37 | str_arr.append(extras) 38 | for m in matches: 39 | line = "AH_TEMPLATE([DUMPI_SKIP_%s], [if %s is missing])" % (m, m) 40 | str_arr.append(line) 41 | str_arr.append("])") 42 | 43 | open("mpiconfigs.m4","w").write("\n".join(str_arr)) 44 | 45 | 46 | -------------------------------------------------------------------------------- /acinclude/clean_constants: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import re 4 | text = open("oldmpiconstants.m4").read() 5 | 6 | regexp = re.compile("AH_TEMPLATE.*?DUMPI_HAVE_([_A-Z\d]+)") 7 | matches = regexp.findall(text) 8 | 9 | str_arr = ["AC_DEFUN([DUMPI_CONSTANTS], ["] 10 | for m in matches: 11 | line = "AH_TEMPLATE([DUMPI_HAVE_%s], [defined if %s is available])" % (m, m) 12 | str_arr.append(line) 13 | line = "AC_DEFINE(DUMPI_HAVE_%s, [1])" % m 14 | str_arr.append(line) 15 | str_arr.append("])") 16 | 17 | open("mpiconstants.m4","w").write("\n".join(str_arr)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /acinclude/clean_ops: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import re 4 | text = open("oldmpiops.m4").read() 5 | 6 | regexp = re.compile("AH_TEMPLATE.*?DUMPI_HAVE_([_A-Z\d]+)") 7 | matches = regexp.findall(text) 8 | 9 | str_arr = ["AC_DEFUN([DUMPI_OPS], ["] 10 | for m in matches: 11 | line = "AH_TEMPLATE([DUMPI_HAVE_%s], [defined if %s is available])" % (m, m) 12 | str_arr.append(line) 13 | line = "AH_TEMPLATE([DUMPI_OP_%s], [Map DUMPI operations to MPI])" % (m) 14 | str_arr.append(line) 15 | line = "AC_DEFINE(DUMPI_HAVE_%s, [1])" % m 16 | str_arr.append(line) 17 | line = "AC_DEFINE(DUMPI_OP_%s, [%s])" % (m,m) 18 | str_arr.append(line) 19 | str_arr.append("])") 20 | 21 | open("mpiops.m4","w").write("\n".join(str_arr)) 22 | 23 | 24 | -------------------------------------------------------------------------------- /acinclude/clean_types: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import re 4 | text = open("oldmpitypes.m4").read() 5 | 6 | regexp = re.compile("AH_TEMPLATE.*?DUMPI_HAVE_([_A-Z\d]+)") 7 | matches = regexp.findall(text) 8 | 9 | str_arr = ["AC_DEFUN([DUMPI_TYPES], ["] 10 | for m in matches: 11 | line = "AH_TEMPLATE([DUMPI_HAVE_%s], [defined if %s is available])" % (m, m) 12 | str_arr.append(line) 13 | line = "AH_TEMPLATE([DUMPI_DATATYPE_%s], [Map DUMPI types to MPI])" % (m) 14 | str_arr.append(line) 15 | line = "AC_DEFINE(DUMPI_HAVE_%s, [1])" % m 16 | str_arr.append(line) 17 | line = "AC_DEFINE(DUMPI_DATATYPE_%s, [%s])" % (m,m) 18 | str_arr.append(line) 19 | str_arr.append("])") 20 | 21 | open("mpitypes.m4","w").write("\n".join(str_arr)) 22 | 23 | 24 | -------------------------------------------------------------------------------- /acinclude/config_buffers.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CONFIG_BUFFER_SIZES], [ 2 | 3 | # Add an option for writing to a memory buffer (instead of direct to file). 4 | minimum_memcache=1048568 dnl One megabyte minus 8 bytes 5 | default_memcache=134217720 dnl 128 megabytes minus 8 bytes 6 | AH_TEMPLATE([DUMPI_MEMBUF_SIZE], [buffer size if DUMPI_WRITE_TO_MEMORY_BUFFER]) 7 | AC_ARG_WITH(trace-buffer-size, 8 | [ --with-trace-buffer[=SIZE] 9 | Default size of a a (large) memory used to cache 10 | output. This cache allows profiling of calls made 11 | outside MPI_Init* and MPI_Finalize. 12 | The size of this buffer can make a significant 13 | performance difference on HPC systems that route 14 | file writes over RPC or RDMA], 15 | [ 16 | # the only allowed values are positive integers. 17 | if ! `echo $enableval | grep -qE '^([0-9]+)$'`; then 18 | AC_MSG_ERROR([--enable-trace-buffer: Invalid buffer size $withval]) 19 | elif test "$enableval" -ge "$minimum_memcache"; then 20 | AC_DEFINE_UNQUOTED(DUMPI_MEMBUF_SIZE, $enableval) 21 | elif test "$enableval" -lt "$minimum_memcache"; then 22 | AC_DEFINE_UNQUOTED(DUMPI_MEMBUF_SIZE, $minimum_memcache) 23 | else 24 | AC_DEFINE_UNQUOTED(DUMPI_MEMBUF_SIZE, $default_memcache) 25 | fi 26 | ],[ 27 | AC_DEFINE_UNQUOTED(DUMPI_MEMBUF_SIZE, $default_memcache) 28 | ] 29 | ) 30 | ]) 31 | 32 | -------------------------------------------------------------------------------- /acinclude/mpio.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([DUMPI_DISABLE_MPIO], [ 2 | AH_TEMPLATE([DUMPI_SKIP_MPIO_TEST], [if MPIO_TEST is missing]) 3 | AH_TEMPLATE([DUMPI_SKIP_MPIO_TESTANY], [if MPIO_TESTANY is missing]) 4 | AH_TEMPLATE([DUMPI_SKIP_MPIO_TESTSOME], [if MPIO_TESTSOME is missing]) 5 | AH_TEMPLATE([DUMPI_SKIP_MPIO_TESTALL], [if MPIO_TESTALL is missing]) 6 | AH_TEMPLATE([DUMPI_SKIP_MPIO_WAIT], [if MPIO_WAIT is missing]) 7 | AH_TEMPLATE([DUMPI_SKIP_MPIO_WAITANY], [if MPIO_WAITANY is missing]) 8 | AH_TEMPLATE([DUMPI_SKIP_MPIO_WAITSOME], [if MPIO_WAITSOME is missing]) 9 | AH_TEMPLATE([DUMPI_SKIP_MPIO_WAITALL], [if MPIO_WAITALL is missing]) 10 | AC_DEFINE([DUMPI_SKIP_MPIO_TEST], [1]) 11 | AC_DEFINE([DUMPI_SKIP_MPIO_TESTANY], [1]) 12 | AC_DEFINE([DUMPI_SKIP_MPIO_TESTSOME], [1]) 13 | AC_DEFINE([DUMPI_SKIP_MPIO_TESTALL], [1]) 14 | AC_DEFINE([DUMPI_SKIP_MPIO_WAIT], [1]) 15 | AC_DEFINE([DUMPI_SKIP_MPIO_WAITANY], [1]) 16 | AC_DEFINE([DUMPI_SKIP_MPIO_WAITSOME], [1]) 17 | AC_DEFINE([DUMPI_SKIP_MPIO_WAITALL], [1]) 18 | ]) 19 | -------------------------------------------------------------------------------- /acinclude/mpiops.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([DUMPI_OPS], [ 2 | AH_TEMPLATE([DUMPI_HAVE_MPI_OP_NULL], [defined if MPI_OP_NULL is available]) 3 | AH_TEMPLATE([DUMPI_OP_MPI_OP_NULL], [Map DUMPI operations to MPI]) 4 | AC_DEFINE(DUMPI_HAVE_MPI_OP_NULL, [1]) 5 | AC_DEFINE(DUMPI_OP_MPI_OP_NULL, [MPI_OP_NULL]) 6 | AH_TEMPLATE([DUMPI_HAVE_MPI_MAX], [defined if MPI_MAX is available]) 7 | AH_TEMPLATE([DUMPI_OP_MPI_MAX], [Map DUMPI operations to MPI]) 8 | AC_DEFINE(DUMPI_HAVE_MPI_MAX, [1]) 9 | AC_DEFINE(DUMPI_OP_MPI_MAX, [MPI_MAX]) 10 | AH_TEMPLATE([DUMPI_HAVE_MPI_MIN], [defined if MPI_MIN is available]) 11 | AH_TEMPLATE([DUMPI_OP_MPI_MIN], [Map DUMPI operations to MPI]) 12 | AC_DEFINE(DUMPI_HAVE_MPI_MIN, [1]) 13 | AC_DEFINE(DUMPI_OP_MPI_MIN, [MPI_MIN]) 14 | AH_TEMPLATE([DUMPI_HAVE_MPI_SUM], [defined if MPI_SUM is available]) 15 | AH_TEMPLATE([DUMPI_OP_MPI_SUM], [Map DUMPI operations to MPI]) 16 | AC_DEFINE(DUMPI_HAVE_MPI_SUM, [1]) 17 | AC_DEFINE(DUMPI_OP_MPI_SUM, [MPI_SUM]) 18 | AH_TEMPLATE([DUMPI_HAVE_MPI_PROD], [defined if MPI_PROD is available]) 19 | AH_TEMPLATE([DUMPI_OP_MPI_PROD], [Map DUMPI operations to MPI]) 20 | AC_DEFINE(DUMPI_HAVE_MPI_PROD, [1]) 21 | AC_DEFINE(DUMPI_OP_MPI_PROD, [MPI_PROD]) 22 | AH_TEMPLATE([DUMPI_HAVE_MPI_LAND], [defined if MPI_LAND is available]) 23 | AH_TEMPLATE([DUMPI_OP_MPI_LAND], [Map DUMPI operations to MPI]) 24 | AC_DEFINE(DUMPI_HAVE_MPI_LAND, [1]) 25 | AC_DEFINE(DUMPI_OP_MPI_LAND, [MPI_LAND]) 26 | AH_TEMPLATE([DUMPI_HAVE_MPI_BAND], [defined if MPI_BAND is available]) 27 | AH_TEMPLATE([DUMPI_OP_MPI_BAND], [Map DUMPI operations to MPI]) 28 | AC_DEFINE(DUMPI_HAVE_MPI_BAND, [1]) 29 | AC_DEFINE(DUMPI_OP_MPI_BAND, [MPI_BAND]) 30 | AH_TEMPLATE([DUMPI_HAVE_MPI_LOR], [defined if MPI_LOR is available]) 31 | AH_TEMPLATE([DUMPI_OP_MPI_LOR], [Map DUMPI operations to MPI]) 32 | AC_DEFINE(DUMPI_HAVE_MPI_LOR, [1]) 33 | AC_DEFINE(DUMPI_OP_MPI_LOR, [MPI_LOR]) 34 | AH_TEMPLATE([DUMPI_HAVE_MPI_BOR], [defined if MPI_BOR is available]) 35 | AH_TEMPLATE([DUMPI_OP_MPI_BOR], [Map DUMPI operations to MPI]) 36 | AC_DEFINE(DUMPI_HAVE_MPI_BOR, [1]) 37 | AC_DEFINE(DUMPI_OP_MPI_BOR, [MPI_BOR]) 38 | AH_TEMPLATE([DUMPI_HAVE_MPI_LXOR], [defined if MPI_LXOR is available]) 39 | AH_TEMPLATE([DUMPI_OP_MPI_LXOR], [Map DUMPI operations to MPI]) 40 | AC_DEFINE(DUMPI_HAVE_MPI_LXOR, [1]) 41 | AC_DEFINE(DUMPI_OP_MPI_LXOR, [MPI_LXOR]) 42 | AH_TEMPLATE([DUMPI_HAVE_MPI_BXOR], [defined if MPI_BXOR is available]) 43 | AH_TEMPLATE([DUMPI_OP_MPI_BXOR], [Map DUMPI operations to MPI]) 44 | AC_DEFINE(DUMPI_HAVE_MPI_BXOR, [1]) 45 | AC_DEFINE(DUMPI_OP_MPI_BXOR, [MPI_BXOR]) 46 | AH_TEMPLATE([DUMPI_HAVE_MPI_MINLOC], [defined if MPI_MINLOC is available]) 47 | AH_TEMPLATE([DUMPI_OP_MPI_MINLOC], [Map DUMPI operations to MPI]) 48 | AC_DEFINE(DUMPI_HAVE_MPI_MINLOC, [1]) 49 | AC_DEFINE(DUMPI_OP_MPI_MINLOC, [MPI_MINLOC]) 50 | AH_TEMPLATE([DUMPI_HAVE_MPI_MAXLOC], [defined if MPI_MAXLOC is available]) 51 | AH_TEMPLATE([DUMPI_OP_MPI_MAXLOC], [Map DUMPI operations to MPI]) 52 | AC_DEFINE(DUMPI_HAVE_MPI_MAXLOC, [1]) 53 | AC_DEFINE(DUMPI_OP_MPI_MAXLOC, [MPI_MAXLOC]) 54 | AH_TEMPLATE([DUMPI_HAVE_MPI_REPLACE], [defined if MPI_REPLACE is available]) 55 | AH_TEMPLATE([DUMPI_OP_MPI_REPLACE], [Map DUMPI operations to MPI]) 56 | AC_DEFINE(DUMPI_HAVE_MPI_REPLACE, [1]) 57 | AC_DEFINE(DUMPI_OP_MPI_REPLACE, [MPI_REPLACE]) 58 | ]) -------------------------------------------------------------------------------- /acinclude/sanity_check_mpicc.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([SANITY_CHECK_MPI], [ 2 | 3 | if test "$enable_libdumpi" = "yes"; then 4 | # We'd better have an MPI-capable C compiler. 5 | AC_MSG_CHECKING([whether $CC can compile and link an MPI program]) 6 | AC_LANG_PUSH([C]) 7 | AC_LINK_IFELSE( 8 | [AC_LANG_PROGRAM( 9 | [#include ], 10 | [ 11 | int aargc; char **aargv; 12 | MPI_Init(&aargc, &aargv); 13 | MPI_Barrier(MPI_COMM_WORLD); 14 | MPI_Finalize(); 15 | ] 16 | )], 17 | [ AC_MSG_RESULT([yes]) ], 18 | [ 19 | AC_MSG_RESULT([no]) 20 | AC_MSG_ERROR([Building libdumpi requires an MPI-capable C compiler.]) 21 | ] 22 | ) 23 | AC_LANG_POP([C]) 24 | 25 | 26 | fi # end of 'if test "$enable_libdumpi" = "yes"' block 27 | 28 | ]) 29 | 30 | -------------------------------------------------------------------------------- /bin/check_const: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import sys 4 | 5 | def getReText(regexp,text): 6 | import re 7 | match = re.compile(regexp, re.DOTALL).search(text) 8 | if not match: 9 | sys.exit("No match for %s in text" % regexp) 10 | return match.groups()[0] 11 | 12 | def getoutput3(cmd,stdin=None,pipe=None): 13 | if not (sys.version_info < (3,0)): 14 | #Python 3 is an unmitigated disaster 15 | #Thanks for breaking everything, Guido 16 | from subprocess import check_output,STDOUT,Popen,PIPE 17 | if stdin: 18 | stdin = open(stdin) 19 | elif pipe: 20 | pipe = Popen(pipe, stdout=PIPE) 21 | stdin = pipe.stdout 22 | import io 23 | result = check_output(cmd.split(),stdin=stdin,stderr=STDOUT).decode("utf-8").rstrip("\n") 24 | if pipe: 25 | pipe.wait() 26 | #Oh, and I love decoding byte strings manually 27 | return result 28 | 29 | def getoutput2(cmd,stdin=None,pipe=None): 30 | if sys.version_info < (3,0): 31 | import commands 32 | if stdin: 33 | cmd = cmd + " < %s" % stdin 34 | elif pipe: 35 | str_arr = [] 36 | for elem in pipe: 37 | if " " in elem: str_arr.append("'%s'" % elem) 38 | else: str_arr.append(elem) 39 | cmd = " ".join(str_arr) + " | " + cmd 40 | return commands.getoutput(cmd) 41 | 42 | getoutput = None 43 | if sys.version_info < (3,0): 44 | getoutput = getoutput2 45 | else: 46 | getoutput = getoutput3 47 | 48 | fobj = open(".const.cc","w") 49 | fobj.write("#include ") 50 | fobj.close() 51 | 52 | import sys 53 | cxx = sys.argv[1] 54 | cmd = "%s -E .const.cc" % cxx 55 | 56 | output = getoutput(cmd) 57 | 58 | constDeprecated = False 59 | constRegular = False 60 | 61 | #do some regexing on this to determine what's going on with standard functions 62 | qualifier = getReText("MPI_Send\s*[(](.*?),", output) 63 | constRegular = "const" in qualifier 64 | 65 | #do some regexing on this to determine what's going on with deprecated functions 66 | qualifier = getReText("MPI_Type_struct\s*[(].*?,(.*?),", output) 67 | constDeprecated = "const" in qualifier 68 | 69 | if constRegular and constDeprecated: 70 | print("all") 71 | elif constRegular: 72 | print("noDeprecated") 73 | else: 74 | print("none") 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | (glibtoolize || libtoolize) \ 15 | && autoreconf --force --install 16 | 17 | -------------------------------------------------------------------------------- /data/combiner.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | my @comb = qw(MPI_COMBINER_NAMED MPI_COMBINER_DUP 15 | MPI_COMBINER_CONTIGUOUS MPI_COMBINER_VECTOR 16 | MPI_COMBINER_HVECTOR_INTEGER MPI_COMBINER_HVECTOR 17 | MPI_COMBINER_INDEXED MPI_COMBINER_HINDEXED_INTEGER 18 | MPI_COMBINER_HINDEXED MPI_COMBINER_INDEXED_BLOCK 19 | MPI_COMBINER_STRUCT_INTEGER MPI_COMBINER_STRUCT 20 | MPI_COMBINER_SUBARRAY MPI_COMBINER_DARRAY 21 | MPI_COMBINER_F90_REAL MPI_COMBINER_F90_COMPLEX 22 | MPI_COMBINER_F90_INTEGER MPI_COMBINER_RESIZED); 23 | 24 | print < 40 | ], [ 41 | int *argc; 42 | char ***argv; 43 | int value = $constant; 44 | MPI_Init(argc, argv); 45 | MPI_Finalize(); 46 | ]), 47 | [ 48 | AC_DEFINE(DUMPI_HAVE_$constant, [1]) 49 | AC_MSG_RESULT([yes]) 50 | ], [ 51 | AC_MSG_RESULT([no]) 52 | ] 53 | ) 54 | 55 | EOF 56 | } 57 | 58 | print < 43 | ], [ 44 | int *argc; 45 | char ***argv; 46 | MPI_Datatype dt = $datatype; 47 | MPI_Init(argc, argv); 48 | MPI_Finalize(); 49 | ]), 50 | [ 51 | AC_DEFINE(DUMPI_HAVE_$datatype, [1]) 52 | AC_DEFINE(DUMPI_DATATYPE_$datatype, [$datatype]) 53 | AC_MSG_RESULT([yes]) 54 | ], [ 55 | AC_DEFINE(DUMPI_DATATYPE_$datatype, [MPI_DATATYPE_NULL]) 56 | AC_MSG_RESULT([no]) 57 | ] 58 | ) 59 | 60 | EOF 61 | } 62 | 63 | print < 38 | ], [ 39 | int *argc; 40 | char ***argv; 41 | MPI_Op op = $operation; 42 | MPI_Init(argc, argv); 43 | MPI_Finalize(); 44 | ]), 45 | [ 46 | AC_DEFINE(DUMPI_HAVE_$operation, [1]) 47 | AC_DEFINE(DUMPI_OP_$operation, [$operation]) 48 | AC_MSG_RESULT([yes]) 49 | ], [ 50 | AC_DEFINE(DUMPI_OP_$operation, [MPI_OP_NULL]) 51 | AC_MSG_RESULT([no]) 52 | ] 53 | ) 54 | 55 | EOF 56 | } 57 | 58 | print < 6 |
  • \ref mpich_fortran 7 |
  • \ref papi_not_supported 8 |
  • \ref papi_failure 9 | 10 | 11 |
    12 | 13 | \section mpich_fortran My FORTRAN program compiles but produces no DUMPI output. 14 | 15 | There is a problem in mpif77 for (some versions of) mpich2 16 | which prevents DUMPI (or any other PMPI library) from grabbing the 17 | MPI_* calls. You can frequently work around the problem by 18 | specifying the mpich libraries directly on the link line: 19 | 20 | \section papi_not_supported My program generates a bunch of "PAPI event ... not supported" 21 | 22 | Your dumpi.conf file specifies PAPI labels that are not supported on 23 | your system. This is not a fatal error -- these performance counters 24 | will be ignored. 25 | 26 | \section papi_failure My program dies because no PAPI counters are found 27 | 28 | You can compile DUMPI with PAPI support even if your kernel or 29 | hardware does not provide any performance counters (this is essential 30 | to allow cross-compiling for various HPC systems). The error message 31 | from DUMPI is a (misleading): 32 |

    ERROR MESSAGE HERE

    33 | You can test whether your system supports performance counters 34 | using 35 | 36 | */ 37 | -------------------------------------------------------------------------------- /docs/dumpi.dox: -------------------------------------------------------------------------------- 1 | /** \mainpage DUMPI: The MPI profiler from the SST simulator suite 2 | 3 | DUMPI was created to facilitate more detailed tracing of MPI calls 4 | than was available from other trace programs we had access to. In 5 | particular, the design goals were to: 6 | 7 |

      8 |
    1. Differentiate between related MPI calls (e.g. MPI_Send, 9 | MPI_Ssend, MPI_Bsend, MPI_Rsend, ...). 10 |
    2. Provide full input and output argument listings (other than 11 | payload data) for MPI calls. In particular: 12 |
        13 |
      • Record vector arguments for MPI_*v and MPI_*w collectives 14 |
      • Detailed tracking of requests, including which request(s) 15 | were matched by MPI_{Wait,Test}{some,any}. 16 |
      • Provide the ability to turn on and off profiling of specific 17 | functions and the amount of data profiled. 18 |
      • Minimize collection overhead, in particular reduce file I/O to 19 | the extent possible (many large parallel platforms have poor 20 | performance for small writes, which may result in large errors 21 | in profiled timings). 22 |
      • Correctly record the special identities of predefined MPI 23 | objects (communicators, constants, datatypes, combiners, 24 | comparisons, and a whole host of others). 25 |
      26 |
    3. Provide a low-overhead API for reading trace files into a 27 | simulator (many of our current traces have millions of MPI calls 28 | recorded on each of hundreds of nodes). 29 |
    30 | 31 |
      32 |
    • \ref using 33 |
    • \ref tools 34 |
    • \ref oaq 35 |
    • \ref known_issues 36 |
    • \ref traceformat 37 |
    38 | 39 | */ 40 | -------------------------------------------------------------------------------- /docs/issues.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | \page known_issues Known issues and concerns 4 | 5 | There are a few issues that will likely force a significant overhaul 6 | of the trace format and DUMPI code design in the near future. 7 | 8 | - The mechanism used to label profiled calls on the stream could 9 | pose difficulties when time comes to extend the family of profiled 10 | calls, which will be of particular concern when MPI-3 eventually is finalized. 11 | - Some records (esp. index records) in the DUMPI trace file should 12 | have been stored as key/value pairs rather than relying on a 13 | specific ordering. Due to the investment in collecting current 14 | trace files, these changes should be done in a backward-compatible 15 | manner. 16 | 17 | */ 18 | -------------------------------------------------------------------------------- /docs/oaq.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | \page oaq Occasionally asked questions (OAQ) 4 | 5 |
      6 |
    1. Why are we not using OTF? 7 |
        8 |
      • We originally intended to use OTF if at all possible. 9 |
      • The major issue we ran into was how to represent OTF event 10 | record types with variable length records (as an example, 11 | consider the receivecount and displacement arrays in 12 | MPI_Gatherv -- these are valid only at root (and may be unsafe 13 | to read from on other nodes), and on root they have the length 14 | of the communicator given as the last argument. 15 |
      • A secondary issue was the potential performance impact of 16 | using OTF, both from converting data to ASCII and from the 17 | more frequent file writes that would be required. 18 |
      19 |
    2. Why are we not using XML? 20 |
        21 |
      • We may eventually move to using XML for the metafile, although 22 | my personal opinion is that XML files are notably less readable 23 | than simple key/value configuration files. 24 |
      • For the same reason, the dumpi.conf preference file for 25 | libdumpi will probably never be converted to xml. 26 |
      27 |
    3. Why are we not compressing the trace files? 28 |
        29 |
      • We tried this as well. 30 |
      • Using zlib compression added an unacceptable overhead to some 31 | MPI trace runs (in particular an unnamed application that does 32 | very frequent calls to MPI_Iprobe). 33 |
      • Compressing the files provides less than two-fold space 34 | savings at the cost of making random access reads intractable. 35 |
      36 |
    4. Why does common/types.h define all these weird compact integer 37 | types for our versions of all the MPI datatypes in common/types.h 38 | (e.g. dumpi_comm, dumpi_errcode, etc.)? How about if I really 39 | need to create more than 32 thousand communicators? 40 |
        41 |
      • We are trying to keep the trace file size down and minimize 42 | file IO; most of these sizes were chosen to exceed the maximum 43 | number of MPI data objects that we expect to encounter in any 44 | actual application. 45 |
      46 |
    5. Won't it be a problem that our biased time (cpu time and wall 47 | time) only have a 16-bit value to hold the seconds? 48 |
        49 |
      • Possibly. This means that our clock rolls over every 18 50 | hours. Realistically, this is only a serious problem if we go 51 | 18 hours without profiling any calls (since the profiled 52 | stream is in chronological order). For current applications 53 | of interest, however, it is almost certain that we will run 54 | out of disk space to hold the trace files long before the 55 | 18-hour time limit is reached. 56 |
      57 |
    58 | 59 | */ -------------------------------------------------------------------------------- /docs/tools.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | \page tools The various parts of DUMPI 4 | 5 | The DUMPI repository contains a collection of libraries and executables 6 | built on a common code base. 7 | 8 |
      9 |
    • libdumpi is the PMPI profiling library. It traps all MPI calls, 10 | profiles them based on the specific options given in the configuration 11 | file, and makes the corresponding PMPI call. It is generally easiest 12 | to build libdumpi with mpicc to make sure that all library dependencies 13 | are handled correctly, but if shared libraries are disabled it should 14 | be sufficient to use any C compiler providing it can find the mpi.h 15 | header file. 16 |
    • libundumpi is a parse-driven interface to read DUMPI trace files. 17 | The parsing is done via callbacks (one callback for each MPI function). 18 | An alternate mechanism for parsing (called dumpistate) is currently 19 | under development; this will provide a mechanism to aggregate all 20 | MPI calls into a common callback routine. The dumpistate mechanism 21 | may be preferable for certain analysis and/or visualization tools. 22 |
    • testmpi is a coverage/sanity checker for DUMPI. It is still under 23 | development, but eventually it should test all SPMD methods in MPI-2 24 | (we might hold off on MPMD methods such as MPI_Comm_spawn_multiple 25 | which are hard to test in a reasonably machine-agnostic manner). 26 |
    • dumpi2ascii converts DUMPI binary traces into a human-readable 27 | ASCII format. 28 |
    • dumpi2otf is currently incomplete. When complete, it will convert 29 | a group of DUMPI traces (identified by a metafile) into a corresponding 30 | group of OTF traces. This utility will require libotf. 31 |
    32 | */ 33 | -------------------------------------------------------------------------------- /dumpi/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | SUBDIRS = common 14 | 15 | if WITH_LIBDUMPI 16 | SUBDIRS += libdumpi 17 | endif 18 | 19 | if WITH_LIBUNDUMPI 20 | SUBDIRS += libundumpi 21 | endif 22 | 23 | if WITH_OTF2 24 | SUBDIRS += libotf2dump 25 | endif 26 | 27 | if WITH_BIN 28 | SUBDIRS += bin 29 | endif 30 | 31 | if WITH_TEST 32 | SUBDIRS += test 33 | endif 34 | 35 | 36 | library_includedir=$(includedir)/dumpi 37 | library_include_HEADERS = dumpiconfig.h 38 | nodist_library_include_HEADERS = dumpiconfig-generated.h 39 | 40 | -------------------------------------------------------------------------------- /dumpi/bin/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | EXTRA_DIST = comm.h dumpi2ascii-callbacks.h dumpi2ascii-defs.h dumpi2dumpi.h \ 14 | group.h metadata.h otfcomplete.h otfwriter.h \ 15 | sharedstate-commconstruct.h sharedstate.h timeutils.h trace.h \ 16 | type.h type.h dumpistats-binbase.h dumpistats-timebin.h \ 17 | dumpistats-gatherbin.h dumpistats-callbacks.h \ 18 | dumpistats-handlers.h \ 19 | test_dumpi2ascii.sh test_dumpi2dumpi.sh 20 | 21 | TESTS = test_dumpi2ascii.sh test_dumpi2dumpi.sh 22 | 23 | AM_LDFLAGS = 24 | bin_PROGRAMS = dumpi2ascii dumpi2dumpi dumpistats ascii2dumpi 25 | 26 | #if WITH_OTF 27 | # bin_PROGRAMS += dumpi2otf 28 | # 29 | # dumpi2otf_SOURCES = dumpi2otf.cc metadata.cc sharedstate.cc \ 30 | # sharedstate-commconstruct.cc trace.cc otfwriter.cc otfcomplete.cc 31 | # dumpi2otf_LDADD = ../libundumpi/libundumpi.la $(OTF2_LDFLAGS) $(OTF2_LIBS) 32 | #endif 33 | 34 | if WITH_OTF2 35 | bin_PROGRAMS += dumpi2otf2 36 | dumpi2otf2_SOURCES = dumpi2otf2.cc dumpi2otf2-callbacks.cc metadata.cc 37 | dumpi2otf2_LDADD = ../libundumpi/libundumpi.la ../libotf2dump/libotf2dump.la $(OTF2_LDFLAGS) $(OTF2_LIBS) 38 | dumpi2otf2_CPPFLAGS = $(OTF2_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) 39 | endif 40 | 41 | dumpi2ascii_SOURCES = dumpi2ascii.c dumpi2ascii-callbacks.c 42 | dumpi2ascii_LDADD = ../libundumpi/libundumpi.la 43 | 44 | ascii2dumpi_SOURCES = ascii2dumpi.c 45 | ascii2dumpi_LDADD = ../libundumpi/libundumpi.la 46 | 47 | dumpi2dumpi_SOURCES = dumpi2dumpi.c dumpi2dumpi-opts.c dumpi2dumpi-help.c \ 48 | dumpi2dumpi-meta.c dumpi2dumpi-callbacks.c 49 | dumpi2dumpi_LDADD = ../libundumpi/libundumpi.la 50 | 51 | dumpistats_SOURCES = dumpistats.cc dumpistats-timebin.cc \ 52 | dumpistats-gatherbin.cc dumpistats-callbacks.cc dumpistats-handlers.cc \ 53 | trace.cc metadata.cc sharedstate.cc sharedstate-commconstruct.cc 54 | dumpistats_LDADD = ../libundumpi/libundumpi.la 55 | 56 | -------------------------------------------------------------------------------- /dumpi/bin/comm.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_COMM_H 46 | #define DUMPI_BIN_COMM_H 47 | 48 | #include 49 | 50 | namespace dumpi { 51 | 52 | typedef int commid; 53 | 54 | /** 55 | * \addtogroup dumpi_utilities dumpi_utilities: C++ analysis utilities. 56 | */ 57 | 58 | /** 59 | * \ingroup dumpi_utilities 60 | */ 61 | /*@{*/ 62 | 63 | /** 64 | * A wrapper class for communicators. 65 | * Intended for C++-based parsing/analysis utilities, 66 | * not used by libdumpi or libundumpi. 67 | */ 68 | class comm { 69 | /// The unique identifier for this comm. 70 | commid index_; 71 | /// The group underlying this comm. 72 | group group_; 73 | 74 | public: 75 | /// Create an empty (NULL) communicator. 76 | comm() : 77 | index_(-1) 78 | {} 79 | 80 | /// Create a communicator around a group. 81 | comm(commid index, const group &gg) : 82 | index_(index), group_(gg) 83 | { 84 | if(group_.get_local_rank() < 0) { 85 | // This node is not a member of the group -- turn this into a 86 | // null communicator. 87 | index_ = -1; 88 | group_ = group(); 89 | } 90 | } 91 | 92 | /// Get the unique communicator index. 93 | commid get_unique_index() const { 94 | return index_; 95 | } 96 | 97 | /// Get my group. 98 | const group& get_group() const { 99 | return group_; 100 | } 101 | 102 | /// Get the unique identifier for this communicator. 103 | commid get_id() const { 104 | return index_; 105 | } 106 | 107 | /// Test whether this is a null communicator. 108 | bool is_null_comm() const { 109 | return index_ < 0; 110 | } 111 | }; 112 | 113 | /*@}*/ 114 | 115 | } // end of namespace dumpi 116 | 117 | #endif // ! DUMPI_BIN_COMM_H 118 | -------------------------------------------------------------------------------- /dumpi/bin/dumpi2ascii-callbacks.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_DUMPI2ASCII_CALLBACKS_H 46 | #define DUMPI_BIN_DUMPI2ASCII_CALLBACKS_H 47 | 48 | #include 49 | 50 | #ifdef __cplusplus 51 | //extern "C" { 52 | #endif /* ! __cplusplus */ 53 | 54 | /** 55 | * \ingroup dumpi2ascii 56 | * \defgroup dumpi2ascii_callbacks dumpi2ascii/callbacks: \ 57 | * callback definitions (used in libundumpi) for converting \ 58 | * a binary DUMPI trace to ASCII format. 59 | */ 60 | /*@{*/ 61 | 62 | /** 63 | * A debugging sanity check -- used in place of a more "real" user arg. 64 | * If we need to, we could use the shared containers (static variables) 65 | * instead of this fake user arg. 66 | */ 67 | #define DUMPI_UARG (void*)0xFF00FF00 /* debugging sanity check */ 68 | 69 | /** 70 | * The address mapping is stored in a shared container. 71 | */ 72 | typedef struct d2a_addrmap { 73 | int count; 74 | uint64_t *address; 75 | char **name; 76 | } d2a_addrmap; 77 | 78 | /** The shared container for address mapping */ 79 | extern d2a_addrmap *d2a_addr; 80 | 81 | /** Define all our callbacks. */ 82 | void set_callbacks(libundumpi_callbacks *cbacks); 83 | 84 | /*@}*/ 85 | 86 | #ifdef __cplusplus 87 | //} /* End of extern "C" block */ 88 | #endif /* ! __cplusplus */ 89 | 90 | #endif /* ! DUMPI_BIN_DUMPI2ASCII_CALLBACKS_H */ 91 | -------------------------------------------------------------------------------- /dumpi/bin/dumpi2dumpi-help.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | 48 | void d2d_print_help(int argc, char **argv, const d2dopts *opt) { 49 | (void)argc; (void)opt; 50 | fprintf(stderr, 51 | "Use: %s [options] [-i old_tracefile] [-o new_tracefile]\n" 52 | " Opts: (-h|--help) Print help\n" 53 | " (-v|--verbose) Verbose output\n" 54 | " (-f|--output-mpi) Output all MPI functions\n" 55 | " (-F|--skip-mpi) Output no MPI functions\n" 56 | " (-w|--output-wall-time) Output wall time values\n" 57 | " (-W|--skip-wall-time) Don't output wall times\n" 58 | " (-c|--output-cpu-time) Output CPU time values\n" 59 | " (-C|--skip-cpu-time) Don't output CPU times\n" 60 | " (-p|--output-perfctrs) Output all perfctr info\n" 61 | " (-P|--skip-perfctrs) Skip all perfctr info\n" 62 | " (-u|--with-user-functions Output any user functions\n" 63 | " (-U|--without-user-functions Omit any user functions\n" 64 | " (-m|--with-mpi) FUNCTION Output the named function\n" 65 | " (-M|--without-mpi) FUNCTION Omit the named function\n" 66 | " (-i|--infile) FILENAME Read the given trace file\n" 67 | " (-I|--metafile) FILENAME Read the given metafile\n" 68 | " (-o|--outfile) FILENAME Write to the given file\n" 69 | "\n" 70 | "Options are parsed in input order, so for example:\n" 71 | "\n" 72 | " %s -F -P -m MPI_Init -m MPI_Finalize -i trace.bin -o foo.bin\n" 73 | "will (1) read the binary trace file 'trace.bin'\n" 74 | " (2) output only MPI_Init and MPI_Finalize information (sans\n" 75 | " perfcounters) to the binary trace file foo.bin\n" 76 | "\n" 77 | " %s -f -M MPI_Probe -M MPI_Iprobe -m trace.meta -o foo\n" 78 | "will (1) read trace.meta to figure out which traces to parse\n" 79 | " (2) read each trace file and output all information except\n" 80 | " MPI_Probe and MPI_Iprobe to a file named foo-.bin\n" 81 | " (3) write a new metafile 'foo.meta' that points to the\n" 82 | " new trace files\n" 83 | "\n" 84 | "Note that the -i and -m options are mutually exclusive.\n", 85 | argv[0], argv[0], argv[0]); 86 | } 87 | -------------------------------------------------------------------------------- /dumpi/bin/dumpi2dumpi.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | 48 | int main(int argc, char **argv) { 49 | d2dopts opt; 50 | int error = 0; 51 | if((error = d2d_collect_opts(argc, argv, &opt))) goto abandon_ship; 52 | if(opt.help) { 53 | d2d_print_help(argc, argv, &opt); 54 | goto abandon_ship; 55 | } 56 | /* Set up the whole mess of callbacks */ 57 | if(opt.verbose) fprintf(stderr, "Setting callbacks.\n"); 58 | if((error = d2d_set_callbacks(&opt))) goto abandon_ship; 59 | if(opt.metafile) { 60 | d2dmeta meta; 61 | int rank; 62 | char *ifname=NULL, *ofname=NULL; 63 | if(opt.verbose) fprintf(stderr, "Parsing metadata.\n"); 64 | if((error = d2d_parse_metadata(&opt, &meta))) goto abandon_ship; 65 | if(opt.verbose) fprintf(stderr, "Parsing tracefiles.\n"); 66 | ifname = (char*)malloc(meta.maxname); 67 | ofname = (char*)malloc(meta.maxname); 68 | for(rank = 0; rank < meta.size; ++rank) { 69 | snprintf(ifname, meta.maxname, meta.traceformat, rank); 70 | snprintf(ofname, meta.maxname, meta.outformat, rank); 71 | if(opt.verbose) { 72 | fprintf(stderr, " Processing rank %d\n" 73 | " Trace input %s\n" 74 | " Trace output %s\n", 75 | rank, ifname, ofname); 76 | } 77 | if((error = d2d_parse_stream(ifname, ofname, &opt))) goto abandon_ship; 78 | } 79 | if(opt.verbose) fprintf(stderr, "Writing new metadata.\n"); 80 | if((error = d2d_write_metadata(&opt, &meta))) goto abandon_ship; 81 | free(ifname); 82 | } 83 | else { 84 | if(opt.verbose) fprintf(stderr, "Parsing tracefile.\n"); 85 | error = d2d_parse_stream(opt.infile, opt.outfile, &opt); 86 | } 87 | 88 | abandon_ship: 89 | return error; 90 | } 91 | -------------------------------------------------------------------------------- /dumpi/bin/dumpi2otf2-defs.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | #ifndef DUMPI2OTF2_H 45 | #define DUMPI2OTF2_H 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | extern "C" { 53 | /** Define all our callbacks. */ 54 | void set_callbacks(libundumpi_callbacks *cbacks); 55 | void set_first_pass_callbacks(libundumpi_callbacks *cbacks); 56 | 57 | /** 58 | * Program options struct. 59 | */ 60 | typedef struct d2o2opt { 61 | int verbose, help; 62 | std::string dumpi_folder; 63 | std::string dumpi_meta; 64 | std::vector dumpi_bin; 65 | std::string output_archive; 66 | bool print_progress = false; 67 | int percent; 68 | } d2o2opt; 69 | } 70 | #endif // DUMPI2OTF2_H 71 | -------------------------------------------------------------------------------- /dumpi/bin/dumpistats-binbase.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_DUMPISTATS_BINBASE_H 46 | #define DUMPI_BIN_DUMPISTATS_BINBASE_H 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | namespace dumpi { 55 | 56 | /** 57 | * Manage binning of data for dumpistats. 58 | */ 59 | class binbase { 60 | /// Blocked copy constructor and assignment operator. 61 | binbase(const binbase&) {} 62 | void operator=(const binbase&) {} 63 | 64 | public: 65 | /// Default constructor needed (since copy constructor is blocked). 66 | binbase() {} 67 | 68 | /// Bye. 69 | virtual ~binbase() {} 70 | 71 | /// Clones all the given handlers. 72 | /// Handlers will be deallocated when this object goes out of scope. 73 | virtual void init(const std::string &binid, 74 | const std::vector *traces, 75 | const std::vector handlers) = 0; 76 | 77 | /// Process the given annotation call. Ignored by default. 78 | virtual void annotate(const char* /*message*/, 79 | uint16_t /*thread*/, 80 | const dumpi_time* /*cpu*/, 81 | const dumpi_time* /*wall*/, 82 | const dumpi_perfinfo* /*perf*/) 83 | {} 84 | 85 | /// Process the given MPI call type. 86 | virtual void handle(dumpi_function func, uint16_t thread, 87 | const dumpi_time *cpu, const dumpi_time *wall, 88 | const dumpi_perfinfo *perf, 89 | int64_t bytes_sent, int to_global_rank, 90 | int64_t bytes_recvd, int from_global_rank, 91 | const void *dumpi_arg) = 0; 92 | 93 | /// Reset counters and internal state in preparation for a new trace. 94 | /// Forces a flush of all active handlers unless callcount_ is zero. 95 | virtual void start_trace(int rank) = 0; 96 | 97 | /// Reset current trace rank. 98 | virtual void reset_trace() = 0; 99 | }; 100 | 101 | } // end of namespace dumpi 102 | 103 | #endif // ! DUMPI_BIN_DUMPISTATS_BINBASE_H 104 | -------------------------------------------------------------------------------- /dumpi/bin/metadata.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_METADATA_H 46 | #define DUMPI_BIN_METADATA_H 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | namespace dumpi { 56 | 57 | /** 58 | * \ingroup dumpi_utilities 59 | */ 60 | /*@{*/ 61 | 62 | /** 63 | * Maintain metadata from a dumpi metafile. 64 | * Intended for C++-based utilities for parsing DUMPI information. 65 | */ 66 | class metadata { 67 | int numprocs_; 68 | std::string metafile_; 69 | std::string folder_; 70 | std::string fileprefix_; 71 | /// This gets expanded to be the sprintf-format needed to open trace files. 72 | std::string tracefmt_; 73 | /// The number of digit in the filename. 74 | int width_; 75 | 76 | public: 77 | metadata(const std::string& metafile); 78 | 79 | /// Number of traces. 80 | int numTraces() const { 81 | return numprocs_; 82 | } 83 | 84 | std::string folder() const { 85 | return folder_; 86 | } 87 | 88 | std::string filePrefix() const { 89 | return fileprefix_; 90 | } 91 | 92 | /// Get the full filename corresponding to the given trace index. 93 | std::string tracename(int index) const { 94 | static char buf[1024]; 95 | if (index >= numprocs_){ 96 | throw std::runtime_error("Requested trace index is too large"); 97 | } 98 | if (snprintf(buf, 1024, tracefmt_.c_str(), index) > 1023){ 99 | throw std::runtime_error("snprintf failed to generate trace name"); 100 | } 101 | return std::string(buf); 102 | } 103 | }; 104 | 105 | /*@}*/ 106 | 107 | } // end of namespace dumpi 108 | 109 | #endif // ! DUMPI_BIN_METADATA_H 110 | -------------------------------------------------------------------------------- /dumpi/bin/otfcomplete.cc: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | 47 | namespace dumpi { 48 | 49 | // 50 | // Add another outstanding request. 51 | // 52 | void otfcomplete::add(dumpi_request requestid, uint32_t recver, uint32_t sender, 53 | uint32_t procgroup, uint32_t tag, uint32_t length, 54 | uint32_t source) 55 | { 56 | if(pending_.find(requestid) != pending_.end()) 57 | throw "otfcomplete::add: Attempt to redefine active request id."; 58 | pending_[requestid] = args(recver, sender, procgroup, tag, length, source); 59 | } 60 | 61 | // 62 | // Complete an outstanding request. 63 | // 64 | void otfcomplete::complete(OTF_Writer *writer, uint64_t stop, 65 | dumpi_request requestid) 66 | { 67 | pending_t::iterator it = pending_.find(requestid); 68 | if(it != pending_.end()) { 69 | args a = it->second; 70 | OTF_Writer_writeRecvMsg(writer, stop, a.recver, a.sender, a.procgroup, 71 | a.tag, a.length, a.source); 72 | pending_.erase(it); 73 | } 74 | } 75 | 76 | // 77 | // Complete a list of outstanding requests (waitany or waitall). 78 | // 79 | void otfcomplete::complete_all(OTF_Writer *writer, uint64_t stop, 80 | int count, const dumpi_request *requests) 81 | { 82 | for(int i = 0; i < count; ++i) 83 | this->complete(writer, stop, requests[i]); 84 | } 85 | 86 | } // end of namespace dumpi 87 | -------------------------------------------------------------------------------- /dumpi/bin/otfcomplete.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_OTFCOMPLETE_H 46 | #define DUMPI_BIN_OTFCOMPLETE_H 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | namespace dumpi { 53 | 54 | /** 55 | * \defgroup dumpi2otf dumpi2otf: Convert DUMPI traces to OTF format. 56 | */ 57 | /*@{*/ 58 | 59 | /** 60 | * Keep track of outstanding irecv requests. 61 | */ 62 | class otfcomplete { 63 | /// Store our outstanding requests. 64 | struct args { 65 | uint32_t recver, sender, procgroup, tag, length, source; 66 | args() : 67 | recver(0), sender(0), procgroup(0), tag(0), length(0), source(0) 68 | {} 69 | args(uint32_t r, uint32_t s, uint32_t p, uint32_t t, uint32_t l, uint32_t x): 70 | recver(r), sender(s), procgroup(p), tag(t), length(l), source(x) 71 | {} 72 | }; 73 | 74 | /// The list of outstanding requests. 75 | typedef std::map pending_t; 76 | pending_t pending_; 77 | 78 | public: 79 | /// Add another outstanding request. 80 | void add(dumpi_request requestid, uint32_t recver, uint32_t sender, 81 | uint32_t procgroup, uint32_t tag, uint32_t length, uint32_t source); 82 | 83 | /// Complete an outstanding request. 84 | /// This is a no-op if the request is not defined (e.g. isend). 85 | void complete(OTF_Writer *writer, uint64_t stop, dumpi_request requestid); 86 | 87 | /// Complete a list of outstanding requests (waitany or waitall). 88 | void complete_all(OTF_Writer *writer, uint64_t stop, 89 | int count, const dumpi_request *requests); 90 | }; 91 | 92 | /*@}*/ 93 | 94 | } // end of namespace dumpi 95 | 96 | #endif // ! DUMPI_BIN_OTFCOMPLETE_H 97 | -------------------------------------------------------------------------------- /dumpi/bin/test_dumpi2ascii.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | ./dumpi2ascii -HSKFPAXf $srcdir/../../tests/traces/testtrace-0000.bin > ttrace.txt 15 | diff -I '^starttime=' -q ttrace.txt $srcdir/../../tests/traces/testtrace-0000.txt 16 | retval="$?" 17 | rm -f ttrace.txt 18 | exit $retval 19 | -------------------------------------------------------------------------------- /dumpi/bin/test_dumpi2dumpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | ./dumpi2dumpi -M MPI_Comm_rank -M MPI_Comm_size \ 15 | -i $srcdir/../../tests/traces/testtrace-0000.bin \ 16 | -o d2d.bin 17 | 18 | ./dumpi2ascii -F d2d.bin > callcounts.txt 19 | diff -q callcounts.txt $srcdir/../../tests/traces/callcounts-single.txt 20 | good="$?" 21 | rm -f d2d.bin 22 | 23 | ./dumpi2dumpi -F -m MPI_Allreduce \ 24 | -I $srcdir/../../tests/traces/testtrace.meta \ 25 | -o d2d-all 26 | 27 | for file in d2d-all-*.bin; do 28 | ./dumpi2ascii -F $file > callcounts-$file.txt 29 | diff -I '^starttime=' -q callcounts-$file.txt $srcdir/../../tests/traces/callcounts-batch.txt 30 | current=$? 31 | #let good=good+current 32 | good=`awk "BEGIN{print $good+$current}"` 33 | done 34 | 35 | rm -f d2d-all* callcounts*.txt 36 | 37 | exit $good 38 | -------------------------------------------------------------------------------- /dumpi/bin/type.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_BIN_TYPE_H 46 | #define DUMPI_BIN_TYPE_H 47 | 48 | #include 49 | 50 | namespace dumpi { 51 | 52 | /** 53 | * \ingroup dumpi_utilities 54 | */ 55 | /*@{*/ 56 | 57 | /** 58 | * Store info about an MPI type. 59 | * Intended for C++-based analysis utilities. 60 | */ 61 | class type { 62 | /// The size of the type in bytes. 63 | int size_; 64 | /// A std::string description of the type, if available. 65 | std::string name_; 66 | 67 | public: 68 | /// Create a new type. 69 | explicit type(int size = -1, const std::string &name = "") : 70 | size_(size), name_(name) 71 | {} 72 | 73 | /// Access the type size. 74 | int get_size() const { 75 | return size_; 76 | } 77 | 78 | /// Access the type name. 79 | const std::string& get_name() const { 80 | return name_; 81 | } 82 | }; 83 | 84 | /*@}*/ 85 | 86 | } // end of namespace dumpi 87 | 88 | #endif // !DUMPI_BIN_TYPE_H 89 | -------------------------------------------------------------------------------- /dumpi/common/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | AM_LDFLAGS = 14 | library_includedir=$(includedir)/dumpi/common 15 | library_include_HEADERS = \ 16 | argtypes.h debugflags.h funclabels.h gettime.h io.h \ 17 | perfctrs.h settings.h constants.h dumpiio.h funcs.h \ 18 | hashmap.h iodefs.h perfctrtags.h types.h byteswap.h 19 | 20 | libdumpi_common_la_SOURCES = types.c funcs.c io.c dumpiio.c funclabels.c \ 21 | gettime.c constants.c perfctrs.c perfctrtags.c iodefs.c debugflags.c 22 | libdumpi_common_la_LDFLAGS = 23 | noinst_LTLIBRARIES = libdumpi_common.la 24 | -------------------------------------------------------------------------------- /dumpi/common/byteswap.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_BYTESWAP_H 46 | #define DUMPI_COMMON_BYTESWAP_H 47 | 48 | #include 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif /* ! __cplusplus */ 53 | 54 | /** 55 | * Defgroup byteutils: Basic byte swap functionality which was, for some 56 | * reason, omitted on Catamount compute nodes. 57 | * 58 | * Written for legibility -- mask-and-shift is likely a little faster 59 | * but simply isn't worth the effort for this platform. 60 | */ 61 | /*@{*/ 62 | 63 | /** 64 | * Swap byte order on a 32-bit entry. Assumes 8-bit bytes. 65 | */ 66 | static inline uint32_t dumpi_swap32(uint32_t val) { 67 | uint32_t v2; 68 | const char *inp = (const char*)(&val); 69 | char *outp = (char*)(&v2); 70 | outp[0] = inp[3]; 71 | outp[1] = inp[2]; 72 | outp[2] = inp[1]; 73 | outp[3] = inp[0]; 74 | return v2; 75 | } 76 | 77 | /** 78 | * Swap byte order on a 16-bit entry. Assumes 8-bit bytes. 79 | */ 80 | static inline uint16_t dumpi_swap16(uint16_t val) { 81 | uint16_t v2; 82 | const char *inp = (const char*)(&val); 83 | char *outp = (char*)(&v2); 84 | outp[0] = inp[1]; 85 | outp[1] = inp[0]; 86 | return v2; 87 | } 88 | 89 | /*@}*/ 90 | 91 | #ifdef __cplusplus 92 | } /* end of extern "C" block */ 93 | #endif /* ! __cplusplus */ 94 | 95 | #endif /* ! DUMPI_COMMON_BYTESWAP_H */ 96 | -------------------------------------------------------------------------------- /dumpi/common/debugflags.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | 48 | #ifndef DUMPI_DEBUG_SETTING 49 | /*#define DUMPI_DEBUG_SETTING DUMPI_DEBUG_ALL */ 50 | #define DUMPI_DEBUG_SETTING DUMPI_DEBUG_NONE 51 | #endif /* ! DUMPI_DEBUG_SETTING */ 52 | 53 | uint64_t dumpi_debug = DUMPI_DEBUG_SETTING; 54 | -------------------------------------------------------------------------------- /dumpi/common/debugflags.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_DEBUGFLAGS 46 | #define DUMPI_COMMON_DEBUGFLAGS 47 | 48 | #include 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif /* ! __cplusplus */ 53 | 54 | /** 55 | * \ingroup common 56 | * \defgroup common_debugflags common/debugflags: \ 57 | * Debug flags for printf-style debugging. \ 58 | * Remarkably, many HPC platforms don't have functional debuggers. 59 | */ 60 | /*@{*/ 61 | 62 | /** A shared variable controlling extend of debug output */ 63 | extern uint64_t dumpi_debug; 64 | 65 | /* 66 | * The value of dumpi_debug is tested against the following bitmasks 67 | * to decide whether to print debug messages to stderr or not 68 | */ 69 | 70 | /** Turn off all debugging */ 71 | #define DUMPI_DEBUG_NONE (0) 72 | /** Turn on all debugging */ 73 | #define DUMPI_DEBUG_ALL (~0) 74 | /** Enable debugging of trace IO */ 75 | #define DUMPI_DEBUG_TRACEIO (1) 76 | /** Enable more extensive trace IO debugging */ 77 | #define DUMPI_DEBUG_TRACEIO_VERBOSE ((1<<1) | DUMPI_DEBUG_TRACEIO) 78 | /** Enable debugging of MPI calls */ 79 | #define DUMPI_DEBUG_MPICALLS (1<<2) 80 | /** Enable debugging from within libdumpi */ 81 | #define DUMPI_DEBUG_LIBDUMPI (1<<3) 82 | 83 | /*@}*/ 84 | 85 | #ifdef __cplusplus 86 | } /* end of extern C block */ 87 | #endif /* ! __cplusplus */ 88 | 89 | #endif /* ! DUMPI_COMMON_DEBUGFLAGS */ 90 | -------------------------------------------------------------------------------- /dumpi/common/funcs.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_FUNCS_H 46 | #define DUMPI_COMMON_FUNCS_H 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif /* ! __cplusplus */ 55 | 56 | /** 57 | * \addtogroup common_internal 58 | */ 59 | /*@{*/ 60 | 61 | /** 62 | * Version numbering. Will probably replace this with autotools versioning. 63 | */ 64 | extern const int8_t dumpi_version; 65 | extern const int8_t dumpi_subversion; 66 | extern const int8_t dumpi_subsubversion; 67 | 68 | /** 69 | * Test whether we meet at least the given version number. 70 | */ 71 | inline static int dumpi_have_version(const char version_array[3], 72 | int min_version, 73 | int min_subversion, 74 | int min_subsubversion) 75 | { 76 | int retval; 77 | if(version_array[0] != min_version) { 78 | retval = (version_array[0] > min_version); 79 | } 80 | else if(version_array[1] != min_subversion) { 81 | retval = (version_array[1] > min_subversion); 82 | } 83 | else { 84 | retval = (version_array[2] >= min_subsubversion); 85 | } 86 | return retval; 87 | } 88 | 89 | /** 90 | * String names for the functions -- used for ascii output 91 | * The last entry (DUMPI_END_OF_STREAM) is NULL (sentinel). 92 | */ 93 | extern const char *dumpi_function_names[DUMPI_END_OF_STREAM+1]; 94 | 95 | /** 96 | * Get the name of the given function. 97 | * Same as calling dumpi_function_names[...], except with bounds checking. 98 | * Returns "DUMPI_NO_SUCH_FUNCTION" if function name is out of bounds. 99 | */ 100 | const char* dumpi_get_function_name(int funcid); 101 | 102 | /*@}*/ 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif /* ! __cplusplus */ 107 | 108 | #endif /* ! DUMPI_COMMON_FUNCS_H */ 109 | -------------------------------------------------------------------------------- /dumpi/common/gettime.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_GETTIME_H 46 | #define DUMPI_COMMON_GETTIME_H 47 | 48 | #include 49 | #include 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif /* ! __cplusplus */ 54 | 55 | /** 56 | * \addtogroup common 57 | */ 58 | /*@{*/ 59 | 60 | /** 61 | * Use high resulution timers (clock_gettime) to retrieve current cpu 62 | * and wall time. 63 | */ 64 | void dumpi_get_time(dumpi_clock *cpu, dumpi_clock *wall); 65 | 66 | /*@}*/ 67 | 68 | # ifdef __cplusplus 69 | } /* end of extern "C" block */ 70 | #endif /* ! __cplusplus */ 71 | 72 | #endif /* ! DUMPI_COMMON_GETTIME_H */ 73 | -------------------------------------------------------------------------------- /dumpi/common/perfctrs.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_PERFCTRS_H 46 | #define DUMPI_COMMON_PERFCTRS_H 47 | 48 | #include 49 | #include 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif /* ! __cplusplus */ 54 | 55 | /** 56 | * \ingroup common 57 | * \defgroup common_perfctrs common/perfctrs: \ 58 | * Support for PAPI performance monitors 59 | */ 60 | /*@{*/ 61 | 62 | /** 63 | * Control whether we are getting the start (in) value or stop (out) value. 64 | */ 65 | typedef enum dumpi_perfinfo_direction { 66 | DUMPI_PERFCTR_IN, DUMPI_PERFCTR_OUT 67 | } dumpi_perfinfo_direction; 68 | 69 | typedef char dumpi_perflabel_t[DUMPI_MAX_PERFCTR_NAME]; 70 | 71 | /** 72 | * Create a perfinfo object that requests as many of the given 73 | * performance counters as possible (up to the value provided by PAPI 74 | * or DUMPI_MAX_PERFCTRS, whichever is smaller). 75 | * 76 | * Counters that are not provided by the current system are ignored. 77 | * All other counters are processed in first-in order, so if the system 78 | * supports (for example) 2 concurrent counters but 4 are requested 79 | * the first 2 supported ones will be turned on. 80 | */ 81 | int dumpi_init_perfctrs(dumpi_perfinfo *ctrs); 82 | 83 | /** 84 | * Read PAPI performance counters. 85 | */ 86 | void dumpi_get_perfctrs(const dumpi_profile *profile, dumpi_perfinfo *perf, 87 | dumpi_perfinfo_direction direction); 88 | 89 | /** 90 | * How many perfcounters are currently active? 91 | */ 92 | size_t dumpi_active_perfctrs(void); 93 | 94 | /** 95 | * What are the labels of currently active perfctrs? 96 | * Array at least of length dumpi_active_perfctrs(). 97 | */ 98 | dumpi_perflabel_t* dumpi_perfctr_labels(void); 99 | 100 | /*@}*/ 101 | 102 | #ifdef __cplusplus 103 | } /* end of extern "C" block */ 104 | #endif /* ! __cplusplus */ 105 | 106 | #endif /* DUMPI_COMMON_PERFCTRS_H */ 107 | -------------------------------------------------------------------------------- /dumpi/common/settings.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_COMMON_SETTINGS_H 46 | #define DUMPI_COMMON_SETTINGS_H 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif /* ! __cplusplus */ 55 | 56 | /** 57 | * \ingroup common_internal 58 | */ 59 | /*@{*/ 60 | 61 | /** 62 | * The settings for whether specific functions should be profiled or not. 63 | * Tested as bitmasks, be careful before changing default values. 64 | */ 65 | typedef enum dumpi_setting { 66 | DUMPI_DISABLE=0, DUMPI_SUCCESS=1, DUMPI_ALWAYS=(1<<1), 67 | DUMPI_ENABLE=(DUMPI_SUCCESS | DUMPI_ALWAYS) 68 | } dumpi_setting; 69 | 70 | /** 71 | * The controls for what timestamp information gets/was output. 72 | * Tested as a bitmask, be careful before changing default values. 73 | */ 74 | typedef enum dumpi_timestamps { 75 | DUMPI_TIME_NONE=0, DUMPI_TIME_CPU=(1<<2), DUMPI_TIME_WALL=(1<<3), 76 | DUMPI_TIME_FULL=(DUMPI_TIME_CPU|DUMPI_TIME_WALL) 77 | } dumpi_timestamps; 78 | 79 | /** Output statuses */ 80 | #define DUMPI_ENABLE_STATUS_MASK DUMPI_ENABLE 81 | /** Output CPU times */ 82 | #define DUMPI_CPUTIME_MASK DUMPI_TIME_CPU 83 | /** Output wall clock */ 84 | #define DUMPI_WALLTIME_MASK DUMPI_TIME_WALL 85 | /** Output thread id */ 86 | #define DUMPI_THREADID_MASK (1<<6) 87 | /** Output PAPI counter info */ 88 | #define DUMPI_PERFINFO_MASK (1<<7) 89 | 90 | /*@}*/ 91 | 92 | #ifdef __cplusplus 93 | } /* End of extern "C" block */ 94 | #endif /* ! __cplusplus */ 95 | 96 | #endif /* ! DUMPI_COMMON_SETTINGS_H */ 97 | -------------------------------------------------------------------------------- /dumpi/dumpiconfig.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_DUMPICONFIG_H 46 | #define DUMPI_DUMPICONFIG_H 47 | 48 | #undef LT_OBJDIR 49 | #undef PACKAGE 50 | #undef PACKAGE_BUGREPORT 51 | #undef PACKAGE_NAME 52 | #undef PACKAGE_STRING 53 | #undef PACKAGE_TARNAME 54 | #undef PACKAGE_URL 55 | #undef PACKAGE_VERSION 56 | #undef VERSION 57 | 58 | #include 59 | 60 | #include 61 | 62 | #ifdef DUMPI_ON_REDSTORM 63 | #define htonl dumpi_swap32 64 | #define htons dumpi_swap16 65 | #define ntohl dumpi_swap32 66 | #define ntohs dumpi_swap16 67 | #endif 68 | 69 | #undef LT_OBJDIR 70 | #undef PACKAGE 71 | #undef PACKAGE_BUGREPORT 72 | #undef PACKAGE_NAME 73 | #undef PACKAGE_STRING 74 | #undef PACKAGE_TARNAME 75 | #undef PACKAGE_URL 76 | #undef PACKAGE_VERSION 77 | #undef VERSION 78 | 79 | #endif /* ! DUMPI_DUMPICONFIG_H */ 80 | -------------------------------------------------------------------------------- /dumpi/libdumpi/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | 12 | include $(top_srcdir)/Makefile.common 13 | #AM_LDFLAGS = -lrt 14 | library_includedir=$(includedir)/dumpi/libdumpi 15 | library_include_HEADERS = \ 16 | callprofile-addrset.h callprofile.h data.h \ 17 | fused-bindings.h init.h libdumpi.h \ 18 | mpibindings-maps.h mpibindings.h mpibindings-utils.h \ 19 | tof77.h 20 | 21 | lib_LTLIBRARIES = libdumpi.la 22 | 23 | if WITH_MPIF77 24 | lib_LTLIBRARIES += libdumpif77.la 25 | endif 26 | 27 | if WITH_MPIF90 28 | lib_LTLIBRARIES += libdumpif90.la 29 | endif 30 | 31 | libdumpi_la_SOURCES = data.c init.c libdumpi.c callprofile.c \ 32 | callprofile-addrset.c mpibindings-utils.c mpibindings-maps.c 33 | 34 | if WITH_MPI_TWO 35 | libdumpi_la_SOURCES += mpibindings2.c 36 | endif 37 | 38 | if WITH_MPI_THREE 39 | libdumpi_la_SOURCES += mpibindings3.c 40 | endif 41 | 42 | 43 | libdumpi_la_LDFLAGS = -version-info @DUMPI_LIBVERSION@ 44 | libdumpi_la_LIBADD = ../common/libdumpi_common.la 45 | 46 | libdumpif77_la_SOURCES = tof77.c fromf77.f 47 | libdumpif77_la_LDFLAGS = -version-info @DUMPI_LIBVERSION@ 48 | libdumpif77_la_LIBADD = ./libdumpi.la 49 | 50 | libdumpif90_la_SOURCES = tof77.c fromf90.f90 51 | libdumpif90_la_LDFLAGS = -version-info @DUMPI_LIBVERSION@ 52 | libdumpif90_la_LIBADD = ./libdumpi.la 53 | -------------------------------------------------------------------------------- /dumpi/libdumpi/callprofile-addrset.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_CALLPROFILE_ADDRSET_H 46 | #define DUMPI_LIBDUMPI_CALLPROFILE_ADDRSET_H 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif /* !__cplusplus */ 56 | 57 | /** 58 | * \ingroup libdumpi_internal 59 | * \defgroup libdumpi_internal_callprofile libdumpi/internal/callprofile: \ 60 | * Functionality to track addresses in a call profile generated \ 61 | * using -finstrument-functions 62 | */ 63 | /*@{*/ 64 | 65 | /** Allow semi-sensible iteration through the buckets */ 66 | typedef struct dumpi_addr_iterator { 67 | int bucket; 68 | int pos; 69 | } dumpi_addr_iterator; 70 | 71 | /** 72 | * Insert an address on the shared address list. 73 | * Uses libdl (if available) to figure out the name at this address. 74 | */ 75 | void libdumpi_insert_address(void *address); 76 | 77 | /** 78 | * Get an iterator to the first valid pointer on the address list. 79 | */ 80 | dumpi_addr_iterator libdumpi_addr_begin_iterator(); 81 | 82 | /** Test whether an iterator is valid */ 83 | int libdumpi_addr_valid_iterator(const dumpi_addr_iterator *it); 84 | 85 | /** 86 | * Increment the given iterator. 87 | * return non-zero if the iterator is still valid after increment. 88 | */ 89 | int libdumpi_addr_increment_iterator(dumpi_addr_iterator *it); 90 | 91 | /* Dereference the given iterator. */ 92 | uint64_t libdumpi_addr_iterator_value(const dumpi_addr_iterator *it); 93 | 94 | /*@}*/ 95 | 96 | #ifdef __cplusplus 97 | } /* close extern "C" block */ 98 | #endif /* !__cplusplus */ 99 | 100 | #endif /* ! DUMPI_LIBDUMPI_CALLPROFILE_ADDRSET_H */ 101 | -------------------------------------------------------------------------------- /dumpi/libdumpi/callprofile.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_CALLPROFILE_H 46 | #define DUMPI_LIBDUMPI_CALLPROFILE_H 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif /* ! __cplusplus */ 55 | 56 | #ifdef DUMPI_ENABLE_INSTRUMENTATION 57 | 58 | /** 59 | * \addtogroup libdumpi_internal_callprofile 60 | */ 61 | /*@{*/ 62 | 63 | /** 64 | * Indicate entry into a profiled function. 65 | * gcc and icc (in gcc compatibility mode) call this function 66 | * at entry into any function. 67 | */ 68 | void DUMPI_SKIP_INSTRUMENTING 69 | __cyg_profile_func_enter(void *fn, void *site); 70 | 71 | /** 72 | * Indicate exit from a profiled function. 73 | * If this reduces the call depth to zero, force output to a trace file. 74 | */ 75 | void DUMPI_SKIP_INSTRUMENTING 76 | __cyg_profile_func_exit(void *fn, void *site); 77 | 78 | #endif /* ! DUMPI_ENABLE_INSTRUMENTATION */ 79 | 80 | /** 81 | * Insert an arbitrary annotation. 82 | */ 83 | void libdumpi_insert_data(uint64_t key, const char *data); 84 | 85 | /** 86 | * Get the function name associated with the given program position. 87 | * Only works on systems that support dladdr -- otherwise returns the 88 | * std::string "(none)". 89 | */ 90 | const char* DUMPI_SKIP_INSTRUMENTING dumpi_function_name(uint64_t fn); 91 | 92 | /** 93 | * Get the number of unique function addresses profiled so far. 94 | */ 95 | int DUMPI_SKIP_INSTRUMENTING dumpi_profile_unique_address_count(void); 96 | 97 | /** 98 | * Get a listing of all unique function addresses profiled so far. 99 | * It is the responsibility of the caller to free the allocated array. 100 | * 101 | * The number of valid entries in the array is 102 | * dumpi_profile_unique_address_count(). 103 | * 104 | * For convenience, the array is also NULL terminated (the entry at 105 | * [dumpi_profile_unique_address_count()] has the value NULL). 106 | */ 107 | uint64_t* DUMPI_SKIP_INSTRUMENTING dumpi_profile_unique_addresses(void); 108 | 109 | /*@}*/ 110 | 111 | #ifdef __cplusplus 112 | } /* end of extern "C" block */ 113 | #endif /* ! __cplusplus */ 114 | 115 | #endif /* ! DUMPI_LIBDUMPI_CALLPROFILE_H */ 116 | -------------------------------------------------------------------------------- /dumpi/libdumpi/data.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | 48 | dumpi_global_t *dumpi_global = NULL; 49 | 50 | #define DUMPI_TEST_DATATYPE(LABEL) 51 | 52 | const MPI_Datatype dumpi_mpi_datatype_match[DUMPI_FIRST_USER_DATATYPE] = { 53 | MPI_DATATYPE_NULL, 54 | MPI_DATATYPE_NULL, 55 | DUMPI_DATATYPE_MPI_CHAR, 56 | DUMPI_DATATYPE_MPI_SIGNED_CHAR, 57 | DUMPI_DATATYPE_MPI_UNSIGNED_CHAR, 58 | DUMPI_DATATYPE_MPI_BYTE, 59 | DUMPI_DATATYPE_MPI_WCHAR, 60 | DUMPI_DATATYPE_MPI_SHORT, 61 | DUMPI_DATATYPE_MPI_UNSIGNED_SHORT, 62 | DUMPI_DATATYPE_MPI_INT, 63 | DUMPI_DATATYPE_MPI_UNSIGNED, 64 | DUMPI_DATATYPE_MPI_LONG, 65 | DUMPI_DATATYPE_MPI_UNSIGNED_LONG, 66 | DUMPI_DATATYPE_MPI_FLOAT, 67 | DUMPI_DATATYPE_MPI_DOUBLE, 68 | DUMPI_DATATYPE_MPI_LONG_DOUBLE, 69 | DUMPI_DATATYPE_MPI_LONG_LONG_INT, 70 | DUMPI_DATATYPE_MPI_UNSIGNED_LONG_LONG, 71 | DUMPI_DATATYPE_MPI_LONG_LONG, 72 | DUMPI_DATATYPE_MPI_PACKED, 73 | DUMPI_DATATYPE_MPI_FLOAT_INT, 74 | DUMPI_DATATYPE_MPI_DOUBLE_INT, 75 | DUMPI_DATATYPE_MPI_LONG_INT, 76 | DUMPI_DATATYPE_MPI_SHORT_INT, 77 | DUMPI_DATATYPE_MPI_2INT, 78 | DUMPI_DATATYPE_MPI_LONG_DOUBLE_INT 79 | }; 80 | 81 | const MPI_Op dumpi_mpi_op_match[DUMPI_FIRST_USER_OP] = { 82 | MPI_OP_NULL, 83 | DUMPI_OP_MPI_MAX, 84 | DUMPI_OP_MPI_MIN, 85 | DUMPI_OP_MPI_SUM, 86 | DUMPI_OP_MPI_PROD, 87 | DUMPI_OP_MPI_LAND, 88 | DUMPI_OP_MPI_BAND, 89 | DUMPI_OP_MPI_LOR, 90 | DUMPI_OP_MPI_BOR, 91 | DUMPI_OP_MPI_LXOR, 92 | DUMPI_OP_MPI_BXOR, 93 | DUMPI_OP_MPI_MINLOC, 94 | DUMPI_OP_MPI_MAXLOC, 95 | DUMPI_OP_MPI_REPLACE, 96 | MPI_OP_NULL 97 | }; 98 | -------------------------------------------------------------------------------- /dumpi/libdumpi/fromf77.f: -------------------------------------------------------------------------------- 1 | C 2 | C This file is part of DUMPI: 3 | C The MPI profiling library from the SST suite. 4 | C Copyright (c) 2009-2023 NTESS. 5 | C This software is distributed under the BSD License. 6 | C Under the terms of Contract DE-NA0003525 with NTESS, 7 | C the U.S. Government retains certain rights in this software. 8 | C For more information, see the LICENSE file in the top 9 | C SST/macroscale directory. 10 | C 11 | subroutine libdumpi_get_f77_constants 12 | implicit none 13 | include 'mpif.h' 14 | integer status_size 15 | integer compare_ident, compare_similar, compare_unequal 16 | status_size = mpi_status_size 17 | compare_ident = mpi_ident 18 | compare_similar = mpi_similar 19 | compare_unequal = mpi_unequal 20 | C Call back the C code to define status info (yuck) 21 | call libdumpi_f77_put_status_info(mpi_status_ignore, 22 | & mpi_statuses_ignore) 23 | return 24 | end 25 | -------------------------------------------------------------------------------- /dumpi/libdumpi/fromf90.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! This file is part of DUMPI: 3 | ! The MPI profiling library from the SST suite. 4 | ! Copyright (c) 2009-2023 NTESS. 5 | ! This software is distributed under the BSD License. 6 | ! Under the terms of Contract DE-NA0003525 with NTESS, 7 | ! the U.S. Government retains certain rights in this software. 8 | ! For more information, see the LICENSE file in the top 9 | ! SST/macroscale directory. 10 | ! 11 | subroutine libdumpi_get_f77_constants 12 | use mpi 13 | implicit none 14 | integer status_size 15 | integer compare_ident, compare_similar, compare_unequal 16 | status_size = mpi_status_size 17 | compare_ident = mpi_ident 18 | compare_similar = mpi_similar 19 | compare_unequal = mpi_unequal 20 | ! Call back the C code to define status info (yuck) 21 | call libdumpi_f77_put_status_info(mpi_status_ignore, mpi_statuses_ignore) 22 | return 23 | end 24 | -------------------------------------------------------------------------------- /dumpi/libdumpi/fused-bindings.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_FUSED_BINDINGS_H 46 | #define DUMPI_LIBDUMPI_FUSED_BINDINGS_H 47 | 48 | #include 49 | #include 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif /* ! __cplusplus */ 54 | 55 | /** 56 | * \ingroup libdumpi 57 | * \addtogroup libdumpi_internal 58 | */ 59 | /*@{*/ /* define scope for subsequent comments */ 60 | 61 | /** 62 | * Utility definition intended for systems where autoconf doesn't work 63 | * correctly (that would be RSQ). Not really appropriate for other machines. 64 | */ 65 | #ifdef DUMPI_MPIO_USES_MPI_REQUESTS 66 | #ifndef MPIO_USES_MPI_REQUEST 67 | #define DUMPI_SKIP_MPIO_TEST 68 | #define DUMPI_SKIP_MPIO_TESTANY 69 | #define DUMPI_SKIP_MPIO_TESTSOME 70 | #define DUMPI_SKIP_MPIO_TESTALL 71 | #define DUMPI_SKIP_MPIO_WAIT 72 | #define DUMPI_SKIP_MPIO_WAITSOME 73 | #define DUMPI_SKIP_MPIO_WAITANY 74 | #define DUMPI_SKIP_MPIO_WAITALL 75 | #endif 76 | #endif 77 | 78 | /*@}*/ /* close scope of doxygen comments */ 79 | 80 | #ifdef __cplusplus 81 | } /* End of extern C block */ 82 | #endif /* ! __cplusplus */ 83 | 84 | #endif /* DUMPI_LIBDUMPI_FUSED_BINDINGS_H */ 85 | -------------------------------------------------------------------------------- /dumpi/libdumpi/init.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_INIT_H 46 | #define DUMPI_LIBDUMPI_INIT_H 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif /* ! __cplusplus */ 59 | 60 | /** 61 | * \ingroup libdumpi 62 | * \defgroup libdumpi_internal libdumpi/internal: \ 63 | * Internal functionality for libdumpi (not stable API) 64 | */ 65 | /*@{*/ /* Define scope for subsequent comments */ 66 | 67 | /** 68 | * Initialize storage and read in configuration file. 69 | * 70 | * Storage gets freed up automatically at exit. 71 | * This is a no-op if(dumpi_global != NULL). 72 | */ 73 | void libdumpi_init(void); 74 | 75 | /** 76 | * Open output files (each node creates its onw dump file; 77 | * node 0 also creates a human-readable metafile to describe the simulation). 78 | * 79 | * Note that in a parallel run (if MPI is initialized and MPI size > 0), 80 | * node 0 broadcasts its start time (as stored in 81 | * dumpi_global::header::starttime) to be used for all filenames. 82 | * 83 | * This method updates at a large portion of dumpi_global (at least 84 | * dumpi_global::file_root, dumpi_global::output_file, 85 | * and dumpi_global::profile). 86 | */ 87 | void libdumpi_open_files(void); 88 | 89 | /** 90 | * Finalize libdumpi and free all dynamically allocated storage. 91 | * This gets called automatically at exit (using atexit(3)), but 92 | * it is safe to call this method manually. 93 | * 94 | * If dumpi_global::profile is NULL, this method calls 95 | * libdumpi_open_files before flushing the output buffer. 96 | */ 97 | void libdumpi_finalize(void); 98 | 99 | /*@}*/ /* close comment scope */ 100 | 101 | #ifdef __cplusplus 102 | } /* end of extern "C" */ 103 | #endif /* ! __cplusplus */ 104 | 105 | #endif /* ! DUMPI_LIBDUMPI_INIT_H */ 106 | -------------------------------------------------------------------------------- /dumpi/libdumpi/libdumpi.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_LIBDUMPI_H 46 | #define DUMPI_LIBDUMPI_LIBDUMPI_H 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif /* ! __cplusplus */ 55 | 56 | /** 57 | * \defgroup libdumpi libdumpi: \ 58 | * Major parts of the dumpi profiling library. \ 59 | * Dumpi can be used either as a link-level library \ 60 | * or for more fine-grained instrumentation (via this \ 61 | * header file). 62 | */ 63 | /*@{*/ /* Define scope for subsequent doxygen comments */ 64 | 65 | /** 66 | * Turn off all MPI profiling (call counts are still gathered. 67 | */ 68 | void libdumpi_disable_profiling(); 69 | 70 | /** 71 | * Turn MPI profiling (back) to what it was before disable_profiling. 72 | */ 73 | void libdumpi_enable_profiling(); 74 | 75 | /** 76 | * Set profiling preferences for the given MPI function. 77 | * This can be done when profiling is disabled; the new value will take 78 | * effect when libdumpi_enable_profiling is called. 79 | * Valid values for setting are DUMPI_DISABLE, DUMPI_SUCCESS, and DUMPI_ENABLE 80 | */ 81 | void libdumpi_set_profiling(dumpi_function fun, dumpi_setting setting); 82 | 83 | /** 84 | * Specify the fileroot for profile output. 85 | * This call is only respected if it is made before MPI_Init. 86 | */ 87 | void libdumpi_set_output(const char *froot); 88 | 89 | /** 90 | * Specify whether status information should be output in the 91 | * trace file. This call can be made at any time (e.g. when trying 92 | * to figure out status problems in select calls). 93 | */ 94 | void libdumpi_set_status_output(dumpi_setting setting); 95 | 96 | /** 97 | * Access the count of MPI calls made to date. 98 | * Indexing is based on the dumpi_function enum 99 | * including DUMPI_ALL_FUNCTIONS. 100 | */ 101 | const uint32_t* libdumpi_call_counts(); 102 | 103 | /*@}*/ /* close scope of doxygen comments */ 104 | 105 | #ifdef __cplusplus 106 | } /* end of extern "C" block */ 107 | #endif /* ! __cplusplus */ 108 | 109 | #endif /* ! DUMPI_LIBDUMPI_LIBDUMPI_H */ 110 | -------------------------------------------------------------------------------- /dumpi/libdumpi/mpibindings-utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_LIBDUMPI_MPIBINDINGS_UTILS_H 46 | #define DUMPI_LIBDUMPI_MPIBINDINGS_UTILS_H 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif /* ! __cplusplus */ 51 | 52 | /** 53 | * A global lock to protect access to dumpiio routines. 54 | */ 55 | int libdumpi_lock_io(void); 56 | 57 | /** 58 | * A global lock for io routines. 59 | */ 60 | int libdumpi_unlock_io(void); 61 | 62 | /** 63 | * Get a unique thread index for this thread. 64 | */ 65 | int libdumpi_get_thread_id(void); 66 | 67 | /** 68 | * Increase call depth counter for this thread. 69 | * If threads are not enabled, this will use a simple static counter. 70 | * A call count of 1 indicates that this MPI function was called directly 71 | * from user code. 72 | * \return updated call count (always > 0). 73 | */ 74 | int libdumpi_enter_mpi(void); 75 | 76 | /** 77 | * Decrease call depth counter for this thread. 78 | * A call count of 0 indicates that the thread is completely outside MPI. 79 | */ 80 | int libdumpi_exit_mpi(void); 81 | 82 | /** 83 | * Read current call depth. 84 | */ 85 | int libdumpi_get_call_depth(void); 86 | 87 | #ifdef __cplusplus 88 | } /* end of extern C block */ 89 | #endif /* ! __cplusplus */ 90 | 91 | #endif /* ! DUMPI_LIBDUMPI_MPIBINDINGS_UTILS_H */ 92 | -------------------------------------------------------------------------------- /dumpi/libotf2dump/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | AM_CPPFLAGS += $(OTF2_CPPFLAGS) 14 | 15 | library_includedir=$(includedir)/dumpi/libotf2dump 16 | library_include_HEADERS = \ 17 | otf2writer.h otf2writer-defs.h 18 | lib_LTLIBRARIES = libotf2dump.la 19 | 20 | libotf2dump_la_SOURCES = \ 21 | otf2writer.cc \ 22 | otf2deftable.cc 23 | 24 | libotf2dump_la_LDFLAGS = -version-info @DUMPI_LIBVERSION@ $(OTF2_LDFLAGS) 25 | libotf2dump_la_LIBADD = ../common/libdumpi_common.la \ 26 | $(OTF2_LDFLAGS) $(OTF2_LIBS) 27 | 28 | -------------------------------------------------------------------------------- /dumpi/libotf2dump/otf2deftable.cc: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | namespace dumpi { 55 | 56 | OTF2DefTable::OTF2DefTable() {} 57 | 58 | int 59 | OTF2DefTable::insert(const std::string& string) 60 | { 61 | auto it = map_.find(string); 62 | if (it != map_.end())return it->second; 63 | map_.insert(std::make_pair(string, counter_)); 64 | return counter_++; 65 | } 66 | 67 | 68 | int 69 | OTF2DefTable::get(const std::string& string) const 70 | { 71 | auto it = map_.find(string); 72 | if (it == map_.end()){ 73 | throw std::runtime_error("string " + string + " not inserted into def table"); 74 | } 75 | return it->second; 76 | } 77 | 78 | std::string 79 | OTF2DefTable::get(int index) const { 80 | // Finds the string corresponding to the given int. 81 | for (auto elem = map_.begin(); elem != map_.end(); elem++) 82 | if (elem->second == index) 83 | return elem->first; 84 | return std::string(); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /dumpi/libundumpi/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | AM_LDFLAGS = 14 | library_includedir=$(includedir)/dumpi/libundumpi 15 | library_include_HEADERS = \ 16 | bindings.h callbacks.h dumpistate.h freedefs.h libundumpi.h 17 | lib_LTLIBRARIES = libundumpi.la 18 | libundumpi_la_SOURCES = libundumpi.c callbacks.c bindings.c 19 | libundumpi_la_LDFLAGS = -version-info @DUMPI_LIBVERSION@ 20 | libundumpi_la_LIBADD = ../common/libdumpi_common.la 21 | -------------------------------------------------------------------------------- /dumpi/test/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | include $(top_srcdir)/Makefile.common 12 | 13 | EXTRA_DIST = coll.h manip.h p2p.h probe.h \ 14 | run_testmpi.sh run_testf77.sh run_testf90.sh \ 15 | apps 16 | 17 | noinst_PROGRAMS = testmpi testthreads 18 | TESTS = run_testmpi.sh 19 | 20 | if WITH_MPIF77 21 | noinst_PROGRAMS += testf77 22 | TESTS += run_testf77.sh 23 | endif 24 | 25 | if WITH_MPIF90 26 | noinst_PROGRAMS += testf90 27 | TESTS += run_testf90.sh 28 | endif 29 | 30 | testmpi_SOURCES = testmpi.c p2p.c coll.c manip.c 31 | testmpi_LDADD = ../libdumpi/libdumpi.la 32 | 33 | testf77_SOURCES = testf77.f 34 | testf77_LDADD = ../libdumpi/libdumpif77.la 35 | 36 | testf90_SOURCES = testf90.f90 37 | testf90_LDADD = ../libdumpi/libdumpif90.la 38 | 39 | testthreads_SOURCES = testthreads.c testthreads-multiple.c \ 40 | testthreads-serialized.c testthreads-funneled.c 41 | testthreads_LDADD = ../libdumpi/libdumpi.la 42 | -------------------------------------------------------------------------------- /dumpi/test/coll.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_TEST_COLL_H 46 | #define DUMPI_TEST_COLL_H 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif /* ! __cplusplus */ 51 | 52 | /** 53 | * \defgroup testmpi testmpi: Coverage/correctness testing for the \ 54 | * DUMPI MPI bindings. 55 | */ 56 | /*@{*/ 57 | 58 | /** Run through all collective tests. */ 59 | void all_collectives(int rank, int size); 60 | 61 | /* Families of collectives */ 62 | 63 | /** bcast, scatter, scatterv, gather, gatherv, reduce, reduce_scatter 64 | * (reduce_scatter is actually not rootless, but it fits better here). */ 65 | void rooted_collectives(int rank, int size); 66 | 67 | /** barrier, allgather, allgatherv, allreduce, alltoall, alltoallv, scan */ 68 | void rootless_collectives(int rank, int size); 69 | 70 | /*@}*/ 71 | 72 | #ifdef __cplusplus 73 | } /* end of extern "C" block */ 74 | #endif /* ! __cplusplus */ 75 | 76 | #endif /* ! DUMPI_TEST_COLL_H */ 77 | -------------------------------------------------------------------------------- /dumpi/test/manip.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_TEST_MANIP_H 46 | #define DUMPI_TEST_MANIP_H 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif /* ! __cplusplus */ 51 | 52 | /** 53 | * \addtogroup testmpi 54 | */ 55 | /*@{*/ 56 | 57 | /** Run through all probing/waiting tests. */ 58 | void all_manips(int rank, int size); 59 | 60 | /** Sizes, ranks, etc. */ 61 | void queries(int rank, int size); 62 | 63 | /** Just probe calls. */ 64 | void probes(int rank, int size); 65 | 66 | /** Tests, waits, and cancels */ 67 | void tests(int rank, int size); 68 | 69 | /** Create and destroy datatypes */ 70 | void types(int rank, int size); 71 | 72 | /** Create and destroy ops. */ 73 | void ops(int rank, int size); 74 | 75 | /** Create and destroy groups. */ 76 | void groups(int rank, int size); 77 | 78 | /** Create and destroy communicators. */ 79 | void comms(int rank, int size); 80 | 81 | /*@}*/ 82 | 83 | #ifdef __cplusplus 84 | } /* End of extern "C" block */ 85 | #endif /* ! __cplusplus */ 86 | 87 | #endif /* ! DUMPI_TEST_MANIP_H */ 88 | -------------------------------------------------------------------------------- /dumpi/test/p2p.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_TEST_P2P_H 46 | #define DUMPI_TEST_P2P_H 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif /* ! __cplusplus */ 51 | 52 | /** 53 | * \addtogroup testmpi 54 | */ 55 | /*@{*/ 56 | 57 | /* Tests for point-to-point communications */ 58 | 59 | /** Run through all p2p tests (sends, isends, deferred_sends, sendrecvs) */ 60 | void all_p2p(int rank, int size); 61 | 62 | /** send, bsend, rsend, ssend, recv */ 63 | void sends(int rank, int size); 64 | 65 | /** isend, ibsend, irsend, issend, irecv */ 66 | void isends(int rank, int size); 67 | 68 | /** send_init, bsend_init, ssend_init, rsend_init, recv_init, start, startall 69 | * 70 | * Still need to add MPI_Request_free here. 71 | **/ 72 | void deferred_sends(int rank, int size); 73 | 74 | /** sendrecv, sendrecv_replace */ 75 | void sendrecvs(int rank, int size); 76 | 77 | /*@}*/ 78 | 79 | #ifdef __cplusplus 80 | } /* end of extern "C" block */ 81 | #endif /* ! __cplusplus */ 82 | 83 | #endif /* DUMPI_TEST_P2P_H */ 84 | -------------------------------------------------------------------------------- /dumpi/test/probe.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #ifndef DUMPI_TEST_PROBE_H 46 | #define DUMPI_TEST_PROBE_H 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif /* ! __cplusplus */ 51 | 52 | /** 53 | * \addtogroup testmpi 54 | */ 55 | /*@{*/ 56 | 57 | /** Run through all probing/waiting tests. */ 58 | void all_probes(int rank, int size); 59 | 60 | /** Just probe calls. */ 61 | void probes(int rank, int size); 62 | 63 | /** Just test calls. */ 64 | void tests(int rank, int size); 65 | 66 | /** Just wait calls. */ 67 | void waits(int rank, int size); 68 | 69 | /** Cancel and friends. */ 70 | void cancels(int rank, int size); 71 | 72 | /*@}*/ 73 | 74 | #ifdef __cplusplus 75 | } /* End of extern "C" block */ 76 | #endif /* ! __cplusplus */ 77 | 78 | #endif /* ! DUMPI_TEST_PROBE_H */ 79 | -------------------------------------------------------------------------------- /dumpi/test/run_testf77.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | cat >dumpi.conf <dumpi.conf <dumpi.conf < 1) then 23 | if(myid == 0) then 24 | v = 10 25 | call mpi_send(v, 1, MPI_INTEGER, 1, 0, MPI_COMM_WORLD, ierr) 26 | else if(myid == 1) then 27 | call mpi_recv(v, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, 28 | & status, ierr) 29 | end if 30 | end if 31 | call mpi_finalize(ierr) 32 | 33 | stop 34 | end 35 | -------------------------------------------------------------------------------- /dumpi/test/testf90.f90: -------------------------------------------------------------------------------- 1 | ! 2 | ! This file is part of DUMPI: 3 | ! The MPI profiling library from the SST suite. 4 | ! Copyright (c) 2009-2023 NTESS. 5 | ! This software is distributed under the BSD License. 6 | ! Under the terms of Contract DE-NA0003525 with NTESS, 7 | ! the U.S. Government retains certain rights in this software. 8 | ! For more information, see the LICENSE file in the top 9 | ! SST/macroscale directory. 10 | ! 11 | program testf90 12 | use mpi 13 | implicit none 14 | integer ierr, myid, numprocs, status, v 15 | call mpi_init(ierr) 16 | call mpi_comm_rank(MPI_COMM_WORLD, myid, ierr) 17 | call mpi_comm_size(MPI_COMM_WORLD, numprocs, ierr) 18 | call mpi_barrier(MPI_COMM_WORLD, ierr) 19 | if(myid == 0) then 20 | write(*,*)'World size:',numprocs 21 | endif 22 | if(numprocs > 1) then 23 | if(myid == 0) then 24 | v = 10 25 | call mpi_send(v, 1, MPI_INTEGER, 1, 0, MPI_COMM_WORLD, ierr) 26 | else if(myid == 1) then 27 | call mpi_recv(v, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, status, ierr) 28 | end if 29 | end if 30 | call mpi_finalize(ierr) 31 | stop 32 | end program testf90 33 | -------------------------------------------------------------------------------- /dumpi/test/testmpi.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2009-2023 National Technology and Engineering Solutions of Sandia, 3 | LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government 4 | retains certain rights in this software. 5 | 6 | Sandia National Laboratories is a multimission laboratory managed and operated 7 | by National Technology and Engineering Solutions of Sandia, LLC., a wholly 8 | owned subsidiary of Honeywell International, Inc., for the U.S. Department of 9 | Energy's National Nuclear Security Administration under contract DE-NA0003525. 10 | 11 | Copyright (c) 2009-2023, NTESS 12 | 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above 22 | copyright notice, this list of conditions and the following 23 | disclaimer in the documentation and/or other materials provided 24 | with the distribution. 25 | 26 | * Neither the name of the copyright holder nor the names of its 27 | contributors may be used to endorse or promote products derived 28 | from this software without specific prior written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Questions? Contact sst-macro-help@sandia.gov 43 | */ 44 | 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | int main(int argc, char **argv) { 53 | int rank, size; 54 | /* 55 | char buf[1024]; buf[1023] = '\0'; 56 | snprintf(buf, 1023, "testmpi-stderr-%05d", (int)getpid()); 57 | fprintf(stderr, "Redirecting stderr to %s\n", buf); 58 | freopen(buf, "w", stderr); 59 | */ 60 | MPI_Init(&argc, &argv); 61 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 62 | MPI_Comm_size(MPI_COMM_WORLD, &size); 63 | 64 | /* fprintf(stderr, "main: Rank %d\n", rank); */ 65 | if(! rank) 66 | printf("point-to-point tests\n"); 67 | all_p2p(rank, size); 68 | if(! rank) 69 | printf("collective tests\n"); 70 | all_collectives(rank, size); 71 | if(! rank) 72 | printf("various manipulations\n"); 73 | all_manips(rank, size); 74 | 75 | MPI_Finalize(); 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /rsq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | CMD=`getopt -o cs --long libdumpi,libundumpi,dumpi2ascii,mpitest,clean -n 'rsq.sh' -- "$@"` 15 | if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi 16 | eval set -- "$CMD" 17 | 18 | while true; do 19 | case "$1" in 20 | --libdumpi) build_libdumpi="yes" ; shift ;; 21 | --libundumpi) build_libundumpi="yes"; shift ;; 22 | --mpitest) build_mpitest="yes"; shift ;; 23 | --dumpi2ascii) build_dumpi2ascii="yes"; shift ;; 24 | -c) build_libdumpi="yes"; build_mpitest="yes"; shift ;; 25 | -s) build_libundumpi="yes"; build_dumpi2ascii="yes"; shift ;; 26 | --clean) rm -rf libdumpi-rsq.a libundumpi-rsq.a mpitest dumpi2ascii build-rsq core ; exit 0 ;; 27 | --) shift; break ;; 28 | *) echo "parse error." ; exit 1 ;; 29 | esac 30 | done 31 | 32 | echo -e "build_libdumpi=$build_libdumpi\nbuild_libundumpi=$build_libundumpi\nbuild_mpitest=$build_mpitest\n" 33 | 34 | # Hack for RSQ until we figure out a better way to 35 | # get autotools to recognize it. 36 | 37 | if test "$CC" = ""; then 38 | CC=cc 39 | fi 40 | if test "$AR" = ""; then 41 | AR=ar 42 | fi 43 | 44 | if test ! -d build-rsq; then 45 | mkdir build-rsq 46 | fi 47 | 48 | # Remove this definition (comment out) if you 49 | # don't want to write to a memory buffer. 50 | membuffer="-DDUMPI_WRITE_TO_MEMORY_BUFFER" 51 | 52 | OPT="-O3" 53 | #OPT="-g" 54 | COMMON="-DDUMPI_HOST_NAME_MAX=64" 55 | CFLAGS="$CFLAGS_COMMON $OPT -DDUMPI_MPIO_USES_MPI_REQUESTS -DDUMPI_SKIP_MPIO_WAITALL -DDUMPI_SKIP_MPIO_TESTALL -DDUMPI_SKIP_MPIO_WAITANY -DDUMPI_SKIP_MPIO_TESTANY -DDUMPI_SKIP_MPIO_WAITSOME -DDUMPI_SKIP_MPIO_TESTSOME -DDUMPI_ON_REDSTORM -DDUMPI_NO_COMPRESSION $membuffer $COMMON" 56 | cd build-rsq 57 | touch dumpiconfig.h 58 | 59 | if [ "X$build_libdumpi" = "Xyes" ]; then 60 | for file in ../src/common/*.c ../src/libdumpi/*.c; do 61 | echo $CC $CFLAGS -I. -I../src -c $file 62 | $CC $CFLAGS -I. -I../src -c $file 63 | done 64 | $AR cru ../libdumpi-rsq.a *.o 65 | echo "Built libdumpi-rsq.a. You may need to link using -rt" 66 | rm *.o 67 | fi 68 | 69 | if [ "X$build_mpitest" = "Xyes" ]; then 70 | for file in ../src/test/*.c; do 71 | echo $CC $CFLAGS -I. -I../src -c $file 72 | $CC $CFLAGS -I. -I../src -c $file 73 | done 74 | echo $CC $CFLAGS -I. -I../src -o ../mpitest *.o ../libdumpi-rsq.a 75 | $CC $CFLAGS -I. -I../src -o ../mpitest *.o ../libdumpi-rsq.a ../linkins/*.o /opt/xt-service/default/lib/cnos64/librca.a 76 | rm *.o 77 | fi 78 | 79 | if [ "X$build_libundumpi" = "Xyes" ]; then 80 | CC=gcc 81 | CFLAGS="$OPT -I/opt/xt-mpt/2.0.62/mpich2-64/P2/include $COMMON" 82 | for file in ../src/common/*.c ../src/libundumpi/*.c; do 83 | echo $CC $CFLAGS -I. -I../src -c $file 84 | $CC $CFLAGS -I. -I../src -c $file 85 | done 86 | $AR cru ../libundumpi-rsq.a *.o 87 | rm *.o 88 | fi 89 | 90 | if [ "X$build_dumpi2ascii" = "Xyes" ]; then 91 | CC=gcc 92 | CFLAGS="-I/opt/xt-mpt/2.0.62/mpich2-64/P2/include" 93 | for file in ../src/bin/*.c; do 94 | echo $CC $CFLAGS -I. -I../src -c $file 95 | $CC $CFLAGS -I. -I../src -c $file 96 | done 97 | $CC $CFLAGS -I. -I../src -o ../dumpi2ascii dumpi2ascii*.o ../libundumpi-rsq.a -lrt 98 | rm *.o 99 | fi 100 | -------------------------------------------------------------------------------- /scripts/cost.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | # Compute lowest and highest cost associated with each MPI function 15 | 16 | use strict; 17 | my %cpu = ( 18 | 'last-in' => -1, 19 | 'maxcost' => {}, 20 | 'mincost' => {}, 21 | 'sumcost' => {}, 22 | 'rawcost' => {}, 23 | 'count' => {} 24 | ); 25 | my %wall = ( 26 | 'last-in' => -1, 27 | 'maxcost' => {}, 28 | 'mincost' => {}, 29 | 'sumcost' => {}, 30 | 'rawcost' => {}, 31 | 'count' => {} 32 | ); 33 | 34 | while(<>) { 35 | if(/(.*?) (entering|returning) at walltime (.*?), cputime (.*?) seconds/) { 36 | my $mpi = $1; 37 | if($2 eq 'entering') { 38 | $wall{'last-in'} = $3; 39 | $cpu{'last-in'} = $4; 40 | } 41 | elsif($2 eq 'returning') { 42 | my $wall_last_out = $3; 43 | my $cpu_last_out = $4; 44 | unless(defined $wall{'maxcost'}->{$mpi}) { 45 | $wall{'maxcost'}->{$mpi} = 0; 46 | $wall{'mincost'}->{$mpi} = 1e100; 47 | $wall{'sumcost'}->{$mpi} = 0; 48 | $wall{'rawcost'}->{$mpi} = []; 49 | $wall{'count'}->{$mpi} = 0; 50 | $cpu{'maxcost'}->{$mpi} = 0; 51 | $cpu{'mincost'}->{$mpi} = 1e100; 52 | $cpu{'sumcost'}->{$mpi} = 0; 53 | $cpu{'rawcost'}->{$mpi} = []; 54 | $cpu{'count'}->{$mpi} = 0; 55 | } 56 | my $wall_inside_mpi = $wall_last_out - $wall{'last-in'}; 57 | my $cpu_inside_mpi = $cpu_last_out - $cpu{'last-in'}; 58 | $wall{'maxcost'}->{$mpi} = $wall_inside_mpi if $wall_inside_mpi > $wall{'maxcost'}->{$mpi}; 59 | $wall{'mincost'}->{$mpi} = $wall_inside_mpi if $wall_inside_mpi < $wall{'mincost'}->{$mpi}; 60 | $wall{'sumcost'}->{$mpi} += $wall_inside_mpi; 61 | push @{$wall{'rawcost'}->{$mpi}}, $wall_inside_mpi; 62 | $wall{'count'}{$mpi} += 1; 63 | $cpu{'maxcost'}->{$mpi} = $cpu_inside_mpi if $cpu_inside_mpi > $cpu{'maxcost'}->{$mpi}; 64 | $cpu{'mincost'}->{$mpi} = $cpu_inside_mpi if $cpu_inside_mpi < $cpu{'mincost'}->{$mpi}; 65 | $cpu{'sumcost'}->{$mpi} += $cpu_inside_mpi; 66 | push @{$cpu{'rawcost'}->{$mpi}}, $cpu_inside_mpi; 67 | $cpu{'count'}{$mpi} += 1; 68 | } 69 | else { 70 | die("Bogus input line: $_"); 71 | } 72 | } 73 | 74 | } 75 | 76 | print "#Call\ttotal-count\twall-mincost\twall-maxcost\twall-average\twall-mean\tcpu-mincost\tcpu-maxcost\tcpu-average\tcpu-mean\n"; 77 | for my $key (keys %{$wall{'mincost'}}) { 78 | my $wallave = $wall{'sumcost'}->{$key} / $wall{'count'}->{$key}; 79 | my $cpuave = $cpu{'sumcost'}->{$key} / $cpu{'count'}->{$key}; 80 | my $mid = scalar(@{$wall{'rawcost'}->{$key}}) / 2; 81 | my $wallmean = $wall{'rawcost'}->{$key}->[$mid]; 82 | my $cpumean = $cpu{'rawcost'}->{$key}->[$mid]; 83 | if($mid != int($mid) and $mid > 0) { 84 | $wallmean = ($wallmean + $wall{'rawcost'}->{$key}->[$mid-1]) / 2; 85 | $cpumean = ($cpumean + $cpu{'rawcost'}->{$key}->[$mid-1]) / 2; 86 | } 87 | print "$key\t$wall{count}->{$key}\t$wall{mincost}->{$key}\t$wall{maxcost}->{$key}\t$wallave\t$wallmean\t$cpu{mincost}->{$key}\t$cpu{maxcost}->{$key}\t$cpuave\t$cpumean\n"; 88 | } 89 | -------------------------------------------------------------------------------- /scripts/delta.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | use strict; 15 | 16 | die("Usage $0 file1 file2\n") unless @ARGV == 2; 17 | 18 | open A, "<$ARGV[0]" or die("Failed to open $ARGV[0] for reading: $!\n"); 19 | open B, "<$ARGV[1]" or die("Failed to open $ARGV[1] for reading: $!\n"); 20 | 21 | my @a = (); 22 | my @b = (); 23 | while() { 24 | my @t = split ' ', $_; 25 | push @a, \@t; 26 | } 27 | while() { 28 | my @t = split ' ', $_; 29 | push @b, \@t; 30 | } 31 | 32 | die("Files have different number of lines\n") unless @a == @b; 33 | 34 | for my $i (0..$#a) { 35 | print($a[$i]->[0], " ", 36 | ($a[$i]->[1] - $b[$i]->[1]), " ", 37 | ($a[$i]->[2] - $b[$i]->[2]), " ", 38 | $a[$i]->[3], " ", 39 | $a[$i]->[4], "\n"); 40 | die("MPI calls don't match\n") unless 41 | ($a[$i]->[3] eq $b[$i]->[3] and 42 | $a[$i]->[4] eq $b[$i]->[4]); 43 | } 44 | -------------------------------------------------------------------------------- /scripts/timings.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | use strict; 15 | 16 | my $wall_last_in = -1; 17 | my $wall_last_out = -1; 18 | my $cpu_last_in = -1; 19 | my $cpu_last_out = -1; 20 | my $wall_inside_mpi = 0.0; 21 | my $wall_outside_mpi = 0.0; 22 | my $cpu_inside_mpi = 0.0; 23 | my $cpu_outside_mpi = 0.0; 24 | while(<>) { 25 | if(/(.*?) (entering|returning) at walltime (.*?), cputime (.*?) seconds/) { 26 | if($2 eq 'entering') { 27 | $wall_last_in = $3; 28 | $cpu_last_in = $4; 29 | if($wall_last_out >= 0) { 30 | $wall_outside_mpi += $wall_last_in - $wall_last_out; 31 | $cpu_outside_mpi += $cpu_last_in - $cpu_last_out; 32 | } 33 | } 34 | elsif($2 eq 'returning') { 35 | $wall_last_out = $3; 36 | $cpu_last_out = $4; 37 | if($wall_last_in >= 0) { 38 | $wall_inside_mpi += $wall_last_out - $wall_last_in; 39 | $cpu_inside_mpi += $cpu_last_out - $cpu_last_in; 40 | } 41 | } 42 | else { 43 | die("Bogus input line: $_"); 44 | } 45 | } 46 | } 47 | 48 | print "$wall_inside_mpi $wall_outside_mpi $cpu_inside_mpi $cpu_outside_mpi\n"; 49 | -------------------------------------------------------------------------------- /scripts/timings2.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | use strict; 15 | 16 | my @colls = qw( 17 | MPI_Barrier MPI_Bcast MPI_Gather MPI_Gatherv 18 | MPI_Scatter MPI_Scatterv MPI_Allgather MPI_Allgatherv 19 | MPI_Alltoall MPI_Alltoallv MPI_Reduce MPI_Allreduce 20 | MPI_Reduce_scatter MPI_Scan MPI_Comm_dup MPI_Comm_create 21 | MPI_Comm_split MPI_Comm_free MPI_Intercomm_create MPI_Init 22 | MPI_Finalize MPI_Comm_spawn MPI_Comm_spawn_multiple 23 | MPI_Alltoallw MPI_Exscan MPI_Init_thread MPI_File_open 24 | MPI_File_close MPI_File_set_size MPI_File_preallocate MPI_File_set_info 25 | MPI_File_set_view MPI_File_read_at_all MPI_File_write_at_all 26 | MPI_File_read_all MPI_File_write_all MPI_File_read_ordered 27 | MPI_File_seek_shared MPI_File_read_at_all_begin MPI_File_read_at_all_end 28 | MPI_File_write_at_all_begin MPI_File_write_at_all_end 29 | MPI_File_read_all_begin MPI_File_read_all_end 30 | MPI_File_write_all_begin MPI_File_write_all_end 31 | MPI_File_read_ordered_begin MPI_File_read_ordered_end 32 | MPI_File_write_ordered_begin MPI_File_write_ordered_end 33 | MPI_File_set_atomicity MPI_File_sync 34 | ); 35 | 36 | my @waits = qw(MPI_Wait MPI_Waitany MPI_Waitsome MPI_Waitall MPI_Probe 37 | MPI_Start MPI_Startall MPI_Win_wait 38 | MPIO_Wait MPIO_Waitany MPIO_Waitsome MPIO_Waitall); 39 | 40 | my(%collmap, %waitmap); 41 | for my $c (@colls) { $collmap{$c} = 1; } 42 | for my $w (@waits) { $waitmap{$w} = 1; } 43 | 44 | my $wall_last_in = -1; 45 | my $wall_last_out = -1; 46 | my $wall_in_mpi = 0.0; 47 | my $wall_in_coll = 0.0; 48 | my $wall_in_wait = 0.0; 49 | my $wall_outside_mpi = 0.0; 50 | while(<>) { 51 | if(/(.*?) (entering|returning) at walltime (.*?), cputime (.*?) seconds/) { 52 | if($2 eq 'entering') { 53 | $wall_last_in = $3; 54 | if($wall_last_out >= 0) { 55 | $wall_outside_mpi += $wall_last_in - $wall_last_out; 56 | } 57 | } 58 | elsif($2 eq 'returning') { 59 | $wall_last_out = $3; 60 | if($wall_last_in >= 0) { 61 | my $deltat = $wall_last_out - $wall_last_in; 62 | if(defined $collmap{$1}) { 63 | $wall_in_coll += $deltat; 64 | } 65 | elsif(defined $waitmap{$1}) { 66 | $wall_in_wait += $deltat; 67 | } 68 | else { 69 | $wall_in_mpi += $deltat; 70 | } 71 | } 72 | } 73 | else { 74 | die("Bogus input line: $_"); 75 | } 76 | } 77 | } 78 | 79 | print "$wall_in_mpi $wall_in_coll $wall_in_wait $wall_outside_mpi\n"; 80 | -------------------------------------------------------------------------------- /scripts/timings3.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | use strict; 15 | 16 | my $binsize=180; 17 | 18 | my @colls = qw( 19 | MPI_Barrier MPI_Bcast MPI_Gather MPI_Gatherv 20 | MPI_Scatter MPI_Scatterv MPI_Allgather MPI_Allgatherv 21 | MPI_Alltoall MPI_Alltoallv MPI_Reduce MPI_Allreduce 22 | MPI_Reduce_scatter MPI_Scan MPI_Comm_dup MPI_Comm_create 23 | MPI_Comm_split MPI_Comm_free MPI_Intercomm_create MPI_Init 24 | MPI_Finalize MPI_Comm_spawn MPI_Comm_spawn_multiple 25 | MPI_Alltoallw MPI_Exscan MPI_Init_thread MPI_File_open 26 | MPI_File_close MPI_File_set_size MPI_File_preallocate MPI_File_set_info 27 | MPI_File_set_view MPI_File_read_at_all MPI_File_write_at_all 28 | MPI_File_read_all MPI_File_write_all MPI_File_read_ordered 29 | MPI_File_seek_shared MPI_File_read_at_all_begin MPI_File_read_at_all_end 30 | MPI_File_write_at_all_begin MPI_File_write_at_all_end 31 | MPI_File_read_all_begin MPI_File_read_all_end 32 | MPI_File_write_all_begin MPI_File_write_all_end 33 | MPI_File_read_ordered_begin MPI_File_read_ordered_end 34 | MPI_File_write_ordered_begin MPI_File_write_ordered_end 35 | MPI_File_set_atomicity MPI_File_sync 36 | ); 37 | 38 | my @waits = qw(MPI_Wait MPI_Waitany MPI_Waitsome MPI_Waitall MPI_Probe 39 | MPI_Start MPI_Startall MPI_Win_wait 40 | MPIO_Wait MPIO_Waitany MPIO_Waitsome MPIO_Waitall); 41 | 42 | my(%collmap, %waitmap); 43 | for my $c (@colls) { $collmap{$c} = 1; } 44 | for my $w (@waits) { $waitmap{$w} = 1; } 45 | 46 | my $first_timestamp = 1e100; 47 | my $wall_last_in = -1; 48 | my $wall_last_out = -1; 49 | my @wall_in_mpi = (); 50 | my @wall_in_coll = (); 51 | my @wall_in_wait = (); 52 | my @wall_outside_mpi = (); 53 | while(<>) { 54 | if(/(.*?) (entering|returning) at walltime (.*?), cputime (.*?) seconds/) { 55 | $first_timestamp = $3 if($3 < $first_timestamp); 56 | my $bin = int($3 - $first_timestamp) / int($binsize); 57 | if($2 eq 'entering') { 58 | $wall_last_in = $3; 59 | if($wall_last_out >= 0) { 60 | $wall_outside_mpi[$bin] += $wall_last_in - $wall_last_out; 61 | } 62 | } 63 | elsif($2 eq 'returning') { 64 | $wall_last_out = $3; 65 | if($wall_last_in >= 0) { 66 | my $deltat = $wall_last_out - $wall_last_in; 67 | if(defined $collmap{$1}) { 68 | $wall_in_coll[$bin] += $deltat; 69 | } 70 | elsif(defined $waitmap{$1}) { 71 | $wall_in_wait[$bin] += $deltat; 72 | } 73 | else { 74 | $wall_in_mpi[$bin] += $deltat; 75 | } 76 | } 77 | } 78 | else { 79 | die("Bogus input line: $_"); 80 | } 81 | } 82 | } 83 | 84 | my $maxsize = &maxval(scalar(@wall_in_mpi), 85 | scalar(@wall_in_coll), 86 | scalar(@wall_in_wait), 87 | scalar(@wall_outside_mpi)); 88 | 89 | printf "# %8s %10s %10s %10s %10s\n", "START", "MPI", "COLL", "WAIT", "NOMPI"; 90 | for(my $i = 0; $i < $maxsize; ++$i) { 91 | printf(" %8.2f %10.4f %10.4f %10.4f %10.4f\n", 92 | $i*$binsize, 93 | defined($wall_in_mpi[$i]) ? $wall_in_mpi[$i] : 0, 94 | defined($wall_in_coll[$i]) ? $wall_in_coll[$i] : 0, 95 | defined($wall_in_wait[$i]) ? $wall_in_wait[$i] : 0, 96 | defined($wall_outside_mpi[$i]) ? $wall_outside_mpi[$i] : 0); 97 | } 98 | 99 | sub maxval { 100 | my @v = sort {$b <=> $a} @_; 101 | return $v[0]; 102 | } 103 | -------------------------------------------------------------------------------- /scripts/tstamps.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # This file is part of DUMPI: 5 | # The MPI profiling library from the SST suite. 6 | # Copyright (c) 2009-2023 NTESS. 7 | # This software is distributed under the BSD License. 8 | # Under the terms of Contract DE-NA0003525 with NTESS, 9 | # the U.S. Government retains certain rights in this software. 10 | # For more information, see the LICENSE file in the top 11 | # SST/macroscale directory. 12 | # 13 | 14 | use strict; 15 | 16 | my $call = 0; 17 | while(<>) { 18 | if(/(.*?) (entering|returning) at walltime (.*?), cputime (.*?) seconds/) { 19 | ++$call; 20 | print "$call $3 $4 $1 $2\n"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of DUMPI: 3 | # The MPI profiling library from the SST suite. 4 | # Copyright (c) 2009-2023 NTESS. 5 | # This software is distributed under the BSD License. 6 | # Under the terms of Contract DE-NA0003525 with NTESS, 7 | # the U.S. Government retains certain rights in this software. 8 | # For more information, see the LICENSE file in the top 9 | # SST/macroscale directory. 10 | # 11 | 12 | EXTRA_DIST = traces/callcounts-batch.txt traces/callcounts-single.txt \ 13 | traces/testtrace-0000.bin traces/testtrace-0000.txt \ 14 | traces/testtrace-0001.bin traces/testtrace-0002.bin \ 15 | traces/testtrace-0003.bin traces/testtrace.meta 16 | -------------------------------------------------------------------------------- /tests/traces/testtrace-0000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sstsimulator/sst-dumpi/a4c8bf5bb22e231e3eabe65619d62c239cee8ef1/tests/traces/testtrace-0000.bin -------------------------------------------------------------------------------- /tests/traces/testtrace-0001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sstsimulator/sst-dumpi/a4c8bf5bb22e231e3eabe65619d62c239cee8ef1/tests/traces/testtrace-0001.bin -------------------------------------------------------------------------------- /tests/traces/testtrace-0002.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sstsimulator/sst-dumpi/a4c8bf5bb22e231e3eabe65619d62c239cee8ef1/tests/traces/testtrace-0002.bin -------------------------------------------------------------------------------- /tests/traces/testtrace-0003.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sstsimulator/sst-dumpi/a4c8bf5bb22e231e3eabe65619d62c239cee8ef1/tests/traces/testtrace-0003.bin -------------------------------------------------------------------------------- /tests/traces/testtrace.meta: -------------------------------------------------------------------------------- 1 | hostname=hadalst-mbp.ca.sandia.gov 2 | numprocs=4 3 | username=hadalst 4 | startime=1296777956 5 | fileprefix=testtrace 6 | version=1 7 | subversion=0 8 | subsubversion=0 9 | -------------------------------------------------------------------------------- /todo: -------------------------------------------------------------------------------- 1 | 1) During trace file gathering: 2 | Read a file which controls what gets output: 3 | a) Check the environment variable DUMPI_CONF for a file name (path) 4 | b) Check the current working directory for a file named dumpi.conf 5 | c) Fall back on some reasonable defaults. 6 | 7 | 1b) During trace gathering: 8 | Ways of turning profiling on and off at given times. 9 | - Timestamp? (at runtime xxx) -- could be problematic 10 | - Given MPI call (at first MPI_xxx) 11 | - Call-in methods for instrumenting application code. 12 | 13 | Need to decide how we handle storing (or not storing) papi parameters. 14 | 15 | 2) During or after trace file gathering: 16 | Utility to output summary of MPI functions called (counts etc.), 17 | configuration parameters used for a given trace file run, etc. 18 | Q: Should we gather statistics on functions that are not explicitly traced 19 | (e.g. how often was MPI_Iprobe called, even if MPI_Iprobe was ignored). 20 | 21 | 3) During trace file parsing: 22 | Move to callback-based parsing (undefined callbacks result 23 | in associated MPI events being ignored). 24 | typedef void (*sendfun_t)(const dumpi_sendprm *, const dumpi_papiprm *); 25 | typedaef void (*isendfun_t)(const dumpi_isendprm *, const dumpi_papiprm *); 26 | ... 27 | void get_send(sendfun_t); 28 | void get_isend(isendfun_t); 29 | ... 30 | 31 | 4) Statistics gathering: Keep separate track of ignored and retreived 32 | MPI calls (e.g. Iprobe). 33 | 34 | --------------------------------------------------------------- 35 | 36 | Make header record a variable-length key/value record (to allow 37 | storing node names, indices, etc.). 38 | 39 | Use zlib to compress the MPI call stream. 40 | 41 | Add an index record to the end of the file (to be read via fseek to 42 | the end of the file): 43 | fpos Header record start 44 | fpos Header record end 45 | fpos Stream record start 46 | 47 | fpos Stream record end 48 | fpos Footer record start 49 | fpos Footer record end 50 | 51 | 52 | Add DUMPI_ANY_TAG and DUMPI_ANY_SOURCE (and associated testing). 53 | 54 | 55 | -------------------------------------------- 56 | 57 | IMPORTANT: Parse routines must take an additional (user) argument 58 | to differentiate between different parsers in the same address space. 59 | 60 | Suggested additions to the header record (fixed width): 61 | 62 | Hostname 63 | User name (or user id?) 64 | Date/time 65 | 66 | ---- 67 | 68 | Add autoconf tests for 69 | 70 | DUMPI_ON_REDSTORM 71 | DUMPI_HAS_PAPI 72 | 73 | 74 | ------------------------ 75 | 76 | KNOWN POTENTIAL PROBLEMS 77 | 78 | Allgatherv: displacement arrays etc. are only required to be valid at root 79 | (several other functions in the same category). 80 | 81 | 82 | ----------------------------- 83 | 84 | Current work: 85 | 86 | Fix up CSTRING and NULLTERM handing for MPIBINDINGS (getting closer to compiling). 87 | -------------------------------------------------------------------------------- /xcode/dumpi/dumpi-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | gov.sandia.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSHumanReadableCopyright 26 | Copyright © 2011 __MyCompanyName__. All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /xcode/dumpi/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /xcode/scripts/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | argv0=$0 4 | target=$1 5 | 6 | echo "Running $argv0 $target" 7 | 8 | ### Set up some utility functions. ### 9 | 10 | function runcmd() { 11 | cmd=$1 12 | echo "Running \"$cmd\"" 13 | if $cmd; then 14 | echo "Successfully ran \"$cmd\"" 15 | else 16 | echo "Failed: \"$cmd\"" 17 | exit 1 18 | fi 19 | } 20 | 21 | function expect_dir_var() { 22 | var=$1 23 | msg=$2 24 | val=${!var} 25 | if test -z "$val"; then 26 | echo "$argv0: Expected $var to be nonempty. $msg Aborting" 27 | exit 1 28 | fi 29 | if test ! -d "$val"; then 30 | echo "$argv0: Expected $var (=\"$val\") to be a directory. $msg Aborting" 31 | exit 1 32 | fi 33 | } 34 | 35 | function expect_var() { 36 | var=$1 37 | msg=$2 38 | val=${!var} 39 | if test -z "$val"; then 40 | echo "$argv0: Expected $var to be nonempty. $msg Aborting" 41 | exit 1 42 | fi 43 | } 44 | 45 | function expect_file() { 46 | val=$1 47 | msg=$2 48 | if test ! -f "$val"; then 49 | echo "$argv0: Expected \"$val\" to be a file. $msg Aborting" 50 | exit 1 51 | fi 52 | } 53 | 54 | ### Perform a series of checks to make sure eveything is set up correctly ### 55 | 56 | expect_dir_var SRCROOT \ 57 | "This variable is assigned by Xcode." 58 | 59 | expect_file $SRCROOT/../bootstrap.sh \ 60 | "Could not find bootstrap file." 61 | 62 | expect_var ARCHS \ 63 | "This variable is assigned by Xcode." 64 | 65 | expect_var BUILD_STYLE \ 66 | "This variable is assigned by Xcode." 67 | 68 | if test "$ACTION" != clean; then 69 | 70 | #expect_dir_var PTH_DIR \ 71 | # "Assign in Xcode->Preferences->Source Trees to GNU Pth directory." 72 | 73 | #expect_dir_var SSTMAC_PREFIX \ 74 | # "Assign in Xcode->Preferences->Source Trees to SST/macro installation directory." 75 | 76 | #expect_dir_var BOOST_DIR \ 77 | # "Assign in Xcode->Preferences->Source Trees to boost directory." 78 | 79 | expect_file /opt/local/bin/glibtoolize \ 80 | "MacPorts version of libtool needed." 81 | 82 | expect_file /opt/local/bin/autoconf \ 83 | "MacPorts version of autoconf needed." 84 | 85 | expect_file /opt/local/bin/automake \ 86 | "MacPorts version of automake needed." 87 | 88 | expect_var GCC_OPTIMIZATION_LEVEL \ 89 | "This variable is assigned by Xcode." 90 | 91 | expect_var GCC_VERSION \ 92 | "This variable is assigned by Xcode." 93 | 94 | if test -z "$CURRENT_ARCH"; then 95 | if test "$ARCHS" != x86_64 -a "$ARCHS" != i386; then 96 | echo "Unexpected value for ARCHS: \"$ARCHS\"" 97 | exit 1 98 | fi 99 | CURRENT_ARCH=$ARCHS 100 | fi 101 | 102 | fi 103 | 104 | ### Finished checks. Now prepare for the build. ### 105 | 106 | PATH=/opt/local/bin:$PATH 107 | 108 | if test "$ACTION" = clean; then 109 | for arch in $ARCHS; do 110 | builddir=$SRCROOT/build/$arch/$BUILD_STYLE 111 | runcmd "/bin/rm -rf $builddir" 112 | done 113 | exit 0 114 | fi 115 | 116 | builddir=$SRCROOT/build/$CURRENT_ARCH/$BUILD_STYLE 117 | 118 | if test ! -f "$SRCROOT/../configure"; then 119 | runcmd "cd $SRCROOT/.." 120 | runcmd "./bootstrap.sh" 121 | fi 122 | 123 | runcmd "mkdir -p $builddir" 124 | runcmd "cd $builddir" 125 | 126 | cflags="-O$GCC_OPTIMIZATION_LEVEL" 127 | cxxflags="-O$GCC_OPTIMIZATION_LEVEL" 128 | if test "$GCC_GENERATE_DEBUGGING_SYMBOLS" = YES -o "$DEBUGGING_SYMBOLS" = yes; then 129 | cflags="$cflags -g" 130 | cxxflags="$cxxflags -g" 131 | fi 132 | 133 | if test "$GCC_VERSION" = com.apple.compilers.llvm.clang.1_0; then 134 | cc=clang 135 | cxx=clang++ 136 | else 137 | cc=gcc 138 | cxx=g++ 139 | fi 140 | 141 | if test ! -f config.status; then 142 | CXX="$cxx" CXXFLAGS="$cxxflags" CC="$cc" CFLAGS="$cflags" \ 143 | runcmd "/bin/sh $SRCROOT/../configure" 144 | fi 145 | 146 | ### Ready to build the autogenerated header. ### 147 | 148 | runcmd "make $target" 149 | 150 | -------------------------------------------------------------------------------- /xcode/scripts/copy_headers: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | argv0=$0 4 | 5 | echo "Running $argv0" 6 | 7 | ### Set up some utility functions. ### 8 | 9 | function runcmd() { 10 | cmd=$1 11 | echo "Running \"$cmd\"" 12 | if $cmd; then 13 | echo "Successfully ran \"$cmd\"" 14 | else 15 | echo "Failed: \"$cmd\"" 16 | exit 1 17 | fi 18 | } 19 | 20 | function expect_dir_var() { 21 | var=$1 22 | msg=$2 23 | val=${!var} 24 | if test -z "$val"; then 25 | echo "$argv0: Expected $var to be nonempty. $msg Aborting" 26 | exit 1 27 | fi 28 | if test ! -d "$val"; then 29 | echo "$argv0: Expected $var (=\"$val\") to be a directory. $msg Aborting" 30 | exit 1 31 | fi 32 | } 33 | 34 | function expect_var() { 35 | var=$1 36 | msg=$2 37 | val=${!var} 38 | if test -z "$val"; then 39 | echo "$argv0: Expected $var to be nonempty. $msg Aborting" 40 | exit 1 41 | fi 42 | } 43 | 44 | function expect_file() { 45 | val=$1 46 | msg=$2 47 | if test ! -f "$val"; then 48 | echo "$argv0: Expected \"$val\" to be a file. $msg Aborting" 49 | exit 1 50 | fi 51 | } 52 | 53 | function do_copy_headers() { 54 | srcdir=$1 55 | headerloc=$2 56 | cd $srcdir || exit 1 57 | if test -f "$headerloc"; then 58 | headers=$headerloc 59 | elif test -d "$headerloc"; then 60 | headers=`find $headerloc -name "*.h"` 61 | else 62 | echo bad header location 63 | exit 1 64 | fi 65 | for i in $headers; do 66 | dname=`dirname $i` 67 | bname=`basename $i` 68 | src=$PWD/$i 69 | dsttopdir=$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH 70 | dst=$dsttopdir/$i 71 | echo Copying $src to $dst 72 | mkdir -p $dsttopdir/$dname || exit 1 73 | cp -a $src $dst || exit 1 74 | done 75 | } 76 | 77 | ### Perform a series of checks to make sure eveything is set up correctly ### 78 | 79 | expect_dir_var SRCROOT \ 80 | "This variable is assigned by Xcode." 81 | 82 | expect_file $SRCROOT/../bootstrap.sh \ 83 | "SRCROOT does not appear to be set correctly." 84 | 85 | expect_var ARCHS \ 86 | "This variable is assigned by Xcode." 87 | 88 | expect_var BUILD_STYLE \ 89 | "This variable is assigned by Xcode." 90 | 91 | expect_dir_var BUILT_PRODUCTS_DIR \ 92 | "This variable is assigned by Xcode." 93 | 94 | expect_var PUBLIC_HEADERS_FOLDER_PATH \ 95 | "This variable is assigned by Xcode." 96 | 97 | if test -z "$CURRENT_ARCH"; then 98 | if test "$ARCHS" != x86_64 -a "$ARCHS" != i386; then 99 | echo "Unexpected value for ARCHS: \"$ARCHS\"" 100 | exit 1 101 | fi 102 | CURRENT_ARCH=$ARCHS 103 | fi 104 | 105 | ### Finished checks. Now copy header files. ### 106 | 107 | PATH=/opt/local/bin:$PATH 108 | 109 | runcmd "mkdir -p $BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH" 110 | 111 | runcmd "cd $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" 112 | if test ! -L Headers; then 113 | runcmd "ln -s Versions/Current/Headers" 114 | fi 115 | 116 | #do_copy_headers $SRCROOT/.. dumpi/dumpiconfig.h 117 | #do_copy_headers $SRCROOT/.. dumpi/libundumpi 118 | #do_copy_headers $SRCROOT/.. dumpi/common 119 | do_copy_headers $SRCROOT/build/$CURRENT_ARCH/$BUILD_STYLE/dumpi dumpiconfig-generated.h 120 | 121 | --------------------------------------------------------------------------------