pax_global_header00006660000000000000000000000064144721352650014523gustar00rootroot0000000000000052 comment=b4a8b85aaf8a4d04f3d59f6960467e8d9719046d eztrace-2.1/000077500000000000000000000000001447213526500130225ustar00rootroot00000000000000eztrace-2.1/.clang-format000066400000000000000000000062631447213526500154040ustar00rootroot00000000000000Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: false BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: false AfterControlStatement: false AfterEnum: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false AfterExternBlock: false BeforeCatch: false BeforeElse: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 0 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeBlocks: Regroup IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: true IndentPPDirectives: None IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left RawStringFormats: - Delimiter: pb Language: TextProto BasedOnStyle: google ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 8 UseTab: Never eztrace-2.1/.gitlab-ci.yml000066400000000000000000000133741447213526500154660ustar00rootroot00000000000000stages: - build - test build:mpich: image: eztrace/eztrace-test:eztrace.mpich stage: build script: # Build EZTrace - mkdir build install - cd build/ - export PATH=$PATH:/opt/opari2/bin:/opt/otf2/bin - cmake .. -DENABLE_BIN_INSTRUMENTATION=OFF -DOTF2_PATH=/opt/otf2 -DEZTRACE_ENABLE_MPI=ON -DMPI_LINK_FLAGS="-fopenmp" -DEZTRACE_ENABLE_OPENMP=ON -DEZTRACE_ENABLE_OMPT=ON -DEZTRACE_ENABLE_STARPU=ON -DEZTRACE_ENABLE_MEMORY=ON -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/eztrace -DCMAKE_C_COMPILER=clang - make - make install artifacts: paths: - $CI_PROJECT_DIR/eztrace build:openmpi: image: eztrace/eztrace-test:eztrace.openmpi stage: build script: # Build EZTrace - mkdir build install - cd build/ - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin:" - cmake .. -DENABLE_BIN_INSTRUMENTATION=OFF -DOTF2_PATH=/opt/otf2 -DEZTRACE_ENABLE_MPI=ON -DMPI_LINK_FLAGS="-fopenmp" -DEZTRACE_ENABLE_OPENMP=ON -DEZTRACE_ENABLE_OMPT=ON -DEZTRACE_ENABLE_STARPU=ON -DEZTRACE_ENABLE_MEMORY=ON -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/eztrace -DCMAKE_C_COMPILER=clang - make - make install artifacts: paths: - $CI_PROJECT_DIR/eztrace test:ompt: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for ompt module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - cd $CI_PROJECT_DIR/test/ompt/ - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:openmp: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for openmp module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - cd $CI_PROJECT_DIR/test/openmp - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:mpich: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for mpi module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - cd $CI_PROJECT_DIR/test/mpi/ - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:openmpi: image: eztrace/eztrace-test:eztrace.openmpi stage: test dependencies: - build:openmpi script: # Run tests for mpi module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/mpi/ - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:pthread: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for the pthread module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/pthread - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:memory: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for the memory module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/memory - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:posixio: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for the posixio module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/posixio - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:starpu: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for the starpu module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/starpu - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh test:compiler_instrumentation: image: eztrace/eztrace-test:eztrace.mpich stage: test dependencies: - build:mpich script: # Run tests for the compiler_instrumentation module - export PATH="$PATH:/opt/opari2/bin:/opt/otf2/bin" - export MPIRUN_CLI_OPTION='--allow-run-as-root --oversubscribe' - cd $CI_PROJECT_DIR/test/compiler_instrumentation - export EZTRACE_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace" - export EZTRACE_AVAIL_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_avail" - export EZTRACE_CC_PATH="$CI_PROJECT_DIR/eztrace/bin/eztrace_cc" - ./run.sh eztrace-2.1/CMakeLists.txt000066400000000000000000000143461447213526500155720ustar00rootroot00000000000000cmake_minimum_required (VERSION 3.7) project(EZTrace VERSION 2.1.0 LANGUAGES C ) # include CMake modules include(CheckLibraryExists) include(CheckIncludeFiles) include(CheckFunctionExists) include(GNUInstallDirs) include(CheckLanguage) include(CheckCSourceCompiles) include(CTest) find_package(PkgConfig) # POLICIES ##################### if (POLICY CMP0074) cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0079 NEW) endif() # RPATH ######################################## set(CMAKE_MACOSX_RPATH 1) set(CMAKE_SKIP_BUILD_RPATH FALSE) # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # when building, don't use the install RPATH already (but later on when installing) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") # the RPATH to be used when installing SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # CMakeFind repository list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules) find_package (OTF2 REQUIRED) if (NOT OTF2_FOUND) message(FATAL_ERROR "libotf2 not found.") endif() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${OTF2_INCLUDE_PATH}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${OTF2_INCLUDE_PATH}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE") # Check if fortran is available check_language(Fortran) if(CMAKE_Fortran_COMPILER) enable_language(Fortran) else() message(STATUS "No Fortran support") endif() # Look for library #find_package (OpenMP) # Options to enable/disable modules option(EZTRACE_ENABLE_MPI "Enable MPI module" OFF) option(EZTRACE_ENABLE_CUDA "Enable CUDA module" OFF) option(EZTRACE_ENABLE_STARPU "Enable StarPU module" OFF) option(EZTRACE_ENABLE_OPENMP "Enable OpenMP module" OFF) #option(EZTRACE_ENABLE_PAPI "Enable PAPI module" OFF) option(EZTRACE_ENABLE_POSIXIO "Enable POSIXIO module" ON) option(EZTRACE_ENABLE_PTHREAD "Enable Pthread module" ON) option(EZTRACE_ENABLE_MEMORY "Enable Memory module" OFF) option(EZTRACE_ENABLE_OMPT "Enable OMPT module" OFF) option(EZTRACE_ENABLE_PNETCDF "Enable PNetCDF module" OFF) option(EZTRACE_ENABLE_NETCDF "Enable NetCDF module" OFF) option(EZTRACE_ENABLE_IOTRACER "Enable IOtracer module" OFF) option(EZTRACE_ENABLE_COMPILER_INSTRUMENTATION "Enable compiler-based instrumentation" ON) SET(MPI_MODULE_NAME "mpi" CACHE STRING "Name of the MPI module") option(ENABLE_BIN_INSTRUMENTATION "Enable binary instrumentation" OFF) if(EZTRACE_ENABLE_IOTRACER) find_path(IOTRACER_PATH "bcc_iotracer.py" REQUIRED) endif() if(ENABLE_BIN_INSTRUMENTATION) find_library(BFD NAMES bfd) if (NOT BFD) message(FATAL_ERROR "libbfd found. This library is required for binary instrumentation") endif() find_package (LibOpcodes) CHECK_LIBRARY_EXISTS(opcodes disassembler "" disassembler_exist) if (NOT disassembler_exist) message(FATAL_ERROR "libopcodes: disassembler not found. This library is required for binary instrumentation") endif() set(EZTRACE_BINARY_INSTRUMENTATION_FLAG -DENABLE_BINARY_INSTRUMENTATION) endif() set (HAVE_DEMANGLE 0) check_library_exists(iberty cplus_demangle "" cplus_demangle_exist) if (cplus_demangle_exist) find_path (DEMANGLE_INCLUDEDIR NAMES "demangle.h" HINTS /usr/include/libiberty/ ) if(DEMANGLE_INCLUDEDIR) set (HAVE_DEMANGLE 1) else() message(WARNING " demangle.h not found. C++ symbols will not be demangled") endif() else() message(WARNING " libiberty not found. C++ symbols will not be demangled") endif() if (EZTRACE_ENABLE_MPI) find_program(MPICC mpicc REQUIRED) find_program(MPIF90 mpif90) endif() if (EZTRACE_ENABLE_STARPU) find_package(STARPU "1.2" REQUIRED COMPONENTS HWLOC) list(APPEND CMAKE_INSTALL_RPATH ${STARPU_LIBRARY_DIRS}) endif() # if (EZTRACE_ENABLE_PAPI) # find_package (LibPapi REQUIRED) # endif() # if (EZTRACE_ENABLE_CUDA) find_package (CUDA REQUIRED) endif() if (EZTRACE_ENABLE_OPENMP) find_package (OpenMP REQUIRED) find_program(OPARI2 opari2) find_program(OPARI2_CONFIG opari2-config) IF( NOT OPARI2) message(FATAL_ERROR " opari2 was not found. Please download it from https://www.vi-hps.org/projects/score-p#opari2 and install it") endIF(NOT OPARI2) IF (NOT OPARI2_CONFIG) message(FATAL_ERROR " opari2-config was not found. Please download it from https://www.vi-hps.org/projects/score-p#opari2 and install it") endIF (NOT OPARI2_CONFIG) endif() if (EZTRACE_ENABLE_PNETCDF) pkg_check_modules(pnetcdf REQUIRED pnetcdf) endif() if (EZTRACE_ENABLE_NETCDF) pkg_check_modules(netcdf REQUIRED netcdf) endif() if (EZTRACE_ENABLE_OMPT) find_package (OpenMP REQUIRED) find_package (OMPT REQUIRED) endif() #set(THREADS_PREFER_PTHREAD_GLAF ON) #find_package(Threads REQUIRED) #################################################### # Some flags for compilation set (prefix "${CMAKE_INSTALL_PREFIX}") check_include_files("sys/prctl.h" HAVE_PRCTL_H) if (NOT HAVE_PRCTL_H) set(HAVE_PRCTL_H 0) endif() check_include_files("libbacktrace/backtrace.h" HAVE_LIBBACKTRACE) if (NOT HAVE_LIBBACKTRACE) set(HAVE_LIBBACKTRACE 0) endif() set(LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib") if ("${APPLE}") set(DYNLIB_EXT "dylib") set(LD_PRELOAD_NAME "DYLD_INSERT_LIBRARIES") set(LD_LIBRARY_PATH_NAME "DYLD_LIBRARY_PATH") else() # By default -> Linux set(DYNLIB_EXT "so") set(LD_PRELOAD_NAME "LD_PRELOAD") set(LD_LIBRARY_PATH_NAME "LD_LIBRARY_PATH") endif() set(EZTRACE_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}) #set(PPTRACE_BINARY_TYPE "PPTRACE_BINARY_TYPE_BFD") #set(__PPTRACE_BINARY_TYPE "PPTRACE_BINARY_TYPE_BFD") #set(abs_top_builddir ${CMAKE_BINARY_DIR}) set(INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") set(INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") # Subdirectory add_subdirectory (src) add_subdirectory (test/) include(PrintOpts) set(EZTRACE_MAN_PAGES ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/) install(DIRECTORY ${EZTRACE_MAN_PAGES} DESTINATION "${CMAKE_INSTALL_MANDIR}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eztrace.pc.in ${CMAKE_CURRENT_BINARY_DIR}/eztrace.pc) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eztrace.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}") message(STATUS "OTF2 version: ${OTF2_VERSION}") eztrace-2.1/COPYING000066400000000000000000000035071447213526500140620ustar00rootroot00000000000000Copyright CNRS, INRIA, Université Bordeaux 1, Télécom SudParis 2014 François Trahay Mathieu Faverge François Rue Damien Martin-Guillerez Roman Iakymchuk Matias Hastaran EZTrace is a computer program whose purpose is to analyze the performance of parallel applications. This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-B license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info". As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability. In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-B license and that you accept its terms. eztrace-2.1/COPYRIGHT000066400000000000000000000516221447213526500143230ustar00rootroot00000000000000CeCILL-B FREE SOFTWARE LICENSE AGREEMENT Notice This Agreement is a Free Software license agreement that is the result of discussions between its authors in order to ensure compliance with the two main principles guiding its drafting: * firstly, compliance with the principles governing the distribution of Free Software: access to source code, broad rights granted to users, * secondly, the election of a governing law, French law, with which it is conformant, both as regards the law of torts and intellectual property law, and the protection that it offers to both authors and holders of the economic rights over software. The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) license are: Commissariat à l'Energie Atomique - CEA, a public scientific, technical and industrial research establishment, having its principal place of business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. Centre National de la Recherche Scientifique - CNRS, a public scientific and technological establishment, having its principal place of business at 3 rue Michel-Ange, 75794 Paris cedex 16, France. Institut National de Recherche en Informatique et en Automatique - INRIA, a public scientific and technological establishment, having its principal place of business at Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex, France. Preamble This Agreement is an open source software license intended to give users significant freedom to modify and redistribute the software licensed hereunder. The exercising of this freedom is conditional upon a strong obligation of giving credits for everybody that distributes a software incorporating a software ruled by the current license so as all contributions to be properly identified and acknowledged. In consideration of access to the source code and the rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors only have limited liability. In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user's attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom. This Agreement may apply to any or all software for which the holder of the economic rights decides to submit the use thereof to its provisions. Article 1 - DEFINITIONS For the purpose of this Agreement, when the following expressions commence with a capital letter, they shall have the following meaning: Agreement: means this license agreement, and its possible subsequent versions and annexes. Software: means the software in its Object Code and/or Source Code form and, where applicable, its documentation, "as is" when the Licensee accepts the Agreement. Initial Software: means the Software in its Source Code and possibly its Object Code form and, where applicable, its documentation, "as is" when it is first distributed under the terms and conditions of the Agreement. Modified Software: means the Software modified by at least one Contribution. Source Code: means all the Software's instructions and program lines to which access is required so as to modify the Software. Object Code: means the binary files originating from the compilation of the Source Code. Holder: means the holder(s) of the economic rights over the Initial Software. Licensee: means the Software user(s) having accepted the Agreement. Contributor: means a Licensee having made at least one Contribution. Licensor: means the Holder, or any other individual or legal entity, who distributes the Software under the Agreement. Contribution: means any or all modifications, corrections, translations, adaptations and/or new functions integrated into the Software by any or all Contributors, as well as any or all Internal Modules. Module: means a set of sources files including their documentation that enables supplementary functions or services in addition to those offered by the Software. External Module: means any or all Modules, not derived from the Software, so that this Module and the Software run in separate address spaces, with one calling the other when they are run. Internal Module: means any or all Module, connected to the Software so that they both execute in the same address space. Parties: mean both the Licensee and the Licensor. These expressions may be used both in singular and plural form. Article 2 - PURPOSE The purpose of the Agreement is the grant by the Licensor to the Licensee of a non-exclusive, transferable and worldwide license for the Software as set forth in Article 5 hereinafter for the whole term of the protection granted by the rights over said Software. Article 3 - ACCEPTANCE 3.1 The Licensee shall be deemed as having accepted the terms and conditions of this Agreement upon the occurrence of the first of the following events: * (i) loading the Software by any or all means, notably, by downloading from a remote server, or by loading from a physical medium; * (ii) the first time the Licensee exercises any of the rights granted hereunder. 3.2 One copy of the Agreement, containing a notice relating to the characteristics of the Software, to the limited warranty, and to the fact that its use is restricted to experienced users has been provided to the Licensee prior to its acceptance as set forth in Article 3.1 hereinabove, and the Licensee hereby acknowledges that it has read and understood it. Article 4 - EFFECTIVE DATE AND TERM 4.1 EFFECTIVE DATE The Agreement shall become effective on the date when it is accepted by the Licensee as set forth in Article 3.1. 4.2 TERM The Agreement shall remain in force for the entire legal term of protection of the economic rights over the Software. Article 5 - SCOPE OF RIGHTS GRANTED The Licensor hereby grants to the Licensee, who accepts, the following rights over the Software for any or all use, and for the term of the Agreement, on the basis of the terms and conditions set forth hereinafter. Besides, if the Licensor owns or comes to own one or more patents protecting all or part of the functions of the Software or of its components, the Licensor undertakes not to enforce the rights granted by these patents against successive Licensees using, exploiting or modifying the Software. If these patents are transferred, the Licensor undertakes to have the transferees subscribe to the obligations set forth in this paragraph. 5.1 RIGHT OF USE The Licensee is authorized to use the Software, without any limitation as to its fields of application, with it being hereinafter specified that this comprises: 1. permanent or temporary reproduction of all or part of the Software by any or all means and in any or all form. 2. loading, displaying, running, or storing the Software on any or all medium. 3. entitlement to observe, study or test its operation so as to determine the ideas and principles behind any or all constituent elements of said Software. This shall apply when the Licensee carries out any or all loading, displaying, running, transmission or storage operation as regards the Software, that it is entitled to carry out hereunder. 5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS The right to make Contributions includes the right to translate, adapt, arrange, or make any or all modifications to the Software, and the right to reproduce the resulting software. The Licensee is authorized to make any or all Contributions to the Software provided that it includes an explicit notice that it is the author of said Contribution and indicates the date of the creation thereof. 5.3 RIGHT OF DISTRIBUTION In particular, the right of distribution includes the right to publish, transmit and communicate the Software to the general public on any or all medium, and by any or all means, and the right to market, either in consideration of a fee, or free of charge, one or more copies of the Software by any means. The Licensee is further authorized to distribute copies of the modified or unmodified Software to third parties according to the terms and conditions set forth hereinafter. 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION The Licensee is authorized to distribute true copies of the Software in Source Code or Object Code form, provided that said distribution complies with all the provisions of the Agreement and is accompanied by: 1. a copy of the Agreement, 2. a notice relating to the limitation of both the Licensor's warranty and liability as set forth in Articles 8 and 9, and that, in the event that only the Object Code of the Software is redistributed, the Licensee allows effective access to the full Source Code of the Software at a minimum during the entire period of its distribution of the Software, it being understood that the additional cost of acquiring the Source Code shall not exceed the cost of transferring the data. 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE If the Licensee makes any Contribution to the Software, the resulting Modified Software may be distributed under a license agreement other than this Agreement subject to compliance with the provisions of Article 5.3.4. 5.3.3 DISTRIBUTION OF EXTERNAL MODULES When the Licensee has developed an External Module, the terms and conditions of this Agreement do not apply to said External Module, that may be distributed under a separate license agreement. 5.3.4 CREDITS Any Licensee who may distribute a Modified Software hereby expressly agrees to: 1. indicate in the related documentation that it is based on the Software licensed hereunder, and reproduce the intellectual property notice for the Software, 2. ensure that written indications of the Software intended use, intellectual property notice and license hereunder are included in easily accessible format from the Modified Software interface, 3. mention, on a freely accessible website describing the Modified Software, at least throughout the distribution term thereof, that it is based on the Software licensed hereunder, and reproduce the Software intellectual property notice, 4. where it is distributed to a third party that may distribute a Modified Software without having to make its source code available, make its best efforts to ensure that said third party agrees to comply with the obligations set forth in this Article . If the Software, whether or not modified, is distributed with an External Module designed for use in connection with the Software, the Licensee shall submit said External Module to the foregoing obligations. 5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES Where a Modified Software contains a Contribution subject to the CeCILL license, the provisions set forth in Article 5.3.4 shall be optional. A Modified Software may be distributed under the CeCILL-C license. In such a case the provisions set forth in Article 5.3.4 shall be optional. Article 6 - INTELLECTUAL PROPERTY 6.1 OVER THE INITIAL SOFTWARE The Holder owns the economic rights over the Initial Software. Any or all use of the Initial Software is subject to compliance with the terms and conditions under which the Holder has elected to distribute its work and no one shall be entitled to modify the terms and conditions for the distribution of said Initial Software. The Holder undertakes that the Initial Software will remain ruled at least by this Agreement, for the duration set forth in Article 4.2. 6.2 OVER THE CONTRIBUTIONS The Licensee who develops a Contribution is the owner of the intellectual property rights over this Contribution as defined by applicable law. 6.3 OVER THE EXTERNAL MODULES The Licensee who develops an External Module is the owner of the intellectual property rights over this External Module as defined by applicable law and is free to choose the type of agreement that shall govern its distribution. 6.4 JOINT PROVISIONS The Licensee expressly undertakes: 1. not to remove, or modify, in any manner, the intellectual property notices attached to the Software; 2. to reproduce said notices, in an identical manner, in the copies of the Software modified or not. The Licensee undertakes not to directly or indirectly infringe the intellectual property rights of the Holder and/or Contributors on the Software and to take, where applicable, vis-à-vis its staff, any and all measures required to ensure respect of said intellectual property rights of the Holder and/or Contributors. Article 7 - RELATED SERVICES 7.1 Under no circumstances shall the Agreement oblige the Licensor to provide technical assistance or maintenance services for the Software. However, the Licensor is entitled to offer this type of services. The terms and conditions of such technical assistance, and/or such maintenance, shall be set forth in a separate instrument. Only the Licensor offering said maintenance and/or technical assistance services shall incur liability therefor. 7.2 Similarly, any Licensor is entitled to offer to its licensees, under its sole responsibility, a warranty, that shall only be binding upon itself, for the redistribution of the Software and/or the Modified Software, under terms and conditions that it is free to decide. Said warranty, and the financial terms and conditions of its application, shall be subject of a separate instrument executed between the Licensor and the Licensee. Article 8 - LIABILITY 8.1 Subject to the provisions of Article 8.2, the Licensee shall be entitled to claim compensation for any direct loss it may have suffered from the Software as a result of a fault on the part of the relevant Licensor, subject to providing evidence thereof. 8.2 The Licensor's liability is limited to the commitments made under this Agreement and shall not be incurred as a result of in particular: (i) loss due the Licensee's total or partial failure to fulfill its obligations, (ii) direct or consequential loss that is suffered by the Licensee due to the use or performance of the Software, and (iii) more generally, any consequential loss. In particular the Parties expressly agree that any or all pecuniary or business loss (i.e. loss of data, loss of profits, operating loss, loss of customers or orders, opportunity cost, any disturbance to business activities) or any or all legal proceedings instituted against the Licensee by a third party, shall constitute consequential loss and shall not provide entitlement to any or all compensation from the Licensor. Article 9 - WARRANTY 9.1 The Licensee acknowledges that the scientific and technical state-of-the-art when the Software was distributed did not enable all possible uses to be tested and verified, nor for the presence of possible defects to be detected. In this respect, the Licensee's attention has been drawn to the risks associated with loading, using, modifying and/or developing and reproducing the Software which are reserved for experienced users. The Licensee shall be responsible for verifying, by any or all means, the suitability of the product for its requirements, its good working order, and for ensuring that it shall not cause damage to either persons or properties. 9.2 The Licensor hereby represents, in good faith, that it is entitled to grant all the rights over the Software (including in particular the rights set forth in Article 5). 9.3 The Licensee acknowledges that the Software is supplied "as is" by the Licensor without any other express or tacit warranty, other than that provided for in Article 9.2 and, in particular, without any warranty as to its commercial value, its secured, safe, innovative or relevant nature. Specifically, the Licensor does not warrant that the Software is free from any error, that it will operate without interruption, that it will be compatible with the Licensee's own equipment and software configuration, nor that it will meet the Licensee's requirements. 9.4 The Licensor does not either expressly or tacitly warrant that the Software does not infringe any third party intellectual property right relating to a patent, software or any other property right. Therefore, the Licensor disclaims any and all liability towards the Licensee arising out of any or all proceedings for infringement that may be instituted in respect of the use, modification and redistribution of the Software. Nevertheless, should such proceedings be instituted against the Licensee, the Licensor shall provide it with technical and legal assistance for its defense. Such technical and legal assistance shall be decided on a case-by-case basis between the relevant Licensor and the Licensee pursuant to a memorandum of understanding. The Licensor disclaims any and all liability as regards the Licensee's use of the name of the Software. No warranty is given as regards the existence of prior rights over the name of the Software or as regards the existence of a trademark. Article 10 - TERMINATION 10.1 In the event of a breach by the Licensee of its obligations hereunder, the Licensor may automatically terminate this Agreement thirty (30) days after notice has been sent to the Licensee and has remained ineffective. 10.2 A Licensee whose Agreement is terminated shall no longer be authorized to use, modify or distribute the Software. However, any licenses that it may have granted prior to termination of the Agreement shall remain valid subject to their having been granted in compliance with the terms and conditions hereof. Article 11 - MISCELLANEOUS 11.1 EXCUSABLE EVENTS Neither Party shall be liable for any or all delay, or failure to perform the Agreement, that may be attributable to an event of force majeure, an act of God or an outside cause, such as defective functioning or interruptions of the electricity or telecommunications networks, network paralysis following a virus attack, intervention by government authorities, natural disasters, water damage, earthquakes, fire, explosions, strikes and labor unrest, war, etc. 11.2 Any failure by either Party, on one or more occasions, to invoke one or more of the provisions hereof, shall under no circumstances be interpreted as being a waiver by the interested Party of its right to invoke said provision(s) subsequently. 11.3 The Agreement cancels and replaces any or all previous agreements, whether written or oral, between the Parties and having the same purpose, and constitutes the entirety of the agreement between said Parties concerning said purpose. No supplement or modification to the terms and conditions hereof shall be effective as between the Parties unless it is made in writing and signed by their duly authorized representatives. 11.4 In the event that one or more of the provisions hereof were to conflict with a current or future applicable act or legislative text, said act or legislative text shall prevail, and the Parties shall make the necessary amendments so as to comply with said act or legislative text. All other provisions shall remain effective. Similarly, invalidity of a provision of the Agreement, for any reason whatsoever, shall not cause the Agreement as a whole to be invalid. 11.5 LANGUAGE The Agreement is drafted in both French and English and both versions are deemed authentic. Article 12 - NEW VERSIONS OF THE AGREEMENT 12.1 Any person is authorized to duplicate and distribute copies of this Agreement. 12.2 So as to ensure coherence, the wording of this Agreement is protected and may only be modified by the authors of the License, who reserve the right to periodically publish updates or new versions of the Agreement, each with a separate number. These subsequent versions may address new issues encountered by Free Software. 12.3 Any Software distributed under a given version of the Agreement may only be subsequently distributed under the same version of the Agreement or a subsequent version. Article 13 - GOVERNING LAW AND JURISDICTION 13.1 The Agreement is governed by French law. The Parties agree to endeavor to seek an amicable solution to any disagreements or disputes that may arise during the performance of the Agreement. 13.2 Failing an amicable solution within two (2) months as from their occurrence, and unless emergency proceedings are necessary, the disagreements or disputes shall be referred to the Paris Courts having jurisdiction, by the more diligent Party. Version 1.0 dated 2006-09-05. eztrace-2.1/ChangeLog000066400000000000000000000100211447213526500145660ustar00rootroot00000000000000Version 2.1 ----------- * New modules: cuda, netcdf, pnetcdf, starpu * Add support for compiler instrumentation * Some modules are still (temporarily) disabled: papi * fix the loading of the ompt module (see https://bugs.launchpad.net/ubuntu/+source/eztrace/+bug/2016471) Version 2.0 ----------- * EZTrace now generates OTF2 traces * Some modules are (temporarily) disabled: cuda, papi, starpu * New module: iotracer. This module uses IOTracer to trace the IO events that happen in the Linux kernel. * New module: ompt. This module traces OpenMP events using the OMPT interface. Unlike with the openmp module, you do not need to instrument the application with eztrace_cc. Version 1.1 ----------- * Add a StarPU module Version 1.0 ----------- * Add support for CUDA applications * Add a script that generates an EZTrace plugin directly from an executable program * EZTrace now relies on LiTL (instead of FxT) for recording events * EZTrace can now track the CPU on which a thread run * Add a sampling interface that allows to call a function every x ms * EZTrace is now under the CeCILL-B license Version 0.9 ----------- * Add support for MPI Communicators in collective communications * Add support for non-blocking collective communications * Add options in eztrace and eztrace.old to manipulate various environment variable (EZTRACE_TRACE, EZTRACE_OUTPUT_DIR, etc.) Version 0.8 ----------- * EZTrace now relies on Opari2. Thus, OpenMP 3.0 programs can be analyzed * EZTrace provides two trace flush policies: the trace is written to disk only at the end of the program (thus, some events may be lost, but there is no overhead) or when the event buffer is full (thus, no event lost, but there's an overhead when the trace is being written to disk) * EZTrace now implements a trace synchronisation mechanism * EZTrace can now instrument functions located inside the application or in a statically-linked library(it does not require to be dynamically linked anymore) Version 0.7 ----------- * EZTrace can now use PAPI (Performance Application Programming Interface) for extracting hardware counters * Update the OpenMP module. It can now use Opari for instrumenting OpenMP program and extract precise informations * Fix the generation of OTF traces * Improve statistics on MPI messages Version 0.6 ----------- * Add a module for standard IO primitives (read, write, select, ...) * Add a module for tracking memory consumption (malloc, free, ...) * Add a source-to-source compiler (eztrace_create) for converting simple scripts into eztrace plugins * FxT and GTG (with OTF support) are now included in eztrace. Thus, you don't need to download/install them separately. Version 0.5 ----------- * EZTrace now relies on modules (plugins). * EZTrace now supports user-defined plugins. * EZTrace now works on Mac OS X. However, since mac os pthread interface is limited compared to the linux one, the pthread module is not available on macos. * The Coreblas module has been removed. It is now part of the Plasma project. * eztrace_stats is now available. Instead of merging traces, it computes statistics on the traces (number of events, average size of MPI messages, etc.) * Fix various bugs in PThread and MPI modules. Version 0.4 ----------- * EZTrace now uses GTG for converting traces. You can now generate OTF traces Version 0.3 ----------- * Add full support for MPI communication operations (for both C and Fortran bindings) * Add support for OpenMP scheduling strategies (static, dynamic, guided and runtime) * Fix various bugs in PThread, OpenMP and MPI modules Version 0.2 ----------- * Add support for Fortran MPI programs * Add support for MPI collective communications * Add support for non-blocking MPI communications Version 0.1.1 ----------- * Fix a bug regarding pthread_cond_signal and pthread_cond_broadcast Version 0.1 ----------- * This first release supports: * Threads state (blocked/working) * OpenMP parallel sections for C or Fortran programs (merely tested) * sem_post/sem_wait are shown as Events and Links in the Paje trace * Basic MPI support eztrace-2.1/NEWS000066400000000000000000000000001447213526500135070ustar00rootroot00000000000000eztrace-2.1/README.md000066400000000000000000000026241447213526500143050ustar00rootroot00000000000000 # What is EZTrace? EZTrace is a tool that automatically generates execution traces from HPC (High Performance Computing) programs. It generates execution trace files that can be interpreted by visualization tools such as ViTE. ## Trace format Since version 2.0, EZTrace generates OTF2 traces. You can analyze them with visualization tools like [ViTE](https://gitlab.inria.fr/solverstack/vite) or Vampir. Other automatic analysis tools are being developped here: [https://gitlab.com/eztrace/analysis-tools](https://gitlab.com/eztrace/analysis-tools). ## Supported platforms EZTrace can run on any Linux platform (yes, even on ARM CPUs). It may work on other kinds of systems (eg. MacOS) but you may find new bugs. In this case, don't hesitate to [submit an Issue](https://gitlab.com/eztrace/eztrace/-/issues). EZTrace ships several plugins for the main parallel programming libraries, including: - MPI - OpenMP - Pthread - CUDA - StarPU A complete list of existing plugins is [available here](doc/plugin.md). ## Need help ? If you encounter any problem, you can either: - browse the [Documentation](#Documentation) - submit an [Issue](https://gitlab.com/eztrace/eztrace/-/issues) ## Documentation - [Getting / Building EZTrace](doc/building.md) - [Using EZTrace](doc/using.md) - [EZTrace plugins](doc/plugin.md) - [Frequently asked questions](doc/faq.md) - [Tutorials](https://gitlab.com/eztrace/eztrace-tutorials) eztrace-2.1/cmake_modules/000077500000000000000000000000001447213526500156325ustar00rootroot00000000000000eztrace-2.1/cmake_modules/FindCommon.cmake000066400000000000000000000020211447213526500206600ustar00rootroot00000000000000### # # @copyright (c) 2018 Inria. All rights reserved. # ### # # @file FindCommon.cmake # # @project MORSE # MORSE is a software package provided by: # Inria Bordeaux - Sud-Ouest, # Univ. of Tennessee, # King Abdullah Univesity of Science and Technology # Univ. of California Berkeley, # Univ. of Colorado Denver. # # @version 1.0.0 # @author Florent Pruvost # @date 13-04-2018 # ### # clean these variables before using them in CMAKE_REQUIRED_* variables in # check_function_exists macro(finds_remove_duplicates) if (REQUIRED_DEFINITIONS) list(REMOVE_DUPLICATES REQUIRED_DEFINITIONS) endif() if (REQUIRED_INCDIRS) list(REMOVE_DUPLICATES REQUIRED_INCDIRS) endif() if (REQUIRED_FLAGS) list(REMOVE_DUPLICATES REQUIRED_FLAGS) endif() if (REQUIRED_LDFLAGS) list(REMOVE_DUPLICATES REQUIRED_LDFLAGS) endif() if (REQUIRED_LIBS) list(REVERSE REQUIRED_LIBS) list(REMOVE_DUPLICATES REQUIRED_LIBS) list(REVERSE REQUIRED_LIBS) endif() endmacro() ## ## @end file FindCommon ## eztrace-2.1/cmake_modules/FindHWLOC.cmake000066400000000000000000000306431447213526500203170ustar00rootroot00000000000000### # # @copyright (c) 2009-2014 The University of Tennessee and The University # of Tennessee Research Foundation. # All rights reserved. # @copyright (c) 2012-2014 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # # - Find HWLOC include dirs and libraries # Use this module by invoking find_package with the form: # find_package(HWLOC # [REQUIRED]) # Fail with error if hwloc is not found # # This module finds headers and hwloc library. # Results are reported in variables: # HWLOC_FOUND - True if headers and requested libraries were found # HWLOC_INCLUDE_DIRS - hwloc include directories # HWLOC_LIBRARY_DIRS - Link directories for hwloc libraries # HWLOC_LIBRARIES - hwloc component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake # options at configure (ex: cmake path/to/project -DHWLOC_DIR=path/to/hwloc): # HWLOC_DIR - Where to find the base directory of hwloc # HWLOC_INCDIR - Where to find the header files # HWLOC_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths # are not given as cmake variable: HWLOC_DIR, HWLOC_INCDIR, HWLOC_LIBDIR #============================================================================= # Copyright 2012-2013 Inria # Copyright 2012-2013 Emmanuel Agullo # Copyright 2012-2013 Mathieu Faverge # Copyright 2012 Cedric Castagnede # Copyright 2013 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= # (To distribute this file outside of Morse, substitute the full # License text for the above reference.) include(CheckStructHasMember) include(CheckCSourceCompiles) if (NOT HWLOC_FOUND) set(HWLOC_DIR "" CACHE PATH "Installation directory of HWLOC library") if (NOT HWLOC_FIND_QUIETLY) message(STATUS "A cache variable, namely HWLOC_DIR, has been set to specify the install directory of HWLOC") endif() endif() set(ENV_HWLOC_DIR "$ENV{HWLOC_DIR}") set(ENV_HWLOC_INCDIR "$ENV{HWLOC_INCDIR}") set(ENV_HWLOC_LIBDIR "$ENV{HWLOC_LIBDIR}") set(HWLOC_GIVEN_BY_USER "FALSE") if ( HWLOC_DIR OR ( HWLOC_INCDIR AND HWLOC_LIBDIR) OR ENV_HWLOC_DIR OR (ENV_HWLOC_INCDIR AND ENV_HWLOC_LIBDIR) ) set(HWLOC_GIVEN_BY_USER "TRUE") endif() # Optionally use pkg-config to detect include/library dirs (if pkg-config is available) # ------------------------------------------------------------------------------------- if(NOT PKG_CONFIG_FOUND) include(CMakeFindDependencyMacro) find_dependency(PkgConfig) endif() if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER ) pkg_search_module(HWLOC hwloc) if (NOT HWLOC_FIND_QUIETLY) if (HWLOC_FOUND AND HWLOC_LIBRARIES) message(STATUS "Looking for HWLOC - found using PkgConfig") #if(NOT HWLOC_INCLUDE_DIRS) # message("${Magenta}HWLOC_INCLUDE_DIRS is empty using PkgConfig." # "Perhaps the path to hwloc headers is already present in your" # "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}") #endif() else() message("${Magenta}Looking for HWLOC - not found using PkgConfig." "Perhaps you should add the directory containing hwloc.pc to" "the PKG_CONFIG_PATH environment variable.${ColourReset}") endif() endif() endif( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER ) if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR (HWLOC_GIVEN_BY_USER) ) if (NOT HWLOC_FIND_QUIETLY) message(STATUS "Looking for HWLOC - PkgConfig not used") endif() # Looking for include # ------------------- # Add system include paths to search include # ------------------------------------------ unset(_inc_env) if(ENV_HWLOC_INCDIR) list(APPEND _inc_env "${ENV_HWLOC_INCDIR}") elseif(ENV_HWLOC_DIR) list(APPEND _inc_env "${ENV_HWLOC_DIR}") list(APPEND _inc_env "${ENV_HWLOC_DIR}/include") list(APPEND _inc_env "${ENV_HWLOC_DIR}/include/hwloc") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") else() string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") endif() endif() list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}") list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") list(REMOVE_DUPLICATES _inc_env) # set paths where to look for set(PATH_TO_LOOK_FOR "${_inc_env}") # Try to find the hwloc header in the given paths # ------------------------------------------------- # call cmake macro to find the header path if(HWLOC_INCDIR) set(HWLOC_hwloc.h_DIRS "HWLOC_hwloc.h_DIRS-NOTFOUND") find_path(HWLOC_hwloc.h_DIRS NAMES hwloc.h HINTS ${HWLOC_INCDIR}) else() if(HWLOC_DIR) set(HWLOC_hwloc.h_DIRS "HWLOC_hwloc.h_DIRS-NOTFOUND") find_path(HWLOC_hwloc.h_DIRS NAMES hwloc.h HINTS ${HWLOC_DIR} PATH_SUFFIXES "include" "include/hwloc") else() set(HWLOC_hwloc.h_DIRS "HWLOC_hwloc.h_DIRS-NOTFOUND") find_path(HWLOC_hwloc.h_DIRS NAMES hwloc.h HINTS ${PATH_TO_LOOK_FOR} PATH_SUFFIXES "hwloc") endif() endif() mark_as_advanced(HWLOC_hwloc.h_DIRS) # Add path to cmake variable # ------------------------------------ if (HWLOC_hwloc.h_DIRS) set(HWLOC_INCLUDE_DIRS "${HWLOC_hwloc.h_DIRS}") else () set(HWLOC_INCLUDE_DIRS "HWLOC_INCLUDE_DIRS-NOTFOUND") if(NOT HWLOC_FIND_QUIETLY) message(STATUS "Looking for hwloc -- hwloc.h not found") endif() endif () if (HWLOC_INCLUDE_DIRS) list(REMOVE_DUPLICATES HWLOC_INCLUDE_DIRS) endif () # Looking for lib # --------------- # Add system library paths to search lib # -------------------------------------- unset(_lib_env) if(ENV_HWLOC_LIBDIR) list(APPEND _lib_env "${ENV_HWLOC_LIBDIR}") elseif(ENV_HWLOC_DIR) list(APPEND _lib_env "${ENV_HWLOC_DIR}") list(APPEND _lib_env "${ENV_HWLOC_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") else() if(APPLE) string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}") else() string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}") endif() list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") endif() endif() list(REMOVE_DUPLICATES _lib_env) # set paths where to look for set(PATH_TO_LOOK_FOR "${_lib_env}") # Try to find the hwloc lib in the given paths # ---------------------------------------------- # call cmake macro to find the lib path if(HWLOC_LIBDIR) set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND") find_library(HWLOC_hwloc_LIBRARY NAMES hwloc HINTS ${HWLOC_LIBDIR}) else() if(HWLOC_DIR) set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND") find_library(HWLOC_hwloc_LIBRARY NAMES hwloc HINTS ${HWLOC_DIR} PATH_SUFFIXES lib lib32 lib64) else() set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND") find_library(HWLOC_hwloc_LIBRARY NAMES hwloc HINTS ${PATH_TO_LOOK_FOR}) endif() endif() mark_as_advanced(HWLOC_hwloc_LIBRARY) # If found, add path to cmake variable # ------------------------------------ if (HWLOC_hwloc_LIBRARY) get_filename_component(hwloc_lib_path ${HWLOC_hwloc_LIBRARY} PATH) # set cmake variables (respects naming convention) set(HWLOC_LIBRARIES "${HWLOC_hwloc_LIBRARY}") set(HWLOC_LIBRARY_DIRS "${hwloc_lib_path}") else () set(HWLOC_LIBRARIES "HWLOC_LIBRARIES-NOTFOUND") set(HWLOC_LIBRARY_DIRS "HWLOC_LIBRARY_DIRS-NOTFOUND") if(NOT HWLOC_FIND_QUIETLY) message(STATUS "Looking for hwloc -- lib hwloc not found") endif() endif () if (HWLOC_LIBRARY_DIRS) list(REMOVE_DUPLICATES HWLOC_LIBRARY_DIRS) endif () # check a function to validate the find if(HWLOC_LIBRARIES) set(REQUIRED_INCDIRS) set(REQUIRED_LIBDIRS) set(REQUIRED_LIBS) # HWLOC if (HWLOC_INCLUDE_DIRS) set(REQUIRED_INCDIRS "${HWLOC_INCLUDE_DIRS}") endif() if (HWLOC_LIBRARY_DIRS) set(REQUIRED_LIBDIRS "${HWLOC_LIBRARY_DIRS}") endif() set(REQUIRED_LIBS "${HWLOC_LIBRARIES}") # set required libraries for link set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}") set(CMAKE_REQUIRED_LIBRARIES) foreach(lib_dir ${REQUIRED_LIBDIRS}) list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}") endforeach() list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}") string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") # test link unset(HWLOC_WORKS CACHE) include(CheckFunctionExists) check_function_exists(hwloc_topology_init HWLOC_WORKS) mark_as_advanced(HWLOC_WORKS) # test headers to guess the version check_struct_has_member( "struct hwloc_obj" parent hwloc.h HAVE_HWLOC_PARENT_MEMBER ) check_struct_has_member( "struct hwloc_cache_attr_s" size hwloc.h HAVE_HWLOC_CACHE_ATTR ) check_c_source_compiles( "#include int main(void) { hwloc_obj_t o; o->type = HWLOC_OBJ_PU; return 0;}" HAVE_HWLOC_OBJ_PU) check_library_exists(${HWLOC_LIBRARIES} hwloc_bitmap_free "" HAVE_HWLOC_BITMAP) if(NOT HWLOC_WORKS) if(NOT HWLOC_FIND_QUIETLY) message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails") message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}") message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails") endif() endif() set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_LIBRARIES) endif(HWLOC_LIBRARIES) endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR (HWLOC_GIVEN_BY_USER) ) if (HWLOC_LIBRARIES) if (HWLOC_LIBRARY_DIRS) list(GET HWLOC_LIBRARY_DIRS 0 first_lib_path) else() list(GET HWLOC_LIBRARIES 0 first_lib) get_filename_component(first_lib_path "${first_lib}" PATH) endif() if (${first_lib_path} MATCHES "/lib(32|64)?$") string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}") set(HWLOC_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of HWLOC library" FORCE) else() set(HWLOC_DIR_FOUND "${first_lib_path}" CACHE PATH "Installation directory of HWLOC library" FORCE) endif() endif() # check that HWLOC has been found # ------------------------------- include(FindPackageHandleStandardArgs) if (PKG_CONFIG_EXECUTABLE AND HWLOC_FOUND) find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARIES) else() find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARIES HWLOC_WORKS) endif() eztrace-2.1/cmake_modules/FindHeadersAndLibs.cmake000066400000000000000000000056001447213526500222460ustar00rootroot00000000000000### # # @copyright (c) 2009-2014 The University of Tennessee and The University # of Tennessee Research Foundation. # All rights reserved. # @copyright (c) 2012-2014 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # # @file FindHeadersAndLibs.cmake # # @project MORSE # MORSE is a software package provided by: # Inria Bordeaux - Sud-Ouest, # Univ. of Tennessee, # King Abdullah Univesity of Science and Technology # Univ. of California Berkeley, # Univ. of Colorado Denver. # # @version 0.9.0 # @author Cedric Castagnede # @author Emmanuel Agullo # @author Mathieu Faverge # @author Florent Pruvost # @date 13-07-2012 # ### # Some macros to print status when search for headers and libs include(PrintFindStatus) function(FindHeader _libname _header_to_find) # save _libname upper and lower case string(TOUPPER ${_libname} LIBNAME) string(TOLOWER ${_libname} libname) # Looking for include # ------------------- # Add system include paths to search include # ------------------------------------------ unset(_inc_env) if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") else() string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") endif() list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") list(REMOVE_DUPLICATES _inc_env) # Try to find the _header_to_find in the given paths # -------------------------------------------------- # call cmake macro to find the header path if(${LIBNAME}_INCDIR) set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND") find_path(${LIBNAME}_${_header_to_find}_DIRS NAMES ${_header_to_find} HINTS ${${LIBNAME}_INCDIR}) elseif(${LIBNAME}_DIR) set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND") find_path(${LIBNAME}_${_header_to_find}_DIRS NAMES ${_header_to_find} HINTS ${${LIBNAME}_DIR} PATH_SUFFIXES include) else() set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND") find_path(${LIBNAME}_${_header_to_find}_DIRS NAMES ${_header_to_find} HINTS ${_inc_env}) endif() mark_as_advanced(${LIBNAME}_${_header_to_find}_DIRS) # Print status if not found # ------------------------- if (NOT ${LIBNAME}_${_header_to_find}_DIRS) Print_Find_Header_Status(${libname} ${_header_to_find}) endif () endfunction(FindHeader) ## ## @end file FindHeadersAndLibs.cmake ## eztrace-2.1/cmake_modules/FindInit.cmake000066400000000000000000000016661447213526500203510ustar00rootroot00000000000000### # # @copyright (c) 2018 Inria. All rights reserved. # ### # # @file FindInit.cmake # # @project MORSE # MORSE is a software package provided by: # Inria Bordeaux - Sud-Ouest, # Univ. of Tennessee, # King Abdullah Univesity of Science and Technology # Univ. of California Berkeley, # Univ. of Colorado Denver. # # @version 1.0.0 # @author Florent Pruvost # @date 24-04-2018 # ### # This include is required to check symbols of libs include(CheckFunctionExists) # This include is required to check defines in headers include(CheckIncludeFiles) # Factorize some piece of code include(FindCommon) # To find headers and libs include(FindHeadersAndLibs) # To transform relative path into absolute for a list of libraries include(LibrariesAbsolutePath) include(FindPkgconfigLibrariesAbsolutePath) # Some macros to print status when search for headers and libs include(PrintFindStatus) ## ## @end file FindInit.cmake ## eztrace-2.1/cmake_modules/FindLibOpcodes.cmake000066400000000000000000000047241447213526500214670ustar00rootroot00000000000000# - Find libelf include dirs and libraries # Use this module by invoking find_package with the form: # find_package(LIBELF [REQUIRED]) # Fail with error if libelf is not found # This module finds libelf headers and library. # Results are reported in variables: # LIBELF_FOUND - True if headers and requested libraries were found # LIBELF_INCLUDE_DIRS - libelf include directories # LIBELF_LIBRARIES - libelf component libraries to be linked # ------------------------------------------------------------------------------------- if (LIBOPCODES_LIBRARIES AND LIBOPCODES_INCLUDE_DIRS) set (LibOpcodes_FIND_QUIETLY TRUE) endif (LIBOPCODES_LIBRARIES AND LIBOPCODES_INCLUDE_DIRS) unset(_inc_env) string(REPLACE ":" ";" _path_env "$ENV{include}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_include_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{include_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{PATH}") list(APPEND _inc_env "${_path_env}") list(REMOVE_DUPLICATES _inc_env) find_path (LIBOPCODES_INCLUDE_DIRS NAMES dis-asm.h PATHS ${_inc_env} /usr/include /usr/include/libelf /usr/local/include /usr/local/include/libelf /opt/local/include /opt/local/include/libelf ENV CPATH) ## Search library in user defined path (via LD_LIBRARY_PATH and LIBRARY_PATH) unset(_lib_env) string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") string(REPLACE ":" ";" _lib_env "$ENV{LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") string(REPLACE ":" ";" _lib_env "$ENV{MIC_LD_LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") list(REMOVE_DUPLICATES _lib_env) find_library ( LIBOPCODES_LIBRARIES NAMES opcodes HINTS ${_lib_env} NO_DEFAULT_PATH ) ## Search in standard path if (NOT LIBOCODES_LIBRARIES) unset(_lib_env) list(APPEND _lib_env "/usr/local/lib64") list(APPEND _lib_env "/usr/lib64") list(APPEND _lib_env "/usr/local/lib") list(APPEND _lib_env "/usr/lib") find_library ( LIBOPCODES_LIBRARIES NAMES opcodes PATHS ${_lib_env} ) endif() include (FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set LIBBFD_FOUND to TRUE if all listed variables are TRUE FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibOpcodes DEFAULT_MSG LIBOPCODES_LIBRARIES LIBOPCODES_INCLUDE_DIRS ) mark_as_advanced(LIBOPCODES_INCLUDE_DIRS LIBOPCODES_LIBRARIES) eztrace-2.1/cmake_modules/FindLibPapi.cmake000066400000000000000000000046661447213526500207710ustar00rootroot00000000000000# - Find libpapi include dirs and libraries # Use this module by invoking find_package with the form: # find_package(LIBPAPI [REQUIRED]) # Fail with error if libpapi is not found # This module finds libpapi headers and library. # Results are reported in variables: # LIBPAPI_FOUND - True if headers and requested libraries were found # LIBPAPI_INCLUDE_DIRS - libpapi include directories # LIBPAPI_LIBRARIES - libpapi component libraries to be linked # ------------------------------------------------------------------------------------- if (LIBPAPI_LIBRARIES AND LIBPAPI_INCLUDE_DIRS) set (LibPapi_FIND_QUIETLY TRUE) endif (LIBPAPI_LIBRARIES AND LIBPAPI_INCLUDE_DIRS) unset(_inc_env) string(REPLACE ":" ";" _path_env "$ENV{include}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_include_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{include_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{PATH}") list(APPEND _inc_env "${_path_env}") list(REMOVE_DUPLICATES _inc_env) find_path (LIBPAPI_INCLUDE_DIRS NAMES papi.h PATHS ${_inc_env} /usr/include /usr/include/libpapi /usr/local/include /usr/local/include/libpapi /opt/local/include /opt/local/include/libpapi ENV CPATH) ## Search library in user defined path (via LD_LIBRARY_PATH and LIBRARY_PATH) unset(_lib_env) string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") string(REPLACE ":" ";" _lib_env "$ENV{LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") string(REPLACE ":" ";" _lib_env "$ENV{MIC_LD_LIBRARY_PATH}") list(APPEND _lib_env "${_path_env}") list(REMOVE_DUPLICATES _lib_env) find_library ( LIBPAPI_LIBRARIES NAMES papi HINTS ${_lib_env} NO_DEFAULT_PATH ) ## Search in standard path if (NOT LIBPAPI_LIBRARIES) unset(_lib_env) list(APPEND _lib_env "/usr/local/lib64") list(APPEND _lib_env "/usr/lib64") list(APPEND _lib_env "/usr/local/lib") list(APPEND _lib_env "/usr/lib") find_library ( LIBPAPI_LIBRARIES NAMES papi PATHS ${_lib_env} ) endif() include (FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set LIBPAPI_FOUND to TRUE if all listed variables are TRUE FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibPapi DEFAULT_MSG LIBPAPI_LIBRARIES LIBPAPI_INCLUDE_DIRS ) mark_as_advanced(LIBPAPI_INCLUDE_DIRS LIBPAPI_LIBRARIES)eztrace-2.1/cmake_modules/FindOMPT.cmake000066400000000000000000000053331447213526500202200ustar00rootroot00000000000000# # Find the OMPT header # # - Find OMPT include dirs and libraries # Use this module by invoking find_package with the form: # find_package(OMPT # [REQUIRED]) # Fail with error if hwloc is not found # # OMPT_FOUND - True if headers and requested libraries were found # OMP_INCLUDE_PATH - OMPT include directories # OMP_LIBRARY_PATH - Link directory for OMPT # OMP_LIBRARY - The libraries needed to use OMPT # HAVE_OMPT_51 - True if OMPT version is greater or equal to 5.1 # # OMPT_PATH can be used to make it simpler to find the various include # directories and compiled libraries when OMPT was not installed in the # usual/well-known directories (e.g. because you made an in tree-source # compilation or because you installed it in an "unusual" directory). # Just set OMPT_PATH it to your specific installation directory try_compile(COMPILES_OMPT "${CMAKE_BINARY_DIR}/temp" "${CMAKE_SOURCE_DIR}/test/ompt//test_ompt.c" LINK_OPTIONS -fopenmp CMAKE_FLAGS "-fopenmp") check_c_source_compiles(" #include int main() { ompt_sync_region_t kind = ompt_sync_region_barrier_implicit_workshare; return 0; } " HAVE_OMPT_51) if(HAVE_OMPT_51) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_OMPT_51=1") endif() if(COMPILES_OMPT) # the compiler is able to compile an ompt program (eg. we're using clang) set(OMPT_FOUND TRUE) mark_as_advanced(OMPT_INCLUDE_PATH OMPT_LIBRARY_PATH OMPT_LIBRARY) else() # the compiler can't compile an ompt program (eg. we're using gcc) # let's see if ompt.h and libomp are available find_path(OMPT_INCLUDE_PATH ompt.h HINTS ${OMPT_INCLUDE_DIRS} ${OMPT_PATH}/include) find_library(OMPT_LIBRARY NAMES omp iomp5 gomp HINTS ${OMPT_LIBDIR} ${OMPT_LIBRARY_PATH} ${OMPT_PATH}/lib ${OMPT_PATH}/lib/* NO_DEFAULT_PATH) IF(OMPT_LIBRARY) MESSAGE ( STATUS "Found OMPT library: ${OMPT_LIBRARY}" ) GET_FILENAME_COMPONENT(OMPT_LIBRARY_tmp "${OMPT_LIBRARY}" PATH) SET (OMPT_LIBRARY_PATH ${OMPT_LIBRARY_tmp} CACHE PATH "") ELSE(OMPT_LIBRARY) SET (OMPT_LIBRARY_PATH "OMPT_LIBRARY_PATH-NOTFOUND") unset(LIBRARY_PATH CACHE) ENDIF(OMPT_LIBRARY) if((OMPT_LIBRARY) AND (OMPT_LIBRARY_PATH) AND (OMPT_INCLUDE_DIR)) SET( OMPT_FOUND TRUE ) else() MESSAGE(STATUS "OMPT installation was not found. Please provide OMPT_PATH:") MESSAGE(STATUS " - through the GUI when working with ccmake, ") MESSAGE(STATUS " - as a command line argument when working with cmake e.g.") MESSAGE(STATUS " cmake .. -DOMPT_PATH:PATH=/usr/local/ompt ") SET(OMPT_PATH "" CACHE PATH "Root of OMPT install tree." ) SET(OMPT_PATH "" CACHE PATH "Root of OMPT install tree." ) endif() mark_as_advanced(OMPT_INCLUDE_PATH OMPT_LIBRARY_PATH OMPT_LIBRARY) endif() eztrace-2.1/cmake_modules/FindOTF2.cmake000066400000000000000000000050501447213526500201470ustar00rootroot00000000000000# # Find the OTF2 library # # OTF2_INCLUDE_PATH - Directories to include to use OTF2 # OTF2_LIBRARY_PATH - Files to link against to use OTF2 # OTF2_CONFIG - Path to otf2-config find_program(OTF2_CONFIG otf2-config REQUIRED) find_program(OTF2_PRINT otf2-print REQUIRED) IF(NOT OTF2_CONFIG OR NOT EXISTS ${OTF2_CONFIG}) MESSAGE(STATUS "Cannot find otf2-config") SET(OTF2_VERSION ${OTF2_REQUIRED_VERSION}) ELSE() message(STATUS "OTF2 installation found. (using ${OTF2_CONFIG})") execute_process(COMMAND ${OTF2_CONFIG} "--cppflags" OUTPUT_VARIABLE OTF2_INCLUDE_PATH) STRING(REPLACE "\n" "" OTF2_INCLUDE_PATH ${OTF2_INCLUDE_PATH}) STRING(REPLACE "-I" "" OTF2_INCLUDE_PATH ${OTF2_INCLUDE_PATH}) execute_process(COMMAND ${OTF2_CONFIG} "--ldflags" OUTPUT_VARIABLE _LINK_LD_ARGS) STRING( REPLACE " " ";" _LINK_LD_ARGS ${_LINK_LD_ARGS} ) FOREACH( _ARG ${_LINK_LD_ARGS} ) IF(${_ARG} MATCHES "^-L") STRING(REGEX REPLACE "^-L" "" _ARG ${_ARG}) STRING(STRIP "${_ARG}" _ARG) SET(OTF2_LINK_DIRS ${OTF2_LINK_DIRS} ${_ARG}) ENDIF(${_ARG} MATCHES "^-L") ENDFOREACH(_ARG) execute_process(COMMAND ${OTF2_CONFIG} "--libs" OUTPUT_VARIABLE _LINK_LD_ARGS) STRING( REPLACE " " ";" _LINK_LD_ARGS ${_LINK_LD_ARGS} ) FOREACH( _ARG ${_LINK_LD_ARGS} ) IF(${_ARG} MATCHES "^-l") STRING(REGEX REPLACE "^-l" "" _ARG "${_ARG}") STRING(STRIP "${_ARG}" _ARG) FIND_LIBRARY(_OTF2_LIB_FROM_ARG NAMES ${_ARG} HINTS ${OTF2_LINK_DIRS} NO_DEFAULT_PATH ) IF(${_ARG} STREQUAL "otf2" OR ${_ARG} STREQUAL "open-trace-format2") SET(OTF2_LIBRARY ${_OTF2_LIB_FROM_ARG}) ELSE() IF(_OTF2_LIB_FROM_ARG) LIST(APPEND OTF2_LIBRARIES ${_OTF2_LIB_FROM_ARG}) ENDIF(_OTF2_LIB_FROM_ARG) ENDIF() UNSET(_OTF2_LIB_FROM_ARG CACHE) ENDIF(${_ARG} MATCHES "^-l") ENDFOREACH(_ARG) execute_process(COMMAND ${OTF2_CONFIG} "--version" OUTPUT_VARIABLE OTF2_VERSION) STRING( REPLACE "otf2-config: version " "" OTF2_VERSION ${OTF2_VERSION} ) STRING( REPLACE "\n" "" OTF2_VERSION ${OTF2_VERSION} ) STRING( REPLACE "." ";" _VERSION ${OTF2_VERSION} ) LIST( GET _VERSION 0 OTF2_MAJOR_VERSION) LIST( GET _VERSION 1 OTF2_MINOR_VERSION) ENDIF() include (FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(OTF2 FOUND_VAR OTF2_FOUND REQUIRED_VARS OTF2_CONFIG OTF2_LIBRARY OTF2_INCLUDE_PATH VERSION_VAR OTF2_VERSION ) if(NOT OTF2_FOUND) unset(OTF2_CONFIG) unset(OTF2_CONFIG CACHE) unset(OTF2_LINK_DIRS) unset(OTF2_LIBRARIES) endif() mark_as_advanced(OTF2_LIBRARY) eztrace-2.1/cmake_modules/FindPAPI.cmake000066400000000000000000000276501447213526500202000ustar00rootroot00000000000000### # # @copyright (c) 2009-2014 The University of Tennessee and The University # of Tennessee Research Foundation. # All rights reserved. # @copyright (c) 2012-2018 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # # - Find PAPI include dirs and libraries # Use this module by invoking find_package with the form: # find_package(PAPI # [REQUIRED]) # Fail with error if papi is not found # # This module finds headers and papi library. # Results are reported in variables: # PAPI_FOUND - True if headers and requested libraries were found # PAPI_INCLUDE_DIRS - papi include directories # PAPI_LIBRARY_DIRS - Link directories for papi libraries # PAPI_LIBRARIES - papi component libraries to be linked # # PAPI_FOUND_WITH_PKGCONFIG - True if found with pkg-config # if found with pkg-config the following variables are set # = PAPI # = for common case # = _STATIC for static linking # _FOUND ... set to 1 if module(s) exist # _LIBRARIES ... only the libraries (w/o the '-l') # _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # _LDFLAGS ... all required linker flags # _LDFLAGS_OTHER ... all other linker flags # _INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') # _CFLAGS ... all required cflags # _CFLAGS_OTHER ... the other compiler flags # # The user can give specific paths where to find the libraries adding cmake # options at configure (ex: cmake path/to/project -DPAPI_DIR=path/to/papi): # PAPI_DIR - Where to find the base directory of papi # PAPI_INCDIR - Where to find the header files # PAPI_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths # are not given as cmake variable: PAPI_DIR, PAPI_INCDIR, PAPI_LIBDIR #============================================================================= # Copyright 2012-2018 Inria # Copyright 2012-2013 Emmanuel Agullo # Copyright 2012-2013 Mathieu Faverge # Copyright 2012 Cedric Castagnede # Copyright 2013-2018 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= # (To distribute this file outside of Morse, substitute the full # License text for the above reference.) # Common macros to use in finds include(FindInit) if (NOT PAPI_FOUND) set(PAPI_DIR "" CACHE PATH "Installation directory of PAPI library") if (NOT PAPI_FIND_QUIETLY) message(STATUS "A cache variable, namely PAPI_DIR, has been set to specify the install directory of PAPI") endif() endif() set(ENV_PAPI_DIR "$ENV{PAPI_DIR}") set(ENV_PAPI_INCDIR "$ENV{PAPI_INCDIR}") set(ENV_PAPI_LIBDIR "$ENV{PAPI_LIBDIR}") set(PAPI_GIVEN_BY_USER "FALSE") if ( PAPI_DIR OR ( PAPI_INCDIR AND PAPI_LIBDIR) OR ENV_PAPI_DIR OR (ENV_PAPI_INCDIR AND ENV_PAPI_LIBDIR) ) set(PAPI_GIVEN_BY_USER "TRUE") endif() # Optionally use pkg-config to detect include/library dirs (if pkg-config is available) # ------------------------------------------------------------------------------------- include(FindPkgConfig) find_package(PkgConfig QUIET) if(PKG_CONFIG_EXECUTABLE AND NOT PAPI_GIVEN_BY_USER) pkg_search_module(PAPI papi) if (NOT PAPI_FIND_QUIETLY) if (PAPI_FOUND AND PAPI_LIBRARIES) message(STATUS "Looking for PAPI - found using PkgConfig") else() message(STATUS "${Magenta}Looking for PAPI - not found using PkgConfig." "\n Perhaps you should add the directory containing papi.pc to the" "\n PKG_CONFIG_PATH environment variable.${ColourReset}") endif() endif() if (PAPI_FOUND AND PAPI_LIBRARIES) set(PAPI_FOUND_WITH_PKGCONFIG "TRUE") find_pkgconfig_libraries_absolute_path(PAPI) else() set(PAPI_FOUND_WITH_PKGCONFIG "FALSE") endif() endif(PKG_CONFIG_EXECUTABLE AND NOT PAPI_GIVEN_BY_USER) if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT PAPI_FOUND) OR (PAPI_GIVEN_BY_USER) ) if (NOT PAPI_FIND_QUIETLY) message(STATUS "Looking for PAPI - PkgConfig not used") endif() # Looking for include # ------------------- # Add system include paths to search include # ------------------------------------------ unset(_inc_env) set(ENV_PAPI_DIR "$ENV{PAPI_DIR}") set(ENV_PAPI_INCDIR "$ENV{PAPI_INCDIR}") if(ENV_PAPI_INCDIR) list(APPEND _inc_env "${ENV_PAPI_INCDIR}") elseif(ENV_PAPI_DIR) list(APPEND _inc_env "${ENV_PAPI_DIR}") list(APPEND _inc_env "${ENV_PAPI_DIR}/include") list(APPEND _inc_env "${ENV_PAPI_DIR}/include/papi") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") else() string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") endif() endif() list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") list(REMOVE_DUPLICATES _inc_env) # Try to find the papi header in the given paths # ------------------------------------------------- # call cmake macro to find the header path if(PAPI_INCDIR) set(PAPI_papi.h_DIRS "PAPI_papi.h_DIRS-NOTFOUND") find_path(PAPI_papi.h_DIRS NAMES papi.h HINTS ${PAPI_INCDIR}) else() if(PAPI_DIR) set(PAPI_papi.h_DIRS "PAPI_papi.h_DIRS-NOTFOUND") find_path(PAPI_papi.h_DIRS NAMES papi.h HINTS ${PAPI_DIR} PATH_SUFFIXES "include" "include/papi") else() set(PAPI_papi.h_DIRS "PAPI_papi.h_DIRS-NOTFOUND") find_path(PAPI_papi.h_DIRS NAMES papi.h HINTS ${_inc_env} PATH_SUFFIXES "papi") endif() endif() mark_as_advanced(PAPI_papi.h_DIRS) # Add path to cmake variable # ------------------------------------ if (PAPI_papi.h_DIRS) set(PAPI_INCLUDE_DIRS "${PAPI_papi.h_DIRS}") else () set(PAPI_INCLUDE_DIRS "PAPI_INCLUDE_DIRS-NOTFOUND") if(NOT PAPI_FIND_QUIETLY) message(STATUS "Looking for papi -- papi.h not found") endif() endif () if (PAPI_INCLUDE_DIRS) list(REMOVE_DUPLICATES PAPI_INCLUDE_DIRS) endif () # Looking for lib # --------------- # Add system library paths to search lib # -------------------------------------- unset(_lib_env) set(ENV_PAPI_LIBDIR "$ENV{PAPI_LIBDIR}") if(ENV_PAPI_LIBDIR) list(APPEND _lib_env "${ENV_PAPI_LIBDIR}") elseif(ENV_PAPI_DIR) list(APPEND _lib_env "${ENV_PAPI_DIR}") list(APPEND _lib_env "${ENV_PAPI_DIR}/lib") else() list(APPEND _lib_env "$ENV{LIBRARY_PATH}") if(WIN32) string(REPLACE ":" ";" _lib_env2 "$ENV{LIB}") elseif(APPLE) string(REPLACE ":" ";" _lib_env2 "$ENV{DYLD_LIBRARY_PATH}") else() string(REPLACE ":" ";" _lib_env2 "$ENV{LD_LIBRARY_PATH}") endif() list(APPEND _lib_env "${_lib_env2}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") endif() list(REMOVE_DUPLICATES _lib_env) # Try to find the papi lib in the given paths # ---------------------------------------------- # call cmake macro to find the lib path if(PAPI_LIBDIR) set(PAPI_papi_LIBRARY "PAPI_papi_LIBRARY-NOTFOUND") find_library(PAPI_papi_LIBRARY NAMES papi HINTS ${PAPI_LIBDIR}) else() if(PAPI_DIR) set(PAPI_papi_LIBRARY "PAPI_papi_LIBRARY-NOTFOUND") find_library(PAPI_papi_LIBRARY NAMES papi HINTS ${PAPI_DIR} PATH_SUFFIXES lib lib32 lib64) else() set(PAPI_papi_LIBRARY "PAPI_papi_LIBRARY-NOTFOUND") find_library(PAPI_papi_LIBRARY NAMES papi HINTS ${_lib_env}) endif() endif() mark_as_advanced(PAPI_papi_LIBRARY) # If found, add path to cmake variable # ------------------------------------ if (PAPI_papi_LIBRARY) get_filename_component(papi_lib_path ${PAPI_papi_LIBRARY} PATH) # set cmake variables (respects naming convention) set(PAPI_LIBRARIES "${PAPI_papi_LIBRARY}") set(PAPI_LIBRARY_DIRS "${papi_lib_path}") else () set(PAPI_LIBRARIES "PAPI_LIBRARIES-NOTFOUND") set(PAPI_LIBRARY_DIRS "PAPI_LIBRARY_DIRS-NOTFOUND") if(NOT PAPI_FIND_QUIETLY) message(STATUS "Looking for papi -- lib papi not found") endif() endif () if (PAPI_LIBRARY_DIRS) list(REMOVE_DUPLICATES PAPI_LIBRARY_DIRS) endif () endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT PAPI_FOUND) OR (PAPI_GIVEN_BY_USER) ) # check a function to validate the find if(PAPI_LIBRARIES) set(REQUIRED_INCDIRS) set(REQUIRED_FLAGS) set(REQUIRED_LDFLAGS) set(REQUIRED_LIBDIRS) set(REQUIRED_LIBS) # PAPI if (PAPI_INCLUDE_DIRS) set(REQUIRED_INCDIRS "${PAPI_INCLUDE_DIRS}") endif() if (PAPI_CFLAGS_OTHER) set(REQUIRED_FLAGS "${PAPI_CFLAGS_OTHER}") endif() if (PAPI_LDFLAGS_OTHER) set(REQUIRED_LDFLAGS "${PAPI_LDFLAGS_OTHER}") endif() if (PAPI_LIBRARY_DIRS) set(REQUIRED_LIBDIRS "${PAPI_LIBRARY_DIRS}") endif() set(REQUIRED_LIBS "${PAPI_LIBRARIES}") # set required libraries for link set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}") if (REQUIRED_FLAGS) set(REQUIRED_FLAGS_COPY "${REQUIRED_FLAGS}") set(REQUIRED_FLAGS) set(REQUIRED_DEFINITIONS) foreach(_flag ${REQUIRED_FLAGS_COPY}) if (_flag MATCHES "^-D") list(APPEND REQUIRED_DEFINITIONS "${_flag}") endif() string(REGEX REPLACE "^-D.*" "" _flag "${_flag}") list(APPEND REQUIRED_FLAGS "${_flag}") endforeach() endif() finds_remove_duplicates() set(CMAKE_REQUIRED_DEFINITIONS "${REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}") set(CMAKE_REQUIRED_LIBRARIES) list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}") string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") # test link unset(PAPI_WORKS CACHE) include(CheckFunctionExists) check_function_exists(PAPI_start PAPI_WORKS) mark_as_advanced(PAPI_WORKS) if(NOT PAPI_WORKS) if(NOT PAPI_FIND_QUIETLY) message(STATUS "Looking for papi : test of PAPI_start with papi library fails") message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}") message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}") message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails") endif() endif() set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_LIBRARIES) endif(PAPI_LIBRARIES) if (PAPI_LIBRARIES) if (PAPI_LIBRARY_DIRS) list(GET PAPI_LIBRARY_DIRS 0 first_lib_path) else() list(GET PAPI_LIBRARIES 0 first_lib) get_filename_component(first_lib_path "${first_lib}" PATH) set(PAPI_LIBRARY_DIRS "${first_lib_path}") endif() if (${first_lib_path} MATCHES "/lib(32|64)?$") string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}") set(PAPI_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of PAPI library" FORCE) else() set(PAPI_DIR_FOUND "${first_lib_path}" CACHE PATH "Installation directory of PAPI library" FORCE) endif() endif() mark_as_advanced(PAPI_DIR) mark_as_advanced(PAPI_DIR_FOUND) # check that PAPI has been found # ------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PAPI DEFAULT_MSG PAPI_LIBRARIES PAPI_WORKS) eztrace-2.1/cmake_modules/FindPkgconfigLibrariesAbsolutePath.cmake000066400000000000000000000071641447213526500255250ustar00rootroot00000000000000### # # @copyright (c) 2018 Inria. All rights reserved. # ### # # @file FindPkgconfigLibrariesAbsolutePath.cmake # # @project MORSE # MORSE is a software package provided by: # Inria Bordeaux - Sud-Ouest, # Univ. of Tennessee, # King Abdullah Univesity of Science and Technology # Univ. of California Berkeley, # Univ. of Colorado Denver. # # @version 1.0.0 # @author Florent Pruvost # @date 06-04-2018 # ### # Transform relative path into absolute path for libraries found with the # pkg_search_module cmake macro # _prefix: the name of the CMake variable used when pkg_search_module was called # e.g. for pkg_search_module(BLAS blas) _prefix would be BLAS macro(FIND_PKGCONFIG_LIBRARIES_ABSOLUTE_PATH _prefix) list(APPEND _lib_env "$ENV{LIBRARY_PATH}") if(WIN32) string(REPLACE ":" ";" _lib_env2 "$ENV{LIB}") elseif(APPLE) string(REPLACE ":" ";" _lib_env2 "$ENV{DYLD_LIBRARY_PATH}") else() string(REPLACE ":" ";" _lib_env2 "$ENV{LD_LIBRARY_PATH}") endif() list(APPEND _lib_env "${_lib_env2}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") # non static case set(${_prefix}_LIBRARIES_COPY "${${_prefix}_LIBRARIES}") set(${_prefix}_LIBRARIES "") foreach(_library ${${_prefix}_LIBRARIES_COPY}) if(EXISTS "${_library}") list(APPEND ${_prefix}_LIBRARIES ${_library}) else() get_filename_component(_ext "${_library}" EXT) set(_lib_extensions ".so" ".a" ".dyld" ".dll") list(FIND _lib_extensions "${_ext}" _index) if (${_index} GREATER -1) get_filename_component(_library "${_library}" NAME_WE) endif() find_library(_library_path NAMES ${_library} HINTS ${${_prefix}_LIBDIR} ${${_prefix}_LIBRARY_DIRS} ${_lib_env}) if (_library_path) list(APPEND ${_prefix}_LIBRARIES ${_library_path}) else() message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND") endif() unset(_library_path CACHE) endif() endforeach() set (${_prefix}_LIBRARIES "${${_prefix}_LIBRARIES}" CACHE INTERNAL "" FORCE) ## static case #set(${_prefix}_STATIC_LIBRARIES_COPY "${${_prefix}_STATIC_LIBRARIES}") #set(${_prefix}_STATIC_LIBRARIES "") #foreach(_library ${${_prefix}_STATIC_LIBRARIES_COPY}) # if(EXISTS "${_library}") # list(APPEND ${_prefix}_STATIC_LIBRARIES ${_library}) # else() # get_filename_component(_ext "${_library}" EXT) # set(_lib_extensions ".so" ".a" ".dyld" ".dll") # list(FIND _lib_extensions "${_ext}" _index) # if (${_index} GREATER -1) # get_filename_component(_library "${_library}" NAME_WE) # endif() # # try static first # set (default_find_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) # set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) # find_library(_library_path NAMES ${_library} # HINTS ${${_prefix}_STATIC_LIBDIR} ${${_prefix}_STATIC_LIBRARY_DIRS} ${_lib_env}) # set (CMAKE_FIND_LIBRARY_SUFFIXES ${default_find_library_suffixes}) # # if not found try dynamic # if (NOT _library_path) # find_library(_library_path NAMES ${_library} # HINTS ${${_prefix}_STATIC_LIBDIR} ${${_prefix}_STATIC_LIBRARY_DIRS} ${_lib_env}) # endif() # if (_library_path) # list(APPEND ${_prefix}_STATIC_LIBRARIES ${_library_path}) # else() # message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND") # endif() # unset(_library_path CACHE) # endif() #endforeach() #set (${_prefix}_STATIC_LIBRARIES "${${_prefix}_STATIC_LIBRARIES}" CACHE INTERNAL "" FORCE) endmacro() ## ## @end file FindPkgconfigLibrariesAbsolutePath.cmake ## eztrace-2.1/cmake_modules/FindSTARPU.cmake000066400000000000000000000755651447213526500204750ustar00rootroot00000000000000### # # @copyright (c) 2009-2014 The University of Tennessee and The University # of Tennessee Research Foundation. # All rights reserved. # @copyright (c) 2012-2018 Inria. All rights reserved. # @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # # - Find STARPU include dirs and libraries # Use this module by invoking find_package with the form: # find_package(STARPU # [version] [EXACT] # Minimum or EXACT version e.g. 1.1 # [REQUIRED] # Fail with error if starpu is not found # [COMPONENTS ...] # dependencies # ) # # COMPONENTS are optional libraries STARPU could be linked with, # Use it to drive detection of a specific compilation chain # COMPONENTS can be some of the following: # - HWLOC: to activate the detection of StarPU linked with HWLOC # - CUDA: to activate the detection of StarPU linked with CUDA # - MPI: to activate the detection of StarPU linked with MPI # - BLAS: to activate the detection of StarPU linked with BLAS # - MAGMA: to activate the detection of StarPU linked with MAGMA # - FXT: to activate the detection of StarPU linked with FxT # - SIMGRID: to activate the detection of StarPU linked with SimGrid # # Results are reported in variables: # STARPU_FOUND - True if headers and requested libraries were found # STARPU_CFLAGS_OTHER - starpu compiler flags without headers paths # STARPU_LDFLAGS_OTHER - starpu linker flags without libraries # STARPU_INCLUDE_DIRS - starpu include directories # STARPU_LIBRARY_DIRS - starpu link directories # STARPU_LIBRARIES - starpu libraries to be linked (absolute path) # STARPU_CFLAGS_OTHER_DEP - starpu + dependencies compiler flags without headers paths # STARPU_LDFLAGS_OTHER_DEP - starpu + dependencies linker flags without libraries # STARPU_INCLUDE_DIRS_DEP - starpu + dependencies include directories # STARPU_LIBRARY_DIRS_DEP - starpu + dependencies link directories # STARPU_LIBRARIES_DEP - starpu + dependencies libraries # STARPU_VERSION - A human-readable string containing the version of the package found # STARPU_VERSION_MAJOR - The major version of the package found # STARPU_VERSION_MINOR - The minor version of the package found # # STARPU_FOUND_WITH_PKGCONFIG - True if found with pkg-config # if found with pkg-config the following variables are set # = STARPU # = for common case # = _STATIC for static linking # _FOUND ... set to 1 if module(s) exist # _LIBRARIES ... only the libraries (w/o the '-l') # _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # _LDFLAGS ... all required linker flags # _LDFLAGS_OTHER ... all other linker flags # _INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') # _CFLAGS ... all required cflags # _CFLAGS_OTHER ... the other compiler flags # # The user can give specific paths where to find the libraries adding cmake # options at configure (ex: cmake path/to/project -DSTARPU=path/to/starpu): # STARPU_DIR - Where to find the base directory of starpu # STARPU_INCDIR - Where to find the header files # STARPU_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths # are not given as cmake variable: STARPU_DIR, STARPU_INCDIR, STARPU_LIBDIR #============================================================================= # Copyright 2012-2018 Inria # Copyright 2012-2013 Emmanuel Agullo # Copyright 2012-2013 Mathieu Faverge # Copyright 2012 Cedric Castagnede # Copyright 2013-2018 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= # (To distribute this file outside of Morse, substitute the full # License text for the above reference.) # Common macros to use in finds include(FindInit) if (NOT STARPU_FOUND) set(STARPU_DIR "" CACHE PATH "Installation directory of STARPU library") if (NOT STARPU_FIND_QUIETLY) message(STATUS "A cache variable, namely STARPU_DIR, has been set to specify the install directory of STARPU") endif() endif() # STARPU may depend on other packages (HWLOC, MPI, CUDA, BLAS, MAGMA, FXT, ...) # try to find them if specified as COMPONENTS during the call set(STARPU_LOOK_FOR_HWLOC FALSE) set(STARPU_LOOK_FOR_CUDA FALSE) set(STARPU_LOOK_FOR_MPI FALSE) set(STARPU_LOOK_FOR_BLAS FALSE) set(STARPU_LOOK_FOR_MAGMA FALSE) set(STARPU_LOOK_FOR_FXT FALSE) set(STARPU_LOOK_FOR_SIMGRID FALSE) if( STARPU_FIND_COMPONENTS ) foreach( component ${STARPU_FIND_COMPONENTS} ) if(${component} STREQUAL "HWLOC") set(STARPU_LOOK_FOR_HWLOC TRUE) elseif(${component} STREQUAL "CUDA") set(STARPU_LOOK_FOR_CUDA TRUE) elseif(${component} STREQUAL "MPI") set(STARPU_LOOK_FOR_MPI TRUE) elseif(${component} STREQUAL "BLAS") set(STARPU_LOOK_FOR_BLAS TRUE) elseif(${component} STREQUAL "MAGMA") set(STARPU_LOOK_FOR_MAGMA TRUE) elseif(${component} STREQUAL "FXT") set(STARPU_LOOK_FOR_FXT TRUE) elseif(${component} STREQUAL "SIMGRID") set(STARPU_LOOK_FOR_SIMGRID TRUE) endif() endforeach() endif() # STARPU may depend on pthread, try to find it find_package(Threads) if( THREADS_FOUND ) libraries_absolute_path(CMAKE_THREAD_LIBS_INIT "") list(APPEND STARPU_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) endif () # STARPU may depend on libm, try to find it find_library(M_m_LIBRARY NAMES m) mark_as_advanced(M_m_LIBRARY) if( M_m_LIBRARY ) list(APPEND STARPU_EXTRA_LIBRARIES ${M_m_LIBRARY}) endif () # STARPU may depend on librt, try to find it find_library(RT_rt_LIBRARY NAMES m) mark_as_advanced(RT_rt_LIBRARY) if( RT_rt_LIBRARY ) list(APPEND STARPU_EXTRA_LIBRARIES ${RT_rt_LIBRARY}) endif () # STARPU may depend on HWLOC, try to find it if (STARPU_LOOK_FOR_HWLOC) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_HWLOC) find_package(HWLOC REQUIRED) else() find_package(HWLOC) endif() endif() # STARPU may depend on CUDA, try to find it if (STARPU_LOOK_FOR_CUDA) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_CUDA) find_package(CUDA REQUIRED) else() find_package(CUDA) endif() if (CUDA_FOUND) mark_as_advanced(CUDA_BUILD_CUBIN) mark_as_advanced(CUDA_BUILD_EMULATION) mark_as_advanced(CUDA_SDK_ROOT_DIR) mark_as_advanced(CUDA_TOOLKIT_ROOT_DIR) mark_as_advanced(CUDA_VERBOSE_BUILD) libraries_absolute_path(CUDA_LIBRARIES "$ENV{CUDA_ROOT}/lib64") endif() endif() # STARPU may depend on MPI, try to find it if (STARPU_LOOK_FOR_MPI) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_MPI) find_package(MPI REQUIRED) else() find_package(MPI) endif() if (MPI_FOUND) mark_as_advanced(MPI_LIBRARY) mark_as_advanced(MPI_EXTRA_LIBRARY) endif() endif() # STARPU may depend on BLAS, try to find it if (STARPU_LOOK_FOR_BLAS) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_BLAS) find_package(BLAS REQUIRED) else() find_package(BLAS) endif() endif() # STARPU may depend on MAGMA, try to find it if (STARPU_LOOK_FOR_MAGMA) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_MAGMA) find_package(MAGMA REQUIRED) else() find_package(MAGMA) endif() endif() # STARPU may depend on FXT, try to find it if (STARPU_LOOK_FOR_FXT) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_FXT) find_package(FXT REQUIRED) else() find_package(FXT) endif() endif() # STARPU may depend on SIMGRID, try to find it if (STARPU_LOOK_FOR_SIMGRID) if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_SIMGRID) find_package(SIMGRID REQUIRED) else() find_package(SIMGRID) endif() endif() set(ENV_STARPU_DIR "$ENV{STARPU_DIR}") set(ENV_STARPU_INCDIR "$ENV{STARPU_INCDIR}") set(ENV_STARPU_LIBDIR "$ENV{STARPU_LIBDIR}") set(STARPU_GIVEN_BY_USER "FALSE") if ( STARPU_DIR OR ( STARPU_INCDIR AND STARPU_LIBDIR) OR ENV_STARPU_DIR OR (ENV_STARPU_INCDIR AND ENV_STARPU_LIBDIR) ) set(STARPU_GIVEN_BY_USER "TRUE") endif() # Optionally use pkg-config to detect include/library dirs (if pkg-config is available) # ------------------------------------------------------------------------------------- if(NOT PKG_CONFIG_FOUND) include(CMakeFindDependencyMacro) find_dependency(PkgConfig) endif() if(PKG_CONFIG_EXECUTABLE AND NOT STARPU_GIVEN_BY_USER) unset(STARPU_FOUND CACHE) set (STARPU_VERSION_LIST "1.3;1.2;1.1;1.0") foreach(_version ${STARPU_VERSION_LIST}) if(STARPU_LOOK_FOR_MPI) pkg_search_module(STARPU starpumpi-${_version}) else() pkg_search_module(STARPU starpu-${_version}) endif() if (STARPU_FOUND) set(STARPU_VERSION "${_version}" CACHE INTERNAL "StarPU version found") break() endif() endforeach() if (NOT STARPU_FIND_QUIETLY) if (STARPU_FOUND AND STARPU_LIBRARIES) message(STATUS "Looking for STARPU - found using PkgConfig") set(STARPU_VERSION_STRING "${STARPU_VERSION}") string(REPLACE "." ";" STARPU_VERSION_STRING_LIST ${STARPU_VERSION_STRING}) list(GET STARPU_VERSION_STRING_LIST 0 STARPU_VERSION_MAJOR) list(GET STARPU_VERSION_STRING_LIST 1 STARPU_VERSION_MINOR) else() message(STATUS "${Magenta}Looking for STARPU - not found using PkgConfig." "\n Perhaps you should add the directory containing libstarpu.pc" "\n to the PKG_CONFIG_PATH environment variable.${ColourReset}") endif() # check if the version found respects the minimum required if (STARPU_FIND_VERSION_EXACT) if( NOT (STARPU_FIND_VERSION_MAJOR STREQUAL STARPU_VERSION_MAJOR) OR NOT (STARPU_FIND_VERSION_MINOR STREQUAL STARPU_VERSION_MINOR) ) if(NOT STARPU_FIND_QUIETLY) message(WARNING "STARPU version found is ${STARPU_VERSION}" " when required is ${STARPU_FIND_VERSION}") endif() endif() else() # if the version found is older than the required then error if( (STARPU_FIND_VERSION_MAJOR STRGREATER STARPU_VERSION_MAJOR) OR (STARPU_FIND_VERSION_MINOR STRGREATER STARPU_VERSION_MINOR) ) if(NOT STARPU_FIND_QUIETLY) message(WARNING "STARPU version found is ${STARPU_VERSION}" " when required is ${STARPU_FIND_VERSION} or newer") endif() endif() endif() if (STARPU_FOUND AND STARPU_LIBRARIES) set(STARPU_FOUND_WITH_PKGCONFIG "TRUE") find_pkgconfig_libraries_absolute_path(STARPU) else() set(STARPU_FOUND_WITH_PKGCONFIG "FALSE") endif() endif() if(STARPU_LOOK_FOR_MPI AND STARPU_LOOK_FOR_SIMGRID AND STARPU_FOUND) # Cmake does not fetch explicit libfxt.a static paths from pkg-config... find_package(FXT) string(REGEX MATCH "[^;]*/libfxt.a" FXT_STATIC_LIB "${STARPU_MPI_LDFLAGS_OTHER}") list(APPEND STARPU_LIBRARIES "${FXT_STATIC_LIB}") list(APPEND STARPU_STATIC_LIBRARIES "${FXT_STATIC_LIB}") endif() endif(PKG_CONFIG_EXECUTABLE AND NOT STARPU_GIVEN_BY_USER) if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND) OR (STARPU_GIVEN_BY_USER) ) # Looking for include # ------------------- # Add system include paths to search include # ------------------------------------------ unset(_inc_env) set(ENV_STARPU_DIR "$ENV{STARPU_DIR}") set(ENV_STARPU_INCDIR "$ENV{STARPU_INCDIR}") if(ENV_STARPU_INCDIR) list(APPEND _inc_env "${ENV_STARPU_INCDIR}") elseif(ENV_STARPU_DIR) list(APPEND _inc_env "${ENV_STARPU_DIR}") list(APPEND _inc_env "${ENV_STARPU_DIR}/include") list(APPEND _inc_env "${ENV_STARPU_DIR}/include/starpu/1.0") list(APPEND _inc_env "${ENV_STARPU_DIR}/include/starpu/1.1") list(APPEND _inc_env "${ENV_STARPU_DIR}/include/starpu/1.2") list(APPEND _inc_env "${ENV_STARPU_DIR}/include/starpu/1.3") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") else() string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}") list(APPEND _inc_env "${_path_env}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") list(APPEND _inc_env "${_path_env}") endif() endif() list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") list(REMOVE_DUPLICATES _inc_env) # Try to find the version of StarPU in starpu_config.h file set(STARPU_hdrs_to_find "starpu_config.h") # call cmake macro to find the header path if(STARPU_INCDIR) foreach(starpu_hdr ${STARPU_hdrs_to_find}) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${STARPU_INCDIR}) endforeach() else() if(STARPU_DIR) foreach(starpu_hdr ${STARPU_hdrs_to_find}) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${STARPU_DIR} PATH_SUFFIXES "include" "include/starpu/1.0" "include/starpu/1.1" "include/starpu/1.2" "include/starpu/1.3") endforeach() else() foreach(starpu_hdr ${STARPU_hdrs_to_find}) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${_inc_env} PATH_SUFFIXES "starpu/1.0" "starpu/1.1" "starpu/1.2" "starpu/1.3") endforeach() endif() endif() mark_as_advanced(STARPU_starpu_config.h_INCLUDE_DIRS) ### # # GET_VERSION: Get the version of the software by parsing a file # ### MACRO(GET_VERSION _PACKAGE _filepath) #message(STATUS "Looking for ${_PACKAGE} version in the file ${_filepath}") file(READ "${_filepath}" _file) string(REGEX REPLACE "(.*)define([ \t]*)${_PACKAGE}_MAJOR_VERSION([ \t]*)([0-9]+)(.*)" "\\4" ${_PACKAGE}_VERSION_MAJOR "${_file}") string(REGEX REPLACE "(.*)define([ \t]*)${_PACKAGE}_MINOR_VERSION([ \t]*)([0-9]+)(.*)" "\\4" ${_PACKAGE}_VERSION_MINOR "${_file}") set(${_PACKAGE}_VERSION "${${_PACKAGE}_VERSION_MAJOR}.${${_PACKAGE}_VERSION_MINOR}" CACHE INTERNAL "StarPU version found") #message(STATUS "${_PACKAGE}_VERSION_MAJOR = -${${_PACKAGE}_VERSION_MAJOR}-") #message(STATUS "${_PACKAGE}_VERSION_MINOR = -${${_PACKAGE}_VERSION_MINOR}-") ENDMACRO(GET_VERSION) # Find the version of StarPU in starpu_config.h file # remark: the version is defined in this file since the STARPU 1.0 version if (STARPU_starpu_config.h_INCLUDE_DIRS) GET_VERSION("STARPU" "${STARPU_starpu_config.h_INCLUDE_DIRS}/starpu_config.h") if (STARPU_VERSION_MAJOR AND STARPU_VERSION_MINOR) if (STARPU_FIND_VERSION_EXACT) if (STARPU_FIND_VERSION_MAJOR AND STARPU_FIND_VERSION_MINOR) if( NOT (STARPU_FIND_VERSION_MAJOR STREQUAL STARPU_VERSION_MAJOR) OR NOT (STARPU_FIND_VERSION_MINOR STREQUAL STARPU_VERSION_MINOR) ) if(NOT STARPU_FIND_QUIETLY) message(WARNING "STARPU version found is ${STARPU_VERSION} " "when required is ${STARPU_FIND_VERSION}") endif() endif() endif() else() if (STARPU_FIND_VERSION_MAJOR AND STARPU_FIND_VERSION_MINOR) # if the version found is older than the required then error if( (STARPU_FIND_VERSION_MAJOR STRGREATER STARPU_VERSION_MAJOR) OR (STARPU_FIND_VERSION_MINOR STRGREATER STARPU_VERSION_MINOR) ) if(NOT STARPU_FIND_QUIETLY) message(WARNING "STARPU version found is ${STARPU_VERSION} " "when required is ${STARPU_FIND_VERSION} or newer") endif() endif() endif() endif() else() if(STARPU_FIND_REQUIRED) message(FATAL_ERROR "STARPU version has not been found using starpu_config.h" " located in ${STARPU_starpu_config.h_INCLUDE_DIRS}") endif() endif() else() if(STARPU_FIND_REQUIRED) message(FATAL_ERROR "starpu_config.h has not been found while required to get StarPU version") endif() endif() # Try to find the starpu headers in the given paths # ------------------------------------------------- # create list of headers to find list(APPEND STARPU_hdrs_to_find "starpu.h;starpu_profiling.h") if(STARPU_LOOK_FOR_MPI) list(APPEND STARPU_hdrs_to_find "starpu_mpi.h") endif() if(STARPU_LOOK_FOR_CUDA) list(APPEND STARPU_hdrs_to_find "starpu_cuda.h;starpu_scheduler.h") endif() # call cmake macro to find the header path if(STARPU_INCDIR) foreach(starpu_hdr ${STARPU_hdrs_to_find}) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${STARPU_INCDIR}) endforeach() else() if(STARPU_DIR) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") foreach(starpu_hdr ${STARPU_hdrs_to_find}) find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${STARPU_DIR} PATH_SUFFIXES "include" "include/starpu/1.0" "include/starpu/1.1" "include/starpu/1.2" "include/starpu/1.3") endforeach() else() foreach(starpu_hdr ${STARPU_hdrs_to_find}) set(STARPU_${starpu_hdr}_INCLUDE_DIRS "STARPU_${starpu_hdr}_INCLUDE_DIRS-NOTFOUND") find_path(STARPU_${starpu_hdr}_INCLUDE_DIRS NAMES ${starpu_hdr} HINTS ${_inc_env} PATH_SUFFIXES "starpu/1.0" "starpu/1.1" "starpu/1.2" "starpu/1.3") endforeach() endif() endif() # If found, add path to cmake variable # ------------------------------------ set(STARPU_INCLUDE_DIRS "") foreach(starpu_hdr ${STARPU_hdrs_to_find}) if (STARPU_${starpu_hdr}_INCLUDE_DIRS) # set cmake variables using the pkg-config naming convention list(APPEND STARPU_INCLUDE_DIRS "${STARPU_${starpu_hdr}_INCLUDE_DIRS}" ) else () if(NOT STARPU_FIND_QUIETLY) message(STATUS "Looking for starpu -- ${starpu_hdr} not found") endif() if(starpu_hdr STREQUAL "starpu_mpi.h") if(NOT STARPU_FIND_REQUIRED_MPI) if (NOT STARPU_FIND_QUIETLY) message(STATUS "Looking for starpu -- ${starpu_hdr} not required") endif() else() list(APPEND STARPU_INCLUDE_DIRS "${STARPU_${starpu_hdr}_INCLUDE_DIRS}" ) endif() elseif( (starpu_hdr STREQUAL "starpu_cuda.h") OR (starpu_hdr STREQUAL "starpu_scheduler.h") ) if(NOT STARPU_FIND_REQUIRED_CUDA) if (NOT STARPU_FIND_QUIETLY) message(STATUS "Looking for starpu -- ${starpu_hdr} not required") endif() else() list(APPEND STARPU_INCLUDE_DIRS "${STARPU_${starpu_hdr}_INCLUDE_DIRS}" ) endif() endif() endif () mark_as_advanced(STARPU_${starpu_hdr}_INCLUDE_DIRS) endforeach(starpu_hdr ${STARPU_hdrs_to_find}) if (STARPU_INCLUDE_DIRS) list(REMOVE_DUPLICATES STARPU_INCLUDE_DIRS) endif () if (STARPU_starpu_config.h_INCLUDE_DIRS) # Looking for lib # --------------- set(STARPU_LIBRARIES "") set(STARPU_LIBRARY_DIRS "") # Add system library paths to search lib # -------------------------------------- unset(_lib_env) set(ENV_STARPU_LIBDIR "$ENV{STARPU_LIBDIR}") if(ENV_STARPU_LIBDIR) list(APPEND _lib_env "${ENV_STARPU_LIBDIR}") elseif(ENV_STARPU_DIR) list(APPEND _lib_env "${ENV_STARPU_DIR}") list(APPEND _lib_env "${ENV_STARPU_DIR}/lib") else() list(APPEND _lib_env "$ENV{LIBRARY_PATH}") if(WIN32) string(REPLACE ":" ";" _lib_env2 "$ENV{LIB}") elseif(APPLE) string(REPLACE ":" ";" _lib_env2 "$ENV{DYLD_LIBRARY_PATH}") else() string(REPLACE ":" ";" _lib_env2 "$ENV{LD_LIBRARY_PATH}") endif() list(APPEND _lib_env "${_lib_env2}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") endif() list(REMOVE_DUPLICATES _lib_env) # Try to find the starpu libs in the given paths # ---------------------------------------------- # create list of libs to find set(STARPU_libs_to_find "starpu-${STARPU_VERSION}") if (STARPU_LOOK_FOR_MPI) list(INSERT STARPU_libs_to_find 0 "starpumpi-${STARPU_VERSION}") endif() # call cmake macro to find the lib path if(STARPU_LIBDIR) foreach(starpu_lib ${STARPU_libs_to_find}) set(STARPU_${starpu_lib}_LIBRARY "STARPU_${starpu_lib}_LIBRARY-NOTFOUND") find_library(STARPU_${starpu_lib}_LIBRARY NAMES ${starpu_lib} HINTS ${STARPU_LIBDIR}) endforeach() else() if(STARPU_DIR) foreach(starpu_lib ${STARPU_libs_to_find}) set(STARPU_${starpu_lib}_LIBRARY "STARPU_${starpu_lib}_LIBRARY-NOTFOUND") find_library(STARPU_${starpu_lib}_LIBRARY NAMES ${starpu_lib} HINTS ${STARPU_DIR} PATH_SUFFIXES lib lib32 lib64) endforeach() else() foreach(starpu_lib ${STARPU_libs_to_find}) set(STARPU_${starpu_lib}_LIBRARY "STARPU_${starpu_lib}_LIBRARY-NOTFOUND") find_library(STARPU_${starpu_lib}_LIBRARY NAMES ${starpu_lib} HINTS ${_lib_env}) endforeach() endif() endif() # If found, add path to cmake variable # ------------------------------------ foreach(starpu_lib ${STARPU_libs_to_find}) if (STARPU_${starpu_lib}_LIBRARY) get_filename_component(${starpu_lib}_lib_path ${STARPU_${starpu_lib}_LIBRARY} PATH) # set cmake variables (respects naming convention) list(APPEND STARPU_LIBRARIES "${STARPU_${starpu_lib}_LIBRARY}") list(APPEND STARPU_LIBRARY_DIRS "${${starpu_lib}_lib_path}") else (STARPU_${starpu_lib}_LIBRARY) list(APPEND STARPU_LIBRARIES "${STARPU_${starpu_lib}_LIBRARY}") if(NOT STARPU_FIND_QUIETLY) message(STATUS "Looking for starpu -- lib ${starpu_lib} not found") endif() endif (STARPU_${starpu_lib}_LIBRARY) mark_as_advanced(STARPU_${starpu_lib}_LIBRARY) endforeach(starpu_lib ${STARPU_libs_to_find}) list(REMOVE_DUPLICATES STARPU_LIBRARIES) if (STARPU_LIBRARY_DIRS) list(REMOVE_DUPLICATES STARPU_LIBRARY_DIRS) endif () if (STARPU_LIBRARIES AND STARPU_LIBRARY_DIRS AND STARPU_INCLUDE_DIRS) set(STARPU_FOUND TRUE) endif() else(STARPU_starpu_config.h_INCLUDE_DIRS) if(NOT STARPU_FIND_QUIETLY) message(STATUS "The version of StarPU is not known so that we do not search libraries") endif() endif(STARPU_starpu_config.h_INCLUDE_DIRS) foreach(_lib ${STARPU_LIBRARIES}) if (NOT _lib) set(STARPU_LIBRARIES "STARPU_LIBRARIES-NOTFOUND") endif() endforeach() endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND) OR (STARPU_GIVEN_BY_USER) ) # check a function to validate the find if(STARPU_LIBRARIES) set(REQUIRED_FLAGS) set(REQUIRED_LDFLAGS) set(REQUIRED_INCDIRS) set(REQUIRED_LIBDIRS) set(REQUIRED_LIBS) # STARPU if (STARPU_INCLUDE_DIRS) set(REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS}") endif() if (STARPU_CFLAGS_OTHER) set(REQUIRED_FLAGS "${STARPU_CFLAGS_OTHER}") endif() if (STARPU_LDFLAGS_OTHER) set(REQUIRED_LDFLAGS "${STARPU_LDFLAGS_OTHER}") endif() foreach(libdir ${STARPU_LIBRARY_DIRS}) if (libdir) list(APPEND REQUIRED_LIBDIRS "${libdir}") endif() endforeach() set(REQUIRED_LIBS "${STARPU_LIBRARIES}") # HWLOC if (HWLOC_FOUND AND STARPU_LOOK_FOR_HWLOC) if (HWLOC_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${HWLOC_INCLUDE_DIRS}") endif() if (HWLOC_CFLAGS_OTHER) list(APPEND REQUIRED_FLAGS "${HWLOC_CFLAGS_OTHER}") endif() if (HWLOC_LDFLAGS_OTHER) list(APPEND REQUIRED_LDFLAGS "${HWLOC_LDFLAGS_OTHER}") endif() if (HWLOC_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${HWLOC_LIBRARY_DIRS}") endif() list(APPEND REQUIRED_LIBS "${HWLOC_LIBRARIES}") endif() # MPI if (MPI_FOUND AND STARPU_LOOK_FOR_MPI) if (MPI_C_INCLUDE_PATH) list(APPEND REQUIRED_INCDIRS "${MPI_C_INCLUDE_PATH}") endif() if (MPI_C_LINK_FLAGS) if (${MPI_C_LINK_FLAGS} MATCHES " -") string(REGEX REPLACE " -" "-" MPI_C_LINK_FLAGS ${MPI_C_LINK_FLAGS}) endif() list(APPEND REQUIRED_LDFLAGS "${MPI_C_LINK_FLAGS}") endif() list(APPEND REQUIRED_LIBS "${MPI_C_LIBRARIES}") endif() # MAGMA if (MAGMA_FOUND AND STARPU_LOOK_FOR_MAGMA) if (MAGMA_INCLUDE_DIRS_DEP) list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS_DEP}") elseif(MAGMA_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS}") endif() if (MAGMA_LIBRARY_DIRS_DEP) list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS_DEP}") elseif(MAGMA_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS}") endif() if (MAGMA_LIBRARIES_DEP) list(APPEND REQUIRED_LIBS "${MAGMA_LIBRARIES_DEP}") elseif(MAGMA_LIBRARIES) foreach(lib ${MAGMA_LIBRARIES}) if (EXISTS ${lib} OR ${lib} MATCHES "^-") list(APPEND REQUIRED_LIBS "${lib}") else() list(APPEND REQUIRED_LIBS "-l${lib}") endif() endforeach() endif() if (MAGMA_LINKER_FLAGS) list(APPEND REQUIRED_LDFLAGS "${MAGMA_LINKER_FLAGS}") endif() endif() # CUDA if (CUDA_FOUND AND STARPU_LOOK_FOR_CUDA) if (CUDA_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${CUDA_INCLUDE_DIRS}") endif() if (CUDA_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${CUDA_LIBRARY_DIRS}") endif() list(APPEND REQUIRED_LIBS "${CUDA_CUBLAS_LIBRARIES};${CUDA_LIBRARIES}") endif() # FXT if (FXT_FOUND AND STARPU_LOOK_FOR_FXT) if (FXT_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${FXT_INCLUDE_DIRS}") endif() if (FXT_CFLAGS_OTHER) list(APPEND REQUIRED_FLAGS "${FXT_CFLAGS_OTHER}") endif() if (FXT_LDFLAGS_OTHER) list(APPEND REQUIRED_LDFLAGS "${FXT_LDFLAGS_OTHER}") endif() if (FXT_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${FXT_LIBRARY_DIRS}") endif() list(APPEND REQUIRED_LIBS "${FXT_LIBRARIES}") endif() # SIMGRID if (SIMGRID_FOUND AND STARPU_LOOK_FOR_SIMGRID) if (SIMGRID_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${SIMGRID_INCLUDE_DIRS}") endif() if (SIMGRID_CFLAGS_OTHER) list(APPEND REQUIRED_FLAGS "${SIMGRID_CFLAGS_OTHER}") endif() if (SIMGRID_LDFLAGS_OTHER) list(APPEND REQUIRED_LDFLAGS "${SIMGRID_LDFLAGS_OTHER}") endif() if (SIMGRID_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${SIMGRID_LIBRARY_DIRS}") endif() list(APPEND REQUIRED_LIBS "${SIMGRID_LIBRARIES}") endif() # BLAS if (BLAS_FOUND AND STARPU_LOOK_FOR_BLAS) if (BLAS_INCLUDE_DIRS) list(APPEND REQUIRED_INCDIRS "${BLAS_INCLUDE_DIRS}") endif() if (BLAS_CFLAGS_OTHER) list(APPEND REQUIRED_FLAGS "${BLAS_CFLAGS_OTHER}") endif() if (BLAS_LDFLAGS_OTHER) list(APPEND REQUIRED_LDFLAGS "${BLAS_LDFLAGS_OTHER}") endif() if (BLAS_LIBRARY_DIRS) list(APPEND REQUIRED_LIBDIRS "${BLAS_LIBRARY_DIRS}") endif() list(APPEND REQUIRED_LIBS "${BLAS_LIBRARIES}") endif() # EXTRA LIBS such that pthread, m, rt list(APPEND REQUIRED_LIBS ${STARPU_EXTRA_LIBRARIES}) # set required libraries for link set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}") if (REQUIRED_FLAGS) set(REQUIRED_FLAGS_COPY "${REQUIRED_FLAGS}") set(REQUIRED_FLAGS) set(REQUIRED_DEFINITIONS) foreach(_flag ${REQUIRED_FLAGS_COPY}) if (_flag MATCHES "^-D") list(APPEND REQUIRED_DEFINITIONS "${_flag}") endif() string(REGEX REPLACE "^-D.*" "" _flag "${_flag}") list(APPEND REQUIRED_FLAGS "${_flag}") endforeach() endif() finds_remove_duplicates() set(CMAKE_REQUIRED_DEFINITIONS "${REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}") set(CMAKE_REQUIRED_LIBRARIES) list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}") string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") # test link unset(STARPU_WORKS CACHE) include(CheckFunctionExists) check_function_exists(starpu_init STARPU_WORKS) mark_as_advanced(STARPU_WORKS) if(STARPU_WORKS) # save link with dependencies set(STARPU_LIBRARIES_DEP "${REQUIRED_LIBS}") set(STARPU_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}") set(STARPU_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}") set(STARPU_CFLAGS_OTHER_DEP "${REQUIRED_FLAGS}") set(STARPU_LDFLAGS_OTHER_DEP "${REQUIRED_LDFLAGS}") else() if(NOT STARPU_FIND_QUIETLY) message(STATUS "Looking for starpu : test of starpu_init fails") message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}") message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}") message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails") message(STATUS "Maybe STARPU is linked with specific libraries. " "Have you tried with COMPONENTS (HWLOC, CUDA, MPI, BLAS, MAGMA, FXT, SIMGRID)? " "See the explanation in FindSTARPU.cmake.") endif() endif() set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_LIBRARIES) endif(STARPU_LIBRARIES) if (STARPU_LIBRARIES) if (STARPU_LIBRARY_DIRS) foreach(dir ${STARPU_LIBRARY_DIRS}) if ("${dir}" MATCHES "starpu") set(first_lib_path "${dir}") endif() endforeach() else() list(GET STARPU_LIBRARIES 0 first_lib) get_filename_component(first_lib_path "${first_lib}" PATH) set(STARPU_LIBRARY_DIRS "${first_lib_path}") endif() if (${first_lib_path} MATCHES "/lib(32|64)?$") string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}") set(STARPU_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of STARPU library" FORCE) else() set(STARPU_DIR_FOUND "${first_lib_path}" CACHE PATH "Installation directory of STARPU library" FORCE) endif() endif() mark_as_advanced(STARPU_DIR) mark_as_advanced(STARPU_DIR_FOUND) # check that STARPU has been found # -------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(STARPU DEFAULT_MSG STARPU_LIBRARIES STARPU_WORKS) eztrace-2.1/cmake_modules/LibrariesAbsolutePath.cmake000066400000000000000000000042741447213526500230730ustar00rootroot00000000000000### # # @copyright (c) 2018 Inria. All rights reserved. # ### # # @file LibrariesAbsolutePath.cmake # # @project MORSE # MORSE is a software package provided by: # Inria Bordeaux - Sud-Ouest, # Univ. of Tennessee, # King Abdullah Univesity of Science and Technology # Univ. of California Berkeley, # Univ. of Colorado Denver. # # @version 1.0.0 # @author Florent Pruvost # @date 13-04-2018 # ### # Transform relative path into absolute path for libraries # lib_list (input/output): the name of the CMake variable containing libraries, e.g. BLAS_LIBRARIES # hints_paths (input): additional paths to add when looking for libraries macro(LIBRARIES_ABSOLUTE_PATH lib_list hints_paths) # collect environment paths to dig list(APPEND _lib_env "$ENV{LIBRARY_PATH}") if(WIN32) string(REPLACE ":" ";" _lib_env2 "$ENV{LIB}") elseif(APPLE) string(REPLACE ":" ";" _lib_env2 "$ENV{DYLD_LIBRARY_PATH}") else() string(REPLACE ":" ";" _lib_env2 "$ENV{LD_LIBRARY_PATH}") endif() list(APPEND _lib_env "${_lib_env2}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") # copy the lib list set (${lib_list}_COPY "${${lib_list}}") # reset the lib list to populate set(${lib_list} "") foreach(_library ${${lib_list}_COPY}) if(EXISTS "${_library}") # if already an absolute path, nothing special to do list(APPEND ${lib_list} ${_library}) else() # replace pattern -lfoo -> foo string(REGEX REPLACE "^-l" "" _library "${_library}") # remove extensions if exist get_filename_component(_ext "${_library}" EXT) set(_lib_extensions ".so" ".a" ".dyld" ".dll") list(FIND _lib_extensions "${_ext}" _index) if (${_index} GREATER -1) get_filename_component(_library "${_library}" NAME_WE) endif() # try to find the lib find_library(_library_path NAMES ${_library} HINTS ${hints_paths} ${_lib_env}) if (_library_path) list(APPEND ${lib_list} ${_library_path}) else() message(FATAL_ERROR "Dependency of ${lib_list} '${_library}' NOT FOUND") endif() unset(_library_path CACHE) endif() endforeach() endmacro() ## ## @end file LibrariesAbsolutePath.cmake ## eztrace-2.1/cmake_modules/PrintFindStatus.cmake000066400000000000000000000200411447213526500217320ustar00rootroot00000000000000### # # @copyright (c) 2009-2014 The University of Tennessee and The University # of Tennessee Research Foundation. # All rights reserved. # @copyright (c) 2012-2014 Inria. All rights reserved. # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved. # ### # # - Some macros to print status when search for headers and libs # Main parameters of macros # _libname: name of the lib you seek, foo for example # _header_to_find: name of the header you seek, foo.h for example # _lib_to_find: name of the library you seek, libfoo for example # _pc_to_find: name of the pkg-config file zyou seek, foo.pc for example #============================================================================= # Copyright 2012-2013 Inria # Copyright 2012-2013 Emmanuel Agullo # Copyright 2012-2013 Mathieu Faverge # Copyright 2012 Cedric Castagnede # Copyright 2013 Florent Pruvost # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file MORSE-Copyright.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= # (To distribute this file outside of Morse, substitute the full # License text for the above reference.) # Set some colors #if(NOT WIN32) # string(ASCII 27 Esc) # set(ColourReset "${Esc}[m") # set(ColourBold "${Esc}[1m") # set(Red "${Esc}[31m") # set(Green "${Esc}[32m") # set(Yellow "${Esc}[33m") # set(Blue "${Esc}[34m") # set(Magenta "${Esc}[35m") # set(Cyan "${Esc}[36m") # set(White "${Esc}[37m") # set(BoldRed "${Esc}[1;31m") # set(BoldGreen "${Esc}[1;32m") # set(BoldYellow "${Esc}[1;33m") # set(BoldBlue "${Esc}[1;34m") # set(BoldMagenta "${Esc}[1;35m") # set(BoldCyan "${Esc}[1;36m") # set(BoldWhite "${Esc}[1;37m") #endif() # This macro informs why the _header_to_find file has not been found macro(Print_Find_Header_Status _libname _header_to_find) # save _libname upper and lower case string(TOUPPER ${_libname} LIBNAME) string(TOLOWER ${_libname} libname) # print status #message(" ") if(${LIBNAME}_INCDIR) message("${Blue}${LIBNAME}_INCDIR is defined but ${_header_to_find}" "has not been found in ${${LIBNAME}_INCDIR}${ColourReset}") else() if(${LIBNAME}_DIR) message("${Blue}${LIBNAME}_DIR is defined but" "${_header_to_find} has not been found in" "${${LIBNAME}_DIR}/include${ColourReset}") else() message("${Blue}${_header_to_find} not found." "Nor ${LIBNAME}_DIR neither ${LIBNAME}_INCDIR" "are defined so that we looked for ${_header_to_find} in" "system paths (INCLUDE, CPATH, C_INCLUDE_PATH," "INCLUDE_PATH, CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)${ColourReset}") if(_inc_env) message("${Blue}${_header_to_find} has not been found in" "${_inc_env}${ColourReset}") endif() endif() endif() message("${BoldBlue}Please indicate where to find ${_header_to_find}. You have three options:\n" "- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n" "- Option 2: Provide the directory where to find the headers with cmake option: -D${LIBNAME}_INCDIR=your/path/to/${libname}/include/\n" "- Option 3: Update your environment variable (INCLUDE or CPATH)\n" "- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}") #message(" ") endmacro() # This macro informs why the _lib_to_find file has not been found macro(Print_Find_Library_Status _libname _lib_to_find) # save _libname upper/lower case string(TOUPPER ${_libname} LIBNAME) string(TOLOWER ${_libname} libname) # print status #message(" ") if(${LIBNAME}_LIBDIR) message("${Yellow}${LIBNAME}_LIBDIR is defined but ${_lib_to_find}" "has not been found in ${${LIBNAME}_LIBDIR}${ColourReset}") else() if(${LIBNAME}_DIR) message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}" "has not been found in ${${LIBNAME}_DIR}/lib(or /lib32 or" "/lib64)${ColourReset}") else() message("${Yellow}${_lib_to_find} not found." "Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR" "are defined so that we looked for ${_lib_to_find} in" "system paths (Linux: LD_LIBRARY_PATH, Windows: LIB," "Mac: DYLD_LIBRARY_PATH," "CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}") if(_lib_env) message("${Yellow}${_lib_to_find} has not been found in" "${_lib_env}${ColourReset}") endif() endif() endif() message("${BoldYellow}Please indicate where to find ${_lib_to_find}. You have three options:\n" "- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n" "- Option 2: Provide the directory where to find the library with cmake option: -D${LIBNAME}_LIBDIR=your/path/to/${libname}/lib/\n" "- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n" "- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}") endmacro() # This macro informs why the _lib_to_find file has not been found macro(Print_Find_Library_Blas_Status _libname _lib_to_find) # save _libname upper/lower case string(TOUPPER ${_libname} LIBNAME) string(TOLOWER ${_libname} libname) # print status #message(" ") if(${LIBNAME}_LIBDIR) message("${Yellow}${LIBNAME}_LIBDIR is defined but ${_lib_to_find}" "has not been found in ${ARGN}${ColourReset}") else() if(${LIBNAME}_DIR) message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}" "has not been found in ${ARGN}${ColourReset}") else() message("${Yellow}${_lib_to_find} not found." "Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR" "are defined so that we look for ${_lib_to_find} in" "system paths (Linux: LD_LIBRARY_PATH, Windows: LIB," "Mac: DYLD_LIBRARY_PATH," "CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}") if(_lib_env) message("${Yellow}${_lib_to_find} has not been found in" "${_lib_env}${ColourReset}") endif() endif() endif() message("${BoldYellow}Please indicate where to find ${_lib_to_find}. You have three options:\n" "- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n" "- Option 2: Provide the directory where to find the library with cmake option: -D${LIBNAME}_LIBDIR=your/path/to/${libname}/lib/\n" "- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n" "- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}") endmacro() # This macro informs why the _lib_to_find file has not been found macro(Print_Find_Library_Blas_CheckFunc_Status _name) # save _libname upper/lower case string(TOUPPER ${_name} FUNCNAME) string(TOLOWER ${_name} funcname) # print status #message(" ") message("${Red}Libs have been found but check of symbol ${_name} failed " "with following libraries ${ARGN}${ColourReset}") message("${BoldRed}Please open your error file CMakeFiles/CMakeError.log" "to figure out why it fails${ColourReset}") #message(" ") endmacro() # This macro informs that _pc_to_find file has not been found in the list # path you give as last argument (read in ${ARGN}) # ex: Print_Find_Pkgconfig_Status(foo foo.pc ${PATHLIST} macro(Print_Find_Pkgconfig_Status _libname _pc_to_find) # save _libname lower case string(TOLOWER ${_libname} libname) # print status #message(" ") message("${Magenta}${_pc_to_find} has not been found in" "${ARGN}${ColourReset}") message("${BoldMagenta}If you really want to use the pkg-config file of" "${libname}, please update your PKG_CONFIG_PATH with the path" "where ${_pc_to_find} states${ColourReset}") #message(" ") endmacro() eztrace-2.1/cmake_modules/PrintOpts.cmake000066400000000000000000000022101447213526500205710ustar00rootroot00000000000000set(dep_message "\nConfiguration of EZtrace:\n" " General:\n" " Install directory : ${CMAKE_INSTALL_PREFIX}\n" " Compiler: C : ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})\n" " Compiler: Fortran : ${CMAKE_Fortran_COMPILER} (${CMAKE_Fortran_COMPILER_ID})\n" " BFD Path : ${BFD_LIBRARY}\n" "\n" " Operating system : ${CMAKE_SYSTEM_NAME}\n") set(dep_message "${dep_message}\n enable binary instrumentation : ") if (ENABLE_BIN_INSTRUMENTATION) set(dep_message "${dep_message}" "Yes\n") else() set(dep_message "${dep_message}" "No\n") endif() set(dep_message "${dep_message}\n" " Enabled modules:\n" " MPI module : ${EZTRACE_ENABLE_MPI}\n" " CUDA module : ${EZTRACE_ENABLE_CUDA}\n" # " StarPU module : ${EZTRACE_ENABLE_STARPU}\n" " OpenMP module : ${EZTRACE_ENABLE_OPENMP}\n" " OMPT module : ${EZTRACE_ENABLE_OMPT}\n" # " PAPI module : ${EZTRACE_ENABLE_PAPI}\n" " POSIXIO module : ${EZTRACE_ENABLE_POSIXIO}\n" " Pthread module : ${EZTRACE_ENABLE_PTHREAD}\n" " Memory module : ${EZTRACE_ENABLE_MEMORY}\n" " IOtracer module: ${EZTRACE_ENABLE_IOTRACER}\n") message(${dep_message}) eztrace-2.1/doc/000077500000000000000000000000001447213526500135675ustar00rootroot00000000000000eztrace-2.1/doc/building.md000066400000000000000000000026721447213526500157150ustar00rootroot00000000000000# Requirements In order to run EZTrace, you need the following software: * CMake; * OTF2 (which can be downloaded here [https://www.vi-hps.org/projects/score-p](https://www.vi-hps.org/projects/score-p)) # Getting EZTrace ## Building from source * You can get the latest stable release on EZTrace website: https://eztrace.gitlab.io/eztrace * Current development version is available via GIT `git clone https://gitlab.com/eztrace/eztrace.git` ## Spack package [Spack](https://github.com/spack/spack/) ships a package for building EZTrace and its dependencies. To install EZTrace, run: ``` spack install eztrace ``` To build EZTrace with the `ompt` module (that automatically instruments OpenMP applications), you need to install `llvm`: ``` spack install eztrace %llvm@12.0.0 ``` ## Docker container [Several docker images](https://hub.docker.com/u/eztrace) contain installed version of eztrace. Some images also contain installed versions of [ViTE](https://gitlab.inria.fr/solverstack/vite/). To use one of these docker images: ``` docker run -v $PWD:/shared -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -h $HOSTNAME -v $HOME/.Xauthority:/root/.Xauthority -it eztrace/eztrace.mpich.vite:latest bash ``` # Checking EZTrace installation Once EZTrace is installed, you should have several executable including `eztrace`, `eztrace_avail`, or `eztrace.preload`. To check if everything works fine, see the [Using EZTrace](using.md) page eztrace-2.1/doc/developper_manual/000077500000000000000000000000001447213526500172715ustar00rootroot00000000000000eztrace-2.1/doc/developper_manual/Figures/000077500000000000000000000000001447213526500206755ustar00rootroot00000000000000eztrace-2.1/doc/developper_manual/Figures/instrumentation_ldpreload.png000066400000000000000000000123271447213526500267010ustar00rootroot00000000000000PNG  IHDR;L pHYsodtEXtSoftwarewww.inkscape.org<dIDATxyXWE6`@ELFtG8fLm1vb,tFΐvbL>Q3* .@ADA,qxX-RWU޺Թsνe<ޏ~,sY;ǀЮF3gz{{4Φ8l@G:^ty `84S@~;\] g石nݺfs=zt /|%oqd=ҥKĐ!ChmmVGf.^Ȉ#0 .(ij_x{.W^%## 6z8w{sޮbX}˖-|w}˗ihhkSTT<\Uhmm%''2 ضm[t˖-#++vtff&ׯ&Q[[1UrIM֑bpՎ}lrrrg„ 皛l6ַ't0%%%477%}KKKѣ6:Y[wi_Pm~)-"::Dz\|c2bd}|2F8@ZZgϞCzz:ϟw3(Fl cϟω'㏉ŋŠ+ qõkײ|r>͛5jİa BCC>,q9fΜY`+Vӓϳh"|||xW4i<6?PPD[FXt)gΜO>aX,z)>#(--eƌ|RQQAtt4鄅1{l0 TTTdYr%vRRRgΝ0j(z衎;vӧOfy֬Y,^@x BBBfҥ 6E5?rss;ދsϱef3QQQ1qDvMqq1gfʕ|8)))3 ZKBBqqqR\\LZZIII 67rYq*++IMMeܹڵ ___N9BdddGΝ;BZ[[fwgOb0HMMeΜ9\x)SO? #??M61n8n6سg;wdΜ9.;{0c IJJ"==Ʉʌ38y$yyy,[ Htt4gϞ%**Տg:YYYoRWWG~~> ]a{<Za޻w/w&,,@.kPt P__Oee%N">>___._|%KjUVOXXMMMdN:EBBW\a֭lݺK:|466v{l0SWWױUW??󵵵 #@]]_~rILLСCqܹѣG)**СC6cf-QQQdff2yd۩@ii)AAAl߾Yn|7L>m=Cnn.III̚5:n*++套^… āիWX,uVƏO||<'N &h$&& l4ĉ/'33iӦq-Jxx8_}<DF۹p󟩪g`0tKNNf`0ˋիWGhh(#Gt#rJ|dddljDYY۶m#** ooof͚E[[%%%ĐɓX,߿ .0}tFݻ$""o?Nkk+111IMM 9991uT)//g„ 455Q]]رcoՋmmmq߿;qL&>d"??ooo1L>}Pnvoalb9rC@3f Ī*bcc1 ;&!!Ouu5ƍ[o)3)Sp;FlllᬷhV.Жѣb\=]3INNn7 '} ?~DZ2vEXT`~w]@k%#.}t aqG1::n55 `p틗b_'QXX8l6[{jjj?ٱH( &''om]H'AOF'hgLC}RqN,@Mrۏ+Hc)*i@ۏ.CVFُDX-[Wc4(7u*TَRwuv2&xq[ `"X괾݈NB4g)2NWq+C( @ƺInY2bu# Og೪x .dY|/n.MҐ-'thȘ=db= :!Af"2U;t<2^uX]f#4G" qLzr/ ,A.%qk2NfގBx#B.Ο![( 1$*׺H:A[ H7|įnӐr2F(챺="Z4 biC2 2nVjF$Uc@dD '+lA`kDAb@i2K%!_"nPbQ5+UZʷVC^*@\NH/zH hx RFV]d67p'|2SsM]f|!E,Gr1L 2D{*FHq:IOV+B*遭uRBrϪNnwtc+CG\~rD}hon4r ~fvRՈ/7H bS)#[k;}>Fg0MuuDc~,6Ҫé*jĀf)eu7uw![+HQz TU01!Zz܏"t<[- !g[ X.!#w/mOYxF 6a]jv C>tU7>|r!Ĩs["\5|F\6$ }b#-Ju R+D/ќ3 cZ9ۅ B2b9bi~_sOd9΄4*"g?3ˈn3pV+ъU"tW~)b0%DV%m5HvH8% DX"^k!6t75&3j HsMXIs~|X]\n+'RK\&Me}'n-~whڸed8sFw[]?N5yYh/w=b$[Lױv<Ð9#};bp:.:vFЎ璲DFґz]C;]ȗ3@}/2}QGnZVn=mB::n.::n1| u;ƀ|KG0"ŗM|b?c]VGpW3_g]uG:r@IENDB`eztrace-2.1/doc/developper_manual/Figures/instrumentation_ldpreload.svg000066400000000000000000000266061447213526500267210ustar00rootroot00000000000000 image/svg+xml Application libfoo ... f ( ): ... ret ...call f ( )... libeztrace-foo ... f ( ) : RECORD_EVENT call f_orig ( ) RECORD_EVENT ret eztrace-2.1/doc/developper_manual/Figures/instrumentation_pptrace_arm.png000066400000000000000000002344221447213526500272320ustar00rootroot00000000000000PNG  IHDR;>y pHYsodtEXtSoftwarewww.inkscape.org< IDATxy\T?}Gq7-=neֵH{-oVo➦徛⊸08GE|<|s>3GA|"1]kDDDDDDDT)hu; ^_M """"""{Π lݺ~:z(uV """"""{]6V`jE3??ш3JtFlll ODGGBDDDDDDDD@`g~~>͛ya߾}յjq)xyyaĉF B>}ja0zhxyyܹs5""""""""Z;̞=gƿZll2xyy?=:{ElmmǏsյ{/S?==HMM-ٳƍǖ=|%y ݻuſ/X|촷GpppM7\#G&ѽgQ "F_kJ\l1a{gUVa5) X7ĉ~Y7n@ݺu1zh 2Ĥ^LL ֬Y͛cرسg֮]8xxx Tvgeeo ^xeN8M6… (**Bƍѭ[7 6̨Ghaa!<}HII;z聉'h_5 8v͛"((?"..< <<nɓ3ȑ#{x$",_ܺk4⋯u|PMേ/e/܎oB={W~' 3[trr+++$??_zܹSׯ/?6gv:99Haa˖-[nݺ@ zU v;V T//#/ߨs='_|\xQ󥨨H"##e@ڵkg|7|S ^zU}%&& v~@\\\dڵRTT$rJqtt_1;ԩ#"7nܐt ;;; v2{܈v vlٲODD劏gpŭϓDD+i8o<5-''GDHLLIC|'&Pyj! @,X`Roǎ@֭+jze;;;Kttt7EEEҡC G1ʛ?^{悝"~3zj dժU&^}U SNʦ=$DP`VajzcFF6l $^C-{x|·~[M![jѢ|||L{///$&&4^^^f`XjZh[[[4o^^^fU;mU+FEEرcKbҥe]ltitLNNW[2Խ]իWcϞ= ľ}f?k֬2UaZ~HJJ\pC ~n=f͚c9rdM7Ҟz)9rVBΝk95"<<&M%&MvrrrU*; :{lذa222LYq `mmmR`k׮AA5m~y*'N+T`@'PCOʲ/K-Vs n@DDD?.s!IJJBttt}G~񈎎F^^^M7lݺx뭷ts*;O?|Musv܉P^/Q^~~>֭[g4P;vlllGKƍ1f>}ѣGU6 0j(| zo:,--Z^~v2[ZǙ3gЦMP\pvvvիWMDDDDDDT't lٲ[BtU)عeܼyG~-;qDbٲe&NV_~ڵ+AǍbf{JjZL>͚5CǎN0"iӦÆ C=p! 2!!!V >~i'2Z`M^1cƘ l`衹m6>|>>>u0;N `رشi|}}||IK/P}FDDDRRRdcʔ)8v~' CŘ1cL&LLLDHHׯɓ'Xb_:u`Ĉ5jQ-[`7ob޼yjMرcN>O'99/իWe\p7n܀Zjqƕ9Ѣɓ'/… (,,D&MеkW 6Mdd$֬YsΡ͛7ѭ[;a˖-ס( 0f:u WƥK "{^sDv֭[q5XXXI&۷/ `Uvv6vڅPΆ' QF=9/JvׯI?ҥK(..F-0qDo߾>}!!!Wzh"dffbe%Kv~>r VZI&x'пrXh]9vXav1+=5j|||LgϞO?/~Xx1 77wơC"##G1zh#9Xz5>ԩS>>>1bkbnn.V\"99...ի&MTnNqI͛qu@۶m1h lff&~G"##۷/&L++2VAx'8уq$w>|3f)))I,--DFFSF!_:w֭dee-k׮]@/EQ$ @:u$ZVH^$''ǨÇ(=66V#}ZHN=9b?}CDT|H˖-͞Ο?+}ghB{ÇKAAQSN ر|ᇢ(hZU3F :'O6/14i:u*g}&""ׯ7J7ֽlv{駟6keeeҊe̙h2B2}t)..uCD$,,Ls; 7K׍#$44(]ˬYuYXXf̘av;gϞj{4FԩYXXm[.]$%%E-\|jBy猖WopBV~_2w7P >Yťm8ܩiӦ@[j%dŊQ='4nX.^hv]~ylܸqF׸k׮{n2v!Y~_k7nX]wƍq=m۶7oݾ~M%5*iРѼys9|NxԩSrǎmlٲ\zdمSO]# V+|IITJd6YTT$/˻%88Xm&"{N'_|<ҬY3ԩ̝;$P'r;9h ),,>Lv*͚5.]ȧ~jr/"rU Vo RSS%88̛B'AAA#ҳgO3g;wΨlZZvtY~mȐ۷KpplܸdEEEi&裏䥗^`sJppɍN˗K+V`Yp퍍`裏=$Tbii)}H=#<"W_5gv:::|嗒'""&M`elbblٲE\zU}]vM-gvI˖-e˖-"׮]S?osɁ$11QDJg-'''QE8`&LP6l<)..3*o~Ȑٽ{p2N<)Ǐ۷eժU)4W`W_}+WJaaڵkEȼyIvtY8 :N ŋGIHHQ %::Z %??_:$ݺu2i$NWѣvDzzZ^ҪU+ٶmdeeInnl޼Y6l(LᅨFKKKYx^;wJ ٙ = v:99ȑ#ލ7dԨQ_~OOOYbJaa9rDڴicr+**2:~-ZH\tIի9nժUF峳EIwޑINN#G1b,]T=ȱcǤw@x u!58sLz.ɓ'K||Z$2sL?D%88XH-{IIIWʰa,\P$)߮[~Z=/_;ꫯ iРl۶M%//O/^K׮][vUT5YJ;+t$Td֬Y&gΜ V?v~ۤމ'DшQ̙3@ڵkWttt4RK.O:tH]$wV+rϋԩSݻ$2|Cggg' Җ-[<UY.FgyF?`ӧEQqww7npQh4ҬY3jz~qEn`Z;)HԺuk`Թ'--MR.,,d]qqq(666\3""BDјt4۷[Z{j) 4F# Fy'F| -k̘1@̙c6\dIh2q͚5&yfү_?HS@/^Njh49z2,XfDa?s*UMѻwo`ױcGteNx7#F@F*]/((@Z 0yd<#w]Κ5k0vXxyygϞHII'*λӧlmm ERR4ib2'P2|-{k9n^Ek׮(**™3g*Uwʕ<쳨_I~.]\x@ɸpV5w^8D 6SNlڴIM_C&İaÐx 2?>FQfލ#z ^p5ʕ+ -fϞ}`ӦMh45k2?<yͯ 1yMU޸quV{ҥ2˗/#**JTU/{{{4il?݋Hd _bvPTTdT&%%R7ׯy ___?z5*s=Zje6U񜜜2999>|8_ӧ_jQNԩS|Wp͠9pnѢEgϞEQQ\]]Id+ aȐ!w]gQQ.]kN@@cg mllpDEE $"""z1g dWeQ`ڵ8q"At?>t:QtpoT%3n޼ܲ999Z<#77͛7G>} '''… k-0An+NnSEWrr2wK.zxx7oFTTIn a͚5XfMe m6+$KY9 ?z< Ð!C`*Gyѣ"##޽{cpuuF;pishUkiiiw ZzK,1>j(+ѣׯWtNh4ގٳ'qy;v$?<<O5zQ.\BiÇls۳gf+d8Y= IDAT?c7CQPP˗_rвO?MK#F@b׮]e~f֭[1c 888`ftZhXZZVfTK׍#$44(}@7o.js[ȿ/:Ҹqc 'N$5Xm&[nUf̘!o߾F OOOYh=K.ҡC9s挤Jjje,sF˓UVV^-N:ra5=66Vڷo۹s = Rty5hZM 3J7/Z̙3GDo _r̙@5k&{1tm6=z剈Hdd8::l޼BwyGȠAŋyPDn_k\o!Gd5ĉҤIl2z֭bkk+!!!DD$--M>s兆חO>DrsswydӦMv &=icc#󥸸XDDe@<<<$%%ŨtQ]f @VDJQvfj;U`''GFEڶm+M4 2SQׯF#Su&@>CW^;eСvHNNIΜ9#5R Һukqppecbbnݺ@K.#2n8322r_Z&--M湹IvQF6<#&7 Ν;x{{|p0Yܳ`yDՊtM<<<޽{MWTT$SLQ(͛7WԠߒ%KLG^;vPk"R`g\\4h@mcΝWH=df""~z.tuu:H/ubccʯ[Ns{-_=)JHzC^[w:ҹsg htw4>'OFϞ=1|DDD œ9sk‰'Fax饗n:X[[e˖&u_}U 8| ;s5jׯoT~̘1޽;-Z#66ر#1|p}o0n8i ,@hh(RRR퍾}W^1o\]]qA,Y6lիWaee#Gg1{'ʞjg疠 lݺ~9z(ut8߲eK]pZ?"##+ӧO]vر#N8Q%xzzMRlR]\\DD4j;VDDDDcϞ=*۲eK|WEDDDDT$"""z5k aaaf')N@wS233qk^`fcc:T]f|>nCj;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;V`j;Vt** [mEf~&fuǖs[hQsJ֭=(CSrHIz Pٳ{ 8"u DFnÁNzh|3߮տߢ6c'Կ8N |(% $mPΜtG,@ vJ֓(ݡ(QΞ͹+ $;B;=4Bo^pvp#`sw[Ftf6Xp@Τ@ڭW}k(ʻ^^>9%">bLJJƍ#  իkf֬YصkټWbĈUt7ݛ?M i[ߌ ÖzJDDC%"O<[JT;+('[h46sJDD[^""""""zUc"ÇcOagg$$$ɩ:VQmw1兄xgon)`-xiPy?s7}tzE;6l.'*:V]vAtjOz'_[oCإ8 vV*+_1p& 3`iafnM1*`$ʬG57GkGyP!+%'Fs(!~B8wh;ݚW~oG:pԃ(_-`aqM9}Q@{] r'>I:SzZj ՞QNJ. g%*Iv@ h\^dh4*g Ҷm 75i#EJTTvwTENVV'@"5DoF+ {{rQV<Ֆ{@ XX9CPnr[[`c1 R E9ߔDDDDDDTKҥKƌ34{{{xyyU믿ٳg޾2o6^xL0e߆~7nl;?=lOS'g@mq6.m緇\=wGha5991x [oS{x1|6ڪw{y-\7WO|ɝ6Jul|yp!Fy(;$/>^u c/6Z4ukjR>9'>n`S?b-X~Gg֙ 9s/"d<#fFiz?oJJ@@}ȗi0f#Qf<[5Q[x_'(gϮ̇N[L mx{;87n OmTVo?Ӡ(_j˻޻ K7_z@zjoJ6P\"KR(,иԺ KDDNDW)]jQETK3%%7ovvAXXX8::յRp9 ʟ"((Z7oѣ+"-/ ~l[٣ctDBV\"AN;c}$d%:7F Nѵi~bٹaLu8v8DEע/bRjUl= ..HO캴gb1ccYY+ʃ=ZF&ñkGxa415_u^h]vN? L]" ]v#NǕ+h:׋#z><&|:EǼzz,.']惝 ,Ç0w*+zȉ (ᰲ'!Q,ۅFrr@uP2w(9 ( Bd<^@Q!7@SבҾ:jI6DU`T6Rifʞy; 2kcQDBQ2 h D^0@$(o-+iN(GI``rUv" C`077ʂNCZZt:PPP\ ! 䩤tupF^GFF]Zz屲R|G^^]h48;;-*}|g0ʭ/Ý%X6,,,`kk 5t vppnKKK88T|u"""K9s`ڵGFFQON ,^=f:ٳg1{l;wHLL7͛ۛ]WBB̙]vaÆȀ-}]1B0tл$j4L0+VTӦMéS+੧*$#%F⹮SԼቐ1罹_Qס.C]|=+tognͺbF~r syOXz ֎8a%ñV\Lsz8OQ\}>r sqi NWL";3XY>r s0eXsz: =A_X;yx|힋k6k5vMV=BסkݚuE.N-QFaڵСC͖( |AAdc""Bܪ>Wnun!Jq&*nh4KU5 v rTp/(Ӡ(Jc:I_+?*K09az=Ƥlda^%y$ % (fBV JV&*?J` |y@n5[@V(z.0zgZr`>3"333Ldeei@VVzXTTl!??_ 0C!33S ljpqqV+TjjOѠE2E?C@CZ-oRр\þ5HKҁ_C?QPPK Ѱnq. UgggXYYzaeeggg5xZ_ v5k?C˝7)SpBw_cFubccѯ_?̜9},-K:DEECtt4^y?YfUhz?~Xt)I*l [/sжaEpS&cGvmCǖs[w0wz>gЋ[&ԸƲ#+|zt]/}s:q񰷲GC(ԕtx+(~ahK۝dw57ݾ)?C|2q@-4xk 7Nݵ}'@:JCy=[ t(~0"eٳDEXqG÷~:@!"r͇:k=pe~竏k4z}P̌!r\H5Ir%SZ'F@Qakc3"%%E@zzQ2++K j]pvv '''8::NNN􄍍 \\\!e V[ឌO672H)5OQXXl䠠j>r<[888puu5gggGDDD_ vZZZUn7_2e 6n܈֭[7oFPPΞ=klpp0{=L0?v܉N:ahժUNKKÕ+W-SZ6mPPPgϢSNcĉS-v s!57{/ƵkT6ŞįQaDsy/v\ =AR]>ءYYxlYhQg"Դ:u렑K#:M6 v(C#@H,IC5P򸽡;lm!11E1 V.^֭̒3(.D@nnI299$ygԩSG}Y>Yf&Lýw%QyJl+;$Uel5Po;##HJJBvvؐo@pvv~W۷G&N[n?%:oܸa4ptt+˗c޼ye;.."R*www(7nT8₨(Ui b󛑑3qg 1b1y oϿѮa[<0 n;P!y`b 4?^o@BM vRrRԻujߢF)3%'f---2!$DZnB6E؟CqbjG{J-50 ` [9EރRSS!11qqqy&㑔/}e:u:uQF 43Χpuu`jaaڳcTr666jMm;TU} v^p19 :tsΩ_xڵ+NǎyjiEQΦwx4|1|JƊ|d(;ڴ9: nenfje!m IDATb4 Pg!/yRQK'J@l]ܠן ޸B:sKJ&Cvv6/^ܼyS h矸y&lmmzaÆW4h@ԯ_j?YYYnݺ[naMT!--MҥKF.ckk[f`]"2mڊ;Rn,t̼M'uhРAWL߄.УywwشX츸`eae}?Lh?+NĪ>G猞L$yK-!#!I=)HZ.^ ڝQ1dp$%ŅԢE% gI-Z#IK$i[:A'M!$A~G&AND%jf@2/t\@ܹsҢE 3+nN Dpp>ENNNFQggV@ N HS?6rwX>,NF"$I{(5`y’8/ES:>/,<hwތ? "~Pլ[_~Hm۶rMOzj+v:uts ĄVZݱoi[`nQiQDEۙ؟(w{dž QkX(-x~B?325Q'iQj󥃰4y.wVʕ+"$#Ie;?t$i ~.@rf ~BФLd@`g%H4nZXXj"IHRKH92Y#Zm]d \ަsSpd9$>]XiTx`,SDGX O !гOO*jܼy JJJ F҄qttqrr2\}rd֯_OJJ 899ѧO{vgÆ \v ޳gO6o|OTytQ!f}hI躴>ȱQ "&=F6cE@[5oޜ-[oF[+.\VwRo)SؼyѪM6q)~d;v3gޱÇ۷/VVVw["..???1bםj4u,kIK ?n J 7WWnd`vWp1\ƽ5^;ClT6nԋ6>[ ԩ)5ƵDEW.z%d2+”ϳ3x8[9ւ~#8yur?XtTaQ0l(,U4g\뱜>8+ȿm[=_&81LFxohHΠ..w*=V155ER1o^AQ |Lv̮d' 彅Z +PXxԘ8$YWxFG.喀32?2; C&B9BPaHeɂvRP0hLf$#,44tuRhta5 \~UXXtE"cjz|[2 PRyk|RSujot-cɴdeYRIiL-t[[ܹ䅇K@ f @f4pԱAj\. '';w.OJJ III$%%?… $''[ݛ5|^fNR#G˛oI^^ё|n޼yWiL̙޽{+Ӻuk.\Ȳe6*m30/jjyVcQm#I]:Na-\I l½,``AصkW-ZDFFqqq9s#F o\&MDjj*SN~Ʋb YzuwyYfѢE زe AAAUʗxzMbb-Zwީ0RyNyh=2LdKШS1ջ)un2K1@[Csh 4i҄;vA-%cõ.V\gI4t;PЭ|/%P4;;;ع~\v_oɆ *쓐@F8{,M6}{ؿ@F^Kƕﶭm/lUh؈ B<AOu?#bkf{?(ԀEJաCh׮Æ 3h355-7[llݺm۶;C>}*'|YnǎښCr*v֭[K/TaǏbΝ;_s9MVw#VkϯPSGSc^W佬;ۧW\_\|u._^ h1tB]'ߵ||TLn I-%?@:JJٹsEAx8 ` j6BW*Qq%=ADr*,н : hwn=K>ơ !^Ih4tթS8ZDr9...wPJQQ˗/gӦMsuue,_/Zx$x+QuOM31ggθc37PoD!5' 3k|^>=n,Pp*>禯Ks29/nFF,Js:xt_k7ʼnDGs W5Fz.;dbϓSCCz:$q1];FZn:T寎/{i֒97tq3 Yt̀&EZrO?wʓY^zѫWj?kn5̙32e ywܹsi~/WF9]|Fa; 5o` ,w3Tvd?bt۔R#.;w W$E&[MP'!</мQ#Z p7ѽik⋥@t݊?fc,Y%zUBƍcH/gϞ5h/tu,Ü9s BBB:u*c 0`m۶&%%3a֮]{ǿolB߾}޽;>}$I dڴiUJWvsmAL 2u{~ߛ"M*}zqYn%;dGz@{vx"VQ' N }n~qoYh[KmHJv c%f~y4s.[ԥ>ijN}s#G~}oe)APW'lKB\ c/]'3?s- n6vjLlF,Q'9{u?aIM#_Ϟнi7#6ұ77E{^u|ҠAǍFvAM'Om*-BA&@G` :Ϳm{|5&Mˤ BJ/x׵Lߡ{Ss֤I?<%I<==o%IF%RϞ=jk$^U$Eތ$I_Or r$IkH"`pp5xU!A[E~*$7-!{5ī i*6S#eeeī i/C _1RUTRPbAߗJ&$^UH>m?Ѿ%^UH7-ŸKnAysywvk& Bu$Itqio[NԶm[ O^"T Q;=Y. =DW%ЪQ.AoAGǕJRktNc ԕ-)ZW:4'|bb"L8v+++^uV\ɒ%Q9s12>9s0iҤJ}ҎV?VUʻ5L  k^8VK[XWp%G[%q1qq3h,6`pF,a/CVwh RmjJ8E"Qkt ՅE"i\[ 㥧cOw`NF7T\籠=L=ܭA [XXpܹ$y"   h v`3.>0 DG{j%}D=?=nH >?K%_?hժU۷oͷsP(*-`ԲeK"""jt&&&ƃN}8}}ԜT}͝\qJyIeWnO{O@W'3/ufw%8)~?$>+x\%23)PڽU}3ٙ'YQ>6B*{nΪG;AAL0 lCr38W؆.y( U ?*R]>UX]4 `hT ՜S}tE vQ333rss$ i^^Jwuu%5&psssLJ&rZ5{9gc/naVי( /ltXT&B|V<|6t}zanjN|V<]'1okfRPSȕ }҂:Y;+K+~\h'Ц`a:p ,^|@]ڗZӪU+BBBHNNɩ>W_BYf9r^z;f͚5/)pT\~vU|ҲZc };TIUp ƅ];ΠFiԘ[ɬ:NXHMfW+ƫ|Mkҗxs|Za݆WS2q LY9- {np|&,_NSO``Aصt''j=Ax:u]t'WIG *%N*~[5GLS I&ީ BILLt+ ]jy:#snBF?#ѭ8](0[`Seّ^6jH$իG\\O?m6O- ,… mL: b>|Jn:,X;tƍ#..ʁ&Ih۶-xyy\ې?ϭ@]߲U LWWԜφ.fP1q麴;X(-t^^h$ qqsr/W=.nIpR0 VS|:{=ž{RY!IxΠByTZZI+榺{Qײk&cj=HN΃\I©jЀ93K֠+M7ӧQom I q S94⃁ѧQoZю7dAcȸ) &JYZ9sIKBiD &U>T|}}IJJߟսۿo+;Gi`… INNi+33Sjٲ%[SB~gP}ZdITStyɺ lGJ+0A+RAgI8 v:{#r)˹֭ŋn[oe>yd77,/Hv9s&-[$==-[p%vi ҥ >]v?]vEV?eV^}@'Ù>}:'OK5]g}Z+ }kIKKݽbO^S EE|}zA{+vkß*]tas5%5֒ {SRK!P)`g.}ng`z+Aw4~Z:7Xvgv q1K]iޚmSfҚIdT.Ҝ+AiN HQFzfaoc#8͏K7#1Fs8>x [˵k]'1+k򃝉$%O\pPg:t={$ooo4iBÆ  (H+- *?M6Uڵkd#hюݡ{Ptik^ 25¹{-[Ǐ3e½)`gXXݻw'33pׯo3}/9rdmOHxx8˖ IDAT-Rt{ڞ\Ν;`#$iP$LNၺXP@Hx@gtn趧GG肜6'v H·x]P^Uy$>>___Ο?O 3|2e8/ygIIInݺ8::AAwJt>ŏv*F଼  XWۓxظ{믿Gg߾}ܹᑐM̹ ]gʭfIJ|֗Mxk56UI&L&޾Ɠ Pm 5U]@pZ  B 7o^}ϝ;\.3z|ϧJ7!p#2[fGG֎5L;Qc_s1vXߏEMZ-33+++ EmOE64?zvXLCA1VY0ItM4y( R9rg2a\\D*!A肚%Nt+67\k3AAv{n:-\}g~A(O;r9۷'--3gΰm6LMML\\ի o-A肛^`RMMAAvh;vЧO͙;wnMZѣ2fSAi@`(0n[ ]KAAAxhhs֭ >33<#-55Lܪ|_4 hZܪ4F$$ ++*")#ɰܲQT>gggj\$QTTĘ1cPT5znAZdbtAxt[7AAA Xlٲ:#o,\\橧?SoŊ|uV>,--&..#FT@VsIBCCDѐ8::a4ԩSceeV%//6mЮ];d2u 9z(ڒ}HĹs DP`jjJvv6^^^ѣ Yd2X! hkqN  +Vpڞ wW^?J}k,عo>ZnCMO?|r~7]!kݻiԨ5j{#553gVN:@?uj5[lÃ^xݷsao, /qvɐ!C EEElܸ/sMׯot$Ib혘saih dݺu< ^5ȫ  <oF&M ڂh4 :` vڡP(8z( }Axd[)  Ԑ}xڞ 4cƌjsR*jرC;ZW^y Y)(( ,,̨ޫ0fӾ} ҭ[76lh4橧pL.]r faaA-бcrlْX4MsAAAAgϞё yaaa˕i׮!!!F!*ckkKLNJ|]TT\.c E38v-v]ᘒsgggSAAAAF{a5qǂ,իW+ xcmmmpL$$IpdY J7KqLAA1 zꅳs8[smiVUAAAAy5}޽ 0&NX۷/7n=%%cǎ|…5 ǏyqF&˩[ncBBB d2ԩCLLLcBCCy{{r kG]i61,ljicbk{NwR2gЗ7deVe<W_ ZRR=GAAAl-ZmmO%sΌ ._L׮]kb>ѣGΪU x5kV+;;wСC~Xtt43fښƍر#$77ܹuVc]tadggOJJɓtԩ1yyEϜ9SVZUnnRU?6Q)M,OidGNN$ /%snRIR^ۚg%6nrͅ|   DDDдi 2UGzz:ΝC$9}4}۶m:wĬYvmAAAA..\=;򹺺֭[ٿ?4lؐ[؉'2qDrssh4X[[βe燧'muaԩS17^z\.ՕݻcjjZ___<<< ʕ+Ӯ];ׯOvv6]tA&֌?ׯMLL 8;;өS [XXvzzzu8Iˣ@ƥs*x6ff-}j0B33N5斕\--~Vh4BFJeBʘfI5Ƥi4W -\G򄻕hLzMAAA ??҂+曒=U>wbb"%(,,ͭ¿*)!!F &w[^9...:{NT*<...SSSD͎Zs?7ިWmcgh(u뒞R'2I;{1];Ξ=$޺B#Gҿ͹Xڽddzw^.\Hrr2Je˖ѧOqOf\zqtt䣏>bРA^K$~gK,,,077'**N:sϑܹs/|XXX`iiItt4#FO>1 3-[hժ˗/gɒ%ի߼y3055ښDf͚ūzW"7n୷СCԫW Z-c֬YEx /ףGf>|^zINښӧO*^(jYt)K.kkkbccgŸ_~aѢE :'2m4 011ڨɓ9q)))۷h?ϻ[s7 tOΐ$II GqLJs;?ܿ[Tg‹6ٹswЌ4ZLF؛ob"3_i|2p ZzZ?n4qq۶ڴױcRfM$gg3]{ ӭ_;FF^V?Ț {^啿Դ7n0?bzqa/+Sgy>0 0 dʕl8Nn=HZy7..*\4upueǬt8խ ٻ{DEPdF5/X; v2#cD\ܰJeif12BÆr4E'\Ϸ0YtJBZbbmٮԹ^  $xd?~M`` 7n4vܹW_} ɓ'1c ?1ܹsIJJѣ8;;ƛ7o楗^33{l9x t+"+zÇ3vZrss4i5 N8Aݺuپ};4v~wXM6ѢE @5?dΜ9p ӿy QQQ̞=+WO?/ZӧӧOΞ=Kݺumzٳxyy1}t}S$&MZȑ#fQQ?ݻwѣ{ 0uT\\\x|27n ~ivEfc/_NNN3gd̘1ؽ{RSs޽ TݩS8r|Ÿ|£Ƕ%,W*/9OylT*Y?a~ƍJOg\+]u`T9*l ~=eVwdiMI)}qq}ڞ_rnzƄivvΣBQTG(R4*6u{1k{  XQ(cff|@~8p~w֭iݺvv6 wiE+RgwСCqttԷ>|/rA}ƍ#11P޽K.q*z \΂  ƩT*T*J'+oWL:Ԡtt4-… s`ѢE̜9j׊̘1ŋ3vX^^^lٲ>}p!}ĄF޽{\j%)v"00`GMHIIaԔٳgcii믿Ά m2 kkkrrrؼyAZ___O JRJʪZ 0"_gͰޞw}OOO]V.9I,"yLKԷ= C6eoQl mޜ=t@D<<%ߦ ^b6iS@gn^^|w!glgd_zjR%T_^4t[ŪժkEEN_UdeZv9~ⲫtSAAʍ5?Ҝ[nF;Ux o ̛7؊+Wayc uXw1^ֺu;wA -z7∍e̘1+J|MV^mkW__jFի?~̙3dgg"{ꩧ ZZWvڵkkr>O$???q޾_Z !֭ FKWJ p-OVRWupSJI镥X(Iry~~nɢjC +)Ox,}B~iZ453%YZޱ   lܸqݻw]aBLbpի山1F6m*T*iР7no.Un\zݨL7nW\Ag@r˖-qtt?;v0ԩS+^CLL KO>wUѧO֯__aM^^^UհaCΟ?W @LL |WV6lV 5722)0"5*Eu7xz%>>pZ|[p0V#RVH77gN׮_>8ɱEGlɜ[Yu<0jx}W~s55͹%IF73[Q V;mkRe77>>6L[Z|1>۷"1U(oca6ٓ"Z,Y´ dSVL>O;;2׶og]8YZC 8˼333c݌; 60b6lHFFN?dԨQJ ^t)#$$ٳg6mذ+W3^|EzMNN۷'++Hn݊ZfX[[}{U… ԫW_ݩݒfͅ u &r9j0w IDAT031ZB.bm&Mи1*,+n7|Jmlq+Zb,1<,JTJ%>>mȨʪ±ۗ m۲>0 /21/~6cӤIh%O-TfJeFZjR$R(44ر<#YYއrr̽ʴ37Vn]+(r411(dd9dtpMҡ: MM3rI(hRe[XD.XZkzlAA1gii?רݥxIY2>I&a֯_>>>|ҥ .]bڵ_S~}͛G=ӪU+.^ȺuضmrrsUV-9UTEݝӧOqFv؁Z}`kkˏ?H^^^Ņjر~zv܉VA̞=nݺUX}tA 6ȑ#+ǎcϞ=۷CL۶m?>:u_^zFeŊZ JEFСC`a b׮] K,FEXYY=BiT2]z(dffҹsg:uT֯grv+'%%1o6yZCM[slȐ;MHH`ڵ* S> łZGF_tKS I&neAx$&&Kʏ { Ύڞ1aիŋk{* Tӌ3bGaҤIw3T*'}dddD}"P rT]㌄aCV볱3FZM_ݯ9   HxU;ةj _~UVVVKw\\YlJE$ ^KMeի|;|8vrV/AIIDa4m)P. gead\6am}PAA FKK4qW`Kptt~Gy榦ؗ jjڔı_-,hDRv-jzMQԱ\&ܣ*LT߹   P2u$~vȑ#~E aZx>HZ)(ڷi?{Wu?p%K@ATjuH\,GKJ:q&,܉?ܲq??vAx?{>|~07眷B!B!#*.$;.%%XRRRB!B!xJѣ̟?i"^@yyy]Lj֬DxZZAAA$''ckkKbb"YB!B!%;^Ji#^0*Aq%bbbGNN[niӦԬYS~EmF~PYB!B!Rm'NyO+!ۅ ZVnݺ888ȄB!B!ijR'OI&O+ݻwwΘkL^^ j5FQRSSQKKK ~0KKbǖi?@jj*j R_eYJB;;;sΝRO!B!B<J|(ʖ-KFFk׮g( !!!9sJ1Һuk갳+ڍ7ptt,yB!Bxػw/;vw(BJHHӳ̙3%lɒ%,[+WZfݺux{{gW!Cٳ'm۶eڴiܽ{'O :t(gΜaB~Ze*U12p) }ʕosgOjv)*T@-b066YfܹsGg'pttuZeʔ?۷o'44uj899)_<ݻwgʕ:eG׮]bPTxzzR8|0;v,s-h9B޽5Y!B!WWW\\\={CBȑ#K,v'Nдi UzjF|XN"""Bڴi 6nXgLhh(7.4VZ3BS-Z… Zmaaaz(0sssիFӦM P~}_N^^^<ߏe˖- !B!BOIq⋈+'aaa:!]]] SlYbҴڲD_NNE*_+yddd Ϥ$EAQBWOJ"''>=rLVVN9mڴyŁ wO,P!B!B.ܸH`z7öL;w_T7䏈?sNT,[1 ErF⸦Ұb(6t.]Dv|x*K.1 .,4_PBCCQƮ[X#bfdm[lآ*AaErma9m6XYj,L<7J/\Ou 9T*czMr cɒ%tԉO?&L`t҅\ ˣo߾&+U'k׮'''E!11СgggZl[.Ψj]˗ҥY+VYf] HVV.\̌-ZLPPbll۷o',, wwwʖ-Kff&\|ZjVa=Jڵ9xε4mB!B!x2ׯ_'++ wwwkѤSvG';;)Stҧc5^/Q}Oޔ@bzb4QAsGbR ̘1Vx+yI:uT**&00 pss# u9ʊK.?Ã*U6nggǛo]cjԨ ahh:[.*Uŋ\p2eIʕIMME`nnceeEz*`aa#͚5L2yԹs"V!B!ģeddIJJ ٤oEց333#柑hnn)FFF`ccsS6;;xXbiN]IDD&M";;=zYغu+YYYL2X]vabbPn޿=D܊DAc-Ly:}3s39~orչ[>RoFnަYtC-JU;vEv;6[FplȥjwC>jbQY9uۑħĂ5ѝ2ƅWƟ߉=*ԣSE;sssj;֢k.p" 4_wkʄ]a9~oר/:c7}]osO<٫___|}}kIGiӦ%ƍK4///vKKK-T6B!B-@5/Nxb |%%%eʔcccʖ-ILZ[[cbbVaE&0QE,U"(deeKRR$%%q}lmm5χ_?&NT&#Fp=FMJ4j5_~%[l!'';;;ܹ-aÆO5ާۛ'Npuk8}4ׯZjžϪU߿VQA 390j=6k ggg0`@dΝ;LB!B!_6@^E|MnCsagg3N󲵵N.@Vk%?|MJJ*ֹO">>>VX9֭[L4+Vзo_d(sNGҧOΜ9SO[[[>ҥKoJZ5##ݻwgԖ,= *Y5NRo鎉d狎34cZVmˇzLv&vUCuwM:D2s2INIs1tpE܎7[#Zrh_çϥ IIs-cK5{wVAQnbкw:2*cE7j9ԢKCғv[Wl47 gkg6CQG͍tHJ\aUbjdO oBbOp?au[~{6S~R9WQ:t~'quuo߾M!B!p>r}7@$pH=lD /^ ?B144\r+W=n8&OV˗/رc:9Je˖4hЀSNѪU2fzͰag\;޽X[Ϝ9Cvvvݏ^ $:?i;cf|ONc\xo͢k^5|I:CC&yOd>ЈW$:>?K;iQ+j> ЪjK J9?ד󟥝{tyϣ(Mv3:=MT?gc[|On޿ﯽ8vֽS i6z-< >=J'e+r򣿹y&U Wk.0h=Wn]vG4hw}G#)))m۶T&֖?\?"B!1j5y+`\=CWeDe||<x}Ù@J]JZXBrЛlk?E,J(Y(b|}Y]ӛ7~y7O@q&gD|B!3.P H~B3?_E~/\333#--Dcrssر#>7nY;b/'''E!)) {{*NN;SxEQ8wV`@jV*\ZyLgϕ\XɺS100c5J6HH"%-=s7 #vVkdf$$QTO|G MKK^zOz[?$+žrBW>p7n\*zN33"ˤz̙3GaڵЯ_?}"]nD!B 4~p 8$f АeJ|嗤RRRt"T yf,,×>>>9roo-_뉕ڒ9z(.dŝZ,M-IJ 69] ^7 u]m\{Ln`wr9|q&\~<4XNoЌqrDe">%D^ 8]O(buѫ&;ˆW^OxdQ]B!B!@sWq>Hlƒ_] 3gdӦM,[ 333ׯOPP*Tl2oNPPԨQUVQzuN<ɵkװZYfM||w{ggg,RvO/}77U< IDATйnjd"|z4[m%% Xp+ j:!Dގ,tZp/նch ]=u߬Lh[V{-Fң^w6LĭHLhZ uh|^Ъ8a{GfM*T5Ꮘ?oM4ʚeې9\G9rxVz3tyR sf0/lݫQBm5KH)n¨jWFa"m~oXd oe˖}@QO^#$$T&{bii) ^Q,W\?gEpBA- f͚;!(TBBNNNn6d 4ZOrfGzPv-hccCRR#;   gw('00};Rs"$zp}Z4VsDϧ6lȹspqq)ȑ#144dѢEEAG촴|P_L&&&xxxfDB!VxhC~ w C NWȑ#Yv-QQQ?zsx:y#%!h^&ѹ_V1kuGٰayQTxYZZ2l0|}m/bڿ?UVwB!Bٓl *b0R]=311/삢xUڙi;2sKto{ :9~Rt^?hB!B!^9@^oߊ~xU9"&zʶ ge6ҔŶ_*qt(ѽ:jϛ}/*YgB!B!J)|y"?X0ký=Ͻ?h$;KΝ;DFFR|yQTI!BQz_rS#@ᥔB$)Hvv6M6%11}2gɘ1cq$&&ς СB!B<;= H~rs-0 ЄB>hK4|bŊ~B!Bg0 CȯފBC?DB(leg x?e{aԩS|yi޼9s̡J*~˗/믿 88@+,,,"..!C0uTLLLt`ƌ_gggy&T^Ӷm[1̜95kPbErrrsG棏>*OJJ 'N$00777޽KYpa //ŋcbb%ׯ_7d8::>-<~W {tU4!B!S`{zW?{7ǸK.**{c}"(<==ݿdguMJ#Wђ%KXl+WZͺufϞ=T^!CгgOڶm˴iӸ{.'O_Gѽ{wvܩ7ߤ]vSLҘ7o1VltЁ͛%_|ߟchiiik׎vYEyyFuNj}bffѣGP2~UV9rD^Z޽ʕ+~:ϏN:B!BbQ@7 $r_lτJJ*xyy;!D |lmm122"""}i}˕+ǪUcռ;ksΥiӦL>]+ &Ou@|74i҄oV|믚y~m͵͛~Ã޽{k][z5YYYlܸQ+SSSƍ&Lo1jjӹ~:*7xT/B!(1  c\ꊋ gw(B9rddXz5GJt>SNdeesmڴi~ǍǦM֬Y 믿s:M:L>˗k_/1 ")[cpB ufg$""{>QfMvWWBǸ($%% jժZSSS122*4 P^=4066Ʀ1 6䯿je:.==8 $T͛СNW!BDɯ 8M NOdB=)(Y(~Ʊ4,--Y޽{2Yh322ʕ+kVQ^kffFZZLOOTgLQݻ?@ƍRre͹uT!B!c3M=XER!s Yu ~Ʊ4|||ظqco߾͑#Gh޼εSӞǔ)Sj_>,vlFFFԩSCg͚5kN^RQvmW`EQi֭W.vlOKff&oߦlٲE!Bŋf'>%)`֬YS|yjI-FSPyqҥ}YYY <^^^tڕWjڢ֭*UOIuV^___3g2j(t:u/)ShO>QFq|w5? 6[FF+0[RV̙3:j???ժB!B]vٳgSV-:wYw/B-'N$**2e;ѣumnE1T*eǎݛrƒ%Kԩ~ic'Lҥ ѣtiӆ>M2tP5k(aXt///fΜIVxiѢ999ݻm۶sgV́8z(̟?-[B!B޽͛Y~=.\ח/7xص233133+}6Eqvv~ܸql166.\+gqyyyTPT4&++xʔ)Sdp pvvĤ066!ϙ@w);vT^nnn֭[6E-]TT5j|J``r9%!!Aߡ";vL^ !ZRfM}BBrssݻw+~~~ү_?%00P*t̍7Tn'g (666O~_OK^SLQ777eڵ(4nX\RZ5e߾}:?mVXҼysrʊ{BRʒ%K5j( 6T'''Gʆ s8nҥJՕ (-ZP*VJrrr{LOVjtRf͚JJ&M(:6mڤԪUKPZh)V%//8bbb+NNNJ&Mի+ʂ Z?|777jժi5h@\SΝ+5kT7nTPA0`ru.])cƌQN<4jHSR~}f͚ʞ={t 8PqssS'''Xܔ3f3{1Byُ~#gN/Z-[VQTbŊJ@@Cd9%N!3̚5KquuU<==s*w)XIvT$rssDeĉʢEO?TiѢreEQʤIܹS^w^`~ >P飵&77W P#F=zҵkW%66VӖ|7J $1Jbbҹsg%((Hѣҿχ۷+/`aÆ5miiiʄ ѣGZ322RquuU~%77W~UK.: ''GT\\\%''Gzrr*?iWJ>}h%6+UVzl߾]WҮ];ҥKk.\P\]]P1YYYJbbү_?e˖-Jbb(4Y6hY}?~CO?5WߡBL.] 664ԩԩSٳCB!߂c.]ӧի۶mAMJ333f̘AٷofwÆ iذjj*GfϞ=ԪUK^^^^t{{{͵rYߏJҚo߾$$$u={p9ۧԔ'bhhȤItZbjj =ɓ'ktUtt4fZ13k,FE|||kaFٳӧV+[l]v8pm`ddDf޽ 4Hk1w̙3k7m۷ٳg666>‚?XVVVyfc ֭ˈ#رckִ`bb)%:@Ͽ`)+[[[>sT-e˖wX^{5;F˖-O>,[ *0bΟ?B!+*$$#FҥK>|87nDgϞZ3-Zj|ɉ>}m6իWk%6x`Ǝն|r>B;v,;w$++xOΔ)St $?l3F+I&quz]u>֬Ysmܸq:WgϞXXXhY &~mNZI!Bp 6nf=BBׯ_dR 66={^hlyHիWkkk"""hԨQcLLLZ*TV>eHdddQ+U#(+Z.0\~}ٷo(¢EعsNZda4bbbSc|HSR`ll̚5kؾ};T^ӧgq.]ʤIܹ3 G! !BD^^v_~!88^ztR7oЄ=z`ٲe%gffV*¢XYYLr s=U%`撞Ds@Zc7n?&PN*UT\ .UVOп]zCBnݴVoT*|||ظq#ϟVZ93w\n߾hB!ċ,!! 777f͚E޽Dϙ,H-صkWx{{qB9sZSoڵ# ۶m###pssԩS57$&&P~G>v֍իW?^dge Fsvvf\tyq)jԨAϞ=ٱcQ!BBBB4h5k$""@4hV !|9BW;۷`QF?;~8dffjƌ9zNw2p@'4vJ||ٳqpp\chh֭[֭AAAKKKٰak׮k׮9M2t~۷g̙4m7n-QQQݻ0.\X_pyƏ_h?333C>}ذa=z͍d?֭[ٳ'1 ,? ,,>?\SiÆ $&&ȸq{wi۶-iii4nܘ $77  Jv#!^E 4Aɺu޽;˗gy֊B!x:uM69{QQOdeeXb`̘1a033Zj̟?/-Zܹs[~L*Wرciݺuc4hٳgY~=۷o'++urϪPި?SaU+Vƍٹs'4nܘ`ʖ-ŋ(PqoooصkjUЪUBC~sÆ [<9r?kƄ (_Vf͚iZ<<>> 8N:RJuWϋZ@X͚5 $xdeeŋIHH`Ĉ 2GGGƕw666$%%;gb0{l}"(#GbhhȢEU@yz%9W?ߨハlܸٳg3j( apww/yB!~ݼyŋ?ӨQ#NJN04w!xԫW/h_ "/;+[%ҒaÆ=rYjժOu9s +^^^ԫWӫW/9^!wY-Zƍڵ+AAAԭ[Wa !D &//Dc,,,R4ep"p]_!ְaC͛ǜ9sؾ};+Wd̘1oMB!/G͛7˗v!K,xNvJq"!^&&&Gbb"7o棏>ߟCB!n:ΝK2e3f [nXߡ !/$;x1|pBBBسgZq̛7D=G(B!bcc?~<l2BBB4h$:BR$N!^ue֬Y1k,BBBV}aǎ澲 !Bŋywhذ!ƍiѢCB!^JocwBtT{Ջ!CРA})9{rCf2fpwstƟ%;7Z5\ 4Mx^_̟?#G0b.]B!^zƞ@m IDATjУGʕ+߿?S!s`u ^V$;\u. ;/+Sb=>q24po-Η(ܹٳgϘ1cXr%M!xe<@OWZ>}:QQQmjբk׮lڴ}(BWiFkty5sЈw )sZ^siϓV\Iz1ccƌҥK3FB!3NB<m)))l۶Kj>OOO})PCC]爞/rA-)1?dHXO}g)..+jgggrJf͚[y޽{ٱcCBPBBB@ydekkk ĠA|2VW^2h 뇓BWZS$'2TѶZrrz7.ܸHn1EQ8|ׂ-kR19#=av+(U+W͛L0l9s&*T`mV! !RR ^^^EQB idO#(!Zj̜9ӧsaVZ_|Af0`XXX;L!x YA&q.?臇5ųm>4ҌUWRݾz8<>v3#3&zStuv o\й\T|ak/,Zkm̵ Ɯ?GU 3-7 "{ݟ3{ͪ4e$FmMܽ8Mn?*#C#{|gرz &8(˖-c8p&M@'WWW\\\={CBȑ#K|S !mmڴaŊ3j(oߎ3}aǎ;L!x%԰A XZ?jwԒQu(Byca[şU[лM+7za[bc8imkЩvG*XU 37{gocDݍ"o߸!M*7ƯA/poʄ\u1iO߃3įA/Xe#V|w V8piݩu?K;iN۰mȴ1l[Y"t_Kܽ8*XUZ024ȕ/9{,&M"55(ܢEϰK.;v={m6It !ϡ"DBffftڕ]ĦM={6#GϏ޽{Ӫգ !x>Zj=*!BST 4Aի߿?ffft֍}j0HS(L0R,vکJՃQOM\?;=136{X֞\G2jX}6kss:{uå 9l:Jtze9[4GÒIL5.;WGMJ+ m-S_+ PTeo>3V+3+u[ zk166fǎddd`ii7~xP()S*V 4DBd+p=bccY&&&-铑Add$UV9J3gPL^&d!bŊ;crQiܸ1UT6*QB"Ԓ*T*B Ep3&9,J}Fɨ#=_|x-bEqs+?g7o|8=9vZZDgضmǏg 6Zjal,ޣ xMdSׯSV-%,L!OR*4jԈgRR%Ξ=3׏_bŊqqT)Bzuh3:|l(7Bb^^jP(8y_EL"WSTg7йN'@\P/6%5KNzv:6} / d>j<%RҢ$&z+[$/eY:sھ>3Z}qq}KIOOɓdff=BVZZCG+;m zw8vKKK֭[ڵki۶-l2~z-}ݗ [bccC@@\vUV1` ={>rʆS!^{[x}SU_Ң-Q͡o^uٔ#;'{=B|r<\| [K[.%\>MOޯaB{ٺ|t(?7ۿ%ZZȄ}8uCKu:^u5~w"CvMOw)[,\']gǥHHȘߝmӮd_ۑL:q036콺OuAu7tف_$&PvCTi+\fQe֌Zn5} 8{~?wKcj9V-v\KϢvt̎鲬n'9SKOj=keXwfUeffRN\Bڵ9qℜ!)gLII!!![[[lmm_QdB9$ >tЁ:<www.]0UPA|ϦMR|yC޽)UW !DQǙ&jR{hQdwU/BƠ5CvӹB%+kGt)UJHAfN&\,M-]s1 ׺^M $e&D}߿p`ep+?\gefEzv:ٹٜy=Q{Xvl'={s?i:ε9u4Jۑl?b?ܓh^<s? g˜%[.lT`u'u(^3ٙիW$### !x9'NdժUϖ-[8q"ǒEѦMyd\xs  m۶Zc~g?V&M )w)ףd h@Eߣ=g͚͛ aҤIxzzһwoڵkiM]=YQo66ZSm?z};iw0lɲT)UwySΦfo͎d77o<5uF8!=sΣT)R2]vlOGqf#ǯNL(m]S]JX\zeݹ2"©(J\*U 9wP}w*ͅ;$93T]v] )-+M9}K;z֥iwU/6Qn0QyeKåIDDDйsgIt !+4eƌCPPIII;{zj8qk֬Jv3j(͛ 2x>CMq㏙7o aÆi _țBrfffKbb"֭dӺukz*xU@ /4yq!a|oBpwcXܑx{GIh޾o271{7wV9 xUלN5L痿?/u ![[[,,,2e رCpwwwTNDDիW׺V&Mؼy3͛7cǎ888hB!݅xSaP666 0p BCC-ZᅬCB!BL4L=Ǐ0~xyƍcԮ]AQvm8<6l@T|ry۷oe̘1x{{غu+.]"<<*U[?( $:!xQ֭cӦM,^CҮ];|3߄B!IŊӓ,tS(L2>}ozj,,,\2[yŋ,[kגCJ3f -[ظ@ߟE P}{O0aCQQQDEE: /vvv@ll,ׯgܸqܺu C';w.ϟ7tBCCך)/B!B Y)jYF (DħB!^CJS!B>degT* EM&>sIt !eze$; X8<6mz,\s璑A RJZ֬Y7|CJJ P~}fΜIZvڕǏs-8VСC !N|v@ԉ9[D,L:˗SB166.|rf͚EVV\vƍD*U^ k1cF]K!^-[p}C!xN{UVoX.! кuHOO{ܹs:eݺuܹS+9uToΪUQ^JXv- 6Ԍ_r%iiiۗaÆokPdWfOħ=XN|n|H!D3f ?͛7״o޼.]l25k 9r}xb.^ȟL<-[g|2Jwޔ,Y#G`kk  /ЊMTTM7۷ounn.;wΎgj>0p@Zh93ӧOFʕ5 ˋK!xB6mH *P昛cjjJ=5jK.ZO8ի9x ֏k( w3 ѣ( 4/kkk-.eX`W|F9 P!˒>|8;wEcݺutޝSNaff fffڵGRX1+++/ bԩ5k֐âEcffz3#dggj*ŋ3c ƌÌ3}VS+W2l0D瓚5kFɒ%9}ta((|ׁf@=(gܨQ߿VҥK2eN'$5fΜw#Fi aȑzmۖTbbb_!0Anݺs5VX9sիWΞB'ŢN|~=Po{__ !xCEFFR^_>ΝG=)Zm/^9?I?)**slmm155%%%E 﨨(j֬www6lؠ˗_~BӉY*BQH5Ȕ)S裏 պ|U uNdB谶~fd /ҺukstTGsڹufS$%%9::2{lw؄B!*%$$JePsuҳ!6pDսbڵygffn:IӧM7޽{kyxx\yzzl֭[Z*֭[z-`;6> !QF899ӧT*9r$-ZT'/ޜ8qBvϵk9rѣGȥKƲuV<<<~q=~xMƙ3gt_~C2m4c< IDAT˗u]ÇJPP_xbܹ7v!BD3g?T*9s ӦM^ߦMz3oʕߟƍӷo_TBVVG%44zѵkWyݻĥK177g혛{BWuڣ^uU0@%!(–/_?gggYd nnn,YD=zо}{ݻw"%%}`NUVexzzҫW/Zj3Wzz:!!!Zň\]]_SNiSSSGpp0fC>nnn,]oooC`ݺudzpB2dq~z>6mڄ?nnnsaBCCiѢET!NHH`ԩdggpN:)7,BH8;;RK?C/Nhh( ,,}QT)jԨADD*T;z8p`Z*-zB>>dffEɒ%:m۶?~+Vo+4jH͛sIVXڵkQ*ԭ[C-j͡CX|9X[[өS'|}}INNfـv%[[[ٵk6mb888Pvmv܉S[~,YOOOəɔ-Y5:?"Q`keK]9v,>|?&F&A'=B!th ~>s oB!D5ϯr ^U=\zuJFJvz.x?h3Iv[DD z=(JynݺEY`A׏ݻwSti8PQ."`#z{{[_P !Be l-m)n^С8;7Tp*Bڶm˕+Wr .$==!68|0K.}|r=Jrrr!FW0de,XC!e!xL@7`;TvB<ŵk bɒ%EP\\VVVC-GG6t،VSߓ3k^pBI $$$: ѻwoVj0x䠮D\X[l(xQre p P|8~u1vXT*]ve̙DFFgqirrr4i ҚwuƏ϶mprr")) F 4q3an߾;wݻw0a899BZZ ";;~9y^ŋ=2}tIOO端bՔ+WdJ*}T*?sJŃ UVzL>]c/d޽/,,,7o>>>/CBQ":z%XO!BڵhC+Mӽl]:Q)8wZq)fN 4qi&V[BuVڹiUsml-m)ah*˺jԢ{w8FRj&F&عP7b~(UJoP(ps[ J-Q(l8{i9ym'.13c3Z{w:ARq ϸw9{BA U'\bldѸcz{8p$[7DU~;TiB`ݩd?z( .|g/ҥK>LPP Z;gÑ#G8p9W\yxxxlj"""7j+V'0w\.]K.xyyqY9 lْure<ȹs8trܜ˗/s!Μ9͛4i'N=LJ .\9< .O>ɳаag޽;vǏ}vVXO?w_|#Gׯ2zh/^Lll,ׯg˖-+PmV%ET+*+8B@7Iu@UZ5C|e<==Ug6tB'&O1>KOlM~Q*T{i=*7Qƪv;_bQ*F*LuU_RTiYi.S'w9ͼԬTc6ӌG,5_|gIJU%e$Z3D(cϝ-b%Muy'שǘe1*F,(va֜q'T_9iWZVN,7M6UMJRT/ҹ#)))uհa@^͛UNNNF_ԱUVRyxxvk 1ׯ_Wn޼ǎ JV{~T-uQ?O˚;wjƌ:ӧOWG;wʖ- j߶mnݺl9999-[jԨg,fR)SFթS'Ujg Q*Y)2P3|Wƣ ߁2B!^xvEddCB̜L6 Z gqlUk}=>K̬v?^8g7^u5Xx _[,f=z`=/覉#;'[k춋wTwԥNgOΩ5HzjK`)ʎn*3[й#ŋĉ3o|G;A![lɓb5 BNN:uC,ZH֭[eOr!J+ 9Nş֩s)A]pZʸPL]%D/}OMy:ΠU喘eZml5LY\tԜyNځ78u虣{vdQ@J8uJۂTxq:&%%EkiiiCEPp/շxbnܸfddR$777d9-[V|X$B!A%%%q]0xqvv{F>7n ++ebfMR)J표_ ۤ쌅EiS}޾Mz?!aLD%^45fԦ[Qɾ_d<̊;=j}CVNY郥z)Û}f4snܤ'?P;]SսcU_]tå we_D-Zu}W3ʎ{tH<A*3g8x(]ԛ݀]~Kci7]Wvs)5Цrkʔ([5.߹L:LkȨ#p0דtkAU܏K;}|.|v?5He]MӜ9r n<>^Ce u ԬY{=""" 9sЫW/v܉ٮ.\̙3t颻yoߞ3gd>#L ?JҴ+ >s>#6lؠ=WT2k,n޼ܹs_86###lllй_Ŕ)S>>L4 ҷo_6lW\a͜>}~Akιs9** .hݝ={jlddܹ3 GGG.^ٳiݺ5:iСP~}>c֭Kzz:'Odʕ;/|dܸqx{{3fʖ-K\\֭#;;O?p>|f zFo`РAxxxHHH9991~xƍG>}Y&[={|ξ} UV76mƷ~Knn.BPh2vؗ~CB!tGkOQ܍zg8p@1 ! Axx8cƌ᧟~Zyft²ehL]8LJ#Gзo_/^ŋ?qss ==ɓ'ӲeK٣:TRѻwoJ,ɑ#Gԉ_~T(U*cffơC43SSS6ml߾]kFnn.;wΎgRdIbbb8p -Zƌӧ rP*EDD5jxg4{eѢE۷كI 7;p3&yft swAюULLiYYk;ZM}9Tlg *VCץ]Tۏ͑[a kmUp󘙘bWoؔso0/پ*Q.=Fƃ \]>VfVvPкr+*>?N?)gS6[^.[.l GS]RUpsɳݝsW_}նzjU.]eI&i-[LթS'R;g:s~'UvOKKS[{O}ݪ?U͛73u)UŊU.{秚cSm?ݿƪWd،Q-GlSn,tR>BzjB!9 g_` pu _PZ^zOS~}Ν;+A Db>.^HZ򜣯PTTSbjjJJJ ֚95ksN366/R+ioDEEhrʧnBWas>m޾> ?~/܍bܦ/֒/mϞ=>לa*G JX IDAT!xELƨ\T@]QP'kkk߿1z|/^uzf@\\N‚iiiZgvZYY=uNRRN#gϦ{e_ >0)J$x-4qiLJi+oSNXuGx!؅B`@ius&dF](x#GdԨQz333Yn7n>}:={zҸqݻVϵӓ3LF}F`P@ kԨNNN)JFI-4ɟ닷7'Nдݹss5Fޮ8zhtXn݊+6mgΜuʴiӴǎK`` /_֙vZ>Gjj*AAAZ$''ŋs?+W2uTmۦLLLk׮/}!B!+;Bg>|Vg= !^˗7}ٙh,YK,;Goߞr]HIIo߾,XssUVexzzҫW/Zj9.]'==bD/ҩS'ڴi)#88Yfu777.]7}ydddn:Yp! 2~ѸqcX~=|6m7779|0hт}8q"5믿KKK#&&!B2Lt  !"އ @ +3PBٸq#;v`ӦMS|yfϞM&M:233һIm۶X~\\]] QFz4oޜ'Ob ֮]Rnݺ:tHoQ#ooo: ښN:Krr2g,ή]شiwڵksNk޼yokk[ B!xQ&@2B!x%pk*`OQx܎z{yzz|'*4|u}kkk !C=?\Ɔnݺ9e˖l{ڵ+k !B# Iv ! -Wy^)(B!uЁ!ETA2 O.D!$,, .b ݋ 6thB!6v!Q] @TA~p0a Q4YZZbkk5mrƤB!DhelB!^t(O/`;n F!+2h C!B! )B>` p?p8 |] !B!Ŀ<.+;Bϙc:us)pj S!B!^N! }Z:bG?^؇QA"B!B1BVv !E<.tz[`>)p8`a0B!ՑB!DѐvbޝUY߈ " j*nfKYئLXY5,eSS35VX6ۨR*. (9A]qrs!$mzm^-@%sZPA$-s$,~nI!"%uKJ2q5Wxxv]ݥpٺu֭[ePnޒT9Gwr@%Ins$IuqãVK:TU⪐*--K(˲ g"jqN`ss6<+i`.1R)so S/kIgEOUD6HM$]Vayծ\R=KwzSQ$p$纟%us$sthκ DR{ռys] *իW_Wov׬Y9s攸?|^?Oip&i]J#ˊ J:+cUc Wl971r^ 2$MtX>W\} OΝciɒ%%Z%!A\roPԩ: y@@cS\N;2:}*/U~lI (qI?^gΒz˹rNEΩ￸^R\fΜ)//qOﯮ]VZҿ򗿨o߾[+1< i"c,$oS5k.m+pق$e]+j cI`EGo(>_5ɲK22,kӗXzNzhYQVTԉ?% ɘfʰo_2ƙԪimrJv,5~"#Mhh{9%Iǯ+*j  cȘeݛl:u%/ޒju2fɘXlݛY"KښJ& rn䝫_Nzke׷¯T5kq8qB-Z(D%&&yegg+>>^̩JIIQ`s第,?~-APBB5k:uTxKeffvEpΟ?_9[M6-u=9秆 Kx%y^< a'xeL,oŖ%eey+:;u2榋 v29w[11yqn2yIk%Yk/-[ :8O1Wff r]!_!Imrr̼CBceE˹Ӆ }MNp(M/4Ikhl2IӮݍzJ\uOGͲ$#SqVL̪2l%-rr43*QIʹ]gI UZ)iy2335m4=}Srr.\ Iƍ5yd?^'Oc=&I7n6oެ_|QoԥKM@&Lƍ?Q3fPe4uT=WFF,YRpuʕzוM*11QC3gΔf̙3z'i&СC ӌ3 ~Ao[>|˗kΝ2e?P}-:[OԢE )##C/F`+JKKq=裒~Zk׮URR6lٳg}g~']{:u$i:thzFG~Zrvڥ)SٳJOO׿/ׯ >?#E1^}Uy>C%%%i ҦM4v?:u;И1cl2OK=úCow.9 Ӑ!Cfy{{~m;wN;wTo0`zWV-S=?^ hܸq$I.}ڼy|||twֲeԼysٳ㏗֭[kyFڵKƍ?s4dM8Qgvϝ;W+(l9r%ieݭ[7ݡ嗼{nm޼YݺusըQCO?٣9shܸqe֭;蔜kRj޼y~~~?~>=sy[rGv_sZn]sJ]vڮz̙3y`>|y<njEDDi/m߾};wnmڴQ6wڸq5kg]6ϽnFIҪUt -\DJR-4o<[GV$ޚ0agS߻ᆱz*O{ァ/u]^׈#|8x -YjJo I.i9pe٥-4Z11gLNuT5!DG )ck|J'tqc貳G9qj֜bmp!zG%WLBjYqﲶm;VH˟e9(9L+&&u,gAS?tJcaөNR?ӡߥ!4z Ƌ]% {I)(-r_sպtv :s=zf͚U_?puU]vUϞ=V`'xBzO<~'Nhz{w}k*!!AJLLTvvv?C?^Z7NӧO/$lREnnեK<#d<(ͦ={r O?'Q~};V˗/׽nGշo_=NRtt>n$igNMRZ֋+D͚5 =VN|^i5kL/։'m6EGGk֬YJOO~~~z5sLhwyGSN-We{;բE ?^VffAՉM.ՠA#M8190%&&x#G߿cj"\r/*3<6#y]x&2&F󙤖rY Ii2,kꖕ{KIt||"L.îѝesinF׽r֛ 4c$*{ FK")7N4cF^bccg;`rmv#IW۶mդI '7[C'OV^4i$eddhӦM\:OxM<9O{HHy|^4{*%%ۧCںuBBB H|VW3gDn߾];v>qDÑ^zIj*Uڵ+[v&L?$i֭Z~Ͽ^֭[+""B9rd?Sz饗ZDx]oPޑGUFeÄ_IAFzQv1vf9[$]#Izڻ7Hd; 輠I!͒;dYSavYRwYMH2&RƜTARO׵Hh$=n+*j &cޗZfc'HZlEG2>WX.N򯚐dIefe] 3J]cYr.IuݾF.ܕc~֊~!W[,?uj՚Vr RrH9$K/頤 *؈# /O?V^{OVTTBBBrJ;vL .Ԙ1cӁׯ_/ݮmJbbbuV4m۶믿;S-[T``mۦf͚iҥ͎";;[ҽޫ)SCPDD^}U_*ɓ'wjܸ^y|WZGjѢE;v$I?BCCkQڵK[lQ׮]K]ޫiӦڶm#GhΜ9ڱcZl k׮ܹ$nSDD 7xCڵݻ׿UC oQAAAo<###OHHpo.g n+ym [˖-oo߾z3ghѢE裏^SN /t-X>6MӦMS߾}/gϞ֮]h"^Z˖-so{<[~} <; MrJ_RCWH{~e?ZQQ$Kr7Z$ɻse=Iu$u1%óv,KIeLgIPgjMum!p97Z.LW͚%u1%L $ svr8FȲ˹I$3Lޒtjh |aK2,krhi,s%':p C%Jz-Z] B;K%uV3'q ATnvꩧRzzn&}:y.\'NH:{G:w5h [=Wnt<ӧnݪ:uJJXIh_ ޽[5k֔n… lszW^2dH::K))):w4`]:tP==oI 8Pޚ1c>-Zhz__]+V;CÇӴiԧOcs^lI&MXR] C;n￯{OkVXX֯_ ҳgOs=jܸB;Vݻw̙3F ֐!Co79B=Tw&iСCx*/ *ƍջwoR< bBCl:$〤}Qc2]u1MN 5^MцdYKpK;;"-'3IDATDƊ9ܐ^2f|\yQvrr[9;[b+**tZSa,}U=efldYeYk #yn[ҍ2fWH]2K$ɘÑ3?MRFF=ee-n*g{AF&QlEG/ԨiEE$53 V6m%թS(ujҤZhMV44h 6LkرF] =zV\Y-d >\Wfc٨QԹsg˅IHH(븜p t_gϞZB;VK5Ro_W@%:7&挤;F8.ܨ6{}y ,?r. p:TɒWMkt&Kϳȹcѥ9`/iC;JմiS3FPllVX'Nȑ#:qիf͚)00PkԨQ#谜5jFsxU2yرMvI͝;W˗Wͷ+?OwkKܿM6:p@ PQXpY0:kH)O;nEG9^9Y;kKuipY%L.(;~3Vcדe򇩸թSъNRBBSN_tiWZ~㣺uvڪS|||TV-lted8W]8{1JLLtD:uJ 6TӦMݣTK{ァ}4c 5kVfϞ+V(66V'NeYzsFU{NII=־[1Bzu6mS%TK,CWO9w.>KҧVck=r8^!5VV3rn^c2FfkfQpUjܸ7n,ViiiJIIQJJuY JOOٳguylUf<,KAAAjРՠAqv4hP3j(tMRkN5j(權wmnД)S$I5jP&M}QH;rN "jJZ*c%kڴ6mZeѾ}.ಔ;Ls}?I)SjeرHҢ2񊭨:jq*LepE*(d*;+ΥaQ18ޗ?&(T.*ԥaaITG!zk]Huܹ@KLL\.v@RjW;3~ѣGuc$9 $UG!:L>>իVZUQSb*;Sa'vl6eeeiϞ=yY(Vt뭷2@u;TJ̊t=ZAAA R&M[9ӧOwӼys}ו^SNjݺniٕ~zxSׯmڴQJJ>* W ;%E\\,ғO>:uHԩ6mk6m{9իW>/^~e;w +լR!Chҥ%8}~۶mmݦP?^7tvΝ럳eս{w ֘1c]^|EiԨQZb{Р kN˖-+h :Tv]Ǐ׍7ި0mڴ{?~\&LPv4n8f)<<Ξ=[CU@@@,}ݧ/*0IfС,Ӌ}K/6mY[/ƍs;g޼yZnzb?rH]DZJW J(c$-:t/^\7NNNѣǫe˖JLLkԩ4isԯ_?iРAr8ڲe͛{Nnݺ9v~h"ǽN͚5ϫe˖> ,ТE7mڤ [ &W^}رc/ohh}Y=%lkƍݻ$mTe˖-ҥKuQ5nX={=ܣu뛑Yf_~QVVu릱cǪQFZdRSSնm[u}ΦMtСBߞ={Yd7|5kV'k:ydjժaÆf͚_~;9rD1bŠ_ll+ٳG׀4j(y{|ݻk image/svg+xml Application foo(): opcode 1 opcode 2 opcode 3 ... ret call foo() libeztrace-foo foo(): record_event call *(orig_addr)°f_orig record_event ret pptrace_allocated reloc_addr: opcode 1 jump sym_addr+over jump repl_addr repl_addr: sym_addr: first_jump back_jump orig_addr: reloc_addr opcode 2 eztrace-2.1/doc/developper_manual/Figures/instrumentation_pptrace_x86_64.png000066400000000000000000002553111447213526500274110ustar00rootroot00000000000000PNG  IHDR;>y pHYsodtEXtSoftwarewww.inkscape.org< IDATxyXTe?}E̝E}5wrOs+Ȳ{|l~̬5ӴLMqIe@qC\@ٙ8"(_5p/3}+(ݣ6OD:cU7*<4n=a0 DDDDDDDt2{"jԩSU7v$""""""""jN"""""""""\#99,HJJxUuSk̙31sLر[)> ___;,=55ѣG4___?~BDDDDDDDDt_`/ӧc׿UY-Z___̘1BDDDDDDDDlxb#bbb_}χ[?##HOO/q%ԯ_S) .?@Z/w%K`3ëe:thU7>nmn1^{Z`E1f$"";DU76\PAw@US0)`ƍ } Yl:wҽ{wy7hZqpp%zJ m۶MH~dԩ@lmm=sݻW]_IIII@4ibly';;;#GѣYYVްaC3+_n]%_&LPuAHttY}^/SLEQ؈EQdڴib0DDD8p|jݒ[=fD}LwIDtQth4|_|ZMേ/f/ǷJU`iK.ҫW/uLN777Nrss`0֭[N:@f̘aVtssYx^7JZ|f*9r_$77Wz$$$>0+?qD/ɓ+#ÇҪU+cBB[jٳҥKj҂~www駟@e*/4c v֬YSjԨ!/ .HFF,^Xl۶q#z1ID@ҴiӪ>M)%%E' TVq̙jZVVF:`'O,wڥ򲳳tS̙3Ǣޖ-[ԪUK v_F /so@ڴi#d߾}fyfkZZƍ.~rJ ^^^dŊ^}U &MȦ$D@`ZazڵkXv-lllONNN1b ,YRj}VkunݺEΝ;-0qD}" /_Fddd V\ xѸq /0nc߾}׬ ;wDFF0p@#G~r c_n]5"gϞSNUJ;; v\ݻ7֭k7~x%K`0XB5bcc-6l''ۮW^G~-???8::BQ(?V6dڶ͛[WEͳNBTq7nTJ;Bd#77Zz*㑑QM!Gǹs,^on:ܫ&R!!!u:`ŋի^pqqABBޙ@qpޣULuիW򅅅 /Haر:u*^uC-W233o5೵bFc|;{QE=#EJJYO<___DGGWQ_||}}VuS`ޭ[7ҥKf)VX8::qErrrU7i+Z166,\ .,EGK*+WΕVLuo>yfʕؾ};BCCcxzzO6ԀoEz._ a oV͡iӰf̚5 Cݶ'|Ê+о}nNƸq`kkqƩܪeDNSnݺGZ&//֮]k׮Y<~ޢӧ7IϟGaa!ZUpA8q\w t ֘zRio5q7d??O~~>Kjy._x""g裏pƍ:xTuSLDDz=~m{UB΂,][oXuVDFFbʕxrsszjɍcpppP/)33֭È#u:9gggtҥ"6l{,^-鰵`=hm۶Y HOOѣGѢE H ݺuefرUM6} vnܸ/^D:uЫW2ˎ;XhESW^:v8Q/Z)j1yd4jm۶`3f D/u4ht={`Xx1|Sϧz @DFsѰaCٳg1bML=47mڄ{" 666/u&¤I0g9ׯG`` c'KԷmDDDd)-- ,&L`ҥHHH'#FXL>x%,^uw^,[ Y& aÆٸq#~wŋ1sL5 /`˖-8r uH+W_T9{,6n܈8\pvvvh֬FUD&/8Aر# d&&&VQPPƍcԩ$''cƍtHLL(ň#{ra\NGVyl۶ 8}0l0'rrr_B0?J֫W/vEEEƩScǢu֥ȑ#Xx1鉾}bѷޘ7o_ɓ':DJJ ,XN۱cG̙3Xbt:ѠA5k֘Pto5c ۛ#O=Y];;;6eԩh2B2ydnDEEW7oi ILL4KѣHt ӦMSecc#6662eHMM]h4fYgcccm:t4+WJ}?ٳgeeĉf+7|~;wZNՊz >HtϤoj%jywwR|r  INN6Ko֬e˖WWWP~}9yu5;<5w2Mז-[$::2k֬k7|c_9䵧e˖rEot] IIIf'uֵ?7n,'N(4iZmM6gZ,;??_|Ik:jO>)w;*Cw; _p5xy+3f̐pٴi;w._?,5vl)vO>;JFC駟Z苈={V՛ot /+??_IXXtUx 9~Y٫W믿nGwޑk׮͛%<<\֭[gY~|GK/Ixx|j,7""d߿<裲l27:NeܹV7))I壏>OcS v|g-"{&MyWꙂbkk+_~䈈Ȏ;A{%ٸq 9{:ZMƍ%--MΟ?~dĉk.t针g777QEvecƌQk׮ }f|M/"׮]<ՀСC2zhټy>##CVX!>>>@~Gzꫯ|rϗ駟]̙3HVo^v%/'O>H/^lV',,L{|͕={HN7N-[XX(gϞÇ ?/Yfi&̔lٰa-nnnbcc#SNsΉ`D  JZZ={V $dܹ_|YD۵jSOҧO~:_}U u֕M6^?,駟Nʀ;+C`($"] v}\N2m4G۫ZDwޱwAh4d:zVZz>5;]]]-z… <f{QkDՊ9s"ĉbgg'5kִEt"vLk W 5j0{ mڴQ+==] "O =r("^^^fM/F5j$AMի H{ vWVZ3((cG͛ =W^UXWrr\rN777h4z)dΝV떼Zy\~]֭+FRSSLO[Zֈ#VMA VM_&Z"oڴi@zev1>U'djzJJىF[,sΜ9j`N cͽ?QEL<"-44ݻwG^^6o\zm۶Eǎ]d2dԫW녅0XҊ+ǏG&MnUV#GE~`` v튴4n1v-&MX~믿"33}E6m,A!77;w,u)))0`_YfaȐ!nk歸k׮0 VϜ9(8::b\NVV֯_FiӦY-s@0W^yb pGGGuu֩GΝѡCeOFlll<*4A[hРռ`BڵKw^X ʭftܹsd\r,MY&K.MT'ҥK{3g?ǁTNmYYY8>Y|4 Q?0</ė_~͛7HMMEAAYj8$&&zC`` N8z:aIppYЀ ͚5f*xVVV珔@BB, <ᡇ(cUEtTIxVzDDDDRZOX]x7nܰzqHwPᶞfuLdccFsqv ggg8qȏƑ#G`oo={^s-Wp!l߾ΝZ} IDATZ0=^y3q]6Zn<,Y"̙3ػwoEDKZMK!C@b۶m~fMDDLlذj[ʣs}o޼9p5纛`W_}U.1YxE _~P۷oGbbE#-- ޷54( ㉈*׾}_W"HӦMN8!DՊlݺUͻxtUȘ1c>|XWF ٹs,;v3Ϙ3 .ᅲdIOO ̤I|wV\XX(@͛˻+@jԨaVO׫ӹsg9uY7K;v͛dڵ2j(,f͚ y7PDh޼ybkk+ZVիW ILL4KѣHӧ iܸt:5'_6.2vX|eӦMM2EHϞ=)>>>qYjz.\(M6rQIOOtU_H/"#+Vx\RH͚5e޽jzRRnZݷ!%%t/e9K=h<{[шVHoذdtRo!"b&[@ԩcq:uF eӦM2|pquuٰaC޻~ɓ'X~~_kK]ƛo)+W E[zGGGYxz-z̞=lyO>lk&ׯ/׶39޴LQEf͚%z^DDrsse@%--ͬѣmVΟ?o ^^^@>j'ѝUfn;ZaS v3<#;v5W2%RlӦl֬tAjC'|RfQH [;ED nÆ SN)666Z vJ۶m("ҢE 2bYYY2l0u]ҲeKiРؔZfh4 >>>ҩS'Wj׮])\8pAAAO>eѾGJzCHH4o\\\\|jلUWWWСݻ5k׮JfϞz[VZIzmhҤEM%{}bkk+~~~l; vV+w-9sLj-:uooo NNNX,@&L \\\$44T7nA Xl٢#))ImGך5kD|d[K``.];ED>S\!mڴƍ_$%%_z8;;v V,e;E_@ ]iFkiQ'==]ڷo/FBCCͮǏWD؉ .DNl2?͚5àAk:V(ѥK,_.\@1d?:Vknݺa߾}8T eݱuV[VNիWvڡw2dE͛nݺa…8{,Z-^yL>{AAAZlYFD瞳:aرcfq9r$RRR0~xtf͂N;7xjX`~i,^QQQ~:jԨ~K.:tz 0Κ3׫WǏqyBDиqcsXxx:5>>>믿GtիYfᥗ^իaooMZ}Wѷo_|78pcذaSY#FsΘ7ov܉$ؠm۶ ѽ{[z WWWsɨQТE ̙3HKKzVvލ `ڵ8{,0tP>>p@[tww;~bQ`'U f̘۷lӦMW_Qec>֨Q#DEEY̧,:?UVVVǦ~]n  vЦMۮTzه~?ADDDDw$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""$""""""""jN"""""""""U{p':1`\O#~=vSK" *eZE Hcf%66 +JLڻ.""ŋ@~~qZ&@Uצ4o$ @mNz`|gmU3l-nE?v$!b!7WV a/ E;!`'Ug6b?> E@^DDDec}ޥukfQۥ]l@!Uرl9n5ϊȼ$"":͛AA{U~r {U""z0TZ˘XreeL6 ۶mwY 2nsㇱshQ7uCs02t-4GUEtm-+w):=rIDDT{ XXݻ[sPt{U""z0Tc"cO䄬,ͭ2VQiwߵTxma񍈻R = ؗyy/g/|X6tliԴZde\''6!^wڎoOna.'H [a!CYjsko8W{Wy7e+-+ (À:xZbmps-GgpG6ml?"W '4Vt ؜^?"9V!&o4H,W*WӼ74xGM }[#͚5V_j;]ʡC =zh "ENZ" JLL4k8=Dacr 0@> W*'N/Z^KC Fr"):'DDDvT:wlm] X7dJHDDDw #x}`v<c^ǎi [˗?<8r=}n0fWds$8zkE1X⎎o F1JڴـXE˂~K7Gݗ.a0,P삣c'zMNRDDTe*14xyyvl;w٥Nl!??z;a߾}xg,V 6:՜\̼g;gtѭF_w(Ƌ-UPǵ3}PC:ذl4{O'Oh1W]^=[8 <8| u:3/99psFˇZ`p n5 =F <\qɬΫN]_@oУ{}h1CCKm\̼L-ieEȻO'O<, Zr sqI:ڤ }2~3XE^=_yyj7gݻ;v8?ig"+7}rmD&(ҢE{*- EYUT6 @3(ʜw&aVJCa} -%[`<.8@Q"\ 1Й`]Q4Z""; LPl{/gx7 p*EGW z=0wnqO|eutZ.c rÑ oSPP\=AicxqD~BB~rP&Ml`c+E0a2)P0޿u/;EY `ׄ*i޼ш论`o___<ؼy3|}}W@@vaޱc裏"((GFpp0RוgyM4?N:UVX~}?`QF4 ƌe˖{PPP'M6Xtmsi j/~q˰0Wk\'H-֬?~yv}A-c K-|=+熉bJaߔH8tLV|fj qNv4`\ ?9~q3(윐W՞3o3kiji9T'(oasaS7=j6i . GuY <`k%9c6l၁ɮ^{&tݔ1N "dCQb@9v,O+2\@QVR9vlD-Zi'`0Tt:ر.ʱccxhyV:E{Rt(,lalL^ErVbbjtl@͚`k;T- ӅAQ> MN%ʽ@?Etai:߽}8}Yuƞ ';*,44G@Xw;;㏁%KO>~wozl^{ mΜkN2Dv*11Jl堬^/c=FcuSEPtEt^0>YSrC>x~4/,5N7"ƞ CSEۧt%cdž+:]_H-R@DDw掂|h"QQQ믿#X+k.䁀ZƴG rCŦǘ@?vp{m>oBy}9nڣsYS휱`wjPRsɘEfhlvк^r`?DO=/Ƶ}ҬmI BFF._Ν;kTMH-k\:R @$xa3e[x 41Ҽn ɐ8dI$ZٹjFc  ^GK9s(xѱ]n=і-Ɵ&}խ | c,77&LufFH޽aL4 YYYfyx1i$ؖd;88[nqĉ2zU9s͚5+׶hyyy8fƠ:AAAPcǎ-w=G[Gly~ګ2=;ށo"ٕzV;bQð( X㗍O-q[Q4G?T|OGVk de"R _4>Tlml-]]_,|M皨^Ϣ(hQj1 S{5kVͭ R^"[`u"|EFĝGZtG^_AQ㹼Fw|*m5L1]*b5 iYy_Ҍ?+ʡ-Z`5 GzUJ6oތ.]yVЫW/DDDiIIIpƌc+cɒ%e;99"r8 ֯cָ#66YYY]Z5g# A2Nڌχ|NϡKmdgagjVC-X0߃ޠ oƶn<o"ѭFԃȚq%!?QV?zj04;?ltc3}j,11w9DePgh4u: (!2"$pq\w ?i;;g(J%uVޜ(͛?Ј %""T^3}n *Oϲ#R^U ic96 dDD= všueiӦ /ɓhժG۶mkV2@QZnօxg{n ?>] +Cu4GaJ:[[ 2l?"nub2 NvNr.E:IIU)_Pg7 CL IDATiS3+&jNU1`8u8}4LZ?ܸ1Yʱcە/ј`h_bnIQzF>WbbCQP |5Tޔ\2QBB{p>%͛7-ZIH4(i|Jlѻ^"""K tq|N2ujpiN y9=C~ IM!%44oVBC`4B9qJwZ""reH3=QL8f₌2\~ݬ5>Epj&0 [ע]s1(7qb4:nut5 [N±S3NƴecEJs'Ik+xl5ʉok7? k) 5ydD\VN6>O|S+'NZ|܊=4Փ&dn}o\HܭP-!#_=r.'JRRJ~`ԩT*/FuIp\)~~8dZmSJuVnvNR*}M]:rmeBdY~^k,#I@78{J Z$#˛$ MݯVrP^%? *"-Cqe?߳ ҹsn;qhot Y:FHl׷M}} 兺qNP~zZ͵4) Y IVA!@pWR)fk6yXm䎓O;3g9wߗ(G=i;Z] бfRpln)[l G*T0rg`ɓ}{hR ;?r23ٳ|0}:*~RСks)y=W >Þ\)*ggwe~^(dCs$})rϯYޥƖ;voW)0rmX,+QN@z/Q 38u`=ǤGZmzԪjD%$Q55Xz’8v8JJIҫ)"޽{3n8̙JUѩUV?ڵkٳgIIIA%˗/o߾U^;YaaaѦ͍EedddpU|||n85jdZ$izvv4fM]:m &,^9+b#OK%켸Ljn*[Cݔgץzl){7|Ȍm %|LrȲ~plIMe$f'ddd1Y榲ܦVVڸr)99=GP|Gr1Y|΋4v>,jZ~Fʽk+ $,?&A=|r[2̑jBuz7d7K $Ȭ P!I-"dIꊡ0.Yv/++g KV11p*v2h7v::.'-m <,(9,Tj{ebH =c'R=Xof Kږ#Ig\I IsRŊ+6+S+aDyNz.i֦5/c~{WO!< WVlQ^e?~im 3g™3p*̹ȗTsr1 vȫL8p@1vհp!&̝[ф믿|2f2߳gO֮]m'=?.vPx Xcgbv"]vAZ8A\M<1yq[[ߟٳg' /ҙ3g^^^z&&&L4kbvm 5k8z(?1l08K/Tؽ{ү_?jxu > *}6p\NBz~:n6n2cXXV*̱6DgDri{>ب-^;AxJ866nыdV?xj w{w^c)]=u!IIbsdl匟/#/b?%$~X*Xm‘0ۋs_FbijKkƶѨc:W/]iݦ2cl$IeYlfR.dD ƠV)1)=Wm166ԔW_(*k뭨)h ^Ȳ#,Q\F SJ?Y.3&??o I"g5k4H-^ԩ<˫5ffH 8#nRx?"ViKheI @+SS Min|}wo I4D:C^XXt-}((ʮCX[;wɉRRRn*[]ٶm[cڶm˜9sXxmԆKXl94ZM5R=+Gvr;Nbݹu%GV*Y``A gdddˉ'>|OV3sLll8q"L2M/5˗/7h`|w￙:u*n:.\bO8A޽IHHֈ;Sia$C9r.]àmb^\;[3[.Ϲm=@psQ:w p xT7X hUjܼz~$$"??>tB ] GbejE'U(/֦d}^],Hfn]* uFBBBYzDJ#=d?`8.+Mzs}}"I!IHϮ/=j { Ύ˚6m˗12R7ٳ௿tL||<-Zɓj6jwaN236:ڶ_N֬b]2ES-}SuЁ4:t^<[{qF6mڄ}\gܸqZ`mm͐!CXtip;t耗VgtINN3քΝ;_s){Yyz.ݰ%cڗƠMzy/kBǦիV/|dTnTN @}|Q0^$]N3Hn L ҩSUA =NŜ&=OYUjz{XS _'یDKe_>dg`aOQ=l JHR(O 7K/ĤI06668w>꯼-w#| ǯ`Ȓa}]+XN_gWW?o~C; Ij , OΝ!h 3RQ-A-x[m;p0y]hsqyq7{&O }-L{GfKkk޼_ipsh83e<Ag6~e|KߵF $) X(4E*~m,־ncIZze "0TU̙3YILLS_6+))ٳguV5jDVV̝;#Fѱ/Xb ?\M^;~́ums~i{t).^橕9xPcvn9[=_<ʮK+ӓjɽ#Y麰;G"(N\YaC_>Q/&(~6jkXi<8EWٜzn3_'5ZQ~ @j>}:^-rwz0p@:tyG*_|FÔ)w~qDF[׮Vٳv|IͫY2xV?H ;Yh;oFT:r$_FԚͻ"R#8xBB0=MfA&*IEgpq#*='9u#>)s~J^0Vs: Crk5"R#}PI*ޝdDE\s3 lh 23`<qmjU؟T;NDJ'Or*ts2=/[#lA7%%7}>}:?($$)SΛo'SXXȀh׮&&&3~xV\YvݺuׯFݻDZc\UKAAo,sY{ӻ5՗d({~ߛbM1Fʼn$f'%d+-ZKzMp 1;ÑGN }9~xQ[5!.+V??̱ O E8ap5dd2;4ʙE oZ \<ܢ\L&< 77’8{\YIs9Ueи-$&#ÑG lNIZ^%l ݦx5dw6m"=?{s{=s cmf0 4Hh4/N9""uxģ `JEܳ(}#$ ?\/YRڟZNp؍cy^&@Sp {{{W? @9!+AeYzYrXeYC?j-m,3C-_>WfZz۶1!!ujyg䬂,]_AqƦtrX7zXjuncd)cfϬ*IM((.SsS+m zϭ~AfZvxI>u\o_~r l#?P˪׌V\J${݇ |=/ʲ,'OmJ4%_F@|||oB5kzڿAl] @? qk{ij_ʾ < E3=;{@je77}F "x@ kӧWzaÆUzx{{˟yeYvwweY9r ={oHFzYo^NrDJ,˲/zlnxr$j]V923rz^'3C-i)o ZAT;vw#0WϨ>u23#?kj*<Q6zTfZnq+]P˦oZTbtyo~5#y?䢒"Ye톯-7Wn׮ ?|nFPN<;jwznč] h^i36kɲKCeQKCnՀ ³,]{p*,VH Z3 XڮQ'Hcrp5shF3%]bv"{еY^>am=b ?Nj0Qܔ.kϭCЛ, 652Gp4(b?љWþ"fƛ_g9[D[’!oC((.uCݽ+"- ;]:6ó;oy[?0(3>`jÿ% aab?2!`-qJ*5^A~q>Ƶm)ʦ252Qdp2\AÊJۮ/Yʪ(ig9ʭgP樲K덄Ù0a~+++^u.]ʗ_^ 8qAI>}:'V]*..{{*ǔɉ{4??R,SėC?P<'w(sJ*ێM;Dua5JXR/ .+B.iݧ26^o<nD[rwj fB/Q)ڙʿǽXSm|>SZ;;0ߡ<~U 4^HPRP%EM'ܭg=V8QZ5gq%Ǩ2K_yQfxeNFP |٬^1cܲrVVVddT=eeeaaqyyy!TJjjkMV;;s;]QWQWs1K yFfon__]Ieȶ Y@o^7ӑۚb6HSDP]Z;E`|OT5< S Ay$^8VA 7_E񎹾ڮ ʢJ!~|moBVյBB0qYq4fEJtF4,Mkpsqyw\>8WXe~ϖW XZҩ%aIaLO^[WLJ?B$>ydM#L|8}<=-/`u뱥C7d)̠of~?|2ZzLF nx:wÖy#M^N(P_EIYr7SQq e(FϮg(g(aoll?͛YdЦMBBBHJJaÆ,_}ޫjxG^ ʬX޽{W{G5+WPe7$[ҷen'**Kd`bv"مx:V,$|Ao~-IN⏓ЏLT? iyi@ߌeRXmo3ܱ],:sI9-y)6SGVVW\uַ'0LUABWFAAtСQ!ѣGڵ+(.,q'%7qo"(IP3݁(CPreu2gcuaw0``x{9\MZ&xfSQԺ9z:{(;s;xk 08y̌hdۈ 0+Jp \X9 f>.e$$)Ğ%%7 c hҎ1RYɲq>>V;Zƙ1g;o>z’B6mh1 ppg<c1=z`oTe]vrpvk.<ܲmW&ijߔ 'Vϳm#xtV^ŖqK K&ܡ(HOaـƽr)lllزe rIxQ\d8C$z5!!!\pӧFȨLz ?JEN0a665 ^x_+'߿شik֬V9ya&i`ڒ"MnЕ$d'`6 ײo2c14Z ɹXXU;"5*}&%uON He;.Ԛ-`杛[ˆ9q$4s`Pl̬9u P6n{{]FaKVG -/FՋMQKj4댋 cQŋ9x &MK 5FҥK4m4xzz_0bD^ K.xbZ}}#.]JΝ.iVONm\a!m#";P<7G֡8P*@pp;M$ۀHOOo]j8|||8}4͚538f̙$&&lٲ۫N^Y xINN''<@ 1B0pX LՌ!=?B՚jW052A=<2]jnnn̝;_y}v6o|5sϊg547#.+6nmj@'&#o̿HeꮨV'N… H}'@P)D" K灴zI eRsSy7,|焱S 7P`y~G;- ꫯVYԩSTo1v|uv5$IF~LL;B;WN:Ř1cعs'uhJWYP QPr= b &ky㹬T/n?(x3PR|S *clx\MJA~JێM;j;;3ˊ! J<jZ|2?0ӦM?C p4 +Voo; վ}8y$ǏNɛ.JSEi$10^ qqc [ @phT:p^5!7F<>bbTToߞ4N8M066^PpףVy'tW^ouػw/4nܸ@pD ׫F@ n,`J@@ Zӧ+yhZOLL F̬BRq8=%d5S w?Ny%TS 7I&3ڸq#Æ Ʀr[F!!!V[ddY&''YQ.2In9999''VeҔebF(F  Tc(4@ 5Jz%7@ D; ٽ{7/Clٲ9s搗G ⡇?]7_~?lܸcii5 >%%%9rP,--h4兽=NNN4iҤѣG  VK~~>> HT}TzdYԩS={Z1999xxxУGZ+d%I}x@ C6WUG ]Rj:t(>h]ss?_~رc@ IzŸqj4֌۷om۶4hРyWh",Y²eBN+Wo߾lٲ-ZO3rHzܹsIMMĉ4lP6o#+Ϝ>3!:z!mx]~VطmƀjPcՕ'''ss1hXh4e'OV+_hNMAS['"⶝~)NaaSBC=1ѿuS8ord_IHQE-CXسױy9{l}!(ӓ&M0o޼V!''___4iܹsk,7tP<<<:thjw Η)ܗ,XOOO4hVouXĽ;nؙA`` ]v } FťK?*2ydNjгs 2+Wڢxe˖z;vݻ3Kpp07nkҥ ;w$''D9BN W9q6mi07)(UO>-ozD6uDaII2[0byx&M찭"Tdo%#mlhVnyvB˖Kڞ*KgZq(j͛WGp0aDDDRPPP*1XYY'|b26m֭[ >*ǁzH o6׷*w4ӦM=-/wInćj72bF#!!!,Z[o9s&wGIh4;O&M`Ŋ,ˤ;$ѵkWVZnnnhZ"## GCQFtԉ+VЦM),,$((333tÇٹs'cll̨Qشi!!!xzzbkkKAAqqqӪUJ 2:u YHJJرcXXXJEvyjr @P\xU':+Prs {a@J-;Ea\]]9|07ndΝӼysO|||0a&L //F5.]bNhh.l`Pe˖4nܘ`BBBPTҽ{w ;0ФI.\@PPдiSrrrҥ $ ֌7+WիWٙN:՚www]:+.U59ReYjFNVVXςRssiTM1&VK\Vff/OAq166L,-15.C1XTd@.jnbRs[$K1QtMh/YՅ&&uRXhժ[Z՚dh4FEEjuI% ]Ϸr26.r32$iŢ" O<'F. *(jV7BM$9Y(s~tt4>CKbb"չeTY|򩩩4hrsiuk:?dgg^n;8*}BbccoPRR;OÆ oZך|j:0x6*,;;dͭVB^o ]Ys<%%$lXTĔ5k37Df3`WnAeź@ 5-,HܜFF/̚5hK Y0x0INX#QQi$?(O980ۛafdDgww? )'\ưM$4\1ƍwMu"?߳QFVkj %o::x6Sqqxg_22OI閡X@aÝS#mr=(;]W^1')gIFFG#КT)%%/z2\7{D7pPsZsdYdgwXAAیqGnnBY6VsZsI*yhxC2V -*rkVgeh4Ӗ.]}6m[lcРA_> Xti={0gbbbpss#::www>cz?LQQgϦ}L:˗/ӬY3 /ӳVܹs̟?'Obgg9L8W0zO j|ᇺ ʦٽ-ZIJeHMMٙLdY?A4z-nJfHII͍󔔔Gd4iBaa!Z>L/~y^{5]*aÆi&ΝKZZ/S{wF̙êU7oƍc۶m̙3$LLLXx1}ѓ;vfŋ4i҄87o 2x.Y駟ꫯ}vԉ'xx^y r?39XZZÙ?~HNP澲|֭M6,Y/<\\\X|yuڵkyw166ښNʌ3nVFtt4o6{qdddjyW:u^7x 6ޏ5O?{Y[[s1LMM%… Yp!FFFX[[C߾}Oitf 2 &sQXX| z?:tdo^a𩧞ޫwrKΐdYۻ(FD0wv 1c >> g}T*1yd ,,MNNֺ 7oƚ5kn:b,Zp#\~!b1svnnׯҥKyfcq)4k Q;}}}d޽[%\PP<==?\mw,,,Ϟ=yaڴijs-ZD@Gmпy{{{fBnn.Ə===|w"## )Sm%%al {o` <_;ژi0}S(ah˖Y% 1L 9E{98-_z6NpY,ŋi?=cq˖p 1S'Pr\ 1TBY7&&7XXU^sAZG3{q e@q%d~~6::)O|*!A^]V֐66 ٕg`颫{W|9B+U$8$ۅؽpr:U9lb)ZY=0Wez߬Uvtd'.|73> sHrQ",ܴ BzZ#K6oDrύTgfv6g ;8ܪOOOtBOpj+|Kg\C6;{P 탊!&H ESNjMo# 5400AA(;wFN?6x<nݺK.aȑ*k>9r$ZXÁP(.,Y'ח%ݻ0UVSYkРAŰa0dx<\x!!!* 011Eנ@cu+Wb֬Yjb.֮]]v L&+&MRkkժƍ|V)R֮]ÇUܹ3Ξ=c*}'N@AAn޼dggϣ{*l|r=~~~{jIk(޽:-@ |@X,l2dn߾M_\]]JH$~֭Uٳ'_}bԨQt WfgX2e 222޵k۷o`Ŋ`2Xr%~wy:::̙3pB|wgԨQ*gϞج///,XiiM6a*펎8w ;wТ!F-???|'*8^P3g ;;׮]S9-ҥKqi`@__RgϞUNҮ];xxx*b'˅ARjG*Ð|χP(ڵkPѭ3"#^A\H'0ѐʱJ&6 J'/&UʔHp?>gp+6 οZ1}DOOEe1pap̍X_ё;6y@'y<Ϸsp 4rG`CbWBCm9ZZ*uĔdj !7cN4fW6?ggC$r<LRz\}UZj*D:CκqUۯJ$mw[X4ǖ͖^S 1D^nbccfy14֭YA6mFuܹؽ{w9.\cǪ 4k  JQ̘1Cĉ HT?㫠P( \|/^ē'OpV-;v,cLܽ{ѝ D"}ݖ#0[7}J&K}ZֻsETb>3gUzǧA4%6a,TWO/YS_Sbf?pt{LBVt*ybjJÓ c:9]Z=)iP9BTJQVPP*^ QSPj#˫]@ #66~m*M9>sxyyynu(ں!ܹsغu+n޼ ''' k;vXlذ!!!ܹ3rss營~A6Ufڴiر#R&T S#+_  ??ӘDDD`РAزe fΜ&ݏ@P177رc:EXS\TXW*ц\.ט; /^o[n7nm۶#ͱ{nӧA6>c{JFCd͛jm:l6FmQ8_Lmx c==,KME#/0 /7ZT4@[ESm$yP)nh)ƗHhdxIbR"Brq w}%%vRq\cpG"1?kꮤ(ϯn<^TH]wQ-::irr*aw4;ZWZZڨ{={ NW^9wbck ooo<9Ǯ]ЩSW(TUC۫w'ر-6.ŋظqܰ@PP5JJ  Tm<̙3tCgȐ!yf&z__:qssO53P*ӺUt…z}TM튐jdذaHJJBdd$~R=ǎw "v?k -Jaa`.Dj9EQ|\L|H/(ʅ<|\nzT|VZZّ<%5uww,ƽllӑ#+ʬQXl.lnz[*m}P,V"NKs͹n<l&::?N/]~O?]0#\dgijgI:`6ޟעq!"ij*8m3;wFJ-0Vb$D8wIceY;cXҷ/J%n~|< WW`;bsr}KСt002__̪wLutkvjj9|&XT9צXG 穩}J(WVf!tKGrZcm^l~X'l6,)1STԼXZYC$r8[P@W++3g!t4Cύ|k6[v¬kaQS C33SM&-)ɽիW&h/V(AVwҖ#õ-\nqW]݄n_adfb"d2oaaV\nf=bqǠ"okE6E%9Y]ݼ2|.#oI-ݓ v[Z9sA2S#_Jق6rb23 >+mXbML ņk*(-Y&T:tu36[X/ֆ@ 49fff֭NsB*ʕ+Ʋe˰}v_֭ãGm6DFFS8yp8: ]./IJe\&&&8r[YYYڵ+^Zm.ڒ~ΩY ڷoEۼy3.]:`޼yh׮J%q9СCjڷo˗cҥ􄙙rrrT#:tAAAJzwww3~d >)))puuD";wp=={6<<<0qD 2DF5k`ؼysW/СCh"񁵵5<==qIDGGcÆ СC_⣏>‚ ꊜ8pNNNX|9n TopppѣGӧdp~?5k郬,(--ţGܿOVZoiA XnJJJSٳgtZ^Xb{`pqqDTT.\RXXX&Lѣ1d|ʕ+HJJÇU#ܹs{ *o~C䎧'', W!)-)W) oTnѐdxsjaj /wwWJP /_B\R82e Zqr2D"訄27J[P߹JBh+ nB͋2m|b2[FBIY,\.XL&,1eK i:l6T֪4fRZoȌ*boR]cL[e`b"5Hoh%xQpqq^V\CሽP(W.д_g7 efGZ]HJ) IDAT^?R@b)99]>*UX^Q>)먫Y{ή<'?1_ٳVV7y%F&SΫ7;bmDOڂ͖bn? TjfpL9E۹$] Hߚh~~;}&daKKyZsppIr1POOXxuQ":Gq)|3@VVLMM {{{L0&L@ ӧs*b޽{QVV'ԔD" -B! 1x`~meX,oߎG-paʼn*hݺ5|}}!QPPP@+ Fzhٲ%p9r/R={ZhSabbV1Xr%zK.!##BΝΝ;Đ!CpQ8pXz5Dx0 _fӧq)yعs֢@zBXX_Xx1qNǎsydԩSR-Z>}TӧO#)) ƍvkkkܿׯ_Ǎ7pXXXsX|Zݻs_|^GGG8vtttТE l߾}Q AJ>|8^UeWBwR9/--H$B .(;A~~>zVlq+"tx{{CTf*((l֌T"k<iesDjJk(Ӈޤesܺu GZį KmSj.\My/7n\]]n:c222*eЬ򌌌R+|̘1شi6@ OOO0Lf6*nݻw1k֬L}rpqqKbDDD˅=; 4Nx>5Hf/yy-#G6<{#2WmmJ ɓ'HJJBpcn H`c,--Y+W`Ĉ 5@ soҰՆ#G4je:J?ž@ yjtk~?@ .nD|'HJJ6no4xtV.x cb}hbzr9gnZZ7``?\ ~kF}$5o[]Xr@ |Ν;ʿΝ;8zhi Ea׮]xi/)SPD"ߏ0 rX,xxx3QQ'ODRR022Ž;0zh!111u. @ #00 E2UMB Ԗ:aaa033ESC L&>8-[ĆCa/LXp8Oym,V۴CƎU/UK χҍ:`֭V>0 㣏>RɹUÁJ!6ݨG  doZ»F\BSSo'wE TCWhChQݠ]vh׮6CUkw̙ͨÇm@ 0:w$''@c!i@ @ J=;|H(JSNҥ  >w`hhbaРAZEQx)BCCbp H~AOO>V ccc}鰰h}@ 4gΜAtt6@ !44o Ɉ._M!u$##]tZ uZ޽{~>|...R oooڵkhѢ?1p@[x1{Ν;X>u>rΝfϞ 6OZVV`С*bg+++̞=Qq]bĈ*gYY|||`oo9s͛W;E`٘6myY^:y$NڤŃbbb4@ رcI c1ݺu{fMłzM!u$ VZ -e8lٲ t;̙3all9s޽{P6ܾ}[hbb͛7cĈ'BBB`ii^zpн{wyiSixq%DFF]vtߣG`ee6cƌÇeFFFBP`ԨQ*6X,t, ku\Jbb"߿I&,@ … ߶ @[[[lڴmB ꈧgZ &wjɱcǰpB2dQ[n?`׮]DFFk׮ZmӧTWhW^WiBJ"keо}{(tMcH<t)))P(Zm/IIIĉahh@ @ =jF՞|Վҥ Լ!144DT&ɪ *dV[XbXeł9HMMUi+,,ĵk״ΩX["4 cD$@ @Qk388kJ[>D"Qc5V?VS$A___(P{*, eeeՎ7+`5Αdjmzzz0`Z(** O>ŤI4(@ 6Ez'' i9-[J8w /a 3Fcvv6߿?Co8pZuBS!99Yc M0L 99YB{QQQ*1 #))I>055Uik֬"##5爊ĉ\%}v?I?a;'v:)ݣww_R)N&bg=xuSةP*sGoZqxD$F '^^^Os|ʝ&N[6C ͛75WTb„ زeZ*+|@oE8v~~zbw?6ع}vӳkUP+ӧpqq6'NĖ-[p1̚5KO&a/5zvF'''v<==-[֭n߾ɓ'COOOmHƪz&MfCff&0J9ӦMS{1ر#?p}*|XX\]]hVHNNƄ Ԅ✜xl@ M[VCoLvL)!oe#,.:$>88ab x)Za1YΊnb :c@>ߍz"txo@ҡ?!qf6.4.d\K_7mo@M`dd>. C_+VԢZS+V`Ŋ^cTeUF#o^t W^mR+SieN֥NVwɮVIO Wj;2`܈)!(()yB-7n:u1cʪQ֬Lu/bܸq|2&MDEEa޽pwwDze4]|91rHr0 ( L2Ehgg.]ĉpqq(B^^bbbC̱F޽qIkP*HHHW0rH\666޽;N8;2 E^[nK. p88q".](4k ())AZZ^z֭[7XM6PJ*a@ X[]޶9Y 9uoe}}4ݎo.݊F8C FU Q.(\T4?( 'zB@) iJ.~W1ojZ6*֪ թ~M_q<* (sP~LT*!kN(--T*EQt=BHRHRbZ022АG+W~nbb~Lf͚%&&mڴqRZ k 30燛q$Lv+ʫ՜v]17b 7ׯ޽{eZ?{l_ x"nݺHggg:u ڵv̙31sLAP@__tػv..sp@tt4##2l5i޲%mm(0LXYYӾ}p@v`cgS.D"A^`0Gc鈏Gbb"aaawӸW]>bDQ҃~PoV{WBA W+ΊL.C+n 4O%:5K `e`v]ѿYjɖd7*b^BTn-ܐX,P\()nkk{ѕΊF8Ucƀex e.ު,-/_"ILd  ^x@ u cp莿FMyFO`g RtXwsf05OfCGvxh BZ*-6ZHd\Ehs*J¬yJnD`BKh>N}/q(򳠍5XA8C}PPRaP aqK#J*L񛟪]_/Qx^fDZA:\>ZX1~xבs[{$J¥ˈy =Xƨv#OP>\QW0,1 Ο?nnn_֞}7d21n87^5ǖbYf  mc++TW E[yޠ*@۶mƠ6Uk:uPf&zff5 xoH̄GZ[@ Ӕ4%KU x-R"oGi\s\Z>*/pGc1YP(i2>,d׫ck|ՑY ͮZCxFC?_ ;y ;OC^Q\6TQJ]wwEM.h!--N~3Fq+r-lƒ KZ Ӕ:80Oh0b/_1 L< b%==9v65<- SNZsnIG/|n9hg'PAǤKȈwWbdBl ++ 111]0Y #ͣy J+ M%@hbcii)򐗗\t{26n(i###+V@@@ PXXc…*u2J%~G;w;''سg\]]ަ HII? HgϞɓh޼y9z(OU(V(X+J%*}|.놭,U?Ǟi?cڏҋBTf5|*vRxN?з@z7ikßcم q*7zrqtΩy8ڜV4~SRJlABX D(1=vRi_p n"~wFkݻw5.^3fhxuF 999j" >{Ah:  T[6t@hl{($%#ȕr&![W.[_-8h++Em=~PŶ3\>I{IJdb?+,& |S k]Fm0b@M}NrBzs(P/`@xb-^c@2ERpb9,r ^FPCB_6o +Ky}o*5p?NDEZ4"==@jj*-pfff055@& e7%u'Ѽ< 8IZZoSeeeaʕ8x L"vRggg\rE5 KXJ!UPR@2J\,V[),aQݷTiOP:QX¢f*,)T3h?mG|n<^(۷lXRX¢LW[P56[/oSX¢3jc[ KXԉj}k(,aQW#m6PX¢( __`|EQWgZʥ?9OzA:kG KXT-] K " Z0y| IDAT&QX¢枞Ѷ($QJG(7l KXT]v3 (,aQL*s(F(2FxǍ?];[(RAQE݌E˪dKVR\j5`UTjj*L]xߨ5kP}S۷LLL(]]]ɉӧ5ejԯJ?~ éLJT^]ݬF BQcmyON-[Q֚2e u1mڴ={V&NHݿq֭Wu).^HyxxiN]3gSEQ>c6)TNN_???*.+$2 Zʥ"3"毹C]C)oj۰?SX¢~~RA9Ќgg?*GkH%!E=I~ZQYYjm> y t**M2 2;z7bnREQ< KX"SomT% KQEHr#}`Ν>/3ѳTnb*٭]nZ @ 2vFv6vJxM;QPPR{|L2 (Ka.0K*_\++웼W-dn(I`chƊ"7;kw.ծ @OnU䥬dIeJ%N~qEH3kͳZ drgG!.7@y8[E_mfa&'=6a7T֚3\^\Pi,vj|dUcp[UWh |>=^=-ݴ7"zEdrt~( .\5kЯ_?ٳGmL~~>G||<hlVVV%KKKBH$ɓ'9uZ֜$##/_Dff&Ѿ}{&Fm*$ J%V^ 7o [ۚS`HcP垚FnTs3a7~ =uj\X'fǭmzi[[#HSÄoBb]Gg\}>>:O-Ɇ D%gi`I*X[~j1P( {&Vqx;i._VI=aǸmeO2733Cjj*Je Y(vcǎ ڄP=...pqQw%@FjyP&ΈʌBFAUB^~׹UƦh_W^ټmgL6~V@נVc?4l 5_U*P#ͭR ,N8>M:@{MWjbg$657|BR7v؁H8::bȐ!عs\GGG8:: ߿?akk ٵ*@ IBB7o^m:ϯIIIoSt())͛3L>]J>Ti۵kWס(͙R)=4sDQ5"t6x:0kٶSuSx\Js5,,WEpY\sZ٫EkVJ9Xr͐UYX,(^ |@ |DfFA BZ4/ϣyv^羆 Gy`c>JeKBS;M_/.轳ο 'czPMRRe|._<B;MSkDcڱڼ56Bo^`1YHO7$0T5,8V[jyH'ys l>@Üp6Baؿ?b1rT߿pttD޽iĤU BS TZJr >_~%|||Լ>F EA$LJwP)*c-*Kdy榪E峮;$ [=b^fb|tvdǨ?c_jexݰ"DjZ5JRo߾@ q ^V%qT9A&A_G(~Y^$GRz\=0jW8 <:q̓䧘px ؿm9c>?8t7{~tu?jR\ M&3 kO4M~nGXիWciL7;; &ɓ:{*YjݻUVxqZlɎ;ҿ²꟯]a{NߟeI͗y7 hv;n_F:)f3nߺk]EB?*Ǐ0侧T ?M;C$_̶۩~[pOuͱ[qЮSmg4.%]8s {J֊^'ުH{K6n拿Y8p;6٦N%h҈,cPL2{!z#]( &Lj?{fξ?OUٚ㍧7ռ[Y;hc 'Ado+ !BHΥhW4Υ\9Mߴ6_}13zykݯuQkR3S$J{/m6J>XғS8y'/Q+㛀zţZo33KVƭ'Okq;Y?r+S143gn'tVs`djf*'Jvo9 EQwfo/tۍ!~um1[ϧM>39sI<ʉK'tIYR!%=S1fT)SO˧l @sЌ111|-$EQN_;͖[r 7HLŶS. B\"spp.BL~LJj֬ݻw9rK,Ϗ~AٙڵkӡCz쉵5,^͛ӱcG~g6oĉ5 uH/Vu놯_5[c\pxӬYjЮ]2~xƌ]1;~3KH"o%߿ꝫ:[k&cZV{)繚zU+ٹ)f1))h~s~/m<wgRS:k4@7va-er("=u,{vZǴv?abbʞ鱤'ѹvV\923tsOu Ǒfi\yekƔ)IHIOa׹$Jd:+JCu׹QQQбO" ݉)iN}/'FoPD>ݻ 9!U Z*yv{auN(ˈ==L:Adw`>/@QKVUV*^R,٦ -*7ٟ)2c6rziYi.T Nښg))ISwS<[&2<|$5xEs%;xI"NB_ e˖-?0NRͱcprrۧ.c.o_dxzzJJJ=Bu%N-bviEQXrh) Q}5FԪWB7?nܽ 9rgw`jbJEۊ 1WcXs"T1CJX QwB!^!!!,^gfp l}l;MۗY$:7ki+غZk= /5jD+YxY[[ӻwoY.e֭; !u4C Bri؛Omz4skƙMۮX7oVZ%%)aaa޽{_ E i G|w±2˼ίy%;M!Bٔnռ8ޗJ|ޤQW4pUޯ`ugݚr8VSjܣM_6e4D!2矆͚†%,Kf|#i5{kݷc wz={^+لB!yf4lA^)UEQ+{,|LJ4qeSȆgB!> {ӧaߞC4Bsubcc)]4nnn;$!B!BqLⱲbŊ <بҺukZlɔ)S۷/lܸѨq !B!BCfvbaa#Gټy"((WѴmۖP<<<B!B!x J?@xIׇժUc̞=H!B!B0t?@^eő1999$&&rErrr=&!! .1/^$11EQ5&33sqƍ|ϕą *и^||_C!B!B2H^9r$.] .РA~*U7g;vMhh(~-ŋƆD>CFy޽رcYt)dffrڷoO*UEZc2227n-|ܻwׯӯ_? ۷:t(Lҥ1ckԩS߰ښ4ie˖}˛/999̝;޽_M!ԩS2vBGѦMc!3qY6lڵk._OJvVAWAfΜٳ7oT*,Y?ׯJ*|tЁ-Z0zh9pzfxw JDfdd+V 4~g [FFZA:u kkk@]"88Kbj`oZZ~~~qY,Ǐӷo_㹏K.XZZk.ʕ+gرC^X7o lٲN:o9Bء![~=˗dxeQR%6lhPi'dgRD:{,SLaiMMM֭%K䣏>b`ggG"Ea˖-ZRJ`:u… ٳشiӨ_>cƌъx >ǏA|ԫWɓ'k.]sjӣGͱo ӓ{O… dŊZ1-Zbiiɐ!C?~>jT*IHȞf͚ !uЁ; !}۷7vB&33cG6 8p +Wj[h_}X;yF cƌaΜ9ZK.e„ zǔ-[^z/ZC|<{f۶mdffI)So+WfLxxxC!B!Bxڳs U'|gZV1$%=A+7\sjj*E1Y&gϞ9x{{sN/ҽ{wLLL KOO'11WWW}FJXjZI !B!BWdg1p9ʰ~l[ni|Xllgll,+VlbbJBR{:%iii(b0 NѢEu֭[:mOԭ[7_=++VʊWjAB!Oŋ}_+Ba 2dU8@cyelْ+V<~5vA t9{0bu؊)۶m3gѢEi~633zlٲEoEQXlN{PP .wlJFF׮]DE!쬳O̘1J*fPB@&NKFԒ!rm}N7UҩS'N>7їI^~ްaCڶm˹s4m.\ (( *ЩS'Æ /իzcYpfƍO?%11QC?~<#Fj3f ~)׮Nlڴ˗ݻz`9ӮRԩlU!B͆  %55ء0c NJBСC9{,Ŋ3v(/~l( e9=" }]{RJ̙3y2d[nM6dggcbbBNN?Yz޼ys @y7Qh/_=fӰaCƍ/=zQFܻw 6f-[> IDAT/ÇAn޼ɼy󰳳cر=O?6lSN,Ym7ؽ{7k֬ߧHC[柫+ݺuÃVZȹs?qww~{s!Bߘ:u*L6!/tӍ+I_pVO(vMhh(7oƍl2jԨnݺѭ[7&},Y bbb;N\:uiӦ,\ŋcffƛow}gpϥ=zмysϟϟI2e߿?$&&2fLMM)[fL سg֭clݺeR^=FARs%חG}v"""صk/4nܸP!Bۭ[HNN޾@{H^t,177ט$233)_<( IIIT*133{lL2 ի舥eׅ K^!ZFFc{ܹõkװ˳x._Lzzzߟ5QyL.]"''rʄ&C233IJJXbyk. .]"33GG|JLL\j`֭[+ WWW寿2}||D_Ovv2w\FqqqQ6m)7Vj֬(RxĞ={@YV!UUiWLRhw^Yf8;;+ѣGᅧLy:t<Ç+*J5kRjUB Jzq+WTUxzz*5R\]])S(*JqrrRrrrsI+>>^ Vz)UTQܔӧ|4h汸j#""ʕ+kժUKQM)UVU֭+WNڵ׬YWWW/T8Ԯ][PU*ׯӽ{wUQbuuuUƎ[(Uҷo_O>yl?ԯQ'|$HOOWlmmEjg*RRjUeŊ_@qISdS SVl߾]}Jʕ;vh߸qC R4o\9sXZZ2x`[s8JtEӧiTf͚XZZ*FtE޽rUM;w!C(7V޽5&;;[ywݻk8?^osJ@@riϟ?_XrIiH!׎$;Bvv :T_ZiԨ5ʰaôƄ)UTQ6lؠվ{nK3gs}JΝ˗/kٲeoWgL~m*/^Դedd(RV-ƍ:c222wQ6oެkN V_(?o5f銷rqM[ZZ2d_~쌍U?Cִ;wNiӦ5w899)/_Vݻu͛_|OJZZ]R)JΝYYY/h]1RfMOuĉr)1JJJ+WVRRRn?FV@ $ٳG8qR|yeĉe˖=8DT^]?^z)NNNiFU\]]ݻ+ӦMSvءdff;מ$;/(Iv>7o*ʹs?zRjUN:)UVURSS`ѢE 2ѣ 55UX Z|yޟxvw?0^oxzz; Yf gڵ|x{{MHH7od޽۷?KKKիGz_>u֕DBOԮ];>uԩSjJ+W7ojRfMc}؋sܹsGS2...b:/^3fqQR%}BWIAP?O_777}ٳV^{x x <_-,,pqqŋT\YoZjpl]t1xB ,Y8/^$11`*Jo"ˋ2eʰeu_0|ǘ>:/4xG#Iv QׯO孷⭷Ҵ%%%Idd$ӦMc׮]XZZKƍL !ufccÍ7sm XZhwLBBNҒTA'--Mk6Ucn]eooϔ)SܹscBӮ];fϞ]q#acc͛7)U>n*Y^1$;;: Ǐ䧟~$;7n܈*T{3fT1 {4] 3BBi۶-cƌaڵ\vM6ѦM:t(eʔF|ܹ{;t!ZlɪU `z!СCڵV[F/P|:qF177״hтe˖tR .\X؄BOڳb Ǐ9J@(??<_֬Yݻw:tϩS:u* W^O_&;+Dfff:7nb |}}o߾*U ___K,Xɓ' e?!eR^=ʕ+uT*OӦM.} " #Ghڮ_N^m?ӧOeƍ4jHxذaL0'NOLLO>a„ ZC a9sFg̪U8pN{vHMMezdgg3k,_7v!Vҥ [ng;nٲݻwk}}{LJ Mۗ_~ɜ9sصkNdww}Fm۶$%%= -Y&NSয়~"88$ǣ ~hbbB:u*QQQ\w^ _N>P^؅ PTrѣ؝sssjԨA5ӧwѣDFFyf&MDbb"5k,_>e˖5rB!ij5o< G8::ryfϞ%]twޡw$''ceeŝ;wѣEί?h޼9Eߤh"}\\\?>AAAo???ٵk ,~QFZqsscΜ9н{w4iݻwYz5.]b̙BϞ=iР_t֍0qss#==rJ6mJ=z_vqƑ={8v옦B*n޼ѣ 22+++>9̰at :1cI>}Ԕ(֬YJb޼yZcʖ-˒%KرKŋs9ˆg޼yZۡ.]իWӹsghݺ5VVV8pٳg3tPڶmuh~rrr8|0&M^sI&tMkLkOPP7oCX[[{n/_ŋi۶-!!!ԯ_?y@@ƍ~t֍ubggٳgٰaQQQ̘1]2~x?W_}e%ׯs,_vꪩ_ѡCӧOgƍDEE3j(V8˗/gܹPlYu>-ZFݺu}6gϞ%44l6oޜV80}Dc"?|}}t$22Yfbnn___B k׮e˖-N 2e 6sl`` ddd"[,^˗ Ǐ^zz4i҄GxbVZJVZ߿`ۀϼyX`666oߞ n߾͔)S"Kvvvm6ؾ};eʔӓ|lUD 5[lRxaBY'33S9E111aرtޝ˗l2,--\2@5رc,Y *VYOZ8z(K.!335jݫ\rR>&CU˗/Ͼ}XbaaadggSn]vM%߸{nŅsl2QTk<˗/'>>yGGGvƍlٲԩS!CPtiownnnU0ӓO>'''s9;;~̙… )Z(UTaڴiWydX"P[nͺu{``ggdE1j(nP -k.vɱcǨPVnݺZݛw!Dj@TժU .ezմlْ~[g{ѿ7nl "j߾=ތ=`˗/wП/ ; ^]vɉI&;!D`jjʯg6̀Ҩ_^Kxzzj6"/IIIZK^D"H޳+&&FS~ʕ9rJ*if~6nܘիcj薾B!B!DլY'OhQDUpp6R,FgmmM޽;Y[b0 H"?s_48t ""I&LڵfVRO !y&44/^Ν;o߾M!x޽)^3FNv8/N&MhҤ;vH֯_τ HHHS+*3@BL+Ӵ^B!ij^B}B!x)N!^%JB!B!^hB<1I !B!Ep8e@} d>>)b!+Wo64v(BRqvvɉI&;!D7z !bÆ 3`ZgϞL2ň !ī'--tc!K%wM䢐L>Cѻw|)VWfժUn{{|;w.ӧOzjiB<$Uj^!P81ԅgBucmmq.]"++ GGG5&))Lʗ/c+BRR* GGG;&;;D EիWIMMKK|///~G7n̴i |Bxs;wvvvv=Ȅx}H9ׯ_Ǵiӆ6mh7s)u7?fz$6A}믿֊MRLMMe„ yf@999tЁ%KrIJ( ݻ7M6{  rʚ/Z-[~z<<L2}|\Ղ;~8ݺucժU-[C!^$fffaiiرc `˖-/OMM_~_^g|Æ iҤ m۶|1{bŊabb"݅(]efB_TDJxRK@>y !^I$:syyyMDDα!C3p@V\նpBl0ЫW/9s0vX$h#G$5ϟϤI/i_h׻$u֤r?Ǐ{l2֭[//:`<ܸq#pppsάYY)kE !?P2x E^ 8HiG!K+::ڵk٧N::u@vC Rrq[Xj֬ipBqqqyܜ;w`ccSF cu> _xÇk}Tzz:qqq:Bƾ}Xd >>>vB22V/~zͶ)deeѳgBNSԅ2,4#"BЌD=3#Uh/B<n{'۷oMҢE cth1L}ҴfYYY9&P2e ;wwlOk֭׏P)J$aooOv={C`ʃYcB$3—|`(zsZ!вeKVZexFFW֛&A]k׮Zm5"<<@,ƍqww\֢E -[fpLn߇p4֮]K='BW@@6mY5 x6Nv !xNˀᨓh`#H#P0G!^z+WSTߟMj?,((9i~:z">>k8p Ǐzcٸq#5BQ6l&Lĉ:O0aV!C?~}pT,/"Y_#B! !B!x#{{}En݊eă LJx9u3}灜Mhh(111,^;wbkkK߾}B!($2S!ċBA<ȱ+W{ pG]9 !FbŰ_~6cR!"3;B 6?Ҟ[lg%uy!kRJa!Bg(wf|B2z8ңP;IU p24B!B!^B3;;T*C!^47GJ+]Q%Ld9KB!BdW@^0`E!^7ox,އbȲx!B!xɞ4W( K.T _5ԉGog[#p!B!2(222̳׹}6+V9E&"nw&g#p!B!x]dg!kӦ QQQQZ5fΜԩS{.*T`ѢEj[b~-wޞ .PN&MD͚5vԉÇs٣@OꫯB߿ms̃gK П=ģ.$+'>>ɓ'3{lc"/!!+++c!3anܸa0sN7oEPAz]^t:wiӦ ۷;;;V^MDDVsܸql޼K(\6mڰj*֭dѣ}׊D !zPԳB]G3?ϣN~>zKB &+Wƅxcbbb0xfZjB<???6mEPc|f-JѢE177K. 0kwQ#GXlFnbbBΝqttO>?{Uq{&! z $44iRl *X({^ ^JQ1b(  %B%!@HL2d $gfYg!WTTW߸ED<WK*xtnT=^.[cL6C|E%3n8ƍWaH9per+R7?x!YXݩQ111]0ED D?mh3 S6wl }fZ/e""""""Mr^l0|z"dffw^%;EDl[lR[ҳ dhcsSY(:!yLԩS_|ᄏC+ n474bb~Рa6zb.rr0vL+kAh=ow11㺗T`KÕ@#lςh=C 9– =|-;APYr%_|>>>P?/q{P21dO]wݥEx!!C1o @{Ud( ;vwLv'URWnmS =-yǤa ܁T*ڵח1cƔ(yNjJܿb\sHQ2ѧOfΜɳ>K/ÕjeΜ9ӇF9kܸ1;vkq:}HEpwL^r ]dcfE[NΏ#_Tx>u%=q6A  >@ |O\͚5СI+tޝnᢞWDDDʇ@ll,fjӹꪫǯznq9Ǐ'""qѢE "223rHq&M8qvڑʮ]oZ*+UV,"زe }xqɈ} D_;22۞r$DZ.mVhl цV[r h$ߌE?gzz:ԫW3gp16lxq)))РAhѣ]{NOO'--m;撘X^QF}HHH^zxzz^.3gΐSYV=;uֽxѣGV k$+""R(y 4hЀ>}`Zӧ`UFdd$k׮g͚5Ӷm[.]J&M\kݺ5k׮O>aΜ9x{{ӲeKfϞM] :hcۨRc$CBk0 yXkĬ=uڴ@ %`b1e@kacBppW,/{aD.9wXXYA%غB}}.m#*88/7Ɩ-)fxxKV7b0@-,MfXXde}f} bZ0@y3A&wg3e; 1Zn,Һ@.'i?7$s=ǒ%Kڲy3f->>oSNh"Xn'O&''ɓ'3qDƎˆ xy}L}{qwn:z)^uWNhh(SN;f͚deet2%W/_9}4u%%%|@HHS'O~z9pz_wy~WZx  DBB~~~,[m۶1eRRRdt޽kZy7iذ!O&++gyQF >}___^SNeդRV-ΝK˖-HNNG?$ Ǐ/2`xÇ^:˗/gL2d233yٳgWDDJd%PV-FQ]vk׮4~<ӥ\z`{0R5 =m>aļ[lyeh/X#t1HaO`+ns:6yav0ψr=.,lCinʴ ?5Vlx 0>;{0 iancgt7ba{,ӀO6CB~4? /͠X^,5٬a!38xBũkcKus4)9[ABB%%qA9‘#Ge„ |^z^zɡm٤:~znVxlܸyq{9s:t(1 #6l؀Æ cĈ/4hЀW_}sr:&M0w\Y۷ogر_}322߿?&Mbܹ 0frssKbN-Zؒ ,`֬Y|g4k֌~R+]w݅7oÇ3~x?}8p ۷~som6|I{{{ZZ{桇⣏>gƎKVV7tC<믙1c~)}Ǐsq9~8'N>|'ޠA6lH6m*n\裏ˠ;vѣ˻ٸ;va:vhossscԩڵ?cǖ:ұcG{l{R[4h/ƍs8o8ܯ~Ge?ov?\ 6mɓ'`Ϛ5Aq]w9[HLLd*ǚrE]/,>>ajӦMi￾;֭[g￳k.V^p+Vp1-ZPXaÆ|tڕQF;wy'y1c=C̙3۝7ou]ǐ!CV ߿ytR{"q.<^媫5V0ka|m7r 0ʹpVbP }8L/7۵kA^_h>>ӌk3  @VDiވa1܈.Ԛ|ݧyfHM7Ncb>>5CC`[*mk> 0CCȟ?:34'  ʈh"}{]c1ױ%;>/7g5y!jmձG?Ɗ--1 p(^^^{zzzړU`wTV333K XV ɂfFFaXf͚Mթ^:>>>O``? 6tix9;+W@DgaF>+S駟f„ DFFҡC:t@.]ի<<{9v[nuY+~/T^^}W&!!BCCIII!//ϡ?0Cq/رcy]hԨ-nվ}{B.]m[-9:uTDgիs뭷l2n6{wMy3?NLL gv8ҥK;tojՈv]UoTKDDܱh+\ֶQhƘw r{gl x iuX#NJyy7aO*SkIV WTEw>ؼH.a[id-Dz]K‰N#6,?fV&e?.lcl?{ь n嚕Efw ٗ8%9MX,rڂ75k֤ZjTRbgr)wիǒ%K8v7o&&&>L̙cuZח;>>[fڴie4RSSׯ:ubذa4lؐ<5\ %%^\5jpJ|VZ߹3=/_Nv\CԩSׯocp7p_5z+~!&Mr_P)%%J͚5]PSDD_Iȕ&p4ֈK0CC Zaa0_1Ft/i/?_oDE9ȟٶ"--nҡ"?[Xja'l ~1vE%Wܹ]vѢE c?Cݻf͚QNG~xGXp!<|4Iɓ'}GVVׯ_W(3ɓ';o;oѢO ۽{7 IDATiii%ϩSxUVlڴ07oСCڧLmf_oa͚5NڵkGǎ/z"""HbnTH5a6èaTöLg7EOe)|l{ހ*} AAUZ-9s4ˬEjԨɓ'ڲX`E9&M{ؿ߱~ւ Xt)ƍ+SSSfDGjrf:3CB\V90ߚaac @8kEb۴0B !!(\qifH ]fXX60=|ŋ|v?={o߾Rm㏳eRSS駟瞣QFlٲ޿o߾t҅>}_ڵk:t(^{-5j 22x{fÆ {?!!H"##IMM_עE P5jԈ^{ݻpBN8]x3f /rۃiӦ /r?N݉9r~iӦ1h E?\T6MvK hO}fhlkX,Owgp@CL 3,fЙbbSj;:a_aaO`[0$. }:34e`Lḍ̰1Y@ fhhĈǥ [%̰nf1T-OͰiΒaتxsB M6bb,Ԗat㼿_("%s7C=Dff&ݺuo%))Eq1VjȑA͚5ӧ=٦M:vHbb5ĉ M .z̛7;vPJBCCYhCqsUVrV>|8iiiddd_ի۪U+:wt%ջwoy9x 6dԨQL> ~_`민͍-Zп^{5{#"﷨=EDD*3ےª8),0`K,)*B`` o7tSE"Wms7ߺuڵ+zlXfX`LBM{Z*=Ohpwؼl?b͍fh+g4"+TxWQO%`+$_ c<"MƷʂ֫X&11?i0  1O9uMc>ǒwުU+vQѱ>}0p ./ӺukFu"sĉ5˗uKԩS 4+W0M7Dv;8!!XV"j\)5kt-"r%+oᙝ""r04{jv+ tUύ5fpps,q@ن0X@(in1"0>@3+?C-W$Xc]9[6M0b~Bgo_cǎ&t!4tp5i &{†cL3\Z wYYͽ9m 8պKps6O#"JJJ⫯bٲeew(PM6e߾}eŤd9}.]Zaѣ[; 8ȵ92#:zpnUcNj哭0 [ ȵX"DG/fs7cwx^oC/]p"W8w _6{?}^ެ;ݛu0 +i}Wǟֲl2|=}6&~MEDrFCuAp;&9#ځnq=^UyID.erω=o-s:;zҳyO5 /rLvn6KDԡMddT;z:i{*VYMrf j6kӮVnoLTCXPғ5inh埗HeQlVс)D?q:֡m궱%%ꕶB: ~?/mO/~n`\^kRR;N~ѡbXL{ۿnΓ(];V"f\_6<>,t(_1OwOW1fXrh7 v \'HOsx0XFWs̏~xM ?Ɍۍb/1yd֯_ɓ0a\,h@z˞l0BѩIG,Cn/v%YeE8fX>ap]P/jFVn_n^`P)a Bgbc3MiOtv7 i':- bIXM+GO%`6'G+Z ໘ygcf7r(n\ؓ[Lx0Ld-NIL{}x0 0ظ]}+ݛuFԡM.Ҥ3 7'[[/dIjp}0 ߐ4>**>͛7#sh3;"""""""";GOv|;~!ݚ]c?uh>ΡC<4cK:zUbPZ:ř34kw皀dd`W h~flO^ޔ?]+xwL~}=_M iV2}wv<G5);)>>\[2]lfz~`xrr[rrs._xkNaNcEl4ڇ`U7^]]cҿu?{۵=_Z5lBff&^^^Ş_rUP]3;EDDDDDDARz}kӣywyL9Td':/.bˎ;\dgXSG'wdI{oΩ-TblKuA%D\,hfo^}4eG[zu-6>Ώ\՘wpQlw苇8$fBN]8KVvO1Gc\"bSPH3;EDDDDDDāW/| 'L9įl3?ss`,޾9:bӗ|\'1-ў8}wLnm |jK<7&Cr/6}Ivn6NjZ_>^UlKUaru=e[~& SEU[i7i;ړ]"¶mݛu+S?߈'iהg{46`&`ۇe7b]"x0$;7oo=q=-j1}toލvotpa,k{ҲvK'gAZnw2= HdIR2SqH>;#87cDpp0IIIߟK#܁ #R"""""""b׺Nk~n7]Ilׄyf{v~u_OpHP޳s hŰ]r˜Xkkcuzz;n|9s}2Cdd[xp#]"ظߎ_ȸ/ƓĢmc,nӚ؄8rrKƪ=:eOoa[6V^Ɋ+gJŒKv']Nfω=N#)= Z&)V}eD*;`,W:"""""""ұqXg5 G U15nl;3.WRk+wiڙwHlҪv+hho-cͯjMiLR޵Zaӻؖwj567Rŭ moVZݾ|lU:5 睿nZwϮ jy]v̚5kr]w8F>Ws-cJEE2e"rE2J傖_?yQ6K2v?Nޙ38㧏k%&Bp _lk%S<\UO;~]n6OEO]й}*)r)@DDDDDDDDJk@;NbZq:mkѧe :wAy2()"""""""W4捞Sla,rHD*%Z."""""""""WN+VASEDDDDDDDD䊦dT JvHP8٩E"""""""""r:wfQZA3|+0Rs/`v EDDDDDDDp/j2b*:$'_5ԩSǗ'NHڵ?Y׮ Oͥo߾o߾1i{NXX (H"X >ԩ@DDDDDDDga߲m۶%0HOOgƌrD?^!׮, `]ܹF&@Ê DDDDDDDD|5GaJFA=+?rϏiӦq1 ￟K*YNvANK_~HunAE""""""""oŋIMMUV= ]Ϸel޼x<<<`ȑy 4Yl3p@Zbbb ;o ^ꫯ&00t7\HVVK.%77X-h׮C[ll,۷o0 Fڵwy___LBݺuؼy3wÃC󉍍ӓFEժU~c۶mݻ5jЧOn󎋋/ȑ#ԯ_[n9rcΝԬYһw"^:&22;wr5h+D=;d\$=7|N:1bڵ+s9owӓҭ[7,Y 7@vv1ǎk?ꫯfԨQ4oޜ^xݻ3iҤbcMHH`F͙3g\ٲe QQQ<ܹ7ҥKhҤ /"z?)_}  0ED*kך ""VZUI:zhR }S0k֬yIf&Mdi|W:t 2oܸq… ڭVٳgOsΜ9.M6ܹS{bbn?}tgϞcJSY|W)S<^~ :d>fX{ې!C;Qf8p霋/6J噝:u2wt?4{a8{͐s֬Y֯_o6kܳg󅄄&L(2#GSN5 6srr_I9wYxfESn]{1 2sL^~+<>>Rir}O?зQFoeqMcǎRײeKFСC3f ?*ٕÏ?Ȱa\_p!={,5x뭷غu+ǚ6mJPPӘ@fMgwdtwwjժ?~:nZ;+#h)\.ry'd̘1ٸ9%:6co:uFG'|BZZZq,[8$?>NbҤIX"OOO222W\0b\gqyXn~{qa\& SSS]& iժ]s,Yĩ}̘1<3.=zwy+͹èHAJJ L4QF9̼dԩl۶iӦ===iڴ) .t8צM۷/&33)Ȅ 0`vr8vx^|E%٤:usscΜ9;v{'O^ԤⅺkxwO>ͫʋ/9tO999dff:;$s={6}cܹtMfѢETZLݻO?D~8s Nwy|K/^ԩS8q"ۏ=l޼^z{{tt4Æ ';;kLNNiii$''fUS3;EDDDDDDT֭[GΝYj7p3gdܸqoߞ^zD^^˖-aܹshӦ {UV<䓼L09sХK80'cq 7 eŊTVĉߩͪUضmwE| [nҥKQ]ta߾};v à{lܸ%:tkv-٭[76mD@@˗/g˖-3͛7X{d}tu0w\,X@y'իCiӦo|WлwoZnG}O۶my )) ///~Wi޼9zꫯfҤI̚5޽{vZ:w ܹ3;v$66x;=\?)?nz jժE:uJ\! v=@ArFDDDDDDD*uRnQFZjРCњ矿q?0k.5kҥK%C;s >6mCv\R OOOZn}ג+۹}@ CDDDDDDDcffU(--|r|ͲWJ9T侧tn3(f """"""""'g.xzi/G=Xr%+ Zj#SO_J2}"dg*ԪXDDDDDDDD*@>\a8y7"%qn5v=؊\1\%;};EDDDDDDDD STS3;EDDDDDDDD䊢"""""""""R)g"""""""""rE2v\%;8&"""""""""rYrNWs,""""""""""V=@ DDDDDDDDDD,JvENhfT E%;wb+R$"""""""""rE(*ٹh\3(*ٙ$g """"""""""e~cAD:_Щ򓒒""W}W;XnQHy1kE!"r)7SDDDDDDD**P=;EDDDDDDDDDKvdggS(""""""""""wd'H<}ty!"""""""""R&)"""""""""fvHPl3--<)biXZN___nZ"""""""""R)^"""""""""r+Qs˖-Ha޽dddG<""""""""""RlbвeK#R)6 Ю];)"""""""""%;Õ˚{I:pKZ^^^E "R$Z!Djb)dP;wݽD?HJu͚5cϞ=]DDDDNL@ӥDJi""r*};vnHeP5."""""""""';۷oOTTԥEDDDDDDDDDJҥ ׯ4KH8Y~}񈈈J_R""""""""""Rj,X."""""""""rdu.U,""""""""""vA:m6233/U<""""""""""rAN///ZjŖ-[.U<""""""""""rANP"<]pSEDDDDDDDDDrTd悓-[$--KH\p0 :uĆ .E<""""""""""rNо"""""""""r)uSvTΝ;E^^ŎGDDDDDDDDDTJꪫhԨ[l񈈈{e?p5ZiD2R(>JgH%b!(@I7NXe' a6(,sebܼ~7~8qz<`7vzzu]NΈk6nݚ˽t Bcg&8vX.)C /8vܙtJcgݹe˖m;8[tJz\b祗^]vj?ҥQv vؙdb֭$I.)]#F~ݻsNr(;N r;g͚ ΂0`@ر#8m9s΍M6t%gsΜ9t%g3ۣ!WZbSN\ k9ezNc/)zBNc㣹9jkksyZ4vFD\eθNzBYYYMMM>ur-QXX1dȐpʕ+[ 6,^yn/w_ȑ#.L&~cņ b޼y|wYc.\֮]}]|w1qhiip͊+Z,] رccΝwؾ}{ܹsڧc /̙3/((?333r;#<uuu>`s9q9DAAA\|==#DO9gŊbŊ8|e;Ν6mz_uuuqС455?pV=.k <566F]]]444d){gϞ;SygώǺuN;L?s/nI&Eiii\s51a„xWi9f̘2eJzQTT-T;<QXX .=1zؼysv%%%1a„(--+22Ll۶:x`,[,FK.L&Ǐkf());////,Y/R2/"3vǷnݚ7.<]iӦ%wIk8]6[$VJΝվfϞ|Y=GMNkM=o|$[Ͽ?UVV&ƍO:>nܸd'ٷo_2f̘dժUѣG[$3fHy晬;nܸj￟;illj>t?8$">_3K=O2vdm8p 8pisȑISSSζyܧ~̟?yGI;w9^WW5*ihh87ޘKmillL./lGTTTt$IC%TWWg5 -w:&Lcǎms|С~ѷ~7o_=1G-5{クꪫbm5*JJJwi=v%K_~ի۽"Ia?nРAѫWؿV+{{9e;nʔ)'˗Ǒ#Gbĉ1`/7+ڝsWƮ]Z߳gOL45jNx\^^^EsssN mٷohll<5uuux(//Yf4^TT?طo_s'pM~ڝ3t?9 |y}q8vXkz(--m3tFDj{gx7Oy[ZZb͚51{c'No&j1k֬ ]ؼX_RR6l[n(--ÇG}}}TWWǺu⡇{キuÇc̙d뮋cǎZ<#SO̙3c'{g㫯j}1}/ݻw䓘6mZDĶ?`c͛7ǦM.(;i#G,>hnnɓ'ŋcqhllQFɓ[l۶-{ǜ9sN^mmmر}Ϙ1#ډO|-[ġCӧƠ7/zxuuu[Kcdڽ^MMMQ[[\pA… #??׷N2%JKK8圏?8,X}3Et?0-[ѷo6M7 #[qqqd2شiS틦/ek#FDUU);N(d ib' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' b' Ljii}tcǎnaܸqcgDzL{3AivuHCK7:IENDB`eztrace-2.1/doc/developper_manual/Figures/instrumentation_pptrace_x86_64.svg000066400000000000000000001010401447213526500274110ustar00rootroot00000000000000 image/svg+xml Application foo(): opcode 1 opcode 2 opcode 3 ... ret call foo() libeztrace-foo foo(): record_event call *(orig_addr) record_event ret pptrace_allocated reloc_addr: jump replay_addr opcode 1 opcode 2 jump sym_addr+over small_jump reloc_addr repl_addr: sym_addr: small_jump back_jump long_jump orig_addr: back_jump_addr back_jump_addr: eztrace-2.1/doc/developper_manual/dev_manual.md000066400000000000000000000107411447213526500217310ustar00rootroot00000000000000# EZTrace Developper Manual ## Introduction The aim of this document is to describe EZTrace internals. In addition to the content of this document, a few research papers describe some aspects of EZTrace internals: - (*EZTrace: a generic framework for performance analysis*)[https://hal.inria.fr/inria-00587216/] briefly describes the architecture of EZTrace. - (*An open-source tool-chain for performance analysis*)[http://hal.archives-ouvertes.fr/hal-00707236] describes the EZTrace + GTG + ViTE tool chain. This paper includes explanations on the way traces are generated with EZTrace-1.0. **Please note that the trace generation changed with EZTrace 2.0** - (*Runtime function instrumentation with EZTrace*)[http://hal.inria.fr/hal-00719979] describe how EZTrace instruments applications using binary instrumentation ## Instrumentation In order to intercept the application calls to the EZTrace modules function, EZTrace needs to *instrument* the application. The goal of the instrumentation of function `foo` is to be able to record an event before and after each occurence of `foo`. Depending on which type of function is `foo`, EZTrace uses two mechanisms: - if `foo` is in a shared library, EZTrace uses a mechanism based on LD_PRELOAD. - otherwise, EZTrace uses PPTrace ### LD_PRELOAD When instrumenting a program in order to intercept the calls to function `f()` located in a shared library, EZTrace uses LD_PRELOAD. As depicted in Figure 1, the basic idea is to ask the program loader to pre-load a library that defines `f()` (eg `libeztrace-foo.so`) when loading the application. This way, the application calls to function `f()` are directed to EZTrace implementation of `f()` (let's call this implementation `eztrace_f()`). Once `eztrace_f()` has recorded an event, it needs to call the actual `f()` function. To do this, EZTrace retrieves the address of `f()` using the `dlsym()` function. This is done at when `libeztrace-foo.so` is loaded ( `DYNAMIC_INTERCEPT_ALL()` in the `libinit` function). !(Figure 1: Instrumentation using LD_PRELOAD)[Figures/instrumentation_ldpreload.png] ### PPTRace When the function to instrument is not in a shared library, the LD_PRELOAD mechanism cannot work. In that case, EZTrace modifies the application binary using PPTrace. The main idea is that PPTrace load the application binary and uses `ptrace` in order to modify the application code section. When instrumenting a function, PPTrace injects a jump instruction at the beginning of the function to instrument. This Section the detailed procedure to do so. Two techniques can be used depending on the where EZTrace managed to allocate memory: - If the memory allocated ``close'' to the code segment (for instance on 32-bits architectures like ARMv7), PPTrace uses a long jump - If the memory is allocated ``far'' from the code segment, (for instance, on 64-bits architectures like x86_64), PPTrace uses a trampoline technique Both strategies are implemented in the `src/pptrace/hijack.c` file. #### Using long jump In some cases, PPTrace uses a long jump for changing the execution flow of the application. The resulting execution flow is depicted in Figure 2. !(Figure 2: Instrumentation using a long jump)[Figures/instrumentation_pptrace_arm.png] PPTrace first allocates a buffer (pptrace_allocated in the Figure) where it stores the first opcodes of function `foo()`. These opcodes are now located at address `reloc_addr`. They are followed by a jump (`back_jump`) to the remaining opcodes of `foo`. PPTrace then changes the first opcode of `foo()` to the instruction that jumps (`first_jump`) to `repl_addr` (which contains the address of EZTrace implementation of `foo`). The address of the relocated code (`reloc_addr`) is then assigned to the module callback for function foo (stored at address `orig_addr`). The drawback of this technique is that the `first_jump` may overwrites many opcodes. Some of these opcodes may be problematic (for instance, `ret` or `mov (%rip+1042), %eax`). When it is possible, another technique that uses a *trampoline* can be used. ### Using a trampoline In order to reduce the number of opcodes that need to be relocated, PPTrace can use the *trampoline* technique depicted in Figure 3. The idea is to first do a ``small jump'' to a trampoline that jumps (`long_jump`) to EZTrace implementation of `foo`. The small jump can be implemented as a relative jump (ie ``jump to %rip + 1000''). !(Figure 3: Instrumentation using a trampoline)[Figures/instrumentation_pptrace_x86_64.png] eztrace-2.1/doc/example/000077500000000000000000000000001447213526500152225ustar00rootroot00000000000000eztrace-2.1/doc/example/README.md000066400000000000000000000047651447213526500165150ustar00rootroot00000000000000# Writing a plugin module for eztrace ## Introduction This is an example of plugin module for eztrace. This directory contains 2 sub-directories: - `libexample_orig` This is an example library with functions that we want to trace using eztrace. This library implements two simple functions (`example_function1` and `example_function2`). This directory also includes a simple program that uses this library. - `libexample_eztrace` This directory contains an example plugin for eztrace. This plugin allows to trace the libexample functions with eztrace. ## Creating an eztrace plugin (see libexample_eztrace/example.c) ### Declaring a plugin First let's give name to our plugin and declare it. This is done with a few C macros: ``` #define CURRENT_MODULE example DECLARE_CURRENT_MODULE; ``` Then, we register the plugin to eztrace. This allows eztrace_avail to describe available plugins, and to initialize all the plugins selected by a user: ``` void __example_init(void) __attribute__ ((constructor)); /* Initialize the current library */ void __example_init(void) { EZT_REGISTER_MODULE(example, "Example module", init_example, finalize_example); } ``` ### Instrumenting functions For recording events, eztrace relies on functions that redefines the functions that have to be traced (eg. MPI_Send, pthread_create, etc.) Writing a plugin module for eztrace thus boils down to redefining all the needed functions (for example `example_function1` and `example_function2`). Each redefined function `f` has to record an event and to call the original `f` function. Usually such a function looks like this: ``` int f(int arg1, double arg2) { FUNCTION_ENTRY_WITH_ARGS(arg1, arg2); int ret = f_orig(arg1, arg2); FUNCTION_EXIT_WITH_ARGS(ret); return ret; } ``` This function records an event, calls the original `f` function, and records another after `f`. In order to call the original `f` function, we need to retrieve its address. This is done by describing the functions to be intercepted by eztrace: ``` PPTRACE_START_INTERCEPT_FUNCTIONS(example) INTERCEPT3("f", f_orig) INTERCEPT3("bar", bar_orig) PPTRACE_END_INTERCEPT_FUNCTIONS(example); ``` This macro replace the original `f` function with the one defined in the current module. It copies the address of the original function in the `f_orig` variable. We also need to provide an initialization function: ``` static void init_example() { INSTRUMENT_FUNCTIONS(example); if (eztrace_autostart_enabled()) eztrace_start(); __example_initialized = 1; } ``` eztrace-2.1/doc/example/libexample_eztrace/000077500000000000000000000000001447213526500210615ustar00rootroot00000000000000eztrace-2.1/doc/example/libexample_eztrace/Makefile000066400000000000000000000005551447213526500225260ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libeztrace-example.so LDFLAGS=`pkg-config --libs eztrace` CFLAGS=`pkg-config --cflags eztrace` all: $(BIN) libeztrace-example.so: example.c $(CC) --shared -o libeztrace-example.so example.c -fPIC $(CFLAGS) $(LDFLAGS) -ldl clean: rm -f $(BIN) eztrace-2.1/doc/example/libexample_eztrace/example.c000066400000000000000000000053441447213526500226660ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* This file contains an alternative libexample.so * The functions defined in libexample (example_function1 and * example_function2) are redefined so that when the application * call one of these functions, the hereby version of it is actually * invoked. */ #include #include #include #define CURRENT_MODULE example DECLARE_CURRENT_MODULE; int __example_initialized = 0; /* pointers to the actual functions (located in the original * libexample.so) */ double (*libexample_function1)(double*, int) = NULL; double (*libexample_static_function)(double*, int) = NULL; int (*libexample_function2)(int*, int) = NULL; /* redefine example_function1. * This version of the function only record some events and calls * the original example_function1 function */ double example_function1(double *array, int array_size) { /* records an event with two parameters */ FUNCTION_ENTRY_WITH_ARGS(array, array_size); /* call the actual function (located in the original libexample.so) */ double ret = libexample_function1(array, array_size); /* records another event without any parameter */ FUNCTION_EXIT; return ret; } double example_static_function(double*array, int array_size) { FUNCTION_ENTRY_WITH_ARGS(array, array_size); /* call the actual function (located in the original libexample.so) */ double ret = libexample_static_function(array, array_size); /* record another event with three parameters */ FUNCTION_EXIT_WITH_ARGS(array, array_size, ret); return ret; } /* redefine example_function2. * This version of the function only record some events and calls * the original example_function2 function */ int example_function2(int *array, int array_size) { FUNCTION_ENTRY_WITH_ARGS(array, array_size); int ret = libexample_function2(array, array_size); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(example) INTERCEPT3("example_function1", libexample_function1) INTERCEPT3("example_static_function", libexample_static_function) INTERCEPT3("example_function2", libexample_function2) PPTRACE_END_INTERCEPT_FUNCTIONS(example); static void init_example() { INSTRUMENT_FUNCTIONS(example); if (eztrace_autostart_enabled()) eztrace_start(); __example_initialized = 1; } static void finalize_example() { __example_initialized = 0; eztrace_stop(); } void __example_init(void) __attribute__ ((constructor)); /* Initialize the current library */ void __example_init(void) { EZT_REGISTER_MODULE(example, "Example module", init_example, finalize_example); } eztrace-2.1/doc/example/libexample_orig/000077500000000000000000000000001447213526500203645ustar00rootroot00000000000000eztrace-2.1/doc/example/libexample_orig/Makefile000066400000000000000000000013141447213526500220230ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libexample.so libstatic_example.a main main_mpi all: $(BIN) main_mpi: main.c example.h mpicc -o main_mpi main.c -L. -lexample -lstatic_example main: main.c example.h libexample.so libstatic_example.a $(CC) -o main main.c -L. -lexample -lstatic_example -O0 -g libexample.so: example.o $(CC) --shared -o libexample.so example.o -ldl libstatic_example.a: static_example.o ar rcs libstatic_example.a static_example.o static_example.o: static_example.c $(CC) -c static_example.c -O0 -g example.o: example.c example.h $(CC) -o example.o -c example.c -fPIC -O0 -g clean: rm -f $(BIN) *.o eztrace-2.1/doc/example/libexample_orig/example.c000066400000000000000000000011441447213526500221630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "example.h" /* dummy function #1 */ double example_function1(double *array, int array_size) { int i; double sum = 0; for (i = 0; i < array_size; i++) { array[i] = array[i] * (i + 1); sum += array[i]; } return sum; } /* dummy function #2 */ int example_function2(int *array, int array_size) { int i; int sum = 0; for (i = 0; i < array_size; i++) { array[i] = array[i] * (i + 1); sum += array[i]; } return sum; } eztrace-2.1/doc/example/libexample_orig/example.h000066400000000000000000000006351447213526500221740ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef __EXAMPLE_H__ #define __EXAMPLE_H__ /* dummy function #1 */ double example_function1(double*, int); /* dummy function #2 */ int example_function2(int*, int); double example_static_function(double *array, int array_size); #endif /* __EXAMPLE_H__ */ eztrace-2.1/doc/example/libexample_orig/main.c000066400000000000000000000020701447213526500214530ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* simple program that calls the libexample library */ #include #include #include "example.h" #define SIZE (1024*1024) int main(int argc, char**argv) { double *double_array = malloc(sizeof(double) * SIZE); int *int_array = malloc(sizeof(int) * SIZE); int i; /* initialize the array with something */ for (i = 0; i < SIZE; i++) { double_array[i] = (i * i) / 31; } double sum_double = example_function1(double_array, SIZE); /* initialize the array with something */ for (i = 0; i < SIZE; i++) { double_array[i] = (i * i) / 31; } double static_sum_double = example_static_function(double_array, SIZE); for (i = 0; i < SIZE; i++) { int_array[i] = i % 17; } int sum_int = example_function2(int_array, SIZE); printf("sum double = %lf\n", sum_double); printf("static sum double = %lf\n", static_sum_double); printf("sum int = %d\n", sum_int); return 0; } eztrace-2.1/doc/example/libexample_orig/static_example.c000066400000000000000000000006471447213526500235410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include "example.h" /* dummy function #1 */ double example_static_function(double *array, int array_size) { int i; double sum = 0; for (i = 0; i < array_size; i++) { array[i] = array[i] * (i + 1); sum += array[i]; } return sum; } eztrace-2.1/doc/faq.md000066400000000000000000000022031447213526500146550ustar00rootroot00000000000000# Frequently Asked Questions Q: What if I don't want to trace my whole application, but only a small part of it? A: Then, you can call `eztrace_start()` and `eztrace_stop()` in your code to specify the part to be traced. You will need to `#include ` and to link with libeztrace. Then, just run your application as usual (i.e. `$ ./my_program my_arg1`) Q: I need to trace my program while using `gdb`, how can I do that? A: Just add the `-d` option to `eztrace` or `eztrace.preload` to enable `gdb`: ``` $ eztrace -d ./my_program my_arg1 my_arg2 ``` Q: I want my trace to be saved in a specific directory, how can I do that? A: By default, EZTrace saves the trace in the current directory. You can change this by setting `EZTRACE_TRACE_DIR` or by providing the `-o` option to eztrace. Q: eztrace does not generate OTF2 traces. Instead, I get file named USER_eztrace_log_rank_X. A: You're using eztrace version 1 with the old trace format. With eztrace 2.0, we move to the standard OTF2 trace format. You can either upgrade to eztrace 2, or use [the documentation for eztrace 1.x](https://eztrace.gitlab.io/eztrace/)eztrace-2.1/doc/man/000077500000000000000000000000001447213526500143425ustar00rootroot00000000000000eztrace-2.1/doc/man/man1/000077500000000000000000000000001447213526500151765ustar00rootroot00000000000000eztrace-2.1/doc/man/man1/eztrace.1000066400000000000000000000017641447213526500167250ustar00rootroot00000000000000.\" Manpage for eztrace. .\" Contact https://gitlab.com/eztrace/eztrace to report errors or typos. .TH man 1 "13 january 2022" "2.0" "eztrace man page" .SH NAME eztrace \- performance analysis tool .SH SYNOPSIS eztrace [OPTION] COMMAND_LINE .SH DESCRIPTION Run COMMAND_LINE and generate an execution trace. .SH OPTIONS .TP 5 -t [plugin1 plugin2 ... pluginN] Select a list of plugins .TP -o DIRECTORY Select the output DIRECTORY .TP -l DIRECTORY Add DIRECTORY to the list of directories in which eztrace search for plugins .TP -f Enable EZTRACE_FLUSH .TP -d Debug mode .TP -?, -h Display this help and exit .SH EXAMPLES $ eztrace -t "memory pthread" ./my_program param1 param2 $ mpirun -np 2 eztrace -t "mpi pthread" ./my_program param1 param2 .SH SEE ALSO eztrace.preload(1), eztrace_cc(1), eztrace_avail(1) .SH REPORTING BUGS Report eztrace bugs to https://gitlab.com/eztrace/eztrace .br EZTrace home page: .SH AUTHOR Francois Trahay (francois.trahay@telecom-sudparis.eu) eztrace-2.1/doc/man/man1/eztrace.preload.1000066400000000000000000000024141447213526500203430ustar00rootroot00000000000000.\" Manpage for eztrace.preload. .\" Contact https://gitlab.com/eztrace/eztrace to report errors or typos. .TH man 1 "13 january 2022" "2.0" "eztrace.preload man page" .SH NAME eztrace.preload \- performance analysis tool .SH SYNOPSIS eztrace.preload [OPTION] COMMAND_LINE .SH DESCRIPTION Run COMMAND_LINE and generate an execution trace. .SH OPTIONS .TP -d Run eztrace.old with gdb .TP -e Show environment .TP -p PadicoTM mode .TP -m MPI mode .TP 5 -t [plugin1 plugin2 ... pluginN] Select a list of plugins .TP -o DIRECTORY Select the output DIRECTORY .TP -l DIRECTORY Add DIRECTORY to the list of directories in which eztrace search for plugins .TP -f Enable EZTRACE_FLUSH .TP -? Display this help and exit .SH EXAMPLES $ eztrace.preload -t "memory pthread" ./my_program param1 param2 For MPI programs: .br $ mpirun -np 2 `eztrace.preload -m ./my_program` param1 param2 .SH SEE ALSO eztrace(1), eztrace_cc(1), eztrace_avail(1) .SH BUGS eztrace.preload is a fallback launcher for eztrace. It relies on LD_PRELOAD for interception function calls. Thus, it only works for shared libraries. .SH REPORTING BUGS Report eztrace bugs to https://gitlab.com/eztrace/eztrace .br EZTrace home page: .SH AUTHOR Francois Trahay (francois.trahay@telecom-sudparis.eu) eztrace-2.1/doc/man/man1/eztrace_avail.1000066400000000000000000000021431447213526500200710ustar00rootroot00000000000000.\" Manpage for eztrace_avail. .\" Contact https://gitlab.com/eztrace/eztrace to report errors or typos. .TH man 1 "13 January 2022" "2.0" "eztrace_avail man page" .SH NAME eztrace_avail \- print the list of available EZTrace modules .SH SYNOPSIS eztrace_avail [OPTIONS] .SH DESCRIPTION Print the list of available EZTrace modules .SH OPTIONS .TP -v Select the verbose mode .TP -h Display this help and exit .SH EXAMPLES $ eztrace_avail .br 3 stdio Module for stdio functions (read, write, select, poll, etc.) .br 2 pthread Module for PThread synchronization functions (mutex, semaphore, spinlock, etc.) .br 6 papi Module for PAPI Performance counters .br 1 omp Module for OpenMP parallel regions .br 4 mpi Module for MPI functions .br 5 memory Module for memory functions (malloc, free, etc.) .SH SEE ALSO eztrace(1), eztrace.preload(1), eztrace_cc(1), eztrace_avail(1) .SH REPORTING BUGS Report eztrace bugs to https://gitlab.com/eztrace/eztrace .br EZTrace home page: .SH AUTHOR Francois Trahay (francois.trahay@telecom-sudparis.eu) eztrace-2.1/doc/man/man1/eztrace_cc.1000066400000000000000000000012261447213526500173630ustar00rootroot00000000000000.\" Manpage for eztrace_cc. .\" Contact https://gitlab.com/eztrace/eztrace to report errors or typos. .TH man 1 "13 January 202" "2.0" "eztrace_cc man page" .SH NAME eztrace_cc \- Compile an OpenMP application for eztrace .SH SYNOPSIS eztrace_cc COMPILATION_COMMAND .SH DESCRIPTION Compile an OpenMP application for eztrace. .SH EXAMPLES $ eztrace_cc gcc -o openmp_program openmp_program.c -fopenm .SH SEE ALSO eztrace(1), eztrace.preload(1), eztrace_avail(1) .SH REPORTING BUGS Report eztrace bugs to https://gitlab.com/eztrace/eztrace .br EZTrace home page: .SH AUTHOR Francois Trahay (francois.trahay@telecom-sudparis.eu) eztrace-2.1/doc/plugin.md000066400000000000000000000103231447213526500154060ustar00rootroot00000000000000# Existing plugins EZTrace ships several plugins for the main parallel programming libraries. ### MPI The MPI plugin traces MPI communications (including non-blocking collectives), and supports MPI communicators. It supports the C and Fortran interfaces. It does not support (yet) MPI-IO primitives. ### OpenMP EZTrace ships two plugins for OpenMP: - `ompt` uses the OMPT interface to trace OpenMP parallel regions, loops, task, etc. - `openmp` intercepts calls to the GNU OpenMP runtime system. It can only trace parallel region with GNU OpenMP. You can also instrument your OpenMP application with Opari to collect more events (including loops, tasks, ...), and to make it work with any OpenMP implementation ### Pthread EZTrace traces pthread creation/destruction. You can also use the `pthread` plugin to trace pthread synchronization functions (eg. `pthread_mutex_*`, `pthread_cond_*`. ### PosixIO EZTrace `posixio` plugin traces calls to PosixIO functions (`open`, `read`, `write`, `dup`, `fread`, `fwrite`, ... ### Memory EZTrace `memory` plugin traces calls to dynamic memory allocation functions (`malloc`, `realloc`, `calloc`, `free`, ... ### IOTracer EZTrace `iotracer` plugin uses IOTracer to trace IO events that happen within the Linux kernel. See [EZIOTracer webpage](https://gitlab.com/idiom1/eziotrace) for instructions. ### CUDA EZTrace `cuda` plugin traces CUDA events (memory copy, kernel invocation, etc.) By default, the plugin captures events located on the GPU (using the CUPTI interface), as well as calls to the CUDA runtime API happening on the CPU. #### Available options Several options are availble for the `cuda` module. They can be specified using environment variables: - `EZTRACE_CUDA_DRIVER`: enable tracing of the CUDA driver API, set - `EZTRACE_CUDA_BUFFER_SIZE=x`: set the size of the CUDA event buffer (default value: `2097152` bytes) ### NETCDF EZTrace `netcdf` plugin traces calls to the [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) library. ### PNETCDF EZTrace `pnetcdf` plugin traces calls to the [PNetCDF](https://parallel-netcdf.github.io/) library. ### StarPU EZTrace `starpu` plugin traces [StarPU](https://starpu.gitlabpages.inria.fr/) events (task creation, task execution, etc.) ### Compiler_instrumentation Module for tracing compiler-instrumented functions. ### PAPI (currently not supported) EZTrace `papi` plugin collect harware counters using the PAPI library. This plugin is currently not supported (we need to port it to use the OTF2 trace format) # Generating custom plugins ** NOT IMPLEMENTED IN EZTRACE-2.0 yet ! ** You can generate one plugin and instrument the functions you want to. In order to generate your plugin, you need to create a file containing: * The name of the library you want to trace (libNAME.so) * A brief description of the library (optional) * An ID to identify the module (0? is reserved for eztrace internal use. Thus, you can use any between 10 and ff) * The prototype of the functions you want to instrument Basically, the file should look like that: BEGIN_MODULE NAME example_lib DESC "module for the example library" ID 99 int example_do_event(int n) double example_function1(double* array, int array_size) END_MODULE Now use eztrace_create_plugin to generate the plugin source code: $ eztrace_create_plugin example.tpl New Module Module name: 'example_lib' Module description: '"module for the example library"' Module id: '99' emulate record_state for 'example_do_event' Function 'example_do_event' done emulate record_state for 'example_function1' Function 'example_function1' done End of Module example_lib The source code is generated in the output directory. Just type: $ make Now set the EZTRACE_LIBRARY_PATH to the appropriate directory and you are good to go. You can also specify (in the example.tpl file) the way a function is depicted in the output trace. For instance: int submit_job(int* array, int array_size) BEGIN ADD_VAR("job counter", 1) END Specifies that when the submit_job function is called, the output trace should increment the "job counter" variable. You can now track the value of a variable! The test/module_generator directory contains several scripts that demonstrate the various commands available. eztrace-2.1/doc/using.md000066400000000000000000000122361447213526500152420ustar00rootroot00000000000000# Using EZTrace ## Viewing available modules EZTrace uses modules that are in charge of instrumenting libraries. You can use `eztrace_avail` to list the available modules: ``` $ eztrace_avail 3 stdio Module for stdio functions (read, write, select, poll, etc.) 2 pthread Module for PThread synchronization functions (mutex, semaphore, spinlock, etc.) 6 papi Module for PAPI Performance counters 1 omp Module for OpenMP parallel regions 4 mpi Module for MPI functions 5 memory Module for memory functions (malloc, free, etc.) ``` The list of modules to compile is selected at CMake time. If some modules are missing, check your cmake configuration. While EZTrace ships plugins for the main parallel programming libraries (eg. MPI, OpenMP, CUDA, ...), you can define new plugins for your own application/library. See the [Plugin page](plugin.md) for instructions. ## Running an application with EZTrace `eztrace` runs an application and generates an execution trace. It needs a list of modules to load that can be specified with `-t`: ``` $ eztrace -t "posixio memory" ./my_program my_arg1 my_arg2 [P0T0] Starting EZTrace (pid: 260513)... [...] [P0T0] Stopping EZTrace (pid:260513)... ``` This generates an execution trace `_trace` in the current directory. ## Running an MPI application with EZTrace You can use EZTrace to instrument MPI applications: ``` $ mpirun -np 4 eztrace -t "mpi posixio" ./my_app my_arg1 my_arg2 ``` ## Other options `eztrace` usage: ``` Usage: eztrace [OPTION] program [arg1 arg2 ...] -t "plugin1 plugin2 ... pluginN" Select a list of plugins -o Select the output directory -l Select a plugin directory -f Enable EZTRACE_FLUSH -d Debug mode -? -h Display this help and exit ``` ## Tracing a program functions By default, EZTrace trace functions located in shared libraries. If you want to trace the main application functions, you can ask the compiler to instrument functions, and EZTrace will trace the instrumented functions. To instrument a program, add `-finstrument-functions` to the compilation flags, and `-rdynamic` to the link flags: ``` $ gcc -c foo.c -o foo.o -finstrument-functions $ gcc -o foo foo.o -rdynamic ``` Then, use EZTrace `compiler_instrumentation` module: ``` $ eztrace -t compiler_instrumentation ./foo [...] ``` By default, the compiler instruments all the functions. To control which functions should be traced, you can: - specify to the compiler the functions to exclude (eg with `-finstrument-functions-exclude-function-list=sym,sym,...`) - specify to EZTrace the functions to exclude with (eg set `EZTRACE_EXCLUDE_LIST="sym1 sym2 ..."`) ## Environment variables Here is a list of the environment variables that you can use for tuning EZTrace. ### General-purpose variables - `EZTRACE_TRACE_DIR`: specifies the directory in which the traces are created (default: ${program_name}_trace). You can also use the `-o` option in eztrace. - `EZTRACE_LIBRARY_PATH`: specifies the directories in which eztrace can find eztrace modules (default: none) You can also use the `-l` option in eztrace. - `EZTRACE_TRACE`: specifies the list of eztrace modules to load (default: the list of available modules) You can also use the `-t` option in eztrace. - `EZTRACE_BUFFER_SIZE`: specifies the size (in byte) of the buffer in which eztrace stores events (default: 16MB) - `EZTRACE_SIGALARM`: ask EZTrace to stop the application every x ms in order to collect information (such as hardware counters). (default: 0) ### Error-handling variables - `EZTRACE_SIGNAL_HANDLER`: enables eztrace signal handling (default: disabled) - `EZTRACE_DEBUGGER`: when an error occurs, eztrace waits so that you can attach gdb to the process to investigate (this can be useful when debugging MPI programs) ### Hardware counters-related variables - `EZTRACE_PAPI_COUNTERS`: selects hardware events to trace using the PAPI library, e.g. `export EZTRACE_PAPI_COUNTERS="PAPI_L3_TCM PAPI_FP_INS"`. Please note that the list of supported events as well as the number of events, which can be traced simultaneously, vary depending on the processor type. This information can be retrieved using 'papi_avail' and the processor documentation. - `EZTRACE_PAPI_SAMPLE_INTERVAL`: select the minimum interval (in microseconds) between each check of the PAPI counters (default: 100) ### CUDA-related variables - `EZTRACE_CUDA_CUPTI_DISABLED`: disable the use of CUPTI in EZTrace. This option disables the recording of events that happen on the GPU. ### IOTracer-related variables - `IOTRACER_TRACED_FILTER`: should IOTracer trace a specific file (`file`) or directory (`dir`) ? - `IOTRACER_TRACED_FILE`: TODO - `IOTRACER_TRACED_INODE`: inode of the file/directory to watch ### Compiler_instrumentation variables - `EZTRACE_EXCLUDE_LIST`: specify to the functions to exclude (eg `export EZTRACE_EXCLUDE_LIST="foo bar baz"`) ## Tutorials [Several tutorials are available here](https://gitlab.com/eztrace/eztrace-tutorials). eztrace-2.1/docker/000077500000000000000000000000001447213526500142715ustar00rootroot00000000000000eztrace-2.1/docker/Dockerfile_mpich000066400000000000000000000024211447213526500174420ustar00rootroot00000000000000FROM debian:bullseye # Install build tools RUN apt update \ && apt install -y build-essential cmake wget git gawk # Install OTF2 in /opt/otf2 and make otf-print available RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-2.3/otf2-2.3.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/otf2-2.3.tar.gz) \ && (cd /tmp/otf2-2.3 && ./configure --prefix=/usr/local&& make &&make install) \ && rm -rf /tmp/otf2-2.3 # Install Opari2 in /usr/local RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/opari2/tags/opari2-2.0.6/opari2-2.0.6.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/opari2-2.0.6.tar.gz) \ && (cd /tmp/opari2-2.0.6 && ./configure --prefix=/usr/local && make &&make install) \ && rm -rf /tmp/opari2-2.0.6 # Install MPICH RUN apt install -y mpich # Install Clang RUN apt install -y clang # Install StarPU RUN apt install -y libstarpu-dev pkgconf # Install EZTrace RUN git clone https://gitlab.com/eztrace/eztrace.git \ && ( mkdir eztrace/build && cd eztrace/build && \ cmake .. \ -DENABLE_BIN_INSTRUMENTATION=OFF -DOTF2_PATH=/opt/otf2 \ -DEZTRACE_ENABLE_MPI=ON -DMPI_LINK_FLAGS="-fopenmp" \ -DEZTRACE_ENABLE_OPENMP=ON -DEZTRACE_ENABLE_OMPT=ON\ -DEZTRACE_ENABLE_MEMORY=ON \ -DCMAKE_C_COMPILER=clang-11 \ && make -j 4 \ && make install) eztrace-2.1/docker/Dockerfile_mpich_vite000066400000000000000000000005741447213526500205000ustar00rootroot00000000000000FROM eztrace/eztrace.mpich # Install ViTE with OTF2 support RUN apt update \ && apt install -y qtbase5-dev qt5-qmake qttools5-dev libqt5charts5-dev \ libqt5svg5-dev libglm-dev libglew-dev RUN git clone https://gitlab.inria.fr/solverstack/vite.git \ && (cd vite \ && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DVITE_ENABLE_OTF2=ON . \ && make -j 4 \ && make install) eztrace-2.1/docker/Dockerfile_openmpi000066400000000000000000000024671447213526500200230ustar00rootroot00000000000000FROM debian:bullseye # Install build tools RUN apt update \ && apt install -y build-essential cmake wget git gawk # Install OTF2 in /opt/otf2 and make otf-print available RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-2.3/otf2-2.3.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/otf2-2.3.tar.gz) \ && (cd /tmp/otf2-2.3 && ./configure --prefix=/usr/local&& make &&make install) \ && rm -rf /tmp/otf2-2.3 # Install Opari2 in /usr/local RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/opari2/tags/opari2-2.0.6/opari2-2.0.6.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/opari2-2.0.6.tar.gz) \ && (cd /tmp/opari2-2.0.6 && ./configure --prefix=/usr/local && make &&make install) \ && rm -rf /tmp/opari2-2.0.6 # Install OpenMPI RUN apt install -y openmpi-bin openmpi-common libopenmpi-dev # Install Clang RUN apt install -y clang # Install StarPU RUN apt install -y libstarpu-dev pkgconf # Install EZTrace RUN git clone https://gitlab.com/eztrace/eztrace.git \ && ( mkdir eztrace/build && cd eztrace/build && \ cmake .. \ -DENABLE_BIN_INSTRUMENTATION=OFF -DOTF2_PATH=/opt/otf2 \ -DEZTRACE_ENABLE_MPI=ON -DMPI_LINK_FLAGS="-fopenmp" \ -DEZTRACE_ENABLE_OPENMP=ON -DEZTRACE_ENABLE_OMPT=ON\ -DEZTRACE_ENABLE_MEMORY=ON \ -DCMAKE_C_COMPILER=clang-11 \ && make -j 4 \ && make install) eztrace-2.1/docker/Dockerfile_openmpi_vite000066400000000000000000000005741447213526500210470ustar00rootroot00000000000000FROM eztrace/eztrace.mpich # Install ViTE with OTF2 support RUN apt update \ && apt install -y qtbase5-dev qt5-qmake qttools5-dev libqt5charts5-dev \ libqt5svg5-dev libglm-dev libglew-dev RUN git clone https://gitlab.inria.fr/solverstack/vite.git \ && (cd vite \ && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DVITE_ENABLE_OTF2=ON . \ && make -j 4 \ && make install) eztrace-2.1/docker/Dockerfile_vite000066400000000000000000000005531447213526500173150ustar00rootroot00000000000000FROM eztrace/eztrace.mpich # Install ViTE with OTF2 support RUN apt install -y qtbase5-dev qt5-qmake qttools5-dev libqt5charts5-dev \ libqt5svg5-dev libglm-dev libglew-dev RUN git clone https://gitlab.inria.fr/solverstack/vite.git \ && (cd vite \ && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DVITE_ENABLE_OTF2=ON . \ && make -j 4 \ && make install) eztrace-2.1/docker/build_docker_images.sh000066400000000000000000000007271447213526500206060ustar00rootroot00000000000000#!/bin/bash docker build -f Dockerfile_mpich . -t eztrace/eztrace.mpich:latest docker build -f Dockerfile_mpich_vite . -t eztrace/eztrace.mpich.vite:latest docker build -f Dockerfile_openmpi . -t eztrace/eztrace.openmpi:latest docker build -f Dockerfile_openmpi_vite . -t eztrace/eztrace.openmpi.vite:latest docker build -f Dockerfile_test_mpich . -t eztrace/eztrace-test:eztrace.mpich docker build -f Dockerfile_test_openmpi . -t eztrace/eztrace-test:eztrace.openmpi eztrace-2.1/eztrace.pc.in000066400000000000000000000005101447213526500154040ustar00rootroot00000000000000prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} includedir=@INSTALL_INCLUDEDIR@ libdir=@INSTALL_LIBDIR@ sharedlibdir=@INSTALL_LIBDIR@ Name: eztrace Description: The EZTrace library Version: @CMAKE_PROJECT_VERSION@ Cflags: -I@INSTALL_INCLUDEDIR@/ -I@OTF2_INCLUDE_PATH@/ Libs: -L@INSTALL_LIBDIR@ -leztrace-lib -leztrace-core eztrace-2.1/src/000077500000000000000000000000001447213526500136115ustar00rootroot00000000000000eztrace-2.1/src/CMakeLists.txt000066400000000000000000000033001447213526500163450ustar00rootroot00000000000000add_subdirectory(core) add_subdirectory(instrumentation) add_subdirectory(eztrace-lib) add_subdirectory(modules) add_subdirectory(plugin_creator) ##################################################### # eztrace.preload configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/eztrace.preload.in ${CMAKE_CURRENT_BINARY_DIR}/eztrace.preload @ONLY # ask cmake to change only variables in the form @VAR@ (ie. don't touch the ${VAR} variables, which can be problematic for bash scripts) ) list(APPEND SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/eztrace.preload ) ##################################################### # eztrace configure_file (${CMAKE_CURRENT_SOURCE_DIR}/eztrace.c.in ${CMAKE_CURRENT_BINARY_DIR}/eztrace.c) add_executable(eztrace ${CMAKE_CURRENT_BINARY_DIR}/eztrace.c ) target_compile_options(eztrace PRIVATE -Wall -Wextra -DEZTRACE_ABS_TOP_BUILDDIR="" # TODO ) target_include_directories(eztrace PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) target_link_libraries(eztrace PRIVATE ${OTF2_LIBRARY} eztrace-instrumentation eztrace-lib ) ##################################################### # eztrace_avail add_executable(eztrace_avail eztrace_avail.c ) target_compile_options(eztrace_avail PRIVATE -Wall -Wextra ) target_link_libraries(eztrace_avail PRIVATE ${OTF2_LIBRARY} eztrace-lib ) ################################################ ##################################################### install(PROGRAMS ${SCRIPTS} DESTINATION ${CMAKE_INSTALL_BINDIR}) install( TARGETS eztrace eztrace_avail LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/core/000077500000000000000000000000001447213526500145415ustar00rootroot00000000000000eztrace-2.1/src/core/CMakeLists.txt000066400000000000000000000031651447213526500173060ustar00rootroot00000000000000configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eztrace_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/eztrace-core/eztrace_config.h) add_library(eztrace-core SHARED ezt_demangle.c eztrace_array.c eztrace_htable.c eztrace_sampling.c eztrace_config.c include/eztrace-core/ezt_demangle.h include/eztrace-core/eztrace_array.h include/eztrace-core/eztrace_htable.h include/eztrace-core/eztrace_list.h include/eztrace-core/eztrace_macros.h include/eztrace-core/eztrace_sampling.h include/eztrace-core/eztrace_spinlock.h include/eztrace-core/eztrace_stack.h include/eztrace-core/eztrace_types.h include/eztrace-core/eztrace_attributes.h include/eztrace-core/types.h include/eztrace-core/eztrace_utils.h ) target_include_directories(eztrace-core PUBLIC $ $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_options(eztrace-core PRIVATE -Wall -Wextra -Werror ) if (HAVE_DEMANGLE) target_include_directories(eztrace-core PRIVATE ${DEMANGLE_INCLUDEDIR} ) target_compile_options(eztrace-core PRIVATE -DHAVE_DEMANGLE ) target_link_libraries(eztrace-core PRIVATE iberty ) endif() install(TARGETS eztrace-core EXPORT EZTraceCoreTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/eztrace-core DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/eztrace-core DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) eztrace-2.1/src/core/ezt_demangle.c000066400000000000000000000016631447213526500173510ustar00rootroot00000000000000#include #include #ifdef HAVE_DEMANGLE #include const char* ezt_demangle(const char* mangled_str) { /* todo: add an option to get only the function name */ /* get the full function prototype (including parameters and return type) */ char* res_str = cplus_demangle(mangled_str, DMGL_AUTO | DMGL_PARAMS); if (!res_str) { /* demangling failed. return the mangled string */ int len = strlen(mangled_str) + 1; res_str = malloc(sizeof(char) * len); if(res_str) { memcpy(res_str, mangled_str, len*sizeof(char)); } } return res_str; } #else /* HAVE_DEMANGLE */ /* Libiberty is not available, return a copy of the mangled string */ const char* ezt_demangle(const char* mangled_str) { int len = strlen(mangled_str) + 1; char* res_str = malloc(sizeof(char) * len); if( res_str ) { memcpy(res_str, mangled_str, len); } return res_str; } #endif /* HAVE_DEMANGLE */ eztrace-2.1/src/core/eztrace_array.c000066400000000000000000000025371447213526500175470ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (c) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include "eztrace-core/eztrace_array.h" #include #include #include #define DEFAULT_PREALLOC 64 /* initialize an array */ void eztrace_array_create(struct eztrace_array_t* p_array, unsigned item_size, unsigned nb_prealloc) { p_array->item_size = item_size; p_array->nb_items = 0; p_array->values = malloc(item_size * nb_prealloc); p_array->nb_allocated = nb_prealloc; } /* free an array */ void eztrace_array_free(struct eztrace_array_t* p_array) { assert(p_array); free(p_array->values); } /* return a new item of an array (for a specific container) */ void* eztrace_array_new_value(struct eztrace_array_t* p_array) { assert(p_array); if (p_array->nb_items >= p_array->nb_allocated) { /* expand the buffer */ p_array->nb_allocated *= 2; if (!p_array->nb_allocated) p_array->nb_allocated = DEFAULT_PREALLOC; void* ptr = realloc(p_array->values, p_array->item_size * p_array->nb_allocated); if (!ptr) { fprintf(stderr, "in %s: cannot allocate enough memory. Aborting.\n", __func__); abort(); } p_array->values = ptr; } p_array->nb_items++; return ITH_VALUE(p_array->nb_items - 1, p_array); } eztrace-2.1/src/core/eztrace_config.c000066400000000000000000000005211447213526500176650ustar00rootroot00000000000000#include "eztrace-core/eztrace_config.h" #include bool eztrace_autostart_enabled() { char* autostart_env = getenv("EZTRACE_AUTOSTART"); if (autostart_env == NULL) return true; if (strcmp(autostart_env, "no") == 0 || strcmp(autostart_env, "No") || strcmp(autostart_env, "NO")) return false; return true; } eztrace-2.1/src/core/eztrace_config.h.in000066400000000000000000000072431447213526500203070ustar00rootroot00000000000000/* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * config.h -- Configuration parameters * * Created on: 02 juil. 2011 * Author: Damien Martin-Guillerez * */ #ifndef PPTRACE_CONFIG_H_ #define PPTRACE_CONFIG_H_ #include "eztrace-core/eztrace_macros.h" #include #include #include #define EZTRACE_VERSION "@CMAKE_PROJECT_VERSION@" #define OTF2_VERSION "@OTF2_VERSION@" #define OTF2_MAJOR_VERSION @OTF2_MAJOR_VERSION@ #define OTF2_MINOR_VERSION @OTF2_MINOR_VERSION@ // enum PPTRACE_BINARY_TYPE { // PPTRACE_BINARY_TYPE_BFD, // Requires -lbfd // PPTRACE_BINARY_TYPE_ELF, // Requires -lelf // }; // #define PPTRACE_ARCH_TYPE_INTEL 1 // What else? enum PTRACE_TRACE_TYPE { PTRACE_TRACE_TYPE_LINUX, PTRACE_TRACE_TYPE_MACOSX, // Not Yet Implemented PTRACE_TRACE_TYPE_BSD, // Not Yet Implemented }; enum PPTRACE_ISIZE_TYPE { PPTRACE_ISIZE_TYPE_TRACE, PPTRACE_ISIZE_TYPE_OPCODE, // Requires -lopcodes and binary type bfd }; // Configuration // Syscall dependency #define HAVE_LIBOPCODE @HAVE_LIBOPCODE@ #define HAVE_LIBBACKTRACE @HAVE_LIBBACKTRACE@ #define USE_GETTID @USE_GETTID@ #define DYNLIB_SUFFIX "@DYNLIB_EXT@" #define DYNLIB_EXT "@DYNLIB_EXT@" #define EZTRACE_LIB_DIR "@EZTRACE_LIB_DIR@" #define HAVE_PRCTL_H @HAVE_PRCTL_H@ #ifndef __PPTRACE_USE_PRCTL #if HAVE_PRCTL_H // This flag is set to use prctl for ptrace to allow child to trace its parent on hardened systems // Set it if prtcl.h, the prtcl() function and the PR_SET_PTRACER constant exists #define __PPTRACE_USE_PRCTL #endif /* HAVE_PRCTL_H */ #endif // defined __PPTRACE_USE_PRCTL #ifndef __PPTRACE_ARCH_TYPE #define __PPTRACE_ARCH_TYPE PPTRACE_ARCH_TYPE_INTEL #endif // defined __PPTRACE_ARCH_TYPE #ifndef __PPTRACE_TRACE_TYPE #define __PPTRACE_TRACE_TYPE PTRACE_TRACE_TYPE_LINUX #endif // defined __PPTRACE_TRACE_TYPE #ifndef __PPTRACE_ISIZE_TYPE #define __PPTRACE_ISIZE_TYPE PPTRACE_ISIZE_TYPE_TRACE #endif // defined __PPTRACE_ISIZE_TYPE // Obscure internal structures #define PPTRACE_HIJACK_FUNCTION pptrace_hijack_list #define PPTRACE_BASENAME PPTRACE_HIJACK_FUNCTION #define PPTRACE_SYMBOL_LIST(module_name) CONCAT(CONCAT(PPTRACE_BASENAME, _), module_name) #define PPTRACE_SYMBOL_ALIAS(module_name) STRINGIFY(PPTRACE_SYMBOL_LIST(module_name)) #define PPTRACE_SYMBOL_EXTERNAL(module_name) CONCAT(_, PPTRACE_SYMBOL_LIST(module_name)) #define PPTRACE_SYMBOL_ALIAS_STRING(dest, module_name_str, N) snprintf(dest, N, "%s_%s", STRINGIFY(PPTRACE_BASENAME), module_name_str) #define PPTRACE_CURRENT_SYMBOL_LIST PPTRACE_SYMBOL_LIST(CURRENT_MODULE) #define PPTRACE_CURRENT_SYMBOL_ALIAS PPTRACE_SYMBOL_ALIAS(CURRENT_MODULE) #define PPTRACE_CURRENT_SYMBOL_EXTERNAL PPTRACE_SYMBOL_EXTERNAL(CURRENT_MODULE) __attribute__((unused)) static void _get_pptrace_symbol_external(char* dest, unsigned buffer_size, const char* module_name); /* copy the pptrace external symbol string corresponding to module_name in buffer dest */ __attribute__((unused)) static void _get_pptrace_symbol_external(char* dest, unsigned buffer_size, const char* module_name) { const char* prefix = STRINGIFY(PPTRACE_SYMBOL_EXTERNAL()); if (buffer_size > strlen(prefix) + strlen(module_name)) { sprintf(dest, "%s%s", prefix, module_name); } else { /* not enough space in the buffer */ dest[0] = '\0'; } } bool eztrace_autostart_enabled(); #define IOTRACER_PATH "@IOTRACER_PATH@" //#define IOTRACER_PATH "/home/islam/new_bcc_iotracer/bpftrace_iotracer_like/bcc_iotracer.py" #define IOTRACER_TRACE_PATH "iotracer_trace.txt" #endif /* PPTRACE_CONFIG_H_ */ eztrace-2.1/src/core/eztrace_htable.c000066400000000000000000000107201447213526500176610ustar00rootroot00000000000000#include #include #include #include #include #include "eztrace-core/eztrace_htable.h" hashkey_t hash_function_str(char* key) { hashkey_t ret = 0; for(int i=0; key[i]!='\0' ; i++) { ret += key[i] << (i%4); } return ret; } hashkey_t hash_function_int32(uint32_t key) { hashkey_t k = key; /* Robert Jenkins' 32 bit Mix Function */ k += (k << 12); k ^= (k >> 22); k += (k << 4); k ^= (k >> 9); k += (k << 10); k ^= (k >> 2); k += (k << 7); k ^= (k >> 12); /* Knuth's Multiplicative Method */ k = (k >> 3) * 2654435761; return k; } hashkey_t hash_function_int64(uint64_t key) { uint32_t key1 = (uint32_t) key; uint32_t key2 = (uint32_t) (key>>32); return hash_function_int32(key1) ^ hash_function_int32(key2); } hashkey_t hash_function_ptr(void* ptr_key) { if(sizeof(ptr_key) == 8) { uint64_t k = (uintptr_t)ptr_key; return hash_function_int64(k); } uint32_t k = (uintptr_t) ptr_key; return hash_function_int32(k); } /* initialize a hashtable */ void ezt_hashtable_init(struct ezt_hashtable *table, int table_len) { table->table_len = table_len; table->table = malloc(sizeof(struct ezt_hashtable_list)*table_len); for(int i=0; itable[i].entries = NULL; ezt_spin_init(&table->table[i].lock); } } /* delete a hashtable */ void ezt_hashtable_finalize(struct ezt_hashtable *table) { for(int i=0; itable_len; i++) { ezt_spin_lock(&table->table[i].lock); struct ezt_hashtable_entry *entry = table->table[i].entries; while(entry) { struct ezt_hashtable_entry *next_entry = entry->next; free(entry); entry = next_entry; } table->table[i].entries = NULL; ezt_spin_unlock(&table->table[i].lock); } free(table->table); table->table = NULL; table->table_len = 0; } /* get the entry associated with a key * * WARNING: the list lock has to be held when calling this function ! */ static struct ezt_hashtable_entry* _ezt_ht_get_from_list(hashkey_t key, struct ezt_hashtable_list* list) { struct ezt_hashtable_entry *e = list->entries; while(e) { if(key == e->key) { return e; } e = e->next; } return NULL; } /* return the data associated with key */ void* ezt_hashtable_get(struct ezt_hashtable *table, hashkey_t key) { int index = key % table->table_len; assert(index < table->table_len); void *retval = NULL; ezt_spin_lock(&table->table[index].lock); struct ezt_hashtable_entry *e = _ezt_ht_get_from_list(key, &table->table[index]); if(e) retval = e->data; ezt_spin_unlock(&table->table[index].lock); return retval; } /* insert data in the hashtable. If key is already in the hashtable, its data is overwritten*/ void ezt_hashtable_insert(struct ezt_hashtable*table, hashkey_t key, void* data) { int index = key % table->table_len; assert(index < table->table_len); ezt_spin_lock(&table->table[index].lock); struct ezt_hashtable_entry *e = _ezt_ht_get_from_list(key, &table->table[index]); if(e) { /* the key already exists. Just replace its data */ e->data = data; } else { /* the key does not exist */ e = malloc(sizeof(struct ezt_hashtable_entry)); e->key = key; e->data = data; e->next = table->table[index].entries; table->table[index].entries = e; } ezt_spin_unlock(&table->table[index].lock); } /* remove an entry from the hashtable */ void ezt_hashtable_remove(struct ezt_hashtable*table, hashkey_t key) { if(table->table_len == 0) return; int index = key % table->table_len; assert(index < table->table_len); ezt_spin_lock(&table->table[index].lock); struct ezt_hashtable_entry *e = table->table[index].entries; if(!e) goto out; if(key == e->key) { /* we need to remove the first entry */ table->table[index].entries = e->next; free(e); } else { while(e->next && key != e->next->key) { e = e->next; } if(e->next) { /* remove e->next */ struct ezt_hashtable_entry *to_remove = e->next; e->next = to_remove->next; free(to_remove); } } out: ezt_spin_unlock(&table->table[index].lock); } void ezt_hashtable_print(struct ezt_hashtable *table) { for(int i=0; itable_len; i++) { if(table->table[i].entries) { printf("List %d :\n", i); struct ezt_hashtable_entry *e = table->table[i].entries; while(e) { printf("\t{%x, %p}", e->key, e->data); e = e->next; } printf("\n"); } } } eztrace-2.1/src/core/eztrace_sampling.c000066400000000000000000000102471447213526500202400ustar00rootroot00000000000000#include "eztrace-core/eztrace_sampling.h" #include #include #include /* perform dest = src+interval on timeval structures */ #define UPDATE_TIMEVAL(dest, src, interval) \ do { \ (dest).tv_sec = (src).tv_sec + ((interval) / ((unsigned)1e6)); \ (dest).tv_usec = (src).tv_usec + ((interval) % ((unsigned)1e6)); \ } while (0) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) #define MAX_SAMPLING_CALLBACKS 100 static struct ezt_sampling_callback_instance callback_instances[MAX_SAMPLING_CALLBACKS]; static int nb_sampling_callbacks = 0; static struct timeval next_call = {.tv_sec = 0, .tv_usec = 0}; struct _ezt_sampling_thread_instance { struct ezt_sampling_callback_instance callback[MAX_SAMPLING_CALLBACKS]; int nb_callbacks; struct timeval next_call; }; static _Thread_local struct _ezt_sampling_thread_instance* _thread_sampling = NULL; /* Initialize thread-specific data */ static struct _ezt_sampling_thread_instance* _ezt_sampling_init_thread() { if (!nb_sampling_callbacks) /* nothing to process */ return NULL; /* Allocate the thread-specific data */ _thread_sampling = malloc(sizeof(struct _ezt_sampling_thread_instance)); _thread_sampling->nb_callbacks = nb_sampling_callbacks; struct timeval cur_time; gettimeofday(&cur_time, NULL); /* copy the callbacks */ unsigned min_interval = callback_instances[0].interval; int i; for (i = 0; i < _thread_sampling->nb_callbacks; i++) { if (callback_instances[i].interval < min_interval) min_interval = callback_instances[i].interval; _thread_sampling->callback[i].callback = callback_instances[i].callback; _thread_sampling->callback[i].interval = callback_instances[i].interval; UPDATE_TIMEVAL(_thread_sampling->callback[i].last_call, cur_time, 0); _thread_sampling->callback[i].plugin_data = NULL; } UPDATE_TIMEVAL(_thread_sampling->next_call, cur_time, min_interval); return _thread_sampling; } /* Calls registered callbacks if needed */ void ezt_sampling_check_callbacks() { if (nb_sampling_callbacks) { struct timeval cur_time; gettimeofday(&cur_time, NULL); if(!_thread_sampling) { /* First time this thread check for callbacks */ _ezt_sampling_init_thread(); if (!_thread_sampling) { return; } } if (TIME_DIFF(cur_time, _thread_sampling->next_call) < 0) { /* we need to call add least one callback */ int i; /* browse the list of registered callbacks */ for (i = 0; i < _thread_sampling->nb_callbacks; i++) { struct ezt_sampling_callback_instance* callback = &_thread_sampling->callback[i]; if (TIME_DIFF(callback->last_call, cur_time) >= (long long)callback->interval) { /* execute the callback */ int ret = callback->callback(callback); if (ret == 0) { /* update the timer */ UPDATE_TIMEVAL(callback->last_call, cur_time, 0); /* update _thread_sampling->next_call */ if (TIME_DIFF(cur_time, _thread_sampling->next_call) > (long long)callback->interval) { /* this callback is the next one */ UPDATE_TIMEVAL(_thread_sampling->next_call, cur_time, callback->interval); } } } } } } } /* todo: distinguish thread-specific callbacks from process-specific callbacks * todo: add the possibility to add an alarm */ /* interval: time in microsecond between calls to callback */ void ezt_sampling_register_callback(ezt_sampling_callback_t callback, unsigned interval) { nb_sampling_callbacks++; callback_instances[nb_sampling_callbacks - 1].callback = callback; callback_instances[nb_sampling_callbacks - 1].interval = interval; callback_instances[nb_sampling_callbacks - 1].last_call.tv_sec = 0; callback_instances[nb_sampling_callbacks - 1].last_call.tv_usec = 0; struct timeval cur_time; gettimeofday(&cur_time, NULL); if (TIME_DIFF(cur_time, next_call) > (long long) interval) { /* this callback is the next one */ UPDATE_TIMEVAL(next_call, cur_time, interval); } } eztrace-2.1/src/core/include/000077500000000000000000000000001447213526500161645ustar00rootroot00000000000000eztrace-2.1/src/core/include/eztrace-core/000077500000000000000000000000001447213526500205475ustar00rootroot00000000000000eztrace-2.1/src/core/include/eztrace-core/ezt_demangle.h000066400000000000000000000002671447213526500233630ustar00rootroot00000000000000#ifndef EZT_DEMANGLE_H #define EZT_DEMANGLE_H /* demangle a string into a newly allocated buffer. */ const char* ezt_demangle(const char* mangled_str); #endif /* EZT_DEMANGLE_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_array.h000066400000000000000000000015571447213526500235630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_ARRAY_H #define EZTRACE_ARRAY_H #include struct eztrace_array_t { unsigned item_size; unsigned nb_items; void* values; unsigned nb_allocated; }; /* return the ith value of an array */ #define ITH_VALUE(__i__, __array__) (void*)((char*)((__array__)->values) + ((__i__) * (__array__)->item_size)) /* initialize an array */ void eztrace_array_create(struct eztrace_array_t* p_array, unsigned item_size, unsigned nb_prealloc); /* free an array */ void eztrace_array_free(struct eztrace_array_t* p_array); /* return a new item of an array (for a specific container) */ void* eztrace_array_new_value(struct eztrace_array_t* p_array); #endif /* EZTRACE_ARRAY_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_attributes.h000066400000000000000000000011171447213526500246230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_ATTRIBUTES_H #define EZTRACE_ATTRIBUTES_H #ifdef __GNUC__ #define MAYBE_UNUSED __attribute__((unused)) #define FALLTHROUGH __attribute__((fallthrough)) #define COLD __attribute__((cold)) #define REENTRANT __attribute__((const)) #define NODISCARD __attribute__((warn_unused_result)) #else #define MAYBE_UNUSED #define FALLTHROUGH #define COLD #define REENTRANT #define NODISCARD #endif #endif /* EZTRACE_ATTRIBUTES_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_htable.h000066400000000000000000000024461447213526500237020ustar00rootroot00000000000000#ifndef EZTRACE_HTABLE_H #define EZTRACE_HTABLE_H #include #include "eztrace_spinlock.h" typedef uint32_t hashkey_t; struct ezt_hashtable_entry { hashkey_t key; void* data; struct ezt_hashtable_entry* next; }; struct ezt_hashtable_list { struct ezt_hashtable_entry *entries; ezt_spinlock lock; }; struct ezt_hashtable { int table_len; struct ezt_hashtable_list* table; }; /* return a hash of str_key */ hashkey_t hash_function_str(char *str_key); hashkey_t hash_function_int32(uint32_t int_key); hashkey_t hash_function_int64(uint64_t int_key); hashkey_t hash_function_ptr(void* ptr_key); /* initialize a hashtable */ void ezt_hashtable_init(struct ezt_hashtable*table, int table_len); /* delete a hashtable */ void ezt_hashtable_finalize(struct ezt_hashtable*table); /* return the data associated with key */ void* ezt_hashtable_get(struct ezt_hashtable*table, hashkey_t key); /* insert data in the hashtable. If key is already in the hashtable, its data is overwritten*/ void ezt_hashtable_insert(struct ezt_hashtable*table, hashkey_t key, void* data); /* remove an entry from the hashtable */ void ezt_hashtable_remove(struct ezt_hashtable*table, hashkey_t key); void ezt_hashtable_print(struct ezt_hashtable *table); #endif /* EZTRACE_HTABLE_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_list.h000066400000000000000000000044701447213526500234150ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_LIST_H #define EZTRACE_LIST_H #include struct ezt_list_t; struct ezt_list_token_t { /* pointer to the user data */ void* data; /* pointer to the list */ struct ezt_list_t* list; /* pointer to the next token in the list */ struct ezt_list_token_t* next; /* pointer to the previous token in the list */ struct ezt_list_token_t* prev; }; struct ezt_list_t { struct ezt_list_token_t* head; struct ezt_list_token_t* tail; int nb_item; }; /* return true if the list is empty */ #define ezt_list_empty(l) ((l)->head == NULL) /* iterate over the list */ #define ezt_list_foreach(l, t) for (t = (l)->head; t != NULL; t = (t)->next) /* same as list_foreach, but supports list modifications * for each iteration, t is the current value (that can be removed from the list) * n is the next value (that should not be modified!) */ #define ezt_list_foreach_safe(l, t, n) for (t = (l)->head, (n) = ((l)->head ? t->next : NULL); \ t != NULL; \ t = n, (n) = t ? (t)->next : NULL) /* return the first token of the list */ #define ezt_list_get_head(l) ((l)->head) /* return the last token of the list */ #define ezt_list_get_tail(l) ((l)->tail) /* initialize a list */ static inline void ezt_list_new(struct ezt_list_t* l) { l->head = NULL; l->tail = NULL; l->nb_item = 0; } /* add a new token at the list tail */ static inline void ezt_list_add(struct ezt_list_t* l, struct ezt_list_token_t* n) { /* initialize the new token */ n->list = l; n->next = NULL; n->prev = l->tail; if (ezt_list_empty(l)) { l->head = n; } else { l->tail->next = n; } l->tail = n; l->nb_item++; } void eztrace_abort(); /* remove a token from the list */ static inline void ezt_list_remove(struct ezt_list_token_t* t) { if (t->prev) t->prev->next = t->next; else t->list->head = t->next; if (t->next) t->next->prev = t->prev; else t->list->tail = t->prev; if (t->list->head && !t->list->tail) eztrace_abort(); t->list->nb_item--; } #endif /* EZTRACE_LIST_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_macros.h000066400000000000000000000045731447213526500237320ustar00rootroot00000000000000#ifndef EZTRACE_MACROS_H #define EZTRACE_MACROS_H #define CONC(a, b) a##b #define CONCAT(a, b) CONC(a, b) #define STRINGIFY2(a) #a #define STRINGIFY(a) STRINGIFY2(a) // Make a FOREACH macro #define FE_1(WHAT, X) WHAT(X) #define FE_2(WHAT, X, ...) WHAT(X)FE_1(WHAT, __VA_ARGS__) #define FE_3(WHAT, X, ...) WHAT(X)FE_2(WHAT, __VA_ARGS__) #define FE_4(WHAT, X, ...) WHAT(X)FE_3(WHAT, __VA_ARGS__) #define FE_5(WHAT, X, ...) WHAT(X)FE_4(WHAT, __VA_ARGS__) #define FE_6(WHAT, X, ...) WHAT(X)FE_5(WHAT, __VA_ARGS__) #define FE_7(WHAT, X, ...) WHAT(X)FE_6(WHAT, __VA_ARGS__) #define FE_8(WHAT, X, ...) WHAT(X)FE_7(WHAT, __VA_ARGS__) #define FE_9(WHAT, X, ...) WHAT(X)FE_8(WHAT, __VA_ARGS__) #define FE_10(WHAT, X, ...) WHAT(X)FE_9(WHAT, __VA_ARGS__) //... repeat as needed #define FE_I_1(WHAT, I, X) WHAT(I, X) #define FE_I_2(WHAT, I, X, ...) WHAT(I, X)FE_I_1(WHAT, I-1, __VA_ARGS__) #define FE_I_3(WHAT, I, X, ...) WHAT(I, X)FE_I_2(WHAT, I-1, __VA_ARGS__) #define FE_I_4(WHAT, I, X, ...) WHAT(I, X)FE_I_3(WHAT, I-1, __VA_ARGS__) #define FE_I_5(WHAT, I, X, ...) WHAT(I, X)FE_I_4(WHAT, I-1, __VA_ARGS__) #define FE_I_6(WHAT, I, X, ...) WHAT(I, X)FE_I_5(WHAT, I-1, __VA_ARGS__) #define FE_I_7(WHAT, I, X, ...) WHAT(I, X)FE_I_6(WHAT, I-1, __VA_ARGS__) #define FE_I_8(WHAT, I, X, ...) WHAT(I, X)FE_I_7(WHAT, I-1, __VA_ARGS__) #define FE_I_9(WHAT, I, X, ...) WHAT(I, X)FE_I_8(WHAT, I-1, __VA_ARGS__) #define FE_I_10(WHAT, I, X, ...) WHAT(I, X)FE_I_9(WHAT, I-1, __VA_ARGS__) #define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,NAME,...) NAME #define FOR_EACH(action,...) GET_MACRO(__VA_ARGS__,FE_10, FE_9, FE_8, FE_7, FE_6 ,FE_5,FE_4,FE_3,FE_2,FE_1)(action,__VA_ARGS__) #define FOR_EACH_I(action,...) GET_MACRO(__VA_ARGS__,FE_I_10, FE_I_9, FE_I_8, FE_I_7, FE_I_6, FE_I_5,FE_I_4,FE_I_3,FE_I_2,FE_I_1)(action, GET_MACRO(__VA_ARGS__,10,9,8,7,6,5,4,3,2,1), __VA_ARGS__) #define __VA_NARGS__(...) GET_MACRO(__VA_ARGS__,10,9,8,7,6,5,4,3,2,1) /* return the offset of the field MEMBER in a structure TYPE */ #define ezt_offset_of(TYPE, MEMBER) ((size_t) & ((TYPE*)0)->MEMBER) /* Find the global structure's address * It needs : * - ptr: address of intern field * - type: type of the global structure * - member: name of the intern field of the global structure */ #define ezt_container_of(ptr, type, member) \ ((type*)((char*)(__typeof__(&((type*)0)->member))(ptr)-ezt_offset_of(type, member))) #endif /* EZTRACE_MACROS_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_sampling.h000066400000000000000000000025661447213526500242600ustar00rootroot00000000000000#ifndef EZTRACE_SAMPLING_H #define EZTRACE_SAMPLING_H #include struct ezt_sampling_callback_instance; /* The callback shall return 0 if successfull. * If successfull, eztrace core will wait interval microseconds before invoking * the callback again. * If unsuccessfull, eztrace core may invoke the callback at any time */ typedef int (*ezt_sampling_callback_t)(struct ezt_sampling_callback_instance* instance); /* This structure is passed to sampling callbacks. The callback should not modify any field apart * from plugin_data. */ struct ezt_sampling_callback_instance { ezt_sampling_callback_t callback; unsigned interval; struct timeval last_call; void* plugin_data; }; /* Register a sampling callback * \param callback: the sampling callback * \param interval: time in microsecond between each call to callback * * NB: the interval is thread-specific. Interval corresponds to the minimum * time difference between two calls (within one thread). Please note that * we use a lazy system: the callback is only called if eztrace intercepts a function. * Thus, if the application performs a long computing phase, the callback may not be * called very often. */ void ezt_sampling_register_callback(ezt_sampling_callback_t callback, unsigned interval); void ezt_sampling_check_callbacks(); #endif /* EZTRACE_SAMPLING_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_spinlock.h000066400000000000000000000024341447213526500242620ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_SPINLOCK_H #define EZTRACE_SPINLOCK_H #include #include #include typedef volatile atomic_flag ezt_spinlock; #define ezt_spin_unlocked ATOMIC_FLAG_INIT #if defined(__x86_64__) #include #define PAUSE _mm_pause() #elif defined(__aarch64__) || defined(__arm64__) #define PAUSE __asm__ __volatile__ ("yield") #else #define PAUSE #endif static void ezt_spin_init(ezt_spinlock *l) __attribute__((unused)); static void ezt_spin_init(ezt_spinlock *l) { atomic_flag_clear(l); } static void ezt_spin_lock(ezt_spinlock *l) __attribute__((unused)); static void ezt_spin_lock(ezt_spinlock *l) { uint64_t count=0; while(atomic_flag_test_and_set(l)) { PAUSE; if(count++ > 100) // we've been waiting for a while, let other thread work sched_yield(); else if(count++ > 1000) // wow we really have trouble getting the lock. sleep for a while to decrease contention usleep(10); } } static void ezt_spin_unlock(ezt_spinlock *l) __attribute__((unused)); static void ezt_spin_unlock(ezt_spinlock *l) { atomic_flag_clear(l); } #endif /* EZTRACE_SPINLOCK_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_stack.h000066400000000000000000000020721447213526500235430ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_STACK_H #define EZTRACE_STACK_H #include "eztrace_list.h" typedef struct ezt_list_t ezt_stack_t; typedef struct ezt_list_token_t ezt_stack_token_t; /* todo: a stack is just like a list, but with different functions */ #define ezt_stack_empty(s) (ezt_list_empty(l)) /* create an empty stack */ static inline void ezt_stack_new(ezt_stack_t* s) { ezt_list_new(s); } /* add a new token to the stack */ static inline void ezt_stack_push(ezt_stack_t* s, ezt_stack_token_t* n) { ezt_list_add(s, n); } /* return a pointer to the token on top of the stack */ static inline ezt_stack_token_t* ezt_stack_get_top(ezt_stack_t* s) { return s->tail; } /* remove the token on top of the stack and return it. */ static inline ezt_stack_token_t* ezt_stack_pop(ezt_stack_t* s) { if (!s->tail) return NULL; ezt_stack_token_t* res = s->tail; ezt_list_remove(res); return res; } #endif /* EZTRACE_STACK_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_types.h000066400000000000000000000011651447213526500236040ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef EZTRACE_TYPES_H #define EZTRACE_TYPES_H /* This header contains the data types that are used by both eztrace and * eztrace_convert/eztrace_stats */ /* application pointer. This pointer is invalid in the current * process, but its value corresponds to an object in the * application. */ #include typedef intptr_t app_ptr; struct ezt_instrumented_function { char function_name[1024]; void* callback; int event_id; }; #endif /* EZTRACE_TYPES_H */ eztrace-2.1/src/core/include/eztrace-core/eztrace_utils.h000066400000000000000000000005001447213526500235700ustar00rootroot00000000000000#ifndef EZTRACE_UTILS #define EZTRACE_UTILS #include static void _eztrace_get_current_program_name(char* buffer) { char tmp_buffer[1024]; FILE* f = fopen("/proc/self/cmdline", "r"); fscanf(f, "%s", tmp_buffer); fclose(f); sprintf(buffer, "%s", basename(tmp_buffer)); } #endif /* EZTRACE_UTILS */ eztrace-2.1/src/core/include/eztrace-core/eztrace_utils.h~000066400000000000000000000004531447213526500237750ustar00rootroot00000000000000#ifndef EZTRACE_UTILS #define EZTRACE_UTILS static void _eztrace_get_current_program_name(char* buffer) { char tmp_buffer[1024]; FILE* f = fopen("/proc/self/cmdline", "r"); fscanf(f, "%s", tmp_buffer); fclose(f); sprintf(buffer, "%s", basename(tmp_buffer)); } #endif /* EZTRACE_UTILS */ eztrace-2.1/src/core/include/eztrace-core/types.h000066400000000000000000000012441447213526500220650ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef TYPES_H #define TYPES_H #include // without explicit distinguishing between architectures, this code is portable on both x86_64 and ARMv7 #if __WORDSIZE == 64 typedef uint64_t word_uint; typedef int64_t word_int; #define WORD_HEX_FORMAT "%lx" #define WORD_DEC_FORMAT "%ld" #else // __WORDSIZE != 64 typedef uint32_t word_uint; typedef int32_t word_int; #define WORD_HEX_FORMAT "%x" #define WORD_DEC_FORMAT "%d" #endif // __WORDSIZE == 64 #endif // TYPES_H #if __arm__ #define ARM_INSTR_SIZE 32 #endif eztrace-2.1/src/eztrace-lib/000077500000000000000000000000001447213526500160125ustar00rootroot00000000000000eztrace-2.1/src/eztrace-lib/CMakeLists.txt000066400000000000000000000016611447213526500205560ustar00rootroot00000000000000add_library(eztrace-lib SHARED eztrace_core.c eztrace_otf2.c eztrace_internals.c eztrace_module.c include/eztrace-lib/eztrace.h include/eztrace-lib/eztrace_otf2.h include/eztrace-lib/eztrace_internals.h include/eztrace-lib/eztrace_module.h pthread_core.c ) target_include_directories(eztrace-lib PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_options(eztrace-lib PUBLIC -D_GNU_SOURCE PRIVATE -Wall -Wextra ) target_link_libraries(eztrace-lib PRIVATE ${OTF2_LIBRARY} atomic PUBLIC eztrace-core dl PRIVATE ${CMAKE_DL_LIBS} rt m ) install(TARGETS eztrace-lib EXPORT EZTraceLibTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/eztrace-lib DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) eztrace-2.1/src/eztrace-lib/eztrace_core.c000066400000000000000000000442441447213526500206330ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include "eztrace-lib/eztrace.h" #include "eztrace-lib/eztrace_mpi.h" #include "eztrace-lib/eztrace_module.h" #include "eztrace-lib/eztrace_internals.h" #include "eztrace-core/eztrace_attributes.h" #include "eztrace-core/eztrace_config.h" #include "eztrace-core/eztrace_utils.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_LIBBACKTRACE #include #include #endif int eztrace_should_trace=0; int eztrace_can_trace = 0; static void _eztrace_run_atexit_functions(); static pthread_key_t protect_on; struct _ezt_write_trace _ezt_trace; __thread enum ezt_trace_status thread_status = ezt_trace_status_uninitialized; __thread uint64_t thread_rank=0; __thread uint64_t otf2_thread_id=0; int using_mpi = 0; int (*EZT_MPI_Recv)(void* buffer, size_t size, int src, int tag) = NULL; int (*EZT_MPI_Send)(void* buffer, size_t size, int dest, int tag) = NULL; int (*EZT_MPI_Reduce)(const void *sendbuf, void *recvbuf, int count, enum EZT_MPI_Datatype datatype, enum EZT_MPI_Op op, int root) = NULL; int (*EZT_MPI_SetMPICollectiveCallbacks)(OTF2_Archive *archive) = NULL; int (*EZT_MPI_Barrier)() = NULL; double (*EZT_MPI_Wtime)() = NULL; static void init_recursion_shield() { static int init_done = 0; if (!init_done) { pthread_key_create(&protect_on, NULL); init_done = 1; todo_set_status("ezt_init_recursion_shield", init_complete); } } void eztrace_register_init_routine(eztrace_function_t init_func) { _ezt_trace.init_routines[_ezt_trace.nb_module++] = init_func; } int _eztrace_fd() { static int fd = -1; /* eztrace may have problems when printing message if the application closes stdout and/or stdout (this may happen at the end of the application, before eztrace_stop is called). To bypass this limitation, let's duplication stderr, and use the resulting fd for printing messages. */ if(fd < 0) { EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); fd=dup(2); /* duplicate stderr */ EZTRACE_PROTECT_OFF(); } else { return 2; /* couldn't call dup, so let's return stderr */ } } return fd; } static char const* _eztrace_get_filedir() { char* res = getenv("EZTRACE_TRACE_DIR"); return res; } void eztrace_set_filename() { /* check if user specified a dirname */ const char* str = _eztrace_get_filedir(); if (_ezt_trace.filename) { free(_ezt_trace.filename); _ezt_trace.filename = NULL; } if(str) { _ezt_trace.filename = strdup(str); } else { /* no dirname specified, use the program name */ char cmd[1024]; _eztrace_get_current_program_name(cmd); _ezt_trace.filename = malloc(1050); snprintf(_ezt_trace.filename, 1050, "%s_trace", cmd); } printf("dir: %s\n", _ezt_trace.filename); } /* return the library name from a symbol string */ static char* get_lib_name(char* symbol) { char* ret; int begin = 0; int end = -1; int i = 0; /* the format of symbol is : '/path/to/libxxx.so (function+0xoffset) [0xaddress]*/ /* so we need to locate the last / and the first ( */ while (symbol[i] != 0) { if (symbol[i] == '/') begin = i + 1; if (symbol[i] == '(') { end = i; break; } i++; } ret = &symbol[begin]; /* replace ( with a \0 */ if (end >= 0) symbol[end] = 0; return ret; } /* return the function name (or library name if the function name is unknown) * from a symbol string. * This function may alter the symbol string. */ static char* get_function_name(char* symbol) { char* ret = symbol; int len = strlen(symbol); int begin = 0; int end = 0; int i; /* the format of symbol is : 'libxxx.so (function+0xoffset) [0xaddress]*/ /* the goal is to retrieve the function+0xoffset string */ for (i = 0; i < len; i++) { if (symbol[i] == '(') { begin = i; if (symbol[i + 1] == '+' || symbol[i + 1] == ')') { return get_lib_name(symbol); } } if (symbol[i] == ')') { end = i; break; } } if (begin == 0) { return symbol; } ret = &symbol[begin + 1]; symbol[end] = 0; return ret; } void eztrace_error_handler(int signo) { static volatile int shield = 0; /* in case several thread receive signals simultaneously, only the first one * handle it. */ while (shield) ; shield = 1; set_recursion_shield_on(); eztrace_log(dbg_lvl_normal, "[EZTrace] signal %d catched. my pid=%d\n", signo, getpid()); // void* buffer[50]; /* get pointers to functions */ // int nb_calls = backtrace(buffer, 50); // EZTRACE_EVENT_PACKED_2(EZTRACE_SIGNAL_RECEIVED, signo, nb_calls); // eztrace_record_backtrace(nb_calls); set_recursion_shield_off(); } void eztrace_abort() { eztrace_log(dbg_lvl_normal, "EZTrace aborts.\n"); char* res = getenv("EZTRACE_DEBUGGER"); if(res) { char host_name[1024]; gethostname(host_name, 1024); eztrace_log(dbg_lvl_error, "To debug this problem, connect to machine %s and run gdb -p %d\n", host_name, getpid()); while(1); } abort(); } void eztrace_signal_handler(int signo) { static volatile int shield = 0; /* in case several thread receive signals simultaneously, only the first one * handle it. */ while (shield) ; shield = 1; eztrace_log(dbg_lvl_error, "EZTrace received signal %d...\n", signo); if (signo == SIGSEGV) eztrace_error_handler(signo); eztrace_stop(); eztrace_log(dbg_lvl_normal, "Signal handling done\n"); exit(EXIT_FAILURE); } /* when an alarm signal is received, check for sampling information */ void _eztrace_alarm_sighandler(int signo __attribute__((unused))) { ezt_sampling_check_callbacks(); } #ifdef __linux__ long _ezt_alarm_interval = 0; int alarm_enabled = 0; int alarm_set = 0; void eztrace_set_alarm() { if (_ezt_alarm_interval >= 0 && alarm_enabled && (!alarm_set)) { alarm_set = 1; struct sigevent sevp; sevp.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; sevp.sigev_signo = SIGALRM; sevp.sigev_value.sival_int = 0; sevp.sigev_notify_function = NULL; sevp.sigev_notify_attributes = NULL; sevp._sigev_un._tid = pthread_self(); timer_t* t = malloc(sizeof(timer_t)); int ret = timer_create(CLOCK_REALTIME, &sevp, t); if (ret != 0) { eztrace_error("timer create failed: %s", strerror(errno)); } struct itimerspec new_value, old_value; new_value.it_interval.tv_sec = 0; new_value.it_interval.tv_nsec = _ezt_alarm_interval; new_value.it_value.tv_sec = 0; new_value.it_value.tv_nsec = _ezt_alarm_interval; ret = timer_settime(*t, 0, &new_value, &old_value); if (ret != 0) { eztrace_error("timer settime failed: %s", strerror(errno)); } } } #else void eztrace_set_alarm() { } #endif static void _eztrace_set_sighandler() { char* res = getenv("EZTRACE_SIGNAL_HANDLER"); if (res && !strncmp(res, "1", 2)) { signal(SIGSEGV, eztrace_signal_handler); signal(SIGINT, eztrace_signal_handler); signal(SIGTERM, eztrace_signal_handler); signal(SIGABRT, eztrace_signal_handler); signal(SIGHUP, eztrace_signal_handler); } #ifdef __linux__ res = getenv("EZTRACE_SIGALARM"); if (res && (strncmp(res, "0", 2) != 0)) { /* convert from ms to ns */ alarm_enabled = 1; _ezt_alarm_interval = atoi(res) * 1000000; eztrace_log(dbg_lvl_debug, "[EZTrace] Setting an alarm every %d ms\n", atoi(res)); signal(SIGALRM, _eztrace_alarm_sighandler); eztrace_set_alarm(); } #endif } void eztrace_start_() { eztrace_start(); } static void _get_current_program_name(char* buffer) { char tmp_buffer[1024]; FILE* f = fopen("/proc/self/cmdline", "r"); fscanf(f, "%s", tmp_buffer); fclose(f); sprintf(buffer, "%s", basename(tmp_buffer)); } static void do_nothing(int signo MAYBE_UNUSED) { /* noting to do */ } void _init_modules() ; static void _set_debug_mode() { static int done = 0; if(done) return; done=1; _ezt_trace.debug_level = dbg_lvl_normal; char* debug_mode = getenv("EZTRACE_DEBUG"); if (debug_mode) { int dbg_lvl = atoi(debug_mode); if(dbg_lvl > dbg_lvl_max) dbg_lvl = dbg_lvl_max; _ezt_trace.debug_level = dbg_lvl; eztrace_log(dbg_lvl_normal, "EZTrace Debug mode enabled (trace level: %d)\n", _ezt_trace.debug_level); } } void _eztrace_init() { enum todo_status ezt_otf2_status = todo_get_status("ezt_otf2"); if(ezt_otf2_status >= init_started && ezt_otf2_status < init_complete) /* ezt_otf2 initialization is pending */ return; enum todo_status ezt_init_status = todo_get_status("eztrace_init"); if(ezt_init_status == init_complete) /* eztrace_init already performed */ return; eztrace_log(dbg_lvl_debug, "eztrace_init starts\n"); todo_set_status("eztrace_init", init_started); /* send a signal so that the current process synchronizes with * pptrace (that waits for a signal, cf pptrace_install_hijack in pptrace.c) */ signal(SIGUSR2, do_nothing); eztrace_log(dbg_lvl_debug, "eztrace_init: send SIGUSR2 to synchronize with pptrace\n"); kill(getpid(), SIGUSR2); if(!using_mpi) _ezt_trace.status = ezt_trace_status_uninitialized; _set_debug_mode(); eztrace_log(dbg_lvl_normal, "Starting EZTrace (pid: %d)...\n", getpid()); if(using_mpi) { eztrace_log(dbg_lvl_normal, "MPI mode selected\n"); } /* make sure eztrace_stop is called when the program stops */ atexit(eztrace_stop); _eztrace_set_sighandler(); todo_set_status("eztrace_init", init_stopped); todo_set_status("eztrace_init", init_complete); eztrace_log(dbg_lvl_debug, "eztrace_init ends\n"); return; } void ezt_init_complete() { todo_set_status("eztrace", init_complete); if(!using_mpi) eztrace_log(dbg_lvl_verbose, "EZTrace initialization is now complete.\n"); } int ezt_is_mpi_mode() { if(dlsym(RTLD_DEFAULT, "MPI_Init") && dlsym(RTLD_DEFAULT, "ezt_mpi_initialize_trace")) { return 1; } return 0; } extern struct ezt_internal_module* ezt_otf2_module; void eztrace_core_constructor() __attribute__((constructor)); void eztrace_core_constructor() { _set_debug_mode(); char cmd[1024]; _get_current_program_name(cmd); if((strcmp(cmd, "eztrace_avail") == 0) || (strcmp(cmd, "eztrace") == 0) || getenv("EZTRACE_DONT_TRACE")) eztrace_should_trace = 0; else eztrace_should_trace = 1; eztrace_log(dbg_lvl_debug, "eztrace_core constructor starts\n"); enqueue_todo("eztrace_init", _eztrace_init, "ezt_otf2", init_complete); enqueue_todo("ezt_init_recursion_shield", init_recursion_shield, "eztrace_init", init_complete); enqueue_todo("ezt_init_thread", ezt_init_thread, "eztrace_init", init_complete); enqueue_todo("ezt_init_modules", _init_modules, "eztrace_init", init_complete); if(ezt_is_mpi_mode()) { using_mpi = 1; if(todo_get_status("ezt_mpi") != init_complete) { add_todo_dependency("eztrace_init", "mpi_init", init_complete); add_todo_dependency("ezt_otf2", "mpi_init", init_complete); } /* using MPI. The "eztrace" task does not depend on anything. * This way, the constructors can finish and let the application call MPI_Init */ enqueue_todo("eztrace", ezt_init_complete, NULL, status_invalid); } else { /* not using MPI. We need to make sure */ enqueue_todo("eztrace", ezt_init_complete, "eztrace_init", init_complete); add_todo_dependency("eztrace", "ezt_otf2", init_complete); } todo_progress(); eztrace_log(dbg_lvl_debug, "eztrace_core constructor ends\n"); } void eztrace_start() { /* avoid executing this function several times */ if (_ezt_trace.status >= ezt_trace_status_running) return; todo_progress(); _ezt_trace.status = ezt_trace_status_running; /* now, we can start recording events. Call pthread_core so that it records the Enter("Working") event */ ezt_pthread_first_event(); /* the current thread needs to be registered since eztrace won't * intercept any pthread_create for this one */ if (!eztrace_autostart_enabled()) { /* call the initialisation routines that were registered */ for (int i = 0; i < _ezt_trace.nb_module; i++) _ezt_trace.init_routines[i](); } } void eztrace_stop_() { eztrace_stop(); } void eztrace_stop() { if (_ezt_trace.status >= ezt_trace_status_being_finalized || _ezt_trace.status < ezt_trace_status_running) return; _ezt_trace.status = ezt_trace_status_being_finalized; finalize_modules(); _eztrace_run_atexit_functions(); ezt_otf2_finalize(); _ezt_trace.status = ezt_trace_status_finalized; if(eztrace_should_trace) { eztrace_log(dbg_lvl_normal, "Stopping EZTrace (pid:%d)...\n", getpid()); } } void eztrace_silent_start() { eztrace_start(); _ezt_trace.status = ezt_trace_status_paused; } void eztrace_pause() { _ezt_trace.status = ezt_trace_status_paused; } void eztrace_resume() { _ezt_trace.status = ezt_trace_status_running; } int recursion_shield_on() { init_recursion_shield(); void* ret = NULL; ret = pthread_getspecific(protect_on); return (ret != NULL); } void set_recursion_shield_on() { init_recursion_shield(); pthread_setspecific(protect_on, (void*)1); } void set_recursion_shield_off() { pthread_setspecific(protect_on, (void*)NULL); } static void _eztrace_get_function_name_from_pointer_fallback(void* pointer, char* output_str, int buffer_len MAYBE_UNUSED) { char** functions; functions = backtrace_symbols(pointer, 1); char* ptr = get_function_name(functions[0]); strncpy(output_str, ptr, strlen(ptr) + 1); free(functions); } #if HAVE_LIBBACKTRACE __thread struct backtrace_state* backtrace_state = NULL; __thread char current_frame[1024]; static void error_callback(void* data, const char* msg, int errnum) { eztrace_error("ERROR: %s (%d)", msg, errnum); } static int backtrace_callback(void* data, uintptr_t pc, const char* filename, int lineno, const char* function) { if (filename == NULL) { /* cannot find debugging info */ _eztrace_get_function_name_from_pointer_fallback((void*)pc, current_frame, 1024); } else { snprintf(current_frame, 1024, "at %s:%d %s", filename, lineno, function); } return 0; } #endif /* HAVE_LIBBACKTRACE */ /* retrieve the name of the function corresponding to pointer * the collected information is copied into output_str * buffer_len is the maximum number of bytes written to output_str */ static void _eztrace_get_function_name_from_pointer(void* pointer, char* output_str, int buffer_len) { #if HAVE_LIBBACKTRACE if (!backtrace_state) { backtrace_state = backtrace_create_state(NULL, 0, error_callback, NULL); } backtrace_pcinfo(backtrace_state, (uintptr_t)pointer, backtrace_callback, error_callback, NULL); strncpy(output_str, current_frame, strlen(current_frame) + 1); #else _eztrace_get_function_name_from_pointer_fallback(pointer, output_str, buffer_len); #endif } /* get information on frame frameid * the collected information is copied into output_str * buffer_len is the maximum number of bytes written to output_str */ void eztrace_get_stack_frame(int frameid, char* output_str, int buffer_len) { void* buffer[frameid + 1]; /* get pointers to functions */ int nb_calls = backtrace(buffer, frameid + 1); if (nb_calls > frameid) { _eztrace_get_function_name_from_pointer(buffer[frameid], output_str, buffer_len); } else if (buffer_len > 0) { output_str[0] = '\0'; } } #define RECORD_BACKTRACES 1 #ifdef RECORD_BACKTRACES /* record events (code=EZTRACE_CALLING_FUNCTION) containing the backtrace */ void eztrace_record_backtrace(int backtrace_depth __attribute__((unused))) { /* the current backtrace looks like this: * 0 - record_backtrace() * 1 - eztrace_callback() * 2 - calling_function * * So, we need to get the name of the function in frame 2. */ #if 0 void* bt_buffer[backtrace_depth]; /* get pointers to functions */ int nb_calls = backtrace(bt_buffer, backtrace_depth); EZTRACE_EVENT1_PACKED_UNPROTECTED(EZTRACE_BACKTRACE_DEPTH, nb_calls); int i; for (i = 0; i < nb_calls; i++) { char buffer[1024]; _eztrace_get_function_name_from_pointer(bt_buffer[i], buffer, 1024); litl_write_probe_raw(_ezt_trace.litl_trace, EZTRACE_CALLING_FUNCTION, strlen(buffer), buffer); } #endif } void record_backtrace() { EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); eztrace_record_backtrace(15); EZTRACE_PROTECT_OFF(); } } #else void eztrace_record_backtrace(int backtrace_depth) { } void record_backtrace() { } #endif struct eztrace_atexit_token_t { eztrace_atexit_function_t func; void* param; }; struct eztrace_atexit_list_t { struct eztrace_atexit_token_t* list; int nb_allocated; int nb_functions; }; struct eztrace_atexit_list_t* atexit_list = NULL; /* register a function to be called before eztrace_stop. */ void eztrace_atexit(eztrace_atexit_function_t f, void* param) { if (!atexit_list) { /* first time this function is called. Allocate/initialize the atexit_list structure */ atexit_list = malloc(sizeof(struct eztrace_atexit_list_t)); atexit_list->nb_allocated = 10; atexit_list->list = malloc(sizeof(struct eztrace_atexit_token_t) * atexit_list->nb_allocated); atexit_list->nb_functions = 0; } int num = atexit_list->nb_functions++; if (num >= atexit_list->nb_allocated) { /* too many atexit callbacks. We need to expand the array */ atexit_list->nb_allocated *= 2; void* ptr = realloc(atexit_list->list, sizeof(struct eztrace_atexit_token_t) * atexit_list->nb_allocated); assert(ptr); atexit_list->list = ptr; } atexit_list->list[num].func = f; atexit_list->list[num].param = param; } /* run all the atexit callbacks that were registered */ static void _eztrace_run_atexit_functions() { if (atexit_list) { int i; for (i = 0; i < atexit_list->nb_functions; i++) { atexit_list->list[i].func(atexit_list->list[i].param); } } } eztrace-2.1/src/eztrace-lib/eztrace_internals.c000066400000000000000000000140261447213526500216750ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) Telecom SudParis * See COPYING in top-level directory. */ #include "eztrace-lib/eztrace.h" #include "eztrace-lib/eztrace_internals.h" struct todo_dependency dependencies_status[128]; int nb_dependencies = 0; int dependency_update = 0; struct token { struct token* next; struct ezt_internal_todo *todo; }; struct token *todo_list = NULL; static void _register_todo(struct ezt_internal_todo *todo) { struct token* token = malloc(sizeof(struct token)); token->todo = todo; token->next = todo_list; todo_list = token; } int _todo_can_run(struct ezt_internal_todo *todo) { eztrace_log(dbg_lvl_debug, "[EZT_Internals]\tCan %s run ?\n",todo->name); if(todo_get_status(todo->name) == init_complete) { eztrace_log(dbg_lvl_debug, "[EZT_Internals]\t\tAlready complete, so no!\n"); return 0; } for(int i=0; inb_dependencies; i++) { enum todo_status expected = todo->dependencies[i].status; enum todo_status actual = todo_get_status(todo->dependencies[i].dep_name); if(actual < expected) { eztrace_log(dbg_lvl_debug, "[EZT_Internals]\t\tRequired dependency %s: %s (current status: %s)\n", todo->dependencies[i].dep_name, STR_STATUS(expected), STR_STATUS(actual)); return 0; } } return 1; } #if 0 static void _free_todos() { struct token* t = todo_list; while(t) { struct token* next = t->next; free(t->todo); free(t); t = next; } return; } #endif static struct ezt_internal_todo* _todo_get(const char* name) { struct token* token = todo_list; while(token) { if(strcmp(token->todo->name, name) == 0) return token->todo; token = token->next; } return NULL; } void todo_print_list() { for(int i=0; inb_dependencies; j++) { printf("\t\tdepend on %s - expected: %s - current status: %s\n", todo->dependencies[j].dep_name, STR_STATUS(todo->dependencies[j].status), STR_STATUS(todo_get_status(todo->dependencies[j].dep_name))); } } } } void enqueue_todo(const char* name, void (*function)(), const char* dependency, enum todo_status dep_status) { struct ezt_internal_todo* todo = NULL; if((todo = _todo_get(name))==NULL) { /* the todo may have been executed before it was enqueued. Check in the list of dependencies */ enum todo_status current_status = todo_get_status(name); if(current_status <= not_initialized) current_status = not_initialized; todo = malloc(sizeof(struct ezt_internal_todo)); todo_set_status(name, current_status); strncpy(todo->name, name, STRING_MAXLEN); todo->nb_dependencies = 0; _register_todo(todo); } todo->todo_function = function; if(dependency) { strncpy(todo->dependencies[todo->nb_dependencies].dep_name, dependency, STRING_MAXLEN); todo->dependencies[todo->nb_dependencies].status = dep_status; todo->nb_dependencies++; } todo_progress(); } void add_todo_dependency(const char* name, const char* dependency, enum todo_status dep_status) { struct ezt_internal_todo* todo = NULL; if((todo = _todo_get(name))==NULL) { todo = malloc(sizeof(struct ezt_internal_todo)); todo_set_status(name, not_initialized); strncpy(todo->name, name, STRING_MAXLEN); todo->nb_dependencies = 0; _register_todo(todo); } assert(todo); for(int i=0; inb_dependencies; i++) { if((strcmp(todo->dependencies[i].dep_name, name) == 0) && todo->dependencies[i].status == dep_status) { /* the dependency already exists */ return; } } assert(todo->nb_dependencies+1 < NB_DEPEND_MAX); int index = todo->nb_dependencies; strncpy(todo->dependencies[index].dep_name, dependency, STRING_MAXLEN); todo->dependencies[index].status = dep_status; todo->nb_dependencies++; } enum todo_status todo_get_status(const char* name) { for(int i=0; itodo; int can_run = _todo_can_run(todo); if(can_run) { eztrace_log(dbg_lvl_debug, "[EZT_Internals] Running %s\n",todo->name); todo->todo_function(); } token = token->next; } }while(dependency_update > 0); } /* wait until module_name initialization is complete */ void todo_wait(const char* todo_name, enum todo_status status) { int i=0; int already_warned =0; while(todo_get_status(todo_name) != status) { if(i++ > 10000 && !already_warned) { /* There's probably something wrong */ eztrace_log(dbg_lvl_debug, "[EZT_Internals] I've been waiting for %s for a while. There's probably something wrong:\n", todo_name); todo_print_list(); already_warned = 1; todo_progress(); } todo_progress(); } } eztrace-2.1/src/eztrace-lib/eztrace_module.c000066400000000000000000000223141447213526500211620ustar00rootroot00000000000000#include "eztrace-lib/eztrace_module.h" #include "eztrace-lib/eztrace_internals.h" #include "eztrace-core/eztrace_config.h" #include "eztrace-core/eztrace_list.h" #include "eztrace-lib/eztrace.h" #include #include #include #include static struct ezt_list_t module_list; char* cur_module_name = NULL; #define SO_STRING DYNLIB_EXT int module_verbose = 0; static int module_initialized = 0; void _core_init(void) __attribute__((constructor)); void _core_init(void) { if (!module_initialized) { module_initialized = 1; ezt_list_new(&module_list); } } /* This function calls the init handler for all the registered modules */ void _init_modules() { static int recursion_shield = 0; if(recursion_shield) return; recursion_shield = 1; struct ezt_list_token_t* token; ezt_list_foreach(&module_list, token) { struct eztrace_module* p_module = (struct eztrace_module*)token->data; p_module->init(); } todo_set_status("ezt_init_modules", init_complete); recursion_shield = 0; return; } /* This function calls the init handler for all the registered modules */ void finalize_modules() { static int recursion_shield = 0; if(recursion_shield) return; recursion_shield = 1; struct ezt_list_token_t* token; ezt_list_foreach(&module_list, token) { struct eztrace_module* p_module = (struct eztrace_module*)token->data; p_module->finalize(); } recursion_shield = 0; return; } int is_registered(const char* module_name) { struct ezt_list_token_t* token; ezt_list_foreach(&module_list, token) { struct eztrace_module* p_module = (struct eztrace_module*)token->data; if(strcmp(p_module->name, module_name)== 0) return 1; } return 0; } int initialize_modules() { static int already_initialized = 0; if(already_initialized) return 0; char*str = getenv("EZTRACE_TRACE"); if(str) { char* buffer = malloc((strlen(str)+1)*sizeof(char)); memcpy(buffer, str, (strlen(str)+1)*sizeof(char)); if(! is_registered("eztrace_core")) { eztrace_warn("module %s is not registered yet !\n", "lib"); return 0; } /* EZTRACE_TRACE is declared. * it should contain modules separated by " ", such * as "mpi memory pthread" * Let's iterate over these modules and check if they are registered */ char* save_ptr = buffer; char* module = strtok_r(buffer, " ", &save_ptr); while (module) { if(! is_registered(module)) { return 0; } module = strtok_r(NULL, " ", &save_ptr); } _init_modules(); already_initialized = 1; todo_wait("eztrace", init_complete); return 1; } return 0; } void eztrace_print_module_list() { struct ezt_list_token_t* token; /* Let's check wether another module with the same prefix is already registered */ ezt_list_foreach(&module_list, token) { struct eztrace_module* p_mod = ezt_container_of(token, struct eztrace_module, token); if(strcmp(p_mod->name, "eztrace_core") != 0) printf("%s\t%s\n", p_mod->name, p_mod->description); } } void eztrace_register_module(struct eztrace_module* p_module) { struct ezt_list_token_t* token; if(module_verbose) eztrace_log(dbg_lvl_normal, "Register module %s\n", p_module->name); /* Let's check wether another module with the same prefix is already registered */ ezt_list_foreach(&module_list, token) { struct eztrace_module* p_mod = (struct eztrace_module*)token->data; if (strcmp(p_module->name, p_mod->name) == 0) { eztrace_warn("Trying to register a module that is already registered. Module name is %s\n", p_mod->name); return; } } p_module->token.data = p_module; ezt_list_add(&module_list, &p_module->token); if (module_verbose) eztrace_log(dbg_lvl_normal, "module %s registered\n", p_module->name); initialize_modules(); } /* return 1 if the filename matches "libeztrace-*.so" */ static int filter(const struct dirent* entry) { const char* filename = entry->d_name; /* check wether the string starts with "libeztrace-" */ if (strncmp(filename, "libeztrace-", strlen("libeztrace-"))) /* the string doesn't start with "libeztrace-" */ return 0; /* check wether the next chars correspond to the module name * that we are looking for */ filename += strlen("libeztrace-"); if (cur_module_name) { if (strncmp(filename, cur_module_name, strlen(cur_module_name))) /* the string doesn't start with "libeztrace-" */ return 0; filename += strlen(cur_module_name); } else { filename = entry->d_name + strlen(entry->d_name) - strlen(SO_STRING); } if (strncmp(filename, SO_STRING, strlen(SO_STRING))) /* the string doesn't end with ".so" */ return 0; /* check wether there are remaining chars after .so */ filename += strlen(SO_STRING); if (filename[0]) return 0; return 1; } struct module{ char fullpath[4096]; char module_name[128]; }; struct module modules[1024]; int nb_modules=0; static int _load_module(struct module* m) { if(!m) return 0; if(module_verbose) eztrace_log(dbg_lvl_normal, "Trying to load module %s\n", m->module_name); void *handle = dlopen(m->fullpath, RTLD_LAZY); if(!handle) { eztrace_error("failed to open %s: %s\n", m->fullpath, dlerror()); return 0; } /* search for the list of functions to instrument in the library we just opened */ char symbol_alias [256]; PPTRACE_SYMBOL_ALIAS_STRING(symbol_alias, m->module_name, 256); void* hijack_address = dlsym(handle, symbol_alias); if(! hijack_address) { dlclose(handle); if(module_verbose) eztrace_log(dbg_lvl_normal, "\tfailed\n"); return 0; } if(module_verbose) eztrace_log(dbg_lvl_normal, "\tsuccess\n"); return 1; } /* search for files that could be modules in dirname */ static void _list_modules_in_dir(const char* dirname) { struct dirent** namelist; int n; /* Get the list of files that match the module name in the libdir directory */ n = scandir(dirname, &namelist, filter, alphasort); if (n < 0) perror("scandir"); else { while (n--) { /* Get the full name of the file (path/libname.so) */ struct module* m=&modules[nb_modules++]; snprintf(m->fullpath, 4096, "%s/%s", dirname, namelist[n]->d_name); // file name is libeztrace-SOMETHING.so // let's extract SOMETHING int prefix_len=strlen("libeztrace-"); int suffix_len=strlen(SO_STRING); int len = strlen(namelist[n]->d_name); strncpy(m->module_name, &namelist[n]->d_name[prefix_len], len-(suffix_len+prefix_len)); m->module_name[len-(suffix_len+prefix_len+1)]='\0'; free(namelist[n]); } free(namelist); } } /* search for files that could be modules in all the directories */ static void _list_modules() { /* search in the default directory*/ _list_modules_in_dir(EZTRACE_LIB_DIR); char* lib_path = getenv("EZTRACE_LIBRARY_PATH"); if (!lib_path) { /* No lib_path specified, we can't find any more plugin */ goto out; } /* Iterate over the lib_path specified. * lib_path are separated by ':' */ char* save_ptr = lib_path; char*cur_path = strtok_r(lib_path, ":", &save_ptr); while (cur_path) { _list_modules_in_dir(cur_path); cur_path = strtok_r(NULL, ":", &save_ptr); } out: /* we have a list of files that could contain modules, let check them */ if(module_verbose) { eztrace_log(dbg_lvl_normal, "%d potential modules:\n", nb_modules); for(int i=0; i #include #include #include #include #include #include _Atomic uint64_t _next_ts= 0; uint64_t next_ts() {return _next_ts++;} __thread OTF2_EvtWriter* evt_writer=NULL; // set to 1 during OTF2 startup. In this case, it is safe to record // OTF2 events even if EZTRACE_SAFE is false static __thread int _ezt_otf2_safe = 0; extern int eztrace_should_trace; int ezt_otf2_set_mpi_rank_called = 0; static int using_mpi = 0; int ezt_mpi_rank = 0; static int mpi_comm_size = 1; static _Atomic int next_string_id = 0; static _Atomic int next_region_id = 0; static _Atomic int next_thread_id = 0; static _Atomic int next_local_thread_id = 0; static _Atomic int next_attribute_id = 0; static _Atomic int next_thread_team_id = 1; static _Atomic int next_mpi_comm_id = 2; OTF2_CommRef comm_world_ref = 0; static int max_id = INT_MAX; int otf2_chunk_size=1; static uint64_t epoch_start; static uint64_t epoch_stop; struct ezt_internal_module* ezt_otf2_module = NULL; static pthread_mutex_t otf2_lock; static struct timespec pre_flush_ts; OTF2_TimeStamp first_timestamp = 0; static OTF2_FlushType pre_flush( void* userData __attribute__((unused)), OTF2_FileType fileType __attribute__((unused)), OTF2_LocationRef location __attribute__((unused)), void* callerData __attribute__((unused)), bool final __attribute__((unused))) { clock_gettime(CLOCK_MONOTONIC, &pre_flush_ts); eztrace_log(dbg_lvl_verbose, "Start flushing\n"); // OTF2 currently does not *always* call post_flush after flushing. // When closing the trace file (when final is true), the post flush // callback will not be called. // In that case, do not pause eztrace because the thread would not // be resumed if(!final) thread_status = ezt_trace_status_paused; return OTF2_FLUSH; } #define TIME_DIFF(t1, t2) (((t2).tv_sec - (t1).tv_sec)*1e9 +((t2).tv_nsec - (t1).tv_nsec)) static OTF2_TimeStamp post_flush( void* userData __attribute__((unused)), OTF2_FileType fileType __attribute__((unused)), OTF2_LocationRef location __attribute__((unused)) ) { /* TODO: what if flush was called at the end ? */ static struct timespec post_flush_ts; clock_gettime(CLOCK_MONOTONIC, &post_flush_ts); static int nb_flush=0; thread_status = ezt_trace_status_running; eztrace_log(dbg_lvl_verbose, "Flush %d ends! (%f us)\n", nb_flush++, TIME_DIFF(pre_flush_ts, post_flush_ts)/1e6); return ezt_get_timestamp(); } static OTF2_FlushCallbacks flush_callbacks = { .otf2_pre_flush = pre_flush, .otf2_post_flush = post_flush }; struct to_register_string { int id; int len; char* buffer; }; struct to_register_function { int id; int function_name; }; struct to_register_thread { int id; int string_id; int mpi_rank; }; struct to_register_gpu { int id; int string_id; int mpi_rank; }; struct to_register_attribute { int id; int string_id; OTF2_Type type; }; struct to_register_thread_team { int id; int string_id; int parent_id; int nb_threads; }; struct to_register_thread_team_member { int thread_team_id; int thread_rank; uint64_t thread_id; int nb_threads; }; struct to_register_mpi_comm { int comm_id; int comm_size; uint64_t* members; /* mpi ranks */ }; enum to_register_type { type_string, type_function, type_thread, type_gpu, type_attribute, type_thread_team, type_thread_team_member, type_mpi_comm, type_invalid, }; struct to_register { enum to_register_type type; union { struct to_register_string string; struct to_register_function function; struct to_register_thread thread; struct to_register_gpu gpu; struct to_register_attribute attribute; struct to_register_thread_team thread_team; struct to_register_thread_team_member thread_team_member; struct to_register_mpi_comm mpi_comm; } data; struct to_register* next; }; struct to_register* to_register=NULL; struct to_register* to_register_tail=NULL; static int _register_string(int string_id, const char* string) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(string_id >= 0); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteString( _ezt_trace.global_def_writer, string_id, string); pthread_mutex_unlock(&otf2_lock); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteString failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); eztrace_warn("string: '%s'\n", string); eztrace_warn("To debug: gdb attach %d\n", getpid()); while(1); return -1; } return 0; } static int _register_function(int id, int function_name) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(id >= 0); assert(function_name >= 0); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteRegion ( _ezt_trace.global_def_writer, id /* id */, function_name /* region name */, function_name /* alternative name */, function_name /* description */, OTF2_REGION_ROLE_FUNCTION, OTF2_PARADIGM_USER, OTF2_REGION_FLAG_NONE, 0 /* source file */, 0 /* begin lno */, 0 /* end lno */ ); pthread_mutex_unlock(&otf2_lock); if (err != OTF2_SUCCESS) { return -1; } return 0; } static int _register_thread(int id, int thread_name, int mpi_rank) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(id >= 0); assert(thread_name >= 0); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteLocation ( _ezt_trace.global_def_writer, id, thread_name, OTF2_LOCATION_TYPE_CPU_THREAD, 2 /* # events */, mpi_rank); pthread_mutex_unlock(&otf2_lock); if (err != OTF2_SUCCESS) { return -1; } return 0; } static int _register_gpu(int id, int gpu_name, int mpi_rank) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(id >= 0); assert(gpu_name >= 0); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteLocation ( _ezt_trace.global_def_writer, id, gpu_name, #if OTF2_MAJOR_VERSION >= 3 OTF2_LOCATION_TYPE_ACCELERATOR_STREAM, #else OTF2_LOCATION_TYPE_GPU, #endif 2 /* # events */, mpi_rank); pthread_mutex_unlock(&otf2_lock); if (err != OTF2_SUCCESS) { return -1; } return 0; } static int _register_attribute(int id, int attribute_name, OTF2_Type type) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(id >= 0); assert(attribute_name >= 0); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteAttribute(_ezt_trace.global_def_writer, id, attribute_name, attribute_name, type); pthread_mutex_unlock(&otf2_lock); if (err != OTF2_SUCCESS) { return -1; } return 0; } /* When registering an OpenMP thread team, we need to know which thread are part of the team * This is done by enqueueing thread team until all the theads where registered */ struct thread_team { int id; int string_id; int parent_id; int nb_threads; uint64_t *thread_ids; int nb_ready_threads; // nb of threads whose id are known struct thread_team *next; }; static struct thread_team *thread_teams = NULL; static ezt_spinlock thread_team_lock; static int _register_thread_team(struct to_register*r) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); struct thread_team *team = malloc(sizeof(struct thread_team)); team->id = r->data.thread_team.id; team->string_id = r->data.thread_team.string_id; team->parent_id = r->data.thread_team.parent_id; team->nb_threads = r->data.thread_team.nb_threads; team->thread_ids = malloc(sizeof(uint64_t)*team->nb_threads); team->nb_ready_threads = 0; /* enqueue the new team */ ezt_spin_lock(&thread_team_lock); team->next = thread_teams; thread_teams = team; ezt_spin_unlock(&thread_team_lock); return 0; } static int _register_thread_team_member(struct to_register*r) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); ezt_spin_lock(&thread_team_lock); struct thread_team *team = thread_teams; struct thread_team *prev = NULL; /* search for the corresponding therad team */ while(team) { if(team->id == r->data.thread_team_member.thread_team_id) { if(team->nb_threads == 0) team->nb_threads = r->data.thread_team_member.nb_threads; assert(team->nb_threads == r->data.thread_team_member.nb_threads); assert(team->nb_threads > r->data.thread_team_member.thread_rank); team->thread_ids[r->data.thread_team_member.thread_rank] = r->data.thread_team_member.thread_id; team->nb_ready_threads++; if(team->nb_ready_threads == team->nb_threads) { /* all the thread were registered. We can now record the OTF2 event */ /* remove the team from the list of unterminated thread teams */ if(prev) prev->next = team->next; else thread_teams = team->next; ezt_spin_unlock(&thread_team_lock); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteGroup(_ezt_trace.global_def_writer, team->id, team->string_id, OTF2_GROUP_TYPE_COMM_LOCATIONS, OTF2_PARADIGM_OPENMP, OTF2_GROUP_FLAG_NONE, team->nb_threads, team->thread_ids); if(err != OTF2_SUCCESS) { eztrace_error( "OTF2_GlobalDefWriter_WriteGroup failed: %s\n", OTF2_Error_GetDescription(err)); } err = OTF2_GlobalDefWriter_WriteComm(_ezt_trace.global_def_writer, team->id, team->string_id, team->id, team->parent_id #if OTF2_MAJOR_VERSION >= 3 , OTF2_COMM_FLAG_NONE #endif ); if(err != OTF2_SUCCESS) { eztrace_error("OTF2_GlobalDefWriter_WriteComm failed: %s\n", OTF2_Error_GetDescription(err)); } pthread_mutex_unlock(&otf2_lock); free(team->thread_ids); free(team); return 0; } ezt_spin_unlock(&thread_team_lock); return 0; } team = team->next; } ezt_spin_unlock(&thread_team_lock); /* not found */ return -1; } static int _register_mpi_comm(int comm_id, int comm_size, uint64_t*members) { if((! _ezt_otf2_safe) && (! EZTRACE_SAFE)) return -1; assert(ezt_mpi_rank == 0); assert(comm_size >= 0); int retval = -1; char comm_name[1024]; char comm_group_name[1024]; snprintf(comm_group_name, 1024, "MPI_COMM_%d_group", comm_id); snprintf(comm_name, 1024, "MPI_COMM_%d", comm_id); int comm_str = ezt_otf2_register_string(comm_name); int comm_group_str = ezt_otf2_register_string(comm_group_name); pthread_mutex_lock(&otf2_lock); OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteGroup( _ezt_trace.global_def_writer, comm_id, comm_group_str, OTF2_GROUP_TYPE_COMM_GROUP, OTF2_PARADIGM_MPI, OTF2_GROUP_FLAG_NONE, comm_size, members ); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteGroup failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); goto out; } OTF2_GlobalDefWriter_WriteComm( _ezt_trace.global_def_writer, comm_id, comm_str, comm_id, comm_world_ref #if OTF2_MAJOR_VERSION >= 3 , OTF2_COMM_FLAG_NONE #endif ); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteComm failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); goto out; } retval = 0; pthread_mutex_unlock(&otf2_lock); out: return retval; } static int _register(struct to_register*r) { switch(r->type) { case type_string: return _register_string(r->data.string.id, r->data.string.buffer); case type_function: return _register_function(r->data.function.id, r->data.function.function_name); case type_thread: return _register_thread(r->data.thread.id, r->data.thread.string_id, r->data.thread.mpi_rank); case type_gpu: return _register_gpu(r->data.gpu.id, r->data.gpu.string_id, r->data.gpu.mpi_rank); case type_attribute: return _register_attribute(r->data.attribute.id, r->data.attribute.string_id, r->data.attribute.type); case type_thread_team: return _register_thread_team(r); case type_thread_team_member: return _register_thread_team_member(r); case type_mpi_comm: return _register_mpi_comm(r->data.mpi_comm.comm_id, r->data.mpi_comm.comm_size, r->data.mpi_comm.members); default: eztrace_warn("invalid register type: %d\n", r->type); } return -1; } static int _postpone_registration(struct to_register* r) { if(ezt_mpi_rank > 0 || _register(r) < 0) { r->next = NULL; /* Use a spinlock to make enqueuing thread-safe */ static ezt_spinlock spinlock; ezt_spin_lock(&spinlock); if(to_register) { assert(to_register_tail); to_register_tail->next = r; to_register_tail = r; } else { to_register = r; to_register_tail = r; } ezt_spin_unlock(&spinlock); } return 0; } static void _register_postponed() { if(mpi_comm_size==1) /* serial program. Nothing to do */ return; int type_tag = 17; int data_tag = 18; _ezt_otf2_safe = 1; if(ezt_mpi_rank == 0) { struct to_register* r = to_register; while(r) { struct to_register* next = r->next; _register(r); free(r); r = next; } for(int i=1; itype, sizeof(r->type), 0, type_tag); switch(r->type) { case type_string: EZT_MPI_Send(&r->data.string.id, 2*sizeof(int), 0, data_tag); EZT_MPI_Send(r->data.string.buffer, r->data.string.len, 0, data_tag); free(r->data.string.buffer); break; case type_function: EZT_MPI_Send(&r->data.function, sizeof(r->data.function), 0, data_tag); break; case type_thread: EZT_MPI_Send(&r->data.thread, sizeof(r->data.thread), 0, data_tag); break; case type_gpu: EZT_MPI_Send(&r->data.gpu, sizeof(r->data.gpu), 0, data_tag); break; case type_attribute: EZT_MPI_Send(&r->data.attribute, sizeof(r->data.attribute), 0, data_tag); break; case type_thread_team: EZT_MPI_Send(&r->data.thread_team, sizeof(r->data.thread_team), 0, data_tag); break; case type_thread_team_member: EZT_MPI_Send(&r->data.thread_team_member, sizeof(r->data.thread_team_member), 0, data_tag); break; case type_mpi_comm: EZT_MPI_Send(&r->data.mpi_comm.comm_id, sizeof(int)*2, 0, data_tag); int buffer_size = r->data.mpi_comm.comm_size*sizeof(uint64_t); EZT_MPI_Send(r->data.mpi_comm.members, buffer_size, 0, data_tag); break; default: eztrace_error("Invalid register type: %d\n", r->type); } struct to_register* next = r->next; free(r); r = next; } /* tell rank 0 that we're done */ enum to_register_type t = type_invalid; EZT_MPI_Send(&t, sizeof(t), 0, type_tag); } _ezt_otf2_safe = 0; } int ezt_otf2_register_mpi_comm(int comm_size, uint64_t *members) { // if(! eztrace_should_trace) // return -1; /* TODO: record the parent communicator */ int comm_id = next_mpi_comm_id++; struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_mpi_comm; r->data.mpi_comm.comm_id = comm_id; r->data.mpi_comm.comm_size = comm_size; size_t buffer_size = comm_size * sizeof(uint64_t); r->data.mpi_comm.members = malloc(buffer_size); for(int i=0; i< comm_size; i++) { r->data.mpi_comm.members[i] = members[i]; } if(_postpone_registration(r) < 0) return -1; return comm_id; } int ezt_otf2_register_thread_team(char *name, int nb_threads) { if(! eztrace_should_trace) return -1; int thread_team_id = next_thread_team_id++; int string_id = ezt_otf2_register_string(name); int parent_id = ezt_mpi_rank; struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_thread_team; r->data.thread_team.id = thread_team_id; r->data.thread_team.string_id = string_id; r->data.thread_team.parent_id = parent_id; r->data.thread_team.nb_threads = nb_threads; if(_postpone_registration(r) < 0) return -1; return thread_team_id; } int ezt_otf2_register_thread_team_member(int team_id, int my_rank, int nb_threads) { if(! eztrace_should_trace) return -1; uint64_t thread_id = thread_rank; struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_thread_team_member; r->data.thread_team_member.thread_team_id = team_id; r->data.thread_team_member.thread_rank = my_rank; r->data.thread_team_member.thread_id = thread_id; r->data.thread_team_member.nb_threads = nb_threads; if(_postpone_registration(r) < 0) return -1; return 0; } int ezt_otf2_register_string(const char* string) { if(! eztrace_should_trace) return -1; int string_id = next_string_id++; if(ezt_mpi_rank > 0) { struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_string; r->data.string.id = string_id; r->data.string.len = strlen(string)+1; r->data.string.buffer = malloc(sizeof(char)*r->data.string.len); assert(r->data.string.buffer); strcpy(r->data.string.buffer, string); if(_postpone_registration(r) < 0) return -1; } else { if( _register_string(string_id, string) < 0) return -1; } return string_id; } int ezt_otf2_register_attribute(char* name, OTF2_Type type) { if(! eztrace_should_trace) return -1; int attr_id = next_attribute_id++; int name_id = ezt_otf2_register_string(name); if(ezt_mpi_rank > 0) { struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_attribute; r->data.attribute.id = attr_id; r->data.attribute.string_id = name_id; r->data.attribute.type = type; if(_postpone_registration(r) < 0) return -1; } else { if(_register_attribute(attr_id, name_id, type) < 0) return -1; } return attr_id; } int ezt_otf2_register_function(const char* function_name) { if(! eztrace_should_trace) return -1; int region_id=next_region_id++; int function_name_id = ezt_otf2_register_string(function_name); if(ezt_mpi_rank > 0) { struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_function; r->data.function.id = region_id; r->data.function.function_name = function_name_id; if(_postpone_registration(r) < 0) return -1; } else { if(_register_function(region_id, function_name_id) < 0) return -1; } return region_id; } int ezt_otf2_register_thread(int local_thread_id) { int thread_id = next_thread_id++; // int local_thread_id = next_local_thread_id++; char thread_name[128]; snprintf(thread_name, 128, "P#%dT#%d", ezt_mpi_rank, local_thread_id); OTF2_StringRef name = ezt_otf2_register_string(thread_name); /* The first thread of each process is already registered */ if(thread_id % otf2_chunk_size == 0) { return thread_id; } if(ezt_mpi_rank > 0) { struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_thread; r->data.thread.id = thread_id; r->data.thread.string_id = name; r->data.thread.mpi_rank = ezt_mpi_rank; if(_postpone_registration(r) < 0) return -1; } else { if(_register_thread(thread_id, name, ezt_mpi_rank) < 0) return -1; } _ezt_trace.def_writer = OTF2_Archive_GetDefWriter( _ezt_trace.archive, thread_id ); return thread_id; } int ezt_otf2_register_gpu(int local_gpu_id) { int gpu_id = next_thread_id++; // int local_thread_id = next_local_thread_id++; char gpu_name[128]; snprintf(gpu_name, 128, "P#%dGPU#%d", ezt_mpi_rank, local_gpu_id); OTF2_StringRef name = ezt_otf2_register_string(gpu_name); if(ezt_mpi_rank > 0) { struct to_register *r = malloc(sizeof(struct to_register)); r->type = type_gpu; r->data.gpu.id = gpu_id; r->data.gpu.string_id = name; r->data.gpu.mpi_rank = ezt_mpi_rank; if(_postpone_registration(r) < 0) return -1; } else { if(_register_gpu(gpu_id, name, ezt_mpi_rank) < 0) return -1; } return gpu_id; } void ezt_otf2_set_mpi_rank(int rank, int comm_size) { static int already_set = 0; if(already_set) return; already_set = 1; ezt_mpi_rank = rank; mpi_comm_size = comm_size; otf2_chunk_size = INT_MAX/comm_size; max_id = otf2_chunk_size*(ezt_mpi_rank+1); next_string_id = otf2_chunk_size * ezt_mpi_rank; next_region_id = otf2_chunk_size * ezt_mpi_rank; next_thread_id = otf2_chunk_size * ezt_mpi_rank; next_attribute_id = otf2_chunk_size * ezt_mpi_rank; if(ezt_mpi_rank > 0) { next_mpi_comm_id = otf2_chunk_size * ezt_mpi_rank; } ezt_otf2_set_mpi_rank_called = 1; } static void _eztrace_set_buffer_size() { char* res = getenv("EZTRACE_BUFFER_SIZE"); if (res) { _ezt_trace.buffer_size = atoi(res); } } extern char**environ; char ld_preload_value[4096]; /* unset LD_PRELOAD * this makes sure that forked processes will not be instrumented */ void unset_ld_preload() { /* unset LD_PRELOAD */ char* ld_preload = getenv("LD_PRELOAD"); if(!ld_preload) { ld_preload_value[0]='\0'; return; } /* save the value of ld_preload so that we can set it back later */ strncpy(ld_preload_value, ld_preload, 4096); int ret = unsetenv("LD_PRELOAD"); if(ret != 0 ){ eztrace_error( "unsetenv failed ! %s\n", strerror(errno)); } /* also change the environ variable since exec* function * rely on it. */ for (int i=0; environ[i]; i++) { if (strstr(environ[i],"LD_PRELOAD=")) { eztrace_log(dbg_lvl_verbose, "hacking out LD_PRELOAD from environ[%d]\n",i); environ[i][0] = '\0'; } } char*plop=getenv("LD_PRELOAD"); if(plop) { eztrace_warn("Warning: cannot unset LD_PRELOAD\nThis is likely to cause problems later.\n"); } } /* set LD_PRELOAD so that future forked processes are instrumented * you need to call unset_ld_preload before calling this function */ void reset_ld_preload() { if(strlen(ld_preload_value)>0) { setenv("LD_PRELOAD", ld_preload_value, 1); } } int ezt_otf2_initialize_thread(int thread_rank) { _ezt_otf2_safe = 1; int ret = ezt_otf2_register_thread(thread_rank); _ezt_otf2_safe = 0; return ret; } void ezt_otf2_init() { eztrace_log(dbg_lvl_debug, "eztrace_otf2_init starts\n"); todo_set_status("ezt_otf2", init_started); if(ezt_is_mpi_mode()) { enum todo_status ezt_mpi_status = todo_get_status("ezt_mpi"); if(ezt_mpi_status != init_complete) { eztrace_log(dbg_lvl_debug, "eztrace_otf2_init needs to wait until MPI is initialized\n"); add_todo_dependency("ezt_otf2", "ezt_mpi", init_complete); /* ezt_mpi initialization is pending */ todo_set_status("ezt_otf2", init_stopped); return; } using_mpi = 1; } else { /* not using mpi == mpi with 1 rank */ ezt_otf2_set_mpi_rank(0, 1); } _ezt_trace.buffer_size = (16 * 1024 * 1024); // 160MB _eztrace_set_buffer_size(); eztrace_set_filename(); const char* trace_directory = _ezt_trace.filename; if(ezt_mpi_rank == 0) { /* Delete the trace directory so that otf2 does not print warnings */ unset_ld_preload(); int child_pid = fork(); if(child_pid == 0) { _ezt_trace.status = ezt_trace_status_finalized; execlp("/bin/rm", "/bin/rm", "-rf", trace_directory, NULL); eztrace_error("execlp failed\n"); exit(EXIT_FAILURE); } else { int status = 0; if(waitpid(child_pid, &status, 0) != child_pid) eztrace_warn("waitpid failed\n"); if(! WIFEXITED(status)){ eztrace_warn("Warning: cannot delete %s at startup (%d)\n", trace_directory, WEXITSTATUS(status)); if(WIFSIGNALED(status)) { eztrace_warn("\tterminated with signal %d\n", WTERMSIG(status)); } eztrace_abort(); } } reset_ld_preload(); } if(using_mpi) { /* make sure rank 0 deleted the trace directory befor entering OTF2_Archive_Open */ EZT_MPI_Barrier(); } fflush(stdout); fflush(stderr); uint64_t size = _ezt_trace.buffer_size; _ezt_trace.archive = OTF2_Archive_Open( trace_directory, "eztrace_log", OTF2_FILEMODE_WRITE, size /* event chunk size */, size /* def chunk size */, OTF2_SUBSTRATE_POSIX, OTF2_COMPRESSION_NONE ); if(!_ezt_trace.archive) { eztrace_error("OTF2_Archive_Open(%s) failed\n", trace_directory); } OTF2_Pthread_Archive_SetLockingCallbacks(_ezt_trace.archive, NULL); OTF2_Archive_SetFlushCallbacks( _ezt_trace.archive, &flush_callbacks, NULL ); if(!using_mpi) { OTF2_Archive_SetSerialCollectiveCallbacks( _ezt_trace.archive ); } else { EZT_MPI_SetMPICollectiveCallbacks( _ezt_trace.archive ); } OTF2_Archive_OpenEvtFiles( _ezt_trace.archive ); _ezt_otf2_safe = 1; if(ezt_mpi_rank == 0) { eztrace_should_trace=1; _ezt_trace.global_def_writer = OTF2_Archive_GetGlobalDefWriter( _ezt_trace.archive ); char cmd[1024]; _eztrace_get_current_program_name(cmd); int program_name = ezt_otf2_register_string(cmd); OTF2_GlobalDefWriter_WriteSystemTreeNode( _ezt_trace.global_def_writer, 0 /* id */, program_name /* name */, program_name /* class */, OTF2_UNDEFINED_SYSTEM_TREE_NODE /* parent */ ); uint64_t locations[mpi_comm_size]; uint64_t members[mpi_comm_size]; int local_thread_id = next_local_thread_id++; OTF2_Archive_OpenDefFiles( _ezt_trace.archive ); for(int i=0; i=0); OTF2_GlobalDefWriter_WriteLocationGroup( _ezt_trace.global_def_writer, i /* id */, process_string /* name */, OTF2_LOCATION_GROUP_TYPE_PROCESS, 0 /* system tree */ #if OTF2_MAJOR_VERSION >= 3 , OTF2_UNDEFINED_LOCATION_GROUP #endif ); int thread_id = MPI2OTF(i); locations[i] = thread_id; members[i] = i; char thread_name[128]; snprintf(thread_name, 128, "P#%dT#%d", i, local_thread_id); OTF2_StringRef name = ezt_otf2_register_string(thread_name); _register_thread(thread_id, name, i); OTF2_DefWriter* def_writer = OTF2_Archive_GetDefWriter( _ezt_trace.archive, thread_id ); OTF2_Archive_CloseDefWriter( _ezt_trace.archive, def_writer ); } OTF2_Archive_CloseDefFiles( _ezt_trace.archive ); int comm_world_str = ezt_otf2_register_string("MPI_COMM_WORLD"); int comm_world_locations_str = ezt_otf2_register_string("All processes"); int comm_world_group_str = ezt_otf2_register_string("Main process group"); OTF2_GroupRef comm_world_locations = 0; OTF2_GroupRef comm_world_group = 1; OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteGroup(_ezt_trace.global_def_writer, comm_world_locations, comm_world_locations_str, OTF2_GROUP_TYPE_COMM_LOCATIONS, OTF2_PARADIGM_MPI, OTF2_GROUP_FLAG_NONE, mpi_comm_size, locations); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteGroup failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); return ; } err = OTF2_GlobalDefWriter_WriteGroup( _ezt_trace.global_def_writer, comm_world_group, comm_world_group_str, OTF2_GROUP_TYPE_COMM_GROUP, OTF2_PARADIGM_MPI, OTF2_GROUP_FLAG_NONE, mpi_comm_size, members); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteGroup failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); return ; } OTF2_GlobalDefWriter_WriteComm( _ezt_trace.global_def_writer, comm_world_ref, comm_world_str, comm_world_group, OTF2_UNDEFINED_COMM #if OTF2_MAJOR_VERSION >= 3 , OTF2_COMM_FLAG_NONE #endif ); if (err != OTF2_SUCCESS) { eztrace_warn("OTF2_GlobalDefWriter_WriteComm failed: %s (%s)\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); return ; } } _ezt_otf2_safe = 0; epoch_start = ezt_get_timestamp(); todo_set_status("ezt_otf2", init_complete); eztrace_log(dbg_lvl_debug, "eztrace_otf2_init ends\n"); eztrace_can_trace = 1; return; } static void _synchronize_epochs() { epoch_stop = ezt_get_timestamp(); uint64_t global_epoch_start; uint64_t global_epoch_stop; if(mpi_comm_size > 1) { EZT_MPI_Reduce( &epoch_start, &global_epoch_start, 1, EZT_MPI_UINT64_T, EZT_MPI_MIN, 0); EZT_MPI_Reduce( &epoch_stop, &global_epoch_stop, 1, EZT_MPI_UINT64_T, EZT_MPI_MIN, 0); } else { global_epoch_start = epoch_start; global_epoch_stop = epoch_stop; } if(ezt_mpi_rank == 0) { OTF2_ErrorCode err = OTF2_GlobalDefWriter_WriteClockProperties( _ezt_trace.global_def_writer, 1e9 /* 1 tick per second */, global_epoch_start, global_epoch_stop - global_epoch_start + 1 #if OTF2_MAJOR_VERSION >= 3 , OTF2_UNDEFINED_TIMESTAMP #endif ); if( err != OTF2_SUCCESS) { eztrace_error("OTF2_GlobalDefWriter_WriteClockProperties failed\n"); } } } struct ezt_finalize_callback { ezt_finalize_callback_t callback; OTF2_EvtWriter* evt_writer; enum ezt_trace_status *thread_status; uint64_t thread_id; }; struct ezt_finalize_callback *ezt_finalize_callbacks = NULL; _Atomic int ezt_finalize_nb_callbacks = 0; static ezt_spinlock at_finalize_lock; /* register a callback to be called during ezt_otf2_finalize before closing the OTF2 archive * this can be used for finalizing a thread */ void ezt_at_finalize(ezt_finalize_callback_t callback, OTF2_EvtWriter* evt_writer, enum ezt_trace_status *thread_status, uint64_t thread_id) { ezt_spin_lock(&at_finalize_lock); int index = ezt_finalize_nb_callbacks++; ezt_finalize_callbacks = realloc(ezt_finalize_callbacks, ezt_finalize_nb_callbacks*sizeof(struct ezt_finalize_callback)); ezt_finalize_callbacks[index].callback = callback; ezt_finalize_callbacks[index].evt_writer = evt_writer; ezt_finalize_callbacks[index].thread_status = thread_status; ezt_finalize_callbacks[index].thread_id = thread_id; ezt_spin_unlock(&at_finalize_lock); } /* in some cases a thread may exit and free its TLS thread_status, * which will cause ezt_at_finalize access memory illegally. * To avoid this, we cancel at_finalize when the thread destruction is detected * * This function assumes that at_finalize_lock is locked */ void ezt_at_finalize_cancel_locked(uint64_t thread_id) { for(int i=0; i 1) return -1; ezt_at_finalize_run(thread_rank); ezt_at_finalize_execute(); ezt_spin_lock(&at_finalize_lock); for(int i=0; i #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #define EZTRACE_API_VERSION 0x00000900 // up to eztrace-1.x // With eztrace 2.0, the API changed #define EZTRACE_API_VERSION 0x00002000 /* start the recording of events */ void eztrace_start(); /* stop recording events and write the trace to the disk */ void eztrace_stop(); /* start eztrace but only record some event (thread creation, mpi_init, mpi communicators creation..)*/ void eztrace_silent_start(); /* Stop the recording of events */ void eztrace_pause(); /* Restart the recording of events*/ void eztrace_resume(); /* unset LD_PRELOAD * this makes sure that forked processes will not be instrumented with eztrace */ void unset_ld_preload(); /* set LD_PRELOAD so that future forked processes are instrumented * you need to call unset_ld_preload before calling this function */ void reset_ld_preload(); /* change the trace filename */ void eztrace_set_filename(); extern int eztrace_can_trace; /* record events (code=EZTRACE_CALLING_FUNCTION) containing the backtrace */ void eztrace_record_backtrace(int backtrace_depth); void record_backtrace(); void eztrace_abort(); /* get information on frame frameid * the collected information is copied into output_str * buffer_len is the maximum number of bytes written to output_str */ void eztrace_get_stack_frame(int frameid, char* output_str, int buffer_len); /* initialize a thread */ void ezt_init_thread(); /* finalize a thread */ void ezt_finalize_thread(); void ezt_pthread_first_event(); /* return 1 if eztrace is in MPI mode */ int ezt_is_mpi_mode(); /* return the number threads that were created */ int ezt_get_nb_threads(); struct ezt_thread_info { int thread_rank; pid_t tid; char thread_name[50]; int otf2_thread_id; }; struct ezt_thread_info* get_thread_info_by_pid(pid_t tid); struct ezt_thread_info* get_thread_info(int thread_id); typedef void (*eztrace_function_t)(void); /* register a callback to be called when the application calls * eztrace_start(). * This function is only usefull when AUTOSTART is disabled */ void eztrace_register_init_routine(eztrace_function_t init_func); typedef void (*eztrace_atexit_function_t)(void*); /* * register a function to be called before eztrace_stop. */ void eztrace_atexit(eztrace_atexit_function_t f, void* param); #define RECORD_HW_COUNTERS() \ { \ ezt_sampling_check_callbacks(); \ } enum ezt_trace_status { ezt_trace_status_uninitialized, ezt_trace_status_running, ezt_trace_status_paused, ezt_trace_status_stopped, ezt_trace_status_being_finalized, /* atexit functions are being called */ ezt_trace_status_finalized, /* event recording has stopped */ }; typedef void (*ezt_finalize_callback_t)(OTF2_EvtWriter*, enum ezt_trace_status *, uint64_t); /* register a callback to be called during ezt_otf2_finalize before closing the OTF2 archive * this can be used for finalizing a thread */ void ezt_at_finalize(ezt_finalize_callback_t callback, OTF2_EvtWriter* evt_writer, enum ezt_trace_status *thread_status, uint64_t thread_id); /* unregister a callback */ void ezt_at_finalize_cancel(uint64_t thread_id); /* unregister a callback * This function assumes that at_finalize_lock is locked */ void ezt_at_finalize_cancel_locked(uint64_t thread_id); /* run the finalization callback for thread thread_id */ void ezt_at_finalize_run(uint64_t thread_id); #define EZT_NB_MODULES_MAX 32 enum eztrace_debug_level { dbg_lvl_error, dbg_lvl_quiet, dbg_lvl_normal, dbg_lvl_verbose, dbg_lvl_debug, dbg_lvl_max, }; struct _ezt_write_trace { OTF2_Archive* archive; OTF2_GlobalDefWriter* global_def_writer; OTF2_DefWriter* def_writer; enum ezt_trace_status status; enum eztrace_debug_level debug_level; size_t buffer_size; char* filename; /* number of init functions to be called when the eztrace_start * is called. */ int nb_module; eztrace_function_t init_routines[EZT_NB_MODULES_MAX]; }; extern struct _ezt_write_trace _ezt_trace; extern __thread OTF2_EvtWriter* evt_writer; extern __thread enum ezt_trace_status thread_status; extern __thread uint64_t thread_rank; extern __thread uint64_t otf2_thread_id; extern int ezt_mpi_rank; extern int system_tree_node_ref; extern int eztrace_should_trace; /* is it safe to record events ? */ #define EZTRACE_SAFE ((_ezt_trace.status == ezt_trace_status_running || \ _ezt_trace.status == ezt_trace_status_being_finalized) && \ thread_status == ezt_trace_status_running && \ eztrace_should_trace) #define EZTRACE_SHOULD_TRACE(x) do { if(EZTRACE_SAFE) x; } while(0) #define EZT_OTF2_EvtWriter_Enter(writer, attr, time, region) do { \ if(region<0) { \ fprintf(stderr, "error in %s:%d region=%d\n", __FILE__, __LINE__, region); \ eztrace_abort(); \ } \ if(EZTRACE_SAFE){ \ EZT_OTF2_CHECK(OTF2_EvtWriter_Enter(writer, attr, time, region)); \ } \ }while(0) #define EZT_OTF2_EvtWriter_Leave(writer, attr, time, region) do { \ if(region<0) { \ fprintf(stderr, "error in %s:%d region=%d\n", __FILE__, __LINE__, region); \ eztrace_abort(); \ } \ if(EZTRACE_SAFE){ \ EZT_OTF2_CHECK(OTF2_EvtWriter_Leave(writer, attr, time, region)); \ } \ }while(0) int _eztrace_fd(); #define eztrace_log(_debug_level_, format, ...) \ do { \ if (_ezt_trace.debug_level >= _debug_level_) { \ dprintf(_eztrace_fd(), "[P%dT%" PRIu64 "] " format, ezt_mpi_rank, thread_rank, ##__VA_ARGS__); \ } \ } while(0) #define eztrace_warn(format, ...) \ do { \ eztrace_log(dbg_lvl_normal, "EZTrace warning in %s (%s:%d): " format, \ __func__, __FILE__, __LINE__, \ ##__VA_ARGS__); \ } while(0) #define eztrace_error(format, ...) \ do { \ eztrace_log(dbg_lvl_error, "EZTrace error in %s (%s:%d): " format, \ __func__, __FILE__, __LINE__, \ ##__VA_ARGS__); \ eztrace_abort(); \ } while(0) #ifdef NDEBUG #define eztrace_assert(cond) do { (void)sizeof(cond);} while (0) #else #define eztrace_assert(cond) \ do { \ if(!(cond)) \ eztrace_error("Assertion failed"); \ } while(0) #endif #define FUNCTION_ENTRY_(fname) \ static __thread int recursion_shield=0; \ eztrace_log(dbg_lvl_verbose, "Entering [%s]\n", fname); \ static struct ezt_instrumented_function* function=NULL; \ \ recursion_shield++; \ if(recursion_shield == 1 && \ eztrace_can_trace && \ _ezt_trace.status == ezt_trace_status_running && \ thread_status == ezt_trace_status_running) { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ if(!function) { \ function=find_instrumented_function(fname, INSTRUMENTED_FUNCTIONS); \ } \ if(function->event_id < 0) { \ instrument_function(function); \ } \ assert(function->event_id >= 0); \ EZT_OTF2_EvtWriter_Enter( evt_writer, \ NULL, \ ezt_get_timestamp(), \ function->event_id ); \ EZTRACE_PROTECT_OFF(); \ } \ } #define FUNCTION_ENTRY FUNCTION_ENTRY_(__func__) #define FUNCTION_ENTRY_WITH_ARGS(...) \ static __thread int recursion_shield=0; \ eztrace_log(dbg_lvl_verbose, "Entering [%s]\n", __func__); \ RECORD_HW_COUNTERS(); \ static struct ezt_instrumented_function* function=NULL; \ static int entry_attr_id[__VA_NARGS__(__VA_ARGS__)]; \ recursion_shield++; \ \ if(recursion_shield == 1 && \ eztrace_can_trace && \ _ezt_trace.status == ezt_trace_status_running && \ thread_status == ezt_trace_status_running) { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ if(!function) { \ function=find_instrumented_function(__func__, INSTRUMENTED_FUNCTIONS); \ } \ if(function->event_id < 0) { \ instrument_function(function); \ } \ assert(function->event_id>=0); \ static int first_time = 1; \ if(first_time) { \ FOR_EACH_I(REGISTER_ARG_ENTRY, __VA_ARGS__); \ first_time = 0; \ } \ OTF2_AttributeList* attribute_list = OTF2_AttributeList_New(); \ FOR_EACH_I(ADD_ATTR_ENTRY, __VA_ARGS__); \ \ EZT_OTF2_EvtWriter_Enter( evt_writer, \ attribute_list, \ ezt_get_timestamp(), \ function->event_id ); \ OTF2_AttributeList_Delete(attribute_list); \ EZTRACE_PROTECT_OFF(); \ } \ } #define FUNCTION_EXIT_(fname) \ eztrace_log(dbg_lvl_verbose, "Leaving [%s]\n", fname); \ recursion_shield--; \ if(recursion_shield == 0 && \ eztrace_can_trace && \ _ezt_trace.status == ezt_trace_status_running && \ thread_status == ezt_trace_status_running) { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ assert(function); \ assert(function->event_id >= 0); \ EZT_OTF2_EvtWriter_Leave( evt_writer, \ NULL, \ ezt_get_timestamp(), \ function->event_id ); \ EZTRACE_PROTECT_OFF(); \ } \ } #define FUNCTION_EXIT FUNCTION_EXIT_(__func__) #define FUNCTION_EXIT_WITH_ARGS(...) do { \ eztrace_log(dbg_lvl_verbose, "Leaving [%s]\n", __func__); \ static int exit_attr_id[__VA_NARGS__(__VA_ARGS__)]; \ static int exit_attr_initialized = 0; \ if(recursion_shield == 1 && \ eztrace_can_trace && \ _ezt_trace.status == ezt_trace_status_running && \ thread_status == ezt_trace_status_running) { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ if(exit_attr_initialized == 0) { \ exit_attr_initialized = 1; \ FOR_EACH_I(REGISTER_ARG_EXIT, __VA_ARGS__); \ } \ assert(function); \ assert(function->event_id >= 0); \ OTF2_AttributeList* attribute_list = OTF2_AttributeList_New(); \ FOR_EACH_I(ADD_ATTR_EXIT, __VA_ARGS__); \ EZT_OTF2_EvtWriter_Leave( evt_writer, \ attribute_list, \ ezt_get_timestamp(), \ function->event_id ); \ OTF2_AttributeList_Delete(attribute_list); \ EZTRACE_PROTECT_OFF(); \ } \ } \ recursion_shield--; \ } while(0) /* check whether dlsym returned successfully */ #define TREAT_ERROR() \ do { \ char* error; \ if ((error = dlerror()) != NULL) { \ fputs(error, stderr); \ eztrace_abort(); \ } \ } while (0) /* intercept function func and store its previous value into var */ #define INTERCEPT(func, var) \ do { \ if (var) \ break; \ void* _handle = RTLD_NEXT; \ var = (typeof(var))(uintptr_t)dlsym(_handle, func); \ TREAT_ERROR(); \ } while (0) /* record an event (code=EZTRACE_CALLING_FUNCTION) with the calling function name */ void record_backtrace(); /* return 1 if an event is being recorded. */ int recursion_shield_on(); void set_recursion_shield_on(); void set_recursion_shield_off(); /* avoid infinite recursion */ #define EZTRACE_PROTECT if (!recursion_shield_on()) /* Set the recursion shield */ #define EZTRACE_PROTECT_ON() set_recursion_shield_on() #define EZTRACE_PROTECT_OFF() set_recursion_shield_off() /* pptrace stuff */ #define DECLARE_MODULE(module_name) \ extern struct ezt_instrumented_function PPTRACE_SYMBOL_LIST(module_name)[] #define DECLARE_CURRENT_MODULE DECLARE_MODULE(CURRENT_MODULE) //#define CURRENT_MODULE lib #define INSTRUMENTED_FUNCTIONS PPTRACE_CURRENT_SYMBOL_LIST #define PPTRACE_START_INTERCEPT_FUNCTIONS(module_name) struct ezt_instrumented_function PPTRACE_SYMBOL_LIST(module_name)[] = { #define PPTRACE_END_INTERCEPT_FUNCTIONS(module_name) \ FUNCTION_NONE \ } \ ; \ extern struct ezt_instrumented_function* PPTRACE_SYMBOL_EXTERNAL(module_name) __attribute__((alias(PPTRACE_SYMBOL_ALIAS(module_name)))); #define INTERCEPT3(func, var) { \ .function_name=func, \ .callback=&(var), \ .event_id = -1, \ }, #define FUNCTION_NONE { \ .function_name="", \ .callback=NULL, \ .event_id = -1, \ }, static void instrument_function(struct ezt_instrumented_function* f) __attribute__((unused)); static void instrument_functions(struct ezt_instrumented_function* functions) __attribute__((unused)); static struct ezt_instrumented_function* find_instrumented_function(const char* fname, struct ezt_instrumented_function* functions) __attribute__((unused)); static void instrument_function(struct ezt_instrumented_function* f) { if(f->event_id >= 0) { /* this function has already been initialized */ return; } assert(f->callback != NULL); static __thread int recursion_shield = 0; recursion_shield++; if(recursion_shield == 1) { if(*(void**)f->callback == NULL) { eztrace_log(dbg_lvl_debug, "Instrumenting %s using dlsym\n", f->function_name); /* binary instrumentation did not find the symbol. */ void* ptr = dlsym(RTLD_NEXT, f->function_name); if(!ptr) { eztrace_log(dbg_lvl_debug, "Warning: cannot find symbol %s: %s\n", f->function_name, dlerror()); } else { memcpy(f->callback, &ptr, sizeof(void*)); } } else { eztrace_log(dbg_lvl_debug, "No need to instrument %s because of binary instrumentation\n", f->function_name); } if(todo_get_status("eztrace") == init_complete && todo_get_status("ezt_otf2") == init_complete && _ezt_trace.status < ezt_trace_status_being_finalized) { f->event_id = ezt_otf2_register_function(f->function_name); } } recursion_shield--; } static struct ezt_instrumented_function* find_instrumented_function(const char* fname, struct ezt_instrumented_function* functions) { struct ezt_instrumented_function*f=NULL; for(f = functions; strcmp(f->function_name, "") != 0; f++) { if(strcmp(f->function_name, fname) == 0) { return f; } } return NULL; } static void instrument_functions(struct ezt_instrumented_function* functions) { struct ezt_instrumented_function*f=NULL; for(f = functions; strcmp(f->function_name, "") != 0; f++) { instrument_function(f); } } #define INSTRUMENT_ALL_FUNCTIONS() do { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ instrument_functions(INSTRUMENTED_FUNCTIONS); \ EZTRACE_PROTECT_OFF(); \ } \ }while(0); #define INSTRUMENT_FUNCTIONS(module) do { \ EZTRACE_PROTECT { \ EZTRACE_PROTECT_ON(); \ instrument_functions(PPTRACE_SYMBOL_LIST(module)); \ EZTRACE_PROTECT_OFF(); \ } \ } while(0) /* instrument one function */ #define INTERCEPT_FUNCTION(fname, cb) do { \ if(!cb) { \ struct ezt_instrumented_function*f=NULL; \ for(f = INSTRUMENTED_FUNCTIONS; \ strcmp(f->function_name, fname) != 0 && \ strcmp(f->function_name, "") != 0; \ f++) { \ } \ instrument_function(f); \ } \ } while(0) #endif /* __EZTRACE_H__ */ eztrace-2.1/src/eztrace-lib/include/eztrace-lib/eztrace_internals.h000066400000000000000000000027571447213526500255360ustar00rootroot00000000000000#ifndef EZTRACE_INTERNALS_H #define EZTRACE_INTERNALS_H enum todo_status { status_invalid, not_initialized, init_started, init_stopped, init_complete, }; //struct ezt_internal_module { // char name[128]; // enum ezt_internal_module_status status; // void (*init_function)(struct ezt_internal_module*); // void *module_data; // /* todo: add dependencies ? */ //}; // #define STR_STATUS(status) \ (status)==not_initialized ? "Not initialized" :\ (status)==init_started ? "Initialization started" : \ (status)==init_stopped ? "Initialization stopped" : \ (status)==init_complete ? "Initialization complete" : \ "Invalid" #define NB_DEPEND_MAX 30 #define STRING_MAXLEN 128 struct todo_dependency { char dep_name[STRING_MAXLEN]; enum todo_status status; }; struct ezt_internal_todo { char name[STRING_MAXLEN]; void (*todo_function)(); struct todo_dependency dependencies[NB_DEPEND_MAX]; int nb_dependencies; }; void todo_print_list(); void enqueue_todo(const char* name, void (*function)(), const char* dependency, enum todo_status dep_status); void add_todo_dependency(const char* name, const char* dependency, enum todo_status dep_status); enum todo_status todo_get_status(const char* todo_name); void todo_set_status(const char* todo_name, enum todo_status status); void todo_progress(); /* wait until module_name initialization is complete */ void todo_wait(const char* todo_name, enum todo_status status); #endif /* EZTRACE_INTERNALS */ eztrace-2.1/src/eztrace-lib/include/eztrace-lib/eztrace_module.h000066400000000000000000000022621447213526500250130ustar00rootroot00000000000000#ifndef EZTRACE_MODULE_H #define EZTRACE_MODULE_H #include /* Describe a plugin */ struct eztrace_module { void (*init)(); void (*finalize)(); char name[128]; char description[128]; struct ezt_instrumented_function *functions; struct ezt_list_token_t token; }; #define EZT_STR(s) #s #define EZT_REGISTER_MODULE(_mod_name, _mod_descr, _mod_init_function, _mod_finalize_function) do { \ static struct eztrace_module module; \ sprintf(module.name, EZT_STR(_mod_name) ); \ sprintf(module.description, EZT_STR(_mod_descr) ); \ module.functions = PPTRACE_SYMBOL_LIST(_mod_name); \ module.init = _mod_init_function; \ module.finalize = _mod_finalize_function; \ eztrace_register_module(&module); \ } while(0) void eztrace_register_module(struct eztrace_module* p_module); /* load all the modules specified by the EZTRACE_TRACE variable */ void eztrace_load_modules(int mod_verb); /* load all the modules specified by the EZTRACE_TRACE variable */ void eztrace_load_all_modules(int mod_verb); void eztrace_print_module_list(); int initialize_modules(); void finalize_modules(); #endif /* EZTRACE_MODULE_H */ eztrace-2.1/src/eztrace-lib/include/eztrace-lib/eztrace_mpi.h000066400000000000000000000056371447213526500243240ustar00rootroot00000000000000#ifndef EZTRACE_MPI_H #define EZTRACE_MPI_H enum EZT_MPI_Datatype { EZT_MPI_DATATYPE_NULL , EZT_MPI_CHAR , EZT_MPI_UNSIGNED_CHAR , EZT_MPI_SHORT , EZT_MPI_UNSIGNED_SHORT , EZT_MPI_INT , EZT_MPI_UNSIGNED , EZT_MPI_LONG , EZT_MPI_UNSIGNED_LONG , EZT_MPI_LONG_LONG_INT , EZT_MPI_LONG_LONG , EZT_MPI_FLOAT , EZT_MPI_DOUBLE , EZT_MPI_LONG_DOUBLE , EZT_MPI_BYTE , EZT_MPI_WCHAR , EZT_MPI_PACKED , EZT_MPI_LB , EZT_MPI_UB , EZT_MPI_C_COMPLEX , EZT_MPI_C_FLOAT_COMPLEX , EZT_MPI_C_DOUBLE_COMPLEX , EZT_MPI_C_LONG_DOUBLE_COMPLEX , EZT_MPI_2INT , EZT_MPI_C_BOOL , EZT_MPI_SIGNED_CHAR , EZT_MPI_UNSIGNED_LONG_LONG , EZT_MPI_CHARACTER , EZT_MPI_INTEGER , EZT_MPI_REAL , EZT_MPI_LOGICAL , EZT_MPI_COMPLEX , EZT_MPI_DOUBLE_PRECISION , EZT_MPI_2INTEGER , EZT_MPI_2REAL , EZT_MPI_DOUBLE_COMPLEX , EZT_MPI_2DOUBLE_PRECISION , EZT_MPI_REAL4 , EZT_MPI_COMPLEX8 , EZT_MPI_REAL8 , EZT_MPI_COMPLEX16 , EZT_MPI_REAL16 , EZT_MPI_COMPLEX32 , EZT_MPI_INTEGER1 , EZT_MPI_INTEGER2 , EZT_MPI_INTEGER4 , EZT_MPI_INTEGER8 , EZT_MPI_INTEGER16 , EZT_MPI_INT8_T , EZT_MPI_INT16_T , EZT_MPI_INT32_T , EZT_MPI_INT64_T , EZT_MPI_UINT8_T , EZT_MPI_UINT16_T , EZT_MPI_UINT32_T , EZT_MPI_UINT64_T , EZT_MPI_AINT , EZT_MPI_OFFSET , EZT_MPI_FLOAT_INT , EZT_MPI_DOUBLE_INT , EZT_MPI_LONG_INT , EZT_MPI_SHORT_INT , EZT_MPI_LONG_DOUBLE_INT }; enum EZT_MPI_Op { EZT_MPI_MAX, EZT_MPI_MIN, EZT_MPI_SUM, EZT_MPI_PROD, EZT_MPI_LAND, EZT_MPI_BAND, EZT_MPI_LOR, EZT_MPI_BOR, EZT_MPI_LXOR, EZT_MPI_BXOR, EZT_MPI_MAXLOC, EZT_MPI_MINLOC, }; extern int (*EZT_MPI_Recv)(void* buffer, size_t size, int src, int tag); extern int (*EZT_MPI_Send)(void* buffer, size_t size, int dest, int tag); extern int (*EZT_MPI_Reduce)(const void *sendbuf, void *recvbuf, int count, enum EZT_MPI_Datatype datatype, enum EZT_MPI_Op op, int root); extern int (*EZT_MPI_SetMPICollectiveCallbacks)(OTF2_Archive *archive); extern int (*EZT_MPI_Barrier)(); extern double (*EZT_MPI_Wtime)(); #endif /* EZTRACE_MPI_H */ eztrace-2.1/src/eztrace-lib/include/eztrace-lib/eztrace_otf2.h000066400000000000000000000141071447213526500244010ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) Telecom SudParis * See COPYING in top-level directory. */ #ifndef __EZTRACE_OTF2_H__ #define __EZTRACE_OTF2_H__ #include #include #include #include #include "eztrace-lib/eztrace_internals.h" #include "eztrace-lib/eztrace_mpi.h" int ezt_otf2_register_function(const char* function_name); int ezt_otf2_register_string(const char* string); int ezt_otf2_register_attribute(char* name, OTF2_Type type); int ezt_otf2_register_thread(int thread_rank); int ezt_otf2_register_gpu(int gpu_id); int ezt_otf2_register_thread_team(char *name, int nb_threads); int ezt_otf2_register_thread_team_member(int team_id, int my_rank, int nb_threads); int ezt_otf2_register_mpi_comm(int comm_size, uint64_t *members); void ezt_otf2_init(); int ezt_otf2_finalize(); int ezt_otf2_initialize_thread(int thread_rank); void ezt_otf2_set_mpi_rank(int rank, int comm_size); #define EZT_OTF2_CHECK( function ) do { \ OTF2_ErrorCode _status_ = function; \ if(_status_ != OTF2_SUCCESS) { \ eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(_status_), \ OTF2_Error_GetDescription(_status_)); \ } \ } while(0) #define OTF2_TYPE_AUTO(var) sizeof(var)==1 ? OTF2_TYPE_UINT8 : \ sizeof(var)==2 ? OTF2_TYPE_UINT16: \ sizeof(var)==4 ? OTF2_TYPE_UINT32: OTF2_TYPE_UINT64 #define REGISTER_ARG_ENTRY(I, arg) REGISTER_ARG(I, arg, entry_attr_id) #define REGISTER_ARG_EXIT(I, arg) REGISTER_ARG(I, arg, exit_attr_id) #define REGISTER_ARG(I, arg, attr_array) do { \ enum OTF2_Type_enum type = OTF2_TYPE_AUTO(arg); \ attr_array[I-1] = ezt_otf2_register_attribute(#arg, OTF2_TYPE_AUTO(arg)); \ } while(0); #define ADD_ATTR_ENTRY(I, arg) ADD_ATTR(I, arg, entry_attr_id) #define ADD_ATTR_EXIT(I, arg) ADD_ATTR(I, arg, exit_attr_id) static void OTF2_AttributeList_AddAttribute_uint8(OTF2_AttributeList * attribute_list, OTF2_AttributeRef attribute, uint8_t value) __attribute__((unused)); static void OTF2_AttributeList_AddAttribute_uint16(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint16_t value) __attribute__((unused)); static void OTF2_AttributeList_AddAttribute_uint32(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint32_t value) __attribute__((unused)); static void OTF2_AttributeList_AddAttribute_uint64(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint64_t value) __attribute__((unused)); static void OTF2_AttributeList_AddAttribute_string(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, const char* value) __attribute__((unused)); static void OTF2_AttributeList_AddAttribute_uint8(OTF2_AttributeList * attribute_list, OTF2_AttributeRef attribute, uint8_t value) { OTF2_AttributeValue attr_value; attr_value.uint8 = value; OTF2_AttributeList_AddAttribute( attribute_list, attribute, OTF2_TYPE_UINT8, attr_value ); } static void OTF2_AttributeList_AddAttribute_uint16(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint16_t value) { OTF2_AttributeValue attr_value; attr_value.uint16 = value; OTF2_AttributeList_AddAttribute( attribute_list, attribute, OTF2_TYPE_UINT16, attr_value ); } static void OTF2_AttributeList_AddAttribute_uint32(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint32_t value) { OTF2_AttributeValue attr_value; attr_value.uint32 = value; OTF2_AttributeList_AddAttribute( attribute_list, attribute, OTF2_TYPE_UINT32, attr_value ); } static void OTF2_AttributeList_AddAttribute_uint64(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, uint64_t value) { OTF2_AttributeValue attr_value; attr_value.uint64 = value; OTF2_AttributeList_AddAttribute( attribute_list, attribute, OTF2_TYPE_UINT64, attr_value ); } static void OTF2_AttributeList_AddAttribute_string(OTF2_AttributeList *attribute_list, OTF2_AttributeRef attribute, const char* value) { OTF2_AttributeValue attr_value; attr_value.stringRef = ezt_otf2_register_string(value?value:""); OTF2_AttributeList_AddAttribute( attribute_list, attribute, OTF2_TYPE_STRING, attr_value ); } #define ADD_ATTRIBUTE(attribute_list, attribute_id, value) _Generic((value), \ uint8_t: OTF2_AttributeList_AddAttribute_uint8 (attribute_list, attribute_id, (uint8_t) (uint64_t)value), \ uint16_t: OTF2_AttributeList_AddAttribute_uint16(attribute_list, attribute_id, (uint16_t) (uint64_t)value), \ uint32_t: OTF2_AttributeList_AddAttribute_uint32(attribute_list, attribute_id, (uint32_t) (uint64_t)value), \ char*: OTF2_AttributeList_AddAttribute_string(attribute_list, attribute_id, (const char*) (uint64_t)value), \ const char*:OTF2_AttributeList_AddAttribute_string(attribute_list, attribute_id, (const char*) (uint64_t)value), \ default: OTF2_AttributeList_AddAttribute_uint64(attribute_list, attribute_id, (uint64_t) (uint64_t)value)); #define ADD_ATTR(I, arg, attr_array) ADD_ATTRIBUTE(attribute_list, attr_array[I-1], arg) uint64_t next_ts(); extern OTF2_TimeStamp first_timestamp; static inline OTF2_TimeStamp ezt_get_timestamp( ) { uint64_t retval = 0; if(EZT_MPI_Wtime) { /* If MPI is enabled, use MPI_Wtime as a clock */ retval = EZT_MPI_Wtime() * 1e9; goto out; } #if 1 struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); retval = t.tv_sec*1e9 + t.tv_nsec; goto out; #else #ifdef __i386 __asm__ volatile ("rdtsc" : "=A" (retval)); goto out; #elif defined __amd64 uint64_t a, d; __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); retval = (d<<32) | a; goto out; #endif #endif out: if(first_timestamp == 0) { first_timestamp = retval; } return retval - first_timestamp; } extern int otf2_chunk_size; static int MPI2OTF(int mpi_rank) __attribute__((unused)); static int MPI2OTF(int mpi_rank) { return mpi_rank*otf2_chunk_size; } #endif /* __EZTRACE_OTF2_H__ */ eztrace-2.1/src/eztrace-lib/pthread_core.c000066400000000000000000000161531447213526500206230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "eztrace-core/eztrace_config.h" #include "eztrace-lib/eztrace.h" #include "eztrace-lib/eztrace_otf2.h" #include "eztrace-lib/eztrace_module.h" #include "eztrace-core/eztrace_spinlock.h" #include #include #include #include #include #include #include #define CURRENT_MODULE eztrace_core DECLARE_CURRENT_MODULE; static volatile int _pthread_core_initialized = 0; extern int eztrace_should_trace; int (*libpthread_create)(pthread_t* thread, const pthread_attr_t* attr, void* (*start_routine)(void*), void* arg); int (*libpthread_join)(pthread_t th, void** thread_return); void (*libpthread_exit)(void* thread_return); static int pthread_create_id=-1; static int pthread_join_id=-1; static int pthread_exit_id=-1; /* this function shall be called by each new thread */ void eztrace_set_alarm(); /* Thread creation/destruction callbacks */ /* Internal structure used for transmitting the function and argument * during pthread_create. */ struct _pthread_create_info_t { void* (*func)(void*); void* arg; }; static _Atomic int nb_threads=0; extern int current_process_ref; static void _ezt_finalize_thread(OTF2_EvtWriter* e_writer, enum ezt_trace_status *th_status, uint64_t thread_id, int is_locked) { while(*th_status != ezt_trace_status_running) { /* the thread is doing something, let's wait until it is safe to stop it */ if(*th_status == ezt_trace_status_finalized) return; sched_yield(); } if(eztrace_should_trace && e_writer) { EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadEnd(e_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM, thread_id)); *th_status = ezt_trace_status_finalized; } *th_status = ezt_trace_status_finalized; if(is_locked) ezt_at_finalize_cancel_locked(thread_id); else ezt_at_finalize_cancel(thread_id); } void ezt_finalize_thread_locked(OTF2_EvtWriter* e_writer, enum ezt_trace_status *status, uint64_t thread_id) { _ezt_finalize_thread(e_writer, status, thread_id, 1); } void ezt_finalize_thread() { _ezt_finalize_thread(evt_writer, &thread_status, otf2_thread_id, 0); } struct ezt_thread_info registered_threads[1024]; struct ezt_thread_info* get_thread_info_by_pid(pid_t tid) { for(int i=0; i= MAC_OS_X_VERSION_10_12 uint64_t tid64; pthread_threadid_np(NULL, &tid64); pid_t tid = (pid_t)tid64; #else pid_t tid = syscall(__NR_gettid); #endif return tid; } static void _ezt_register_thread() { struct ezt_thread_info *info = ®istered_threads[thread_rank]; info->thread_rank = thread_rank; info->tid = _gettid(); snprintf(info->thread_name, 50, "P#%dT#%d", ezt_mpi_rank, info->thread_rank); int thread_id = ezt_otf2_initialize_thread(thread_rank); assert(thread_id != -1); otf2_thread_id = thread_id; info->otf2_thread_id = otf2_thread_id; evt_writer = OTF2_Archive_GetEvtWriter( _ezt_trace.archive, otf2_thread_id); } void ezt_thread_cleanup() { static _Thread_local int finalized = 0; if(finalized) return; finalized = 1; ezt_finalize_thread(); ezt_at_finalize_cancel(otf2_thread_id); return; } void ezt_init_thread() { if((thread_status >= ezt_trace_status_running)) return; if(todo_get_status("eztrace_init") != init_complete) return; /* atomically increment nb_threads */ thread_rank = nb_threads++; _ezt_register_thread(); thread_status = ezt_trace_status_running; ezt_at_finalize(ezt_finalize_thread_locked, evt_writer, &thread_status, otf2_thread_id); RECORD_HW_COUNTERS(); eztrace_set_alarm(); todo_set_status("ezt_init_thread", init_complete); ezt_pthread_first_event(); } void ezt_pthread_first_event() { if(EZTRACE_SAFE) { EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadBegin(evt_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM, thread_rank)); } } int ezt_get_nb_threads() { return nb_threads; } /* Invoked by pthread_create on the new thread */ static void* _pthread_new_thread(void* arg) { struct _pthread_create_info_t* p_arg = (struct _pthread_create_info_t*)arg; void* (*f)(void*) = p_arg->func; void* _arg = p_arg->arg; free(p_arg); ezt_init_thread(); void* res = (*f)(_arg); ezt_at_finalize_run(otf2_thread_id); return res; } int pthread_create(pthread_t* __restrict thread, const pthread_attr_t* __restrict attr, void* (*start_routine)(void*), void* __restrict arg) { FUNCTION_ENTRY; struct _pthread_create_info_t* _args = (struct _pthread_create_info_t*)malloc( sizeof(struct _pthread_create_info_t)); _args->func = start_routine; _args->arg = arg; if (!libpthread_create) INTERCEPT("pthread_create", libpthread_create); /* We do not call directly start_routine since we could not get the actual creation timestamp of * the thread. Let's invoke _pthread_new_thread that will PROF_EVENT the thread and call * start_routine. */ int retval = libpthread_create(thread, attr, _pthread_new_thread, _args); FUNCTION_EXIT; return retval; } int pthread_join(pthread_t th, void** thread_return) { FUNCTION_ENTRY; if (!libpthread_join) INTERCEPT("pthread_join", libpthread_join); int ret = libpthread_join(th, thread_return); FUNCTION_EXIT; return ret; } void pthread_exit(void* thread_return) { ezt_thread_cleanup(); libpthread_exit(thread_return); __builtin_unreachable(); } PPTRACE_START_INTERCEPT_FUNCTIONS(eztrace_core) INTERCEPT3("pthread_create", libpthread_create) INTERCEPT3("pthread_join", libpthread_join) INTERCEPT3("pthread_exit", libpthread_exit) PPTRACE_END_INTERCEPT_FUNCTIONS(eztrace_core) static void init_pthread_core() { INSTRUMENT_FUNCTIONS(eztrace_core); if(pthread_create_id<0) pthread_create_id=ezt_otf2_register_function("pthread_create"); if(pthread_join_id<0) pthread_join_id=ezt_otf2_register_function("pthread_join"); if(pthread_exit_id<0) pthread_exit_id=ezt_otf2_register_function("pthread_exit"); if (eztrace_autostart_enabled()) eztrace_start(); _pthread_core_initialized = 1; } static void finalize_pthread_core() { if(_pthread_core_initialized) { _pthread_core_initialized = 0; eztrace_stop(); } } static void _pthread_core_init(void) __attribute__((constructor)); static void _pthread_core_init(void) { EZT_REGISTER_MODULE(eztrace_core, "EZTrace core", init_pthread_core, finalize_pthread_core); } static void _pthread_core_conclude(void) __attribute__((destructor)); static void _pthread_core_conclude(void) { if(_pthread_core_initialized) { _pthread_core_initialized = 0; eztrace_stop(); } } eztrace-2.1/src/eztrace.c.in000066400000000000000000000210541447213526500160210ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include #include extern char **environ; void print_version() { printf( "eztrace: version %s\n", EZTRACE_VERSION ); exit( EXIT_SUCCESS ); } void set_launcher_env() { setenv("TESTLAUNCHER", "1", 1); } void unset_launcher_env() { setenv("TESTLAUNCHER", "0", 1); } int file_exists(const char *pathname) { if (access(pathname, F_OK) != -1) { return 1; // file exists } return 0; } int str_ends_with(char *str, char *end) { size_t str_len = strlen(str); size_t end_len = strlen(end); char *str_end = str + str_len - end_len; return strcmp(str_end, end) == 0; } void usage(const char *prog_name) { printf("Usage: %s [OPTION] program [arg1 arg2 ...]\n", prog_name); printf("\t-t \"plugin1 plugin2 ... pluginN\" Select a list of plugins\n"); printf("\t-o Select the output directory\n"); printf("\t-l Select a plugin directory\n"); printf("\t-f Enable EZTRACE_FLUSH\n"); printf("\t-d Debug mode\n"); printf("\t-s Enable signal handling\n"); printf("\t-v Verbose mode\n"); printf("\t--version Display the version number\n"); printf("\t-? -h Display this help and exit\n"); } static char* get_env_str(const char* env_name, const char* suffix) { char* tmp = getenv(env_name); int string_length = 1; char* res = NULL; if ((tmp == NULL || tmp[0] == '\0') && suffix == NULL) return NULL; if (tmp && !suffix) return strdup(tmp); if (!tmp && suffix) return strdup(suffix); string_length += strlen(tmp) + strlen(suffix); res = calloc(string_length, sizeof(char)); sprintf(res, "%s%s", tmp, suffix); return res; } /* add to_add to an already allocated string */ static char* add_to_str(char* dest_str, const char* to_add) { int len = strlen(dest_str) + strlen(to_add) + 1; dest_str = realloc(dest_str, len); strcat(dest_str, to_add); return dest_str; } int main(int argc, char **argv) { int debug = 0; int i, j = 0; int test = 0; char* libdir=NULL; char *ezt_library_path = NULL; int nb_opts = 0; // options char *prog_name = NULL; // prog_name void *bin = NULL; int nb_modules = 0; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d")) { debug = 1; nb_opts++; } else if (!strcmp(argv[i], "-p")) { test = 1; nb_opts++; } else if (!strcmp(argv[i], "-t")) { setenv("EZTRACE_TRACE", argv[i + 1], 1); i++; nb_opts += 2; } else if (!strcmp(argv[i], "-o")) { setenv("EZTRACE_TRACE_DIR", argv[i + 1], 1); i++; nb_opts += 2; } else if (!strcmp(argv[i], "-l")) { setenv("EZTRACE_LIBRARY_PATH", argv[i + 1], 1); i++; nb_opts += 2; } else if (!strcmp(argv[i], "-f")) { setenv("EZTRACE_FLUSH", "1", 1); nb_opts++; } else if (!strcmp(argv[i], "-s")) { setenv("EZTRACE_SIGNAL_HANDLER", "1", 1); nb_opts++; } else if (!strcmp(argv[i], "--version")) { print_version(); exit(EXIT_SUCCESS); } else if (!strcmp(argv[i], "-?") || !strcmp(argv[i], "-h")) { usage(argv[0]); return EXIT_SUCCESS; } else if (argv[i][0] == '-' && argv[i][1] == 'v') { nb_opts++; int verbose_level=dbg_lvl_normal; for (j = 1; argv[i][j] == 'v'; j++) verbose_level++; set_pptrace_debug_level(verbose_level); char str[16]; snprintf(str, 16, "%d", verbose_level); setenv("EZTRACE_DEBUG", str, 1); } else { /* Unknown parameter name. It's probably the program name. We can stop * parsing the parameter list. */ break; } } // list of enabled module char *ezt_trace = get_env_str("EZTRACE_TRACE", ""); if(!test) { int len = strlen(EZTRACE_LIB_DIR); libdir=malloc(sizeof(char)*(len+2)); snprintf(libdir, len+2, ":%s", EZTRACE_LIB_DIR); } // user libs env variable ezt_library_path = get_env_str("EZTRACE_LIBRARY_PATH", libdir); prog_name = argv[nb_opts + 1]; if (prog_name == NULL) { usage(argv[0]); return EXIT_SUCCESS; } // init binary & catch all modules bin = pptrace_prepare_binary(prog_name); if (!bin) { fprintf(stderr, "Unable to load binary %s\n", prog_name); return EXIT_FAILURE; } // modules in ezt_trace if (ezt_trace != NULL) { char *module = strtok(ezt_trace, " "); while (module != NULL && ++nb_modules) module = strtok(NULL, " "); free(ezt_trace); if(nb_modules == 0) { unsetenv("EZTRACE_TRACE"); ezt_trace=NULL; } } char *modules[nb_modules]; if (nb_modules != 0) { // we have to get EZTRACE_TRACE again because we strtok-ed it ezt_trace = get_env_str("EZTRACE_TRACE", ""); char *module = strtok(ezt_trace, " "); i = 0; while (module != NULL) { modules[i++] = module; module = strtok(NULL, " "); } } // dirs in ezt_library_path int nb_dirs = 0; if (ezt_library_path != NULL) { char *dir = strtok(ezt_library_path, ":"); while (dir != NULL && ++nb_dirs) dir = strtok(NULL, ":"); free(ezt_library_path); } char *dirs[nb_dirs]; if (nb_dirs != 0) { // we have to get EZTRACE_LIBRARY_PATH again because we strtok-ed it ezt_library_path = get_env_str("EZTRACE_LIBRARY_PATH",libdir); char *dir = strtok(ezt_library_path, ":"); i = 0; while (dir != NULL) { dirs[i++] = dir; dir = strtok(NULL, ":"); } } // libeztrace-core and libeztrace-lib should always be preloaded! char *files = NULL; if (test) { /* If test is enable, it means that eztrace is invoked by "make * test", and we should use the libraries located in the build * directory instead of the one in the installed directory. */ fprintf(stderr, "Eztrace test Mode\n"); files = strdup("@CMAKE_BINARY_DIR@"); files = add_to_str(files, "/src/core/libeztrace-core.@DYNLIB_EXT@"); files = strdup("@CMAKE_BINARY_DIR@"); files = add_to_str(files, "/src/eztrace-lib/libeztrace-lib.@DYNLIB_EXT@"); } else { files = strdup(EZTRACE_LIB_DIR); files = add_to_str(files, "/libeztrace-core.@DYNLIB_EXT@"); files = strdup(EZTRACE_LIB_DIR); files = add_to_str(files, "/libeztrace-lib.@DYNLIB_EXT@"); } if (pptrace_add_preload(bin, files)) { fprintf(stderr, "Unable to add %s to @LD_PRELOAD_NAME@\n", files); return EXIT_FAILURE; } set_launcher_env(); if (ezt_trace != NULL) { for (i = 0; i < nb_modules; i++) { int module_found=0; for (j = 0; j < nb_dirs; j++) { char *pathname = strdup(dirs[j]); pathname = add_to_str(pathname, "/libeztrace-"); pathname = add_to_str(pathname, modules[i]); pathname = add_to_str(pathname, ".@DYNLIB_EXT@"); if (file_exists(pathname)) { module_found=1; if (pptrace_load_module(bin, pathname)) { fprintf(stderr, "Unable to add %s to @LD_PRELOAD_NAME@\n", pathname); return EXIT_FAILURE; } files = add_to_str(files, ":"); files = add_to_str(files, pathname); } free(pathname); } if(!module_found) { fprintf(stderr,"[EZTrace] cannot find module %s\n", modules[i]); } } free(ezt_trace); } else { for (i = 0; i < nb_dirs; i++) { char *pathname = dirs[i]; struct dirent *dirent; DIR *d = opendir(pathname); while ((dirent = readdir(d))) { if (!strncmp(dirent->d_name, "libeztrace-", 11) && str_ends_with(dirent->d_name, ".@DYNLIB_EXT@")) { char *file = strdup(pathname); file = add_to_str(file, "/"); file = add_to_str(file, dirent->d_name); if (pptrace_load_module(bin, file)) { fprintf(stderr, "Unable to add %s to @LD_PRELOAD_NAME@\n", file); return EXIT_FAILURE; } files = add_to_str(files, ":"); files = add_to_str(files, file); free(file); } } closedir(d); } } free(ezt_library_path); unset_launcher_env(); // run if (debug) { // TODO: make it configurable char *debugger[5]; debugger[0] = "gdb"; debugger[1] = "-quiet"; debugger[2] = "{name}"; debugger[3] = "{pid}"; debugger[4] = NULL; pptrace_add_debugger(bin, debugger); } if (pptrace_run(bin, argv + nb_opts + 1, environ)) { fprintf(stderr, "Unable to run the target\n"); return EXIT_FAILURE; } return EXIT_SUCCESS; } eztrace-2.1/src/eztrace.preload.in000077500000000000000000000074621447213526500172370ustar00rootroot00000000000000#!/bin/bash # Copyright CNRS, INRIA, Universit Bordeaux 1, Tlcom SudParis # See COPYING in top-level directory. debug=n mpi=n show_env=n remove_new_file=no verbose= usage() { cat << EOF usage: $0 options OPTIONS: -? Show this message -t "plugin1 plugin2 ... pluginN" Select a list of plugins -o Select the output directory -l Select a plugin directory -f Enable EZTRACE_FLUSH -d Run EZtrace with gdb -e Show environment -s Enable signal handling -v Verbose mode -V Display the version number -p PadicoTM mode -m MPI mode EOF } while getopts 't:o:l:fbdmepsvV' OPTION; do case $OPTION in d) debug=y ;; e) show_env=y ;; m) mpi=y ;; p) padico=y ;; t) modules=$OPTARG export EZTRACE_TRACE=$modules ;; o) output_path=$OPTARG export EZTRACE_TRACE_DIR=$output_path ;; l) eztrace_lib_path=$OPTARG export EZTRACE_LIBRARY_PATH=$eztrace_library_path ;; f) export EZTRACE_FLUSH=1 ;; s) export EZTRACE_SIGNAL_HANDLER=1 ;; v) export EZTRACE_DEBUG=5 ;; V) echo "eztrace.preload: version $@CMAKE_PROJECT_VERSION@" exit 0 ;; ?) usage exit 2 ;; esac done # remove the options from the command line shift $(($OPTIND - 1)) libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ bindir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@ # make sure eztrace libs are available export @LD_LIBRARY_PATH_NAME@=$@LD_LIBRARY_PATH_NAME@:$libdir prog_name=$1 shift new_prog_name=$prog_name # libeztrace should always be preloaded! files=${libdir}/libeztrace-core.@DYNLIB_EXT@:${libdir}/libeztrace-lib.@DYNLIB_EXT@ EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}:$libdir/ if [ "x$EZTRACE_TRACE" != x ]; then # only use the specified modules nb_modules=0 for module in $EZTRACE_TRACE do for dir in `echo $EZTRACE_LIBRARY_PATH |sed 's/:/ /g'` do if [ -f ${dir}/libeztrace-${module}.@DYNLIB_EXT@ ]; then files="$files:${dir}/libeztrace-${module}.@DYNLIB_EXT@" nb_modules=$(($nb_modules + 1)) fi done done if [ $nb_modules -lt 1 ]; then echo "No module were loaded. Please check your EZTRACE_TRACE variable or the -t option are used properly" >&2 exit 1 fi else # use all the available modules for dir in `echo $EZTRACE_LIBRARY_PATH |sed 's/:/ /g'` do for module in `ls $dir/libeztrace-*.@DYNLIB_EXT@ 2>/dev/null` do files="$files:$module" done done fi if [ x$debug = xy ]; then # generate a gdbinit file that will preload all the modules gdbinit_file=`mktemp` echo "set env @LD_PRELOAD_NAME@ $files" > $gdbinit_file echo "set env @LD_LIBRARY_PATH_NAME@ $@LD_LIBRARY_PATH_NAME@" >> $gdbinit_file echo "handle SIGUSR2 nostop noprint" >> $gdbinit_file echo "echo \n" >> $gdbinit_file echo "echo EZTrace: hook loaded\n" >> $gdbinit_file gdb -x $gdbinit_file --args $new_prog_name $* rm $gdbinit_file elif [ x$show_env = xy ]; then remove_new_file=no echo env @LD_PRELOAD_NAME@=$files @LD_LIBRARY_PATH_NAME@=$@LD_LIBRARY_PATH_NAME@ EZTRACE_TRACE="$EZTRACE_TRACE" $new_prog_name $* elif [ x$mpi = xy ]; then remove_new_file=no echo env @LD_PRELOAD_NAME@=$files @LD_LIBRARY_PATH_NAME@=$@LD_LIBRARY_PATH_NAME@ EZTRACE_TRACE="$EZTRACE_TRACE" $new_prog_name $* elif [ x$padico = xy ]; then remove_new_file=no echo $files $new_prog_name $* else OMP_TOOL_LIBRARIES="$files" @LD_PRELOAD_NAME@=$ld_preload EZTRACE_TRACE="$EZTRACE_TRACE" $new_prog_name $* fi if [ "x$remove_new_file" = "xyes" ]; then echo "removing $new_prog_name" rm $new_prog_name fi eztrace-2.1/src/eztrace_avail.c000066400000000000000000000027271447213526500165760ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include static int verbose_mode = 0; /* This program list the available modules */ static void usage(int argc __attribute__((unused)), char** argv) { fprintf(stderr, "Usage : %s [OPTION]\n", argv[0]); fprintf(stderr, "\t--version Display the version number\n"); fprintf(stderr, "\t-h Display this help and exit\n"); } void print_version() { printf( "eztrace_avail: version %s\n", EZTRACE_VERSION ); exit( EXIT_SUCCESS ); } static void parse_args(int argc, char** argv) { int i; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-h") == 0) { usage(argc, argv); exit(-1); } else if (strcmp(argv[i], "-v") == 0) { printf("Verbose mode turned on\n"); verbose_mode = 1; } else if (strcmp(argv[i], "--version") == 0) { print_version(); } } } int main(int argc, char** argv) { /* clear the EZTRACE_TRACE environment variable so that all the available modules are listed */ unsetenv("EZTRACE_TRACE"); setenv("EZTRACE_DONT_TRACE", "1", 1); /* parse the arguments passed to this program */ parse_args(argc, argv); eztrace_load_all_modules(verbose_mode); printf("Available modules:\n"); eztrace_print_module_list(); return 0; } eztrace-2.1/src/instrumentation/000077500000000000000000000000001447213526500170545ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/CMakeLists.txt000066400000000000000000000047431447213526500216240ustar00rootroot00000000000000set(EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary.h errors.c include/eztrace-instrumentation/errors.h include/eztrace-instrumentation/linux.h include/eztrace-instrumentation/pptrace.h pptrace.c proc_maps.c proc_maps.h include/eztrace-instrumentation/tracing.h tracing.c ) SET(COMPILE_FLAGS "") if(ENABLE_BIN_INSTRUMENTATION) list(APPEND EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary_instrumentation/bfd.c binary_instrumentation/binary.c binary_instrumentation/hijack.c binary_instrumentation/hijack.h binary_instrumentation/isize.h binary_instrumentation/memory.c binary_instrumentation/memory.h binary_instrumentation/opcodes.h ) if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") list(APPEND EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary_instrumentation/arch/x86_64/hijack.c binary_instrumentation/arch/x86_64/intel.c) if(LIBOPCODES_FOUND) list(APPEND EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary_instrumentation/arch/x86_64/opcode.c) else() list(APPEND EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary_instrumentation/arch/x86_64/trace.c) endif() string(APPEND COMPILE_FLAGS -DHAVE_CHECK_INSTRUCTIONS) endif() if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm") list(APPEND EZTRACE_BINARY_INSTRUMENTATION_SOURCES binary_instrumentation/arch/armv7/arm.c binary_instrumentation/arch/armv7/opcode.c binary_instrumentation/arch/armv7/trace.c) endif() set(EZTRACE_BINARY_INSTRUMENTATION_DEPS PRIVATE bfd opcodes ) endif() add_library(eztrace-instrumentation SHARED ${EZTRACE_BINARY_INSTRUMENTATION_SOURCES}) target_include_directories(eztrace-instrumentation PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/binary_instrumentation ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_options(eztrace-instrumentation PUBLIC ${EZTRACE_BINARY_INSTRUMENTATION_FLAG} PRIVATE # -Werror # TODO ${COMPILE_FLAGS} ) target_link_libraries(eztrace-instrumentation ${EZTRACE_BINARY_INSTRUMENTATION_DEPS} PUBLIC eztrace-core ) if (ENABLE_BIN_INSTRUMENTATION) target_link_libraries(eztrace-instrumentation PRIVATE ) endif() install(TARGETS eztrace-instrumentation EXPORT EZTraceInstrumentationTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/eztrace-instrumentation DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) eztrace-2.1/src/instrumentation/binary.h000066400000000000000000000066051447213526500205200ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * binary.h -- Interface for reading symbol from binaries * * Provided methods: * - open_binary(path): open the binary for reading and return an opaque * structure * - close_binary(bin): close the opaque structure opened by open_binary * - get_symbol(bin, symbol): get the symbol in which name is provided by * the symbol parameter from the binary bin (opaque structure). * The returned structure contains the section of the symbol (name * and address), the offset of the symbol inside the section, * the symbol name and, if available, the symbol size. * - free_symbol(symbol): free a structure returned by a previous call of get_symbol() * - get_binary_bits(bin): return the size of a word inside the binary (e.g. is the code * of the binary for a 32 bits arch or a 64 bits * - read_symbol(bin, symbol, buffer, size): read the symbol content from the binary bin. * If the symbol is found and present in the library, then its content is * copied in buffer copying at most size bytes. The number of copied bytes * are returned in result. * - read_zstring(bin, symbol, addr, buffer, size): read size bytes given an address read from * the symbol given in argument. If the address is found, at most size bytes * are copied into buffer. * - read_zstring_array(bin, symbol): read a null terminated string array from a binary and * allocate the string array. The string array should be freed upon with * free_zstring_array(). * - free_zstring_array(arr): delete a null terminated string array allocated by read_zstring_array(). * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_BINARY_H_ #define PPTRACE_BINARY_H_ #include #include #include #include typedef word_uint zzt_word; typedef struct _zzt_symbol { zzt_word symbol_offset; char* symbol_name; zzt_word symbol_size; char* section_name; zzt_word section_addr; uint32_t flags; /* the address can be used as is */ #define ZZT_FLAG_STATIC 1 /* the address is only an offset from the binary base address */ #define ZZT_FLAG_DYNAMIC 1 << 1 } zzt_symbol; #define INIT_ZZT_SYMBOL(n, addr, size) \ zzt_symbol n; \ n.symbol_name = #n; \ n.symbol_size = (zzt_word)(size); \ n.section_name = NULL; \ n.section_addr = (zzt_word)0; \ n.symbol_offset = (zzt_word)(addr); void close_binary(void* bin); void* open_binary(const char* path); zzt_symbol* get_symbol(void* bin, char* symbol); void free_symbol(zzt_symbol* symbol); zzt_symbol* copy_symbol(zzt_symbol* symbol); int get_binary_bits(void* bin); size_t read_symbol(void* bin, zzt_symbol* symbol, void* buffer, ssize_t size); size_t read_zstring(void* bin, zzt_symbol* symbol, zzt_word addr, void* buffer, ssize_t size); #ifdef ENABLE_BINARY_INSTRUMENTATION char** read_zstring_array(void* bin, char* symbol); void free_zstring_array(char** strarray); struct ezt_instrumented_function *read_function_array(void* bin, zzt_symbol*sym); #endif #endif /* PPTRACE_BINARY_H_ */ eztrace-2.1/src/instrumentation/binary_instrumentation/000077500000000000000000000000001447213526500236635ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/binary_instrumentation/arch/000077500000000000000000000000001447213526500246005ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/binary_instrumentation/arch/armv7/000077500000000000000000000000001447213526500256345ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/binary_instrumentation/arch/armv7/arm.c000066400000000000000000000062231447213526500265620ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * arm.c * * Generate opcodes for ARM cortex-A9 processors * * Author: Damien Martin-Guillerez */ #ifndef HAVE_ARM #error "This file is for x86_64 only" #endif #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include #include ssize_t insert_opcodes(uint8_t* opcode, int opcode_size, uint8_t* buf, size_t size, size_t offset) { int i = 0; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(opcodes)\tinserting opcodes: "); while (offset < size && i < opcode_size) { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "%02X ", opcode[i]); buf[offset] = opcode[i]; offset++; i++; } pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\n"); return offset; } ssize_t read_jump(uint8_t* buf, size_t size, size_t offset, uint8_t prefix) { // Since the size of instructions on ARMv7 is static (=32b), the size of the jump instruction // can be simply computed as return ARM_INSTR_SIZE / 8; } static inline int get_unsigned_nb_bits(word_uint value) { int index = 0; while (value) { value >>= 1; index++; } return index; } int get_signed_nb_bits(word_int value) { if (value < 0) { value = -value; } else { value++; } return get_unsigned_nb_bits(value) + 1; } ssize_t generate_nops(uint8_t* buffer, size_t size) { int i; uint8_t buf[1024]; for (i = 0; i < 1024; i += 2) { buf[i] = 0xbf; buf[i + 1] = 0x00; } return insert_opcodes(buf, 12, buffer, size, 0); } ssize_t generate_trampoline(uint8_t* buffer, size_t size, word_uint orig_addr, word_uint reloc_addr) { uint8_t buf[12]; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(opcodes)\tgenerating trampoline from 0x%lx to 0x%lx\n", (unsigned long)orig_addr, (unsigned long)reloc_addr); if (size < 12) return -1; uint32_t addr = reloc_addr; #define GET_IM8(addr_16) ((addr_16) & 0x000000ff) #define GET_IM3(addr_16) (((addr_16)>>8) & 0x00000007) #define GET_I(addr_16) (((addr_16) >>11) & 0x00000001) #define GET_IM4(addr_16) (((addr_16) >>12) & 0x0000000f) /* working with register R8 */ uint8_t register_id = 8; /* switch to Thumb mode */ addr = addr | 0x01; // im4:i:im3:im8 uint16_t addr16 = addr & 0x0000FFFF; // movw rX, addr[0:15] uint32_t _im8 = GET_IM8(addr16); uint32_t _im3 = GET_IM3(addr16); uint32_t _i = GET_I(addr16); uint32_t _im4 = GET_IM4(addr16); buf[3] = (_im3 << 4) | register_id; buf[2] = _im8; buf[1] = (_i << 2) | (uint8_t)0xf2; buf[0] = _im4 | (uint8_t)0x40; // movt rX, addr[16:31] addr16 = addr >> 16; _im8 = GET_IM8(addr16); _im3 = GET_IM3(addr16); _i = GET_I(addr16); _im4 = GET_IM4(addr16); buf[7] = (_im3 << 4) | register_id; buf[6] = _im8; buf[5] = (_i << 2) | (uint8_t)0xf2; buf[4] = _im4 | (uint8_t)0xC0; // bx rX buf[8] = register_id << 3; buf[9] = 0x47; // nop buf[10] = 0x00; buf[11] = 0xbf; return insert_opcodes(buf, 12, buffer, size, 0); } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/armv7/opcode.c000066400000000000000000000037571447213526500272650ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * opcode.c * * Determining the size to override (by computing the size of instructions) using the opcode library */ #ifndef HAVE_ARM #error "This file is for x86_64 only" #endif #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "opcodes.h" #include "tracing.h" #include #include #include #include int dummy_print(void* stream MAYBE_UNUSED, const char* fmt MAYBE_UNUSED, ...) { return 0; } /* * This function determines the size of instructions that will be replaced. * Output is the size of the replacement */ ssize_t opcode_get_overridden_size(bfd* abfd, pid_t child, word_uint symbol, size_t trampoline_size) { size_t max_size = trampoline_size * 2; if (max_size < 10) max_size = 10; unsigned char* code = (unsigned char*)malloc(max_size); trace_read(child, symbol, code, max_size); struct disassemble_info i; #if HAVE_BINUTILS_2_38_50_OR_HIGHER init_disassemble_info(&i, NULL, dummy_print, NULL); #else init_disassemble_info(&i, NULL, dummy_print); #endif i.arch = bfd_get_arch(abfd); i.mach = bfd_get_mach(abfd); #if HAVE_BINUTILS_2_28_OR_OLDER disassembler_ftype disassemble = disassembler(abfd); #else disassembler_ftype disassemble = disassembler(i.arch, bfd_big_endian(abfd), i.mach, abfd); #endif i.buffer = code; i.buffer_vma = (unsigned long)i.buffer; i.buffer_length = max_size; i.disassembler_options = "force-thumb"; size_t j; for (j = 0; j < trampoline_size;) { j += disassemble(i.buffer_vma + j, &i); } free(code); return j; } ssize_t get_overridden_size(void* bin, pid_t child, word_uint symbol, size_t trampoline_size) { return opcode_get_overridden_size((bfd*)bin, child, symbol, trampoline_size); } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/armv7/trace.c000066400000000000000000000024051447213526500270770ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * trace.c * * Determining the size to override (by computing the size of instructions) using single step tracing */ #ifndef HAVE_ARM #error "This file is for x86_64 only" #endif #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "errors.h" #include "opcodes.h" #include "tracing.h" #include #include #define ARM_INSTR_SIZE_BYTE (ARM_INSTR_SIZE / 8) /* * This function determines the size of instructions that will be replaced. * Output is the size of the replacement */ ssize_t get_overridden_size(void* bin, pid_t child, word_uint symbol, size_t trampoline_size) { /* On ARM mode, the size of instructions is static (32 bits). Thus, the size of instructions to replace * can be computed as follows. * Please note that this is only possible for ARM mode, *the result for Thumb mode is incorrect* ! */ return (size_t)( ((trampoline_size + symbol) / ARM_INSTR_SIZE_BYTE + ((trampoline_size + symbol) % ARM_INSTR_SIZE_BYTE == 0 ? 0 : 1)) * ARM_INSTR_SIZE_BYTE - symbol); } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/x86_64/000077500000000000000000000000001447213526500255365ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/binary_instrumentation/arch/x86_64/hijack.c000066400000000000000000000111551447213526500271360ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * hijack.c * * Check the instructions that we are going to overwrite with a trampoline * */ #ifndef __x86_64__ #error "This file is for x86_64 only" #endif #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include #include "opcodes.h" #include "eztrace-instrumentation/tracing.h" #include "eztrace-instrumentation/errors.h" #include #include int dummy_print(void* stream __attribute__((unused)), const char* fmt __attribute__((unused)), ...) { return 0; } /* Check the instructions that we are going to overwrite with a trampoline * Return 1 if the trampoline can be inserted without any issue. * return 0 if the trampoline may break the program */ int check_instructions(void* bin, pid_t child, word_uint sym_addr, word_uint reloc_addr, size_t length) { /* copy the child memory locally so that we can modify it */ uint8_t buffer[1024]; trace_read(child, sym_addr, buffer, length); bfd* abfd = (bfd*)bin; /* set to 1 if it is possible to modify the child program */ int can_change = 1; asection* section; section = bfd_get_section_by_name(abfd, ".text"); if (section == NULL) { return 0; } pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Check instruction %d bytes starting at %p. relocating to %p\n", length, sym_addr, reloc_addr); /* reloc_addr and sym_addr are separated by more than 2GB * -> we can't use 'small jumps' */ if (reloc_addr - sym_addr > 1 << 30) { can_change = 0; } struct disassemble_info i; #if HAVE_BINUTILS_2_38_50_OR_HIGHER init_disassemble_info(&i, NULL, dummy_print, NULL); #else init_disassemble_info(&i, NULL, dummy_print); #endif i.arch = bfd_get_arch(abfd); i.mach = bfd_get_mach(abfd); #if HAVE_BINUTILS_2_28_OR_OLDER disassembler_ftype disassemble = disassembler(abfd); #else disassembler_ftype disassemble = disassembler(i.arch, bfd_big_endian(abfd), i.mach, abfd); #endif if (disassemble == NULL) { return 0; } i.buffer_vma = section->vma; i.buffer_length = section->size; i.section = section; bfd_malloc_and_get_section(abfd, section, &i.buffer); disassemble_init_for_target(&i); unsigned long count, pc; pc = sym_addr; count = 0; unsigned start_addr = 0; int need_to_push_changes = 0; /* browse the instructions and search for problematic opcodes. We may have a * problem in the following situations: * - one of the instructions is a jump * - one of the instruction uses RIP-relative addressing * -> in this case we can try to change the offset */ do { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "0x%x ", pc); count = disassemble(pc, &i); pc += count; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\n\t"); /* TODO: check for other problematic instructions (ie. jump) */ if (buffer[start_addr] == 0x8b && buffer[start_addr + 1] == 0x5) { /* the instruction is a 'mov offset(%rip), %register' * we need to change the value of offset */ if (can_change) { /* it is possible to change the offset */ //uint32_t *p_addr = (uint32_t*)&buffer[start_addr+2]; uint32_t addr = buffer[start_addr + 2] | buffer[start_addr + 3] << 8 | buffer[start_addr + 4] << 16; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\t\told offset: %lx\n", addr); addr = addr - (reloc_addr - sym_addr); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\t\tnew offset: %lx\n", addr); buffer[start_addr + 2] = addr & 0xff; buffer[start_addr + 3] = (addr & 0xff00) >> 8; buffer[start_addr + 4] = (addr & 0xff0000) >> 16; addr = buffer[start_addr + 2] | buffer[start_addr + 3] << 8 | buffer[start_addr + 4] << 16; need_to_push_changes = 1; } else { /* it's not possible to change the offset. We should not instrument this * function ! */ return 0; } } start_addr += count; } while (count > 0 && pc < bfd_get_start_address(abfd) + section->size && pc <= sym_addr + length); if (need_to_push_changes && can_change) { /* some instructions were modified. We need to push the modifications */ pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\tWriting the modified instructions.\n"); trace_write(child, sym_addr, buffer, length); } return 1; } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/x86_64/intel.c000066400000000000000000000123601447213526500270170ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * intel.c * * Production of opcodes for 64-bit intel processors (aka. amd64 architecture). * This file should also be used for 32-bit targets (the program should adapt itself to the target). * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef __x86_64__ #error "This file is for x86_64 only" #endif #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "eztrace-instrumentation/errors.h" #include "eztrace-core/types.h" #include #include #include ssize_t insert_opcodes(uint8_t* opcode, int opcode_size, uint8_t* buf, size_t size, size_t offset) { int i = 0; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(opcodes)\tinserting opcodes: "); while (offset < size && i < opcode_size) { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "%02X ", opcode[i]); buf[offset] = opcode[i]; offset++; i++; } pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\n"); return offset; } ssize_t read_jump(uint8_t* buf, size_t size, size_t offset, uint8_t prefix) { ssize_t offlen = (prefix == 0x66) ? 2 : 4; // if prefix is an instruction size override then it's 16-bits offset switch (buf[offset]) { case 0xEB: // JMP cb case 0xE3: // JrCXZ cb case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: // Jcc cb case 0x78: case 0x79: case 0x7A: case 0x7B: case 0x7C: case 0x7D: case 0x7E: case 0x7F: return 2; case 0x0f: // Possible Jcc cw/cd (0x0f 0x8x cd) if (size < offset + 2) return -2; // We need more byte to answer return ((buf[offset + 1] & 0xf0) == 0x80) ? 2 + offlen : 0; case 0xE9: // JMP cw/cd case 0xE8: // CALL cw/cd case 0x9A: // CALL FAR cw/cd return 1 + offlen; case 0xFF: // JMP /4, JMP FAR /5, CALL /2, CALL FAR /3 // Parse the ModRM byte if (size < offset + 2) return -2; // We need more byte to answer uint8_t modRM = buf[offset + 1]; uint8_t mod = (modRM >> 6) & 0x3; uint8_t reg = (modRM >> 3) & 0x7; uint8_t rm = (modRM)&0x7; if (reg < 2 || reg > 5) return -1; // Neither CALL nor JMP switch (mod) { case 0: // Registers ( + SIB byte if rm = 4) return (rm == 4) ? 4 : 3; case 3: // Extended registers return 3; case 1: // offset16 ( + SIB byte if rm = 4) return (rm == 4) ? 5 : 4; case 2: // offset32 ( + SIB byte if rm = 4) return (rm == 4) ? 7 : 6; } return -1; // ??? case 0xC3: // RET case 0xCB: // RET FAR return 1; case 0xC2: // RET cw case 0xCA: // RET FAR cw return 3; // Prefixes case 0x66: // Operand-Size Override case 0x67: // Address-Size Override case 0x2E: case 0x3E: case 0x26: case 0x64: case 0x65: case 0x36: // Segment Override case 0xF0: // Lock case 0xF3: case 0xF2: // Repeat return 0; // Retry with next byte default: return -1; // It's not a jump, nor a prefix } } static inline int get_unsigned_nb_bits(word_uint value) { int index = 0; while (value) { value >>= 1; index++; } return index; } int get_signed_nb_bits(word_int value) { if (value < 0) { value = -value; } else { value++; } return get_unsigned_nb_bits(value) + 1; } ssize_t generate_trampoline(uint8_t* buffer, size_t size, word_uint orig_addr, word_uint reloc_addr) { uint8_t buf[12]; word_int offset = reloc_addr - orig_addr; pptrace_debug( PPTRACE_DEBUG_LEVEL_ALL, "(opcodes)\tgenerating trampoline from 0x%lx to 0x%lx (delta is %ld)\n", (unsigned long)orig_addr, (unsigned long)reloc_addr, (unsigned long)offset); if (get_signed_nb_bits(offset - 2) <= 8) { if (size < 2) return -1; // 8-bit offset (jmp rel8off EB) buf[0] = 0xeb; buf[1] = offset - 2; return insert_opcodes(buf, 2, buffer, size, 0); } else if (get_signed_nb_bits(offset - 5) <= 32) { if (size < sizeof(uint32_t) + 1) return -1; // 32-bit offset (jmp rel32off E9) buf[0] = 0xe9; uint32_t off = offset - 5; memcpy((void*)(buf + 1), (void*)(&off), sizeof(uint32_t)); return insert_opcodes(buf, sizeof(uint32_t) + 1, buffer, size, 0); } else if (get_unsigned_nb_bits(reloc_addr) <= 32) { // 32-bits jump // mov eax, addr (B8 + rd); jump eax (FF E0) if (size < 7) return -1; buf[0] = 0xb8; // mov eax, addr uint32_t addr = reloc_addr; memcpy((void*)(buf + 1), (void*)(&addr), sizeof(uint32_t)); buf[5] = 0xff; // jmp eax buf[6] = 0xe0; return insert_opcodes(buf, 7, buffer, size, 0); } else { // 64-bits jump if (size < 12) return -1; // Absolute jump (mov rax, addr (REX.W + B8+ rd) ; jmp rax) buf[0] = 0x48; // mov rax, addr buf[1] = 0xb8; memcpy((void*)(buf + 2), (void*)(&reloc_addr), sizeof(word_uint)); buf[10] = 0xff; // jmp rax buf[11] = 0xe0; return insert_opcodes(buf, 12, buffer, size, 0); } } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/x86_64/opcode.c000066400000000000000000000040741447213526500271600ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * opcode.c * * Determining the size to override (by computing the size of instructions) using the opcode library * * Created on: 2 August 2011 * Author: dmartin */ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif /* ENABLE_BINARY_INSTRUMENTATION */ #ifndef __x86_64__ #error "This file is for x86_64 only" #endif #include "opcodes.h" #include #include #include int dummy_print(void* stream __attribute__((unused)), const char* fmt __attribute__((unused)), ...); void trace_read(pid_t child, word_uint fromaddr, uint8_t* buffer, size_t length); /* * This function determines the size of instructions that will be replaced. * Output is the size of the replacement */ ssize_t opcode_get_overridden_size(bfd* abfd, pid_t child, word_uint symbol, size_t trampoline_size) { size_t max_size = trampoline_size * 2; bfd_byte* code; struct disassemble_info i; if (max_size < 10) max_size = 10; code = (bfd_byte*)malloc(max_size); trace_read(child, symbol, code, max_size); #if HAVE_BINUTILS_2_38_50_OR_HIGHER init_disassemble_info(&i, NULL, dummy_print, NULL); #else init_disassemble_info(&i, NULL, dummy_print); #endif i.arch = bfd_get_arch(abfd); i.mach = bfd_get_mach(abfd); #if HAVE_BINUTILS_2_28_OR_OLDER disassembler_ftype disassemble = disassembler(abfd); #else disassembler_ftype disassemble = disassembler(i.arch, bfd_big_endian(abfd), i.mach, abfd); #endif i.buffer = code; i.buffer_vma = (unsigned long)i.buffer; i.buffer_length = max_size; size_t j; for (j = 0; j < trampoline_size;) { j += disassemble(i.buffer_vma + j, &i); } free(code); return j; } ssize_t get_overridden_size(void* bin, pid_t child, word_uint symbol, size_t trampoline_size) { return opcode_get_overridden_size((bfd*)bin, child, symbol, trampoline_size); } eztrace-2.1/src/instrumentation/binary_instrumentation/arch/x86_64/trace.c000066400000000000000000000060151447213526500270020ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * trace.c * * Determining the size to override (by computing the size of instructions) using single step tracing * * Created on: 2 July 2011 * Author: Damien Martin-Guillerez */ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #ifndef __x86_64__ #error "This file is for x86_64 only" #endif #include "eztrace-instrumentation/errors.h" #include "eztrace-instrumentation/tracing.h" #include "opcodes.h" #include #include #include /* * This function returns the jump size */ ssize_t trace_get_jump_size(pid_t child, word_uint instruction_addr) { uint8_t buf[10]; size_t offset = 0; uint8_t prefix = 0; trace_read(child, instruction_addr, buf, 10); ssize_t r = read_jump(buf, 10, offset, prefix); while (!r && offset < 9) { prefix = buf[offset]; offset++; r = read_jump(buf, 10, offset, prefix); } if (r > 0) { return r + offset; // it's a jump of r + offset bytes } return 0; } /* * This function determines the size of instructions that will be replaced. * To do so, place rip on the symbol and single step until the size of instruction exceed trampoline_size * Output is the size of the replacement */ ssize_t get_overridden_size(void* bin __attribute__((unused)), pid_t child, word_uint symbol, size_t trampoline_size) { REG_STRUCT regs; trace_get_regs(child, ®s); // Backup registers set_ip(child, symbol); // Jump to symbol word_uint crip = symbol; int n_signal = 0; while (crip < symbol + trampoline_size) { int status = trace_singlestep(child); // single stepping until we go further than symbol + trampoline_size if (WIFSTOPPED(status)) { if (n_signal++ > 100) { printf("Child %d received %d signals (the last one was: %s). Aborting\n", child, n_signal, strsignal(WSTOPSIG(status))); abort(); return 0; } } else { n_signal = 0; } word_uint newrip = get_ip(child); // Unfortunately, this works only if no jump / call if (newrip < crip || newrip > crip + 2) { // There might be a jump // Tells whether it is a jump or not ssize_t off = trace_get_jump_size(child, crip); if (off) { newrip = crip + off; set_ip(child, newrip); } else if (newrip < crip) { trace_set_regs(child, ®s); // Restore registers return 0; // We have failed! } } else if (newrip == crip) { if (WIFSTOPPED(status)) { newrip = crip; // Stopped, continue } else { pptrace_fubar("got signal %d (term) %d (status)", WTERMSIG(status), WSTOPSIG(status)); } } crip = newrip; } trace_set_regs(child, ®s); // Restore registers return (size_t)(crip - symbol); } eztrace-2.1/src/instrumentation/binary_instrumentation/bfd.c000066400000000000000000000156531447213526500245740ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * bfd.c * * Parsing of binaries using the BFD library. See binary.h for the interfaces * This file needs the -lbfd flag when linking * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #include "binary.h" #include #include #include #include #include #include #include #include #include #include #include // Internals int _initialized = 0; void _zzt_bin_init() { if (_initialized == 0) { bfd_init(); } } zzt_word zzt_asymbol_size(asymbol* sym) { if (bfd_asymbol_flavour(sym) == bfd_target_elf_flavour) { // ELF case hack by reverse engineering libbfd... bfd_vma* ielf = (bfd_vma*)(sym + 1); // The elf_internal_sym structure can be found right after the bfd struct return *(ielf + 1); // and second word in that struct is the size of the symbol } else { // We don't know return 0; } } /* read the symtable * fills syms and return the number of symbols */ static int _get_symbol_table(bfd* abfd, asymbol*** symbol_table) { asymbol** syms = 0; unsigned int size; int dyn = 0; int i; char* p = NULL; /* search for symbols a static binary */ long symcount = bfd_read_minisymbols(abfd, dyn, (void**)&syms, &size); if (symcount == 0) { /* no symbol found. abfd is probably a dynamic library */ dyn = 1; symcount = bfd_read_minisymbols(abfd, dyn, (void**)&syms, &size); } if (symcount < 0) { return symcount; } *symbol_table = (asymbol**)malloc(sizeof(asymbol*) * symcount); assert(*symbol_table); p = (char*)syms; for (i = 0; i < symcount; i++) { (*symbol_table)[i] = bfd_minisymbol_to_symbol(abfd, dyn, p, NULL); p += size; } return symcount; } void* apply_on_symbol(void* bin, char* symbol, void* (*apply)(bfd* abfd, asymbol* sym, va_list ap), ...) { va_list ap; bfd* abfd = (bfd*)bin; asymbol** symbol_table; long number_of_symbols; long i; va_start(ap, apply); number_of_symbols = _get_symbol_table(abfd, &symbol_table); if (number_of_symbols < 0) return NULL; for (i = 0; i < number_of_symbols; i++) { if (strcmp(symbol_table[i]->name, symbol) == 0 || strcmp(ezt_demangle(symbol_table[i]->name), symbol) == 0) { void* result = apply(abfd, symbol_table[i], ap); va_end(ap); free(symbol_table); return result; } } va_end(ap); free(symbol_table); return NULL; } const char* pptrace_bin_error() { if (bfd_get_error() == bfd_error_no_error) return NULL; return bfd_errmsg(bfd_get_error()); } // free_symbol void free_symbol(zzt_symbol* symbol) { if (symbol == NULL) return; free(symbol->symbol_name); free(symbol->section_name); free(symbol); } static char* _copy_string(const char* str) { int len = strlen(str) + 1; char* ret = malloc(sizeof(char)*len); memcpy(ret, str, sizeof(char)*len); return ret; } zzt_symbol* copy_symbol(zzt_symbol* symbol) { zzt_symbol* ret = malloc(sizeof(zzt_symbol)); ret->symbol_offset = symbol->symbol_offset; ret->symbol_name = _copy_string(symbol->symbol_name); ret->symbol_size = symbol->symbol_size; ret->section_name = _copy_string(symbol->section_name); ret->section_addr = symbol->section_addr; ret->flags = symbol->flags; return ret; } // open_binary void* open_binary(const char* path) { bfd* bfd; _zzt_bin_init(); bfd = bfd_openr(path, NULL); if (!bfd) { return NULL; } if (!bfd_check_format(bfd, bfd_object)) { bfd_close(bfd); return NULL; } return bfd; } // close_binary void close_binary(void* bin) { bfd_close((bfd*)bin); } int get_binary_bits(void* bin) { return bfd_arch_bits_per_address((bfd*)bin); } // get_symbol void* symbol_from_bfd_sym(bfd* abfd __attribute__((unused)), asymbol* sym, va_list ap __attribute__((unused))) { zzt_symbol* result; result = (zzt_symbol*)malloc(sizeof(zzt_symbol)); result->symbol_name = strdup(sym->name); result->symbol_offset = sym->value; if (sym->section == NULL) { result->section_name = ""; result->section_addr = 0; } else { result->section_name = strdup(sym->name); result->section_addr = sym->section->vma; } if (abfd->flags & DYNAMIC) { /* The binary is relocatable (ie. compiled with -fPIE). The address * is thus an offset from the base address of the binary */ result->flags = ZZT_FLAG_DYNAMIC; } else { /* the address is the exact place where the symbol will be (ie. not * compiled with -fPIE) */ result->flags = ZZT_FLAG_STATIC; } result->symbol_size = zzt_asymbol_size(sym); #ifdef __arm__ /* On ARM processors, a symbol defined in a shared-library (ie. marked as 'U' in the symbol table) * may have a base address. The instructions located at this base address seem to be replaced by * the 'real' instruction when the library is loaded. * * In order to simplify pptrace behavior, let's return NULL for these symbols. */ if (result) { symbol_info syminfo; bfd_get_symbol_info(abfd, sym, &syminfo); if (syminfo.type == 'U') { result = NULL; } } #endif return (void*)result; } zzt_symbol* get_symbol(void* bin, char* symbol) { return (zzt_symbol*)apply_on_symbol(bin, symbol, symbol_from_bfd_sym); } // read_symbol void* read_symbol_from_bfd_sym(bfd* abfd, asymbol* sym, va_list ap) { void* buffer = va_arg(ap, void*); ssize_t size = va_arg(ap, ssize_t); size_t result = zzt_asymbol_size(sym); if (result == 0 || result > size) result = size; if (sym->section != NULL) { if (bfd_get_section_contents(abfd, sym->section, buffer, sym->value, result)) { return (void*) result; } } return (void*)0; } size_t read_symbol(void* bin, zzt_symbol* symbol, void* buffer, ssize_t size) { return (size_t)apply_on_symbol(bin, symbol->symbol_name, read_symbol_from_bfd_sym, buffer, size); } // read_zstring struct _get_section_struct { asection* result; zzt_word addr; }; size_t read_zstring(void* bin, zzt_symbol* symbol __attribute__((unused)), zzt_word addr, void* buffer, ssize_t size) { asection* sect; uint8_t buf; bfd* abfd = (bfd*)bin; for (sect = abfd->sections; sect != NULL; sect = sect->next) { if (sect->vma <= addr && addr < sect->vma + sect->size) { addr -= sect->vma; if (size > sect->size - addr) { size = sect->size - addr; } size_t result; for (result = 0; result < size - 1 && bfd_get_section_contents(abfd, sect, &buf, addr + result, 1) && buf != 0; result++) { ((uint8_t*)buffer)[result] = buf; } ((uint8_t*)buffer)[result] = 0; result++; return result; } } return 0; } eztrace-2.1/src/instrumentation/binary_instrumentation/binary.c000066400000000000000000000037711447213526500253230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * binary.c * * Wrapper to include the good library for parsing of binary files * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "binary.h" #include "eztrace-instrumentation/errors.h" #include #include #include #include struct ezt_instrumented_function *read_function_array(void* bin, zzt_symbol*sym) { /* get the size of the array */ size_t size = sym->symbol_size; if (size <= 0) size = 1024; /* allocate an array and copy the symbol to it */ struct ezt_instrumented_function * buf = malloc(size); if(buf == NULL) return NULL; read_symbol(bin, sym, buf, size); return buf; } char** read_zstring_array(void* bin, char* symbol) { char** result; char* buf; char buf2[4096]; zzt_symbol* sym = get_symbol(bin, symbol); int bytes = get_binary_bits(bin) >> 3; if (sym == NULL) return NULL; size_t size = sym->symbol_size; if (size <= 0) size = 1024; buf = malloc(size); if (buf == NULL) return NULL; uint32_t* val32 = (uint32_t*)buf; word_uint* val64 = (word_uint*)buf; size = read_symbol(bin, sym, buf, size) / bytes; result = (char**)malloc(size * sizeof(char*)); size_t i = 0; for (i = 0; i < size; i++) { zzt_word w = (bytes == 4) ? val32[i] : val64[i]; if (w == 0) { result[i] = 0; free(buf); return result; } read_zstring(bin, sym, w, buf2, 1024); // printf("\t[%d] %p %s\n", i, (void*)w, buf2); result[i] = strdup(buf2); } free(buf); return result; } void free_zstring_array(char** strarray) { int i = 0; while (strarray[i] != NULL) { free(strarray[i]); i++; } free(strarray); } eztrace-2.1/src/instrumentation/binary_instrumentation/hijack.c000066400000000000000000000314621447213526500252660ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "binary.h" #include "eztrace-instrumentation/errors.h" #include "eztrace-instrumentation/tracing.h" #include "isize.h" #include "memory.h" #include "opcodes.h" #include #include #ifndef __x86_64__ #error unsupported CPU architecture #endif int check_instructions(void* bin, pid_t child, word_uint sym_addr, word_uint reloc_addr, size_t length); #ifndef HAVE_CHECK_INSTRUCTIONS /* check_instructions is not defined. * define it as a dummy function that always allow the insertion of a trampoline */ int check_instructions(void* bin, pid_t child, word_uint sym_addr, word_uint reloc_addr, size_t length) { return 1; } #endif #define HIJACK_CODE_FAILED(test) \ if (test) { \ goto out_failed; \ } static ssize_t _install_jump(pid_t child, ssize_t max_size, word_uint src_addr, word_uint dest_addr) { // create the trampoline back to the original address uint8_t* jump = (uint8_t*)malloc(max_size); ssize_t jump_size = generate_trampoline(jump, max_size, src_addr, dest_addr); HIJACK_CODE_FAILED(jump_size < 0); // install the jump pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(hijack)\tinserting a jump from (0x%lx) to (0x%lx)\n", (unsigned long)(src_addr), (unsigned long)(dest_addr)); trace_write(child, src_addr, jump, jump_size); out: assert(jump_size <= max_size); free(jump); return jump_size; out_failed: jump_size = -1; goto out; } /* copies the overwritten opcodes, creates the back jump from * reloc_addr+overwrite_size to sym_addr+overwrite_size and installs it * return the size of the created back jump (or -1 in case of an error) */ static ssize_t _install_back_jump(pid_t child, word_uint reloc_addr, word_uint sym_addr, ssize_t overwrite_size) { // copy the overwritten code to reloc_addr pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(hijack)\tcopying overwritten code (%d bytes) from original code (0x%lx) to relocated position (0x%lx)\n", overwrite_size, (unsigned long)sym_addr, (unsigned long)(reloc_addr)); trace_copy(child, sym_addr, reloc_addr, overwrite_size); ssize_t back_jump_size = _install_jump(child, MAX_TRAMPOLINE_SIZE, reloc_addr + overwrite_size, sym_addr + overwrite_size); HIJACK_CODE_FAILED(back_jump_size < 0); out: return back_jump_size; out_failed: back_jump_size = -1; goto out; } /* creates the first jump from sym_addr to repl_addr * * return the size that will be overwritten when the jump is installed * or -1 in case of an error. */ static ssize_t _prepare_first_jump(void* bin, pid_t child, word_uint sym_addr, word_uint sym_size, word_uint repl_addr, uint8_t** first_jump) { *first_jump = (uint8_t*)malloc(sym_size); // Build the first jump from sym_addr to repl_addr ssize_t first_jump_size = generate_trampoline(*first_jump, sym_size, sym_addr, repl_addr); HIJACK_CODE_FAILED(first_jump_size < 0); // get the size to override ssize_t over = get_overridden_size(bin, child, sym_addr, first_jump_size); HIJACK_CODE_FAILED(over < first_jump_size || over > sym_size); out: return over; out_failed: /* no need to free first_jump since it will be freed by the calling function */ over = -1; goto out; } /* install the first jump from sym_addr to repl_addr and free *first_jump */ static void _finalize_first_jump(pid_t child, word_uint sym_addr, word_uint repl_addr, uint8_t* first_jump, ssize_t overwrite_size) { // install first_jump pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(hijack)\tinserting first jump from 0x%lx to 0x%lx\n", (unsigned long)sym_addr, (unsigned long)repl_addr); trace_write(child, sym_addr, first_jump, overwrite_size); // Insert the long jump free(first_jump); } /* set the callback address to reloc_addr */ static void _assign_callback_address(pid_t child, word_uint reloc_addr, word_uint orig_addr) { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "(hijack)\tassigning callback (located at addr 0x%lx) to 0x%lx\n", (unsigned long)orig_addr, (unsigned long)reloc_addr); /* the struct ezt_instrumented_function structure contains a callback field that points to * a callback to reloc_addr. * we need to do something like: * *f->callback = reloc_addr */ /* get the value of f->callback */ word_uint callback_addr = orig_addr; /* &f->callback */ word_uint buffer; /* f->callback */ trace_read(child, callback_addr, (uint8_t*)&buffer, sizeof(callback_addr)); /* now write *f->callback = reloc_addr; */ trace_write(child, buffer, (uint8_t*)&reloc_addr, sizeof(callback_addr)); } static ssize_t hijack_code_small_jump(void* bin, pid_t child, word_uint sym_addr, word_uint sym_size, word_uint reloc_addr, word_uint orig_addr, word_uint repl_addr) { // If the size is not available, then we suppose we have enough room if (sym_size <= 0) { sym_size = MAX_TRAMPOLINE_SIZE; } uint8_t* small_jump = NULL; /* sym_addr: address of the original function (in which we install a call to eztrace) * reloc_addr: address of the block of data that jumps to eztrace * orig_addr: address of the eztrace version of the function * repl_addr: address of the callback in eztrace that permits to call the user-defined function */ /* the goal here is to change the child process so that when the application calls the sym_addr function, * the following behavior occurs: * call sym_addr: (small) jump to reloc_addr (<-- small_jump) * reloc_addr: (long) jump to repl_addr (<-- long_jump) * orig_addr: perform eztrace stuff (recording events, etc.) * orig_addr: call *repl_addr (=reloc_addr+over) * repl_addr: replay the overwritten opcodes * repl_addr: (long) jump to sym_addr+x (<-- back_jump) * sym_addr: process stuff (it is the application function) * sym_addr: ret -> go back to repl_addr * orig_addr: perform eztrace stuff (recording events, etc.) * orig_addr: ret -> go back to the application */ /* We need to : - install a small (ie. relative) jump from sym_addr to reloc_addr - install long (ie. absolute) jump from reloc_addr to orig_addr - copy the overwritten opcodes from sym_addr to reloc_addr+sizeof(long_jump) - install a jump from reloc_addr+sizeof(long_jump) to sym_addr - set the callback value to reloc_addr+sizeof(long_jump) */ // Prepare the first (small) jump from sym_addr to reloc_addr ssize_t over = _prepare_first_jump(bin, child, sym_addr, sym_size, reloc_addr, &small_jump); HIJACK_CODE_FAILED((!check_instructions(bin, child, sym_addr, reloc_addr, over))); // Install the (long) jump from reloc_addr to orig_addr ssize_t long_jump_size = _install_jump(child, MAX_TRAMPOLINE_SIZE, reloc_addr, orig_addr); HIJACK_CODE_FAILED(long_jump_size < 0); // copy the overwritten opcodes and installs the jump back to sym_addr word_uint back_jump_addr = reloc_addr + long_jump_size; ssize_t back_jump_size = _install_back_jump(child, back_jump_addr, sym_addr, over); HIJACK_CODE_FAILED(back_jump_size < 0); // Insert the trampoline into the dest process _finalize_first_jump(child, sym_addr, reloc_addr, small_jump, over); // set the callback to back_jump_addr _assign_callback_address(child, back_jump_addr, repl_addr); // Return the size of the inserted code ssize_t retval = long_jump_size + back_jump_size + over; out: return retval; out_failed: free(small_jump); retval = -1; goto out; } static ssize_t hijack_code_long_jump(void* bin, pid_t child, word_uint sym_addr, word_uint sym_size, word_uint reloc_addr, word_uint orig_addr, word_uint repl_addr) { // If the size is not available, then we assume we have enough room if (sym_size <= 0) { sym_size = MAX_TRAMPOLINE_SIZE; } /* sym_addr: address of the original function (in which we install a call to eztrace) * reloc_addr: address of the block of data that jumps back to the application * repl_addr: address of the eztrace version of the function * orig_addr: address of the callback in eztrace that permits to call the user-defined function */ /* the goal here is to change the child process so that when the application calls the sym_addr function, * the following behavior occurs: * call sym_addr: jump to repl_addr (<-- first_jump) * repl_addr: perform eztrace stuff (recording events, etc.) * repl_addr: call *orig_addr (=reloc_addr) * reloc_addr: replay the overwritten opcodes * reloc_addr: (long) jump to sym_addr+x (<-- back_jump) * sym_addr: process stuff (it is the application function) * sym_addr: ret -> go back to repl_addr * repl_addr: perform eztrace stuff (recording events, etc.) * repl_addr: ret -> go back to the application */ /* We need to : - install a jump from sym_addr to repl_addr - copy the overwritten opcodes from sym_addr to reloc_addr - install a jump from reloc_addr to sym_addr - set the callback value to reloc_addr */ // Prepare the first jump from sym_addr to repl_addr uint8_t* first_jump = NULL; ssize_t overwrite_size = _prepare_first_jump(bin, child, sym_addr, sym_size, repl_addr, &first_jump); HIJACK_CODE_FAILED(overwrite_size < 0); // Copy the opcodes that are going to be overwritten by first_jump // and install the jump back to sym_addr /* BUG: we should check that the relocated opcodes to not depend on their address * For instance, mov (%rip+x), %eax fails */ ssize_t back_jump_size = _install_back_jump(child, reloc_addr, sym_addr, overwrite_size); HIJACK_CODE_FAILED(back_jump_size < 0); // Now we can install the first jump (and thus overwrite the first opcode) _finalize_first_jump(child, sym_addr, repl_addr, first_jump, overwrite_size); // set the callback to reloc_addr #ifdef __arm__ /* we need to switch to Thumb momde */ reloc_addr |= 0x01; #endif _assign_callback_address(child, reloc_addr, orig_addr); // Return the size of the inserted code ssize_t retval = back_jump_size + overwrite_size; out: return retval; out_failed: free(first_jump); retval = 1; goto out; } ssize_t hijack_code(void* bin, pid_t child, word_uint sym_addr, word_uint sym_size, word_uint reloc_addr, word_uint orig_addr, word_uint repl_addr) { #if __arm__ return hijack_code_long_jump(bin, child, sym_addr, sym_size, reloc_addr, orig_addr, repl_addr); #else return hijack_code_small_jump(bin, child, sym_addr, sym_size, reloc_addr, orig_addr, repl_addr); #endif } ssize_t hijack(void* bin, pid_t child, zzt_symbol* toHijack, zzt_symbol* orig, zzt_symbol* repl) { // Compute the addresses from the symbols word_uint addr = (word_uint)(toHijack->symbol_offset + toHijack->section_addr); word_uint sym_size = (word_uint)(toHijack->symbol_size); word_uint orig_addr = (word_uint)(orig->symbol_offset + orig->section_addr); word_uint repl_addr = (word_uint)(repl->symbol_offset + repl->section_addr); pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Hijacking application symbol %s (0x%lx)\n", toHijack->symbol_name, (unsigned long)addr); /* application symbol */ pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "\tthe library function is %s (0x%lx)\n", orig->symbol_name, (unsigned long)orig_addr); /* library symbol */ pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "\tThe replay address will be stored in a callback in %s (0x%lx).\n", repl->symbol_name, (unsigned long)repl_addr); /* callback */ pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Allocating buffer for relocating bytes... "); word_uint reloc_addr = allocate_buffer(child, MAX_TRAMPOLINE_SIZE); if (reloc_addr != 0) { pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "ok (0x%lx)\n", (unsigned long)reloc_addr); ssize_t hijack_size = hijack_code(bin, child, addr, sym_size, reloc_addr, orig_addr, repl_addr); if (hijack_size > 0 && hijack_size != MAX_TRAMPOLINE_SIZE) { correct_buffer_allocation(child, MAX_TRAMPOLINE_SIZE, hijack_size); } pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Symbol hijacked...\n"); return hijack_size; } pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "failed!\n"); return -1; } eztrace-2.1/src/instrumentation/binary_instrumentation/hijack.h000066400000000000000000000032121447213526500252630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * hijack.h -- High-level interface for inserting hijacks into a traced process * * Provided methods are: * - hijack_code(bin, child, sym_addr, sym_size, reloc_addr, orig_addr, * repl_addr): hijacks the symbol at address *sym_addr* which size is * *sym_size*. It will insert a jump to *repl_addr* at *sym_addr*. The * symbol at *orig_addr* will be filled with the address *reloc_addr* * that contains the code overridden by the trampoline. This is done by * determining the size of instruction using the *bin* parameter (a * binary opened by open_binary()) * - hijack(bin, child, toHijack, orig, repl): allocates * the destination buffer for the hijack and then do the hijack using * hijack_symbol(). *toHijack* is the symbol to intercept, *orig* is the * symbol to store the address of the hijack code and *repl* is the symbol * called instead of the *toHijack* symbol * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef HIJACK_H_ #define HIJACK_H_ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include ssize_t hijack_code(void* bin, pid_t child, word_uint sym_addr, word_uint sym_size, word_uint reloc_addr, word_uint orig_addr, word_uint repl_addr); ssize_t hijack(void* bin, pid_t child, zzt_symbol* toHijack, zzt_symbol* orig, zzt_symbol* repl); #endif /* HIJACK_H_ */ eztrace-2.1/src/instrumentation/binary_instrumentation/isize.h000066400000000000000000000017401447213526500251610ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * isize.h -- determining instruction size * * Provided method: * - get_overridden_size(bin, child, symbol, trampoline_size): determines * how much of *symbol* should be copied to replace the part overridden by * the trampoline of size *trampoline_size*. *bin* is the opaque structure * of the binary and *child* the pid of the child process. * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_ISIZE_H_ #define PPTRACE_ISIZE_H_ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include #include #include ssize_t get_overridden_size(void* bin, pid_t child, word_uint symbol, size_t trampoline_size); #endif /* PPTRACE_ISIZE_H_ */ eztrace-2.1/src/instrumentation/binary_instrumentation/memory.c000066400000000000000000000032121447213526500253350ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * memory.c * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include "memory.h" #include "eztrace-core/eztrace_config.h" #include "eztrace-instrumentation/tracing.h" #include // Memory allocation. Don't handle memory free (we don't care actually) #define MY_PAGE_SIZE (1024 * 1024) // We use 1Mbytes pages for allocation word_uint currentPointer = 0; // The current pointer toward free memory word_uint currentEndPointer = 0; // The pointer to the end of the current page word_uint allocate_buffer(pid_t child, size_t size) { // This algorithm is dummy, because we don't need to be memory efficient for the kind of target we plan if (currentPointer - currentEndPointer < size) { // We need a new page word_uint pagesize = MY_PAGE_SIZE; while (pagesize < size) pagesize += MY_PAGE_SIZE; currentPointer = trace_mmap(child, 0, pagesize, PROT_READ | PROT_EXEC); if (currentPointer) { currentEndPointer = currentPointer + pagesize; } else { currentEndPointer = 0; return 0; } } // Do the dummy allocation word_uint r = currentPointer; currentPointer += size; return r; } void correct_buffer_allocation(pid_t child __attribute__((unused)), size_t required_size, size_t actual_size) { currentPointer -= (required_size - actual_size); } eztrace-2.1/src/instrumentation/binary_instrumentation/memory.h000066400000000000000000000021401447213526500253410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * memory.h -- handles memory allocation in the target process * * Provided methods: * - allocate_buffer(child, size): allocate a buffer of size *size* in * the process *child*. Returns the address allocated * - correct_buffer_allocation(child, required_size, actual_size): free * (*required_size*-*actual_size*) in the process *child* for the last * allocation made by allocate_buffer(). * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_MEMORY_H_ #define PPTRACE_MEMORY_H_ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include #include #include #include word_uint allocate_buffer(pid_t child, size_t size); void correct_buffer_allocation(pid_t child, size_t required_size, size_t actual_size); #endif /* PPTRACE_MEMORY_H_ */ eztrace-2.1/src/instrumentation/binary_instrumentation/opcodes.h000066400000000000000000000037761447213526500255050ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * opcodes.h -- Opcode generation * * - insert_opcodes(opcode, opcode_size, buf, size, offset): insert *opcode* * of size *opcode_size* at offset *offset* of *buf* of size *size*. * Returns min(offset+opcode_size, size) * - generate_trampoline(buf, size, orig_addr, reloc_addr): generates * opcodes to jump to *reloc_addr* from *orig_addr*. The opcodes are the * smallest possible. * The generated opcodes are put at the beginning of *buf* (that is * of size *size*). Returns the new size of the inserted opcodes. * - read_jump(buf, size, offset, prefix): read a jump part that was prefixed * by *prefix* and that is contained at offset *offset* of *buf* (*size* is * the size of *buf*). The returned value is the size of the instruction * if a jump is read, 0 if a valid prefix for a jump was encountered, and < 0 * if the instruction is not a jump. * * - MAX_TRAMPOLINE_SIZE is a constant giving the maximum size of a trampoline * overwrite * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_OPCODES_H_ #define PPTRACE_OPCODES_H_ #ifndef ENABLE_BINARY_INSTRUMENTATION #error "This file is for binary instrumentation only" #endif #include #include #include #include #if __x86_64__ #define MAX_TRAMPOLINE_SIZE 48 // Be large :) #elif __arm__ #define MAX_TRAMPOLINE_SIZE 24 // in bytes!!! = sizes of one jumps and max overridden size. #endif ssize_t insert_opcodes(uint8_t* opcode, int opcode_size, uint8_t* buf, size_t size, size_t offset); ssize_t generate_trampoline(uint8_t* buffer, size_t size, word_uint orig_addr, word_uint reloc_addr); ssize_t read_jump(uint8_t* buf, size_t size, size_t offset, uint8_t prefix); #endif /* PPTRACE_OPCODES_H_ */ eztrace-2.1/src/instrumentation/errors.c000066400000000000000000000041021447213526500205310ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * errors.c * * Created on: 2 Aug. 2011 * Author: Damien Martin-Guillerez */ #include "eztrace-instrumentation/errors.h" #include #include #include #include #include char errmsg[1024]; enum PPTRACE_DEBUG_LEVEL pptrace_debug_level = PPTRACE_DEBUG_LEVEL_NONE; void set_pptrace_debug_level(enum PPTRACE_DEBUG_LEVEL debug_level) { pptrace_debug_level = debug_level; } enum PPTRACE_DEBUG_LEVEL get_pptrace_debug_level() { return pptrace_debug_level; } const char* pptrace_get_error() { #ifdef ENABLE_BINARY_INSTRUMENTATION const char* bin_error = pptrace_bin_error(); if (bin_error) return bin_error; if (errmsg[0]) return errmsg; if (errno) { return strerror(errno); } #endif return NULL; } void pptrace_clear_error() { errmsg[0] = 0; } void pptrace_report_error(char* fmt, ...) { va_list va; va_start(va, fmt); vsnprintf(errmsg, sizeof(errmsg), fmt, va); va_end(va); } void pptrace_error(char* fmt, ...) { va_list va; va_start(va, fmt); vfprintf(stderr, fmt, va); va_end(va); const char* emsg = pptrace_get_error(); if (emsg) { fprintf(stderr, ": %s\n", emsg); } else { fprintf(stderr, "\n"); } } void pptrace_fubar(char* fmt, ...) { va_list va; va_start(va, fmt); fprintf(stderr, "FUBAR: "); vfprintf(stderr, fmt, va); fprintf(stderr, "\n"); va_end(va); exit(-1); } void pptrace_debug(enum PPTRACE_DEBUG_LEVEL level, char* fmt, ...) { if (level <= pptrace_debug_level) { va_list va; va_start(va, fmt); vfprintf(stderr, fmt, va); va_end(va); } } void pptrace_dump_buffer(enum PPTRACE_DEBUG_LEVEL level, char* buffer, size_t length) { size_t i; if (level <= pptrace_debug_level) { for (i = 0; i < length; i++) { fprintf(stderr, "%02x ", buffer[i]); if (i % 20 == 0) fprintf(stderr, "\n"); } fprintf(stderr, "\n"); } } eztrace-2.1/src/instrumentation/include/000077500000000000000000000000001447213526500204775ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/include/eztrace-instrumentation/000077500000000000000000000000001447213526500253755ustar00rootroot00000000000000eztrace-2.1/src/instrumentation/include/eztrace-instrumentation/errors.h000066400000000000000000000037541447213526500270730ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * errors.h -- Error reporting inside PPTrace. * * Methods provided are: * - pptrace_get_error(): returns the last reported error * - pptrace_clear_error(): clear the error reported by PPTrace internals * - pptrace_error(fmt, ...): printf-like function to display an error. * *PPTrace Internals* * - pptrace_report_error(fmt, ...): printf-like function to report an error * that won't be displayed. *PPTrace Internals* * - pptrace_fubar(fmt, ...): printf-like function for fatal error. This ends * the process. *PPTrace Internals* * - pptrace_bin_error(): method implemented by the binary module to provides * error specific to the binary module. *PPTrace Internals* * - pptrace_debug(level, fmt, ...): printf-like function for printing * debugging information. *PPTrace Internals* * - pptrace_dump_buffer(level, buffer, length): print in hex format the * buffer given in argument for debugging purpose. *PPTrace Internals* * * Created on: 2 Aug. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_ERRORS_H_ #define PPTRACE_ERRORS_H_ #include #include enum PPTRACE_DEBUG_LEVEL { PPTRACE_DEBUG_LEVEL_NONE, PPTRACE_DEBUG_LEVEL_INFO, PPTRACE_DEBUG_LEVEL_VERBOSE, PPTRACE_DEBUG_LEVEL_DEBUG, PPTRACE_DEBUG_LEVEL_ALL, }; void set_pptrace_debug_level(enum PPTRACE_DEBUG_LEVEL debug_level); enum PPTRACE_DEBUG_LEVEL get_pptrace_debug_level(); const char* pptrace_get_error(); void pptrace_clear_error(); void pptrace_error(char* fmt, ...); void pptrace_report_error(char* fmt, ...); void pptrace_fubar(char* fmt, ...); const char* pptrace_bin_error(); void pptrace_debug(enum PPTRACE_DEBUG_LEVEL level, char* fmt, ...); void pptrace_dump_buffer(enum PPTRACE_DEBUG_LEVEL level, char* buffer, size_t length); #endif // PPTRACE_ERRORS_H_ eztrace-2.1/src/instrumentation/include/eztrace-instrumentation/linux.h000066400000000000000000000261221447213526500267100ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include // Copy/pasted from asm/unistd_32.h #define __NR32_restart_syscall 0 #define __NR32_exit 1 #define __NR32_fork 2 #define __NR32_read 3 #define __NR32_write 4 #define __NR32_open 5 #define __NR32_close 6 #define __NR32_waitpid 7 #define __NR32_creat 8 #define __NR32_link 9 #define __NR32_unlink 10 #define __NR32_execve 11 #define __NR32_chdir 12 #define __NR32_time 13 #define __NR32_mknod 14 #define __NR32_chmod 15 #define __NR32_lchown 16 #define __NR32_break 17 #define __NR32_oldstat 18 #define __NR32_lseek 19 #define __NR32_getpid 20 #define __NR32_mount 21 #define __NR32_umount 22 #define __NR32_setuid 23 #define __NR32_getuid 24 #define __NR32_stime 25 #define __NR32_ptrace 26 #define __NR32_alarm 27 #define __NR32_oldfstat 28 #define __NR32_pause 29 #define __NR32_utime 30 #define __NR32_stty 31 #define __NR32_gtty 32 #define __NR32_access 33 #define __NR32_nice 34 #define __NR32_ftime 35 #define __NR32_sync 36 #define __NR32_kill 37 #define __NR32_rename 38 #define __NR32_mkdir 39 #define __NR32_rmdir 40 #define __NR32_dup 41 #define __NR32_pipe 42 #define __NR32_times 43 #define __NR32_prof 44 #define __NR32_brk 45 #define __NR32_setgid 46 #define __NR32_getgid 47 #define __NR32_signal 48 #define __NR32_geteuid 49 #define __NR32_getegid 50 #define __NR32_acct 51 #define __NR32_umount2 52 #define __NR32_lock 53 #define __NR32_ioctl 54 #define __NR32_fcntl 55 #define __NR32_mpx 56 #define __NR32_setpgid 57 #define __NR32_ulimit 58 #define __NR32_oldolduname 59 #define __NR32_umask 60 #define __NR32_chroot 61 #define __NR32_ustat 62 #define __NR32_dup2 63 #define __NR32_getppid 64 #define __NR32_getpgrp 65 #define __NR32_setsid 66 #define __NR32_sigaction 67 #define __NR32_sgetmask 68 #define __NR32_ssetmask 69 #define __NR32_setreuid 70 #define __NR32_setregid 71 #define __NR32_sigsuspend 72 #define __NR32_sigpending 73 #define __NR32_sethostname 74 #define __NR32_setrlimit 75 #define __NR32_getrlimit 76 /* Back compatible 2Gig limited rlimit */ #define __NR32_getrusage 77 #define __NR32_gettimeofday 78 #define __NR32_settimeofday 79 #define __NR32_getgroups 80 #define __NR32_setgroups 81 #define __NR32_select 82 #define __NR32_symlink 83 #define __NR32_oldlstat 84 #define __NR32_readlink 85 #define __NR32_uselib 86 #define __NR32_swapon 87 #define __NR32_reboot 88 #define __NR32_readdir 89 #define __NR32_mmap 90 #define __NR32_munmap 91 #define __NR32_truncate 92 #define __NR32_ftruncate 93 #define __NR32_fchmod 94 #define __NR32_fchown 95 #define __NR32_getpriority 96 #define __NR32_setpriority 97 #define __NR32_profil 98 #define __NR32_statfs 99 #define __NR32_fstatfs 100 #define __NR32_ioperm 101 #define __NR32_socketcall 102 #define __NR32_syslog 103 #define __NR32_setitimer 104 #define __NR32_getitimer 105 #define __NR32_stat 106 #define __NR32_lstat 107 #define __NR32_fstat 108 #define __NR32_olduname 109 #define __NR32_iopl 110 #define __NR32_vhangup 111 #define __NR32_idle 112 #define __NR32_vm86old 113 #define __NR32_wait4 114 #define __NR32_swapoff 115 #define __NR32_sysinfo 116 #define __NR32_ipc 117 #define __NR32_fsync 118 #define __NR32_sigreturn 119 #define __NR32_clone 120 #define __NR32_setdomainname 121 #define __NR32_uname 122 #define __NR32_modify_ldt 123 #define __NR32_adjtimex 124 #define __NR32_mprotect 125 #define __NR32_sigprocmask 126 #define __NR32_create_module 127 #define __NR32_init_module 128 #define __NR32_delete_module 129 #define __NR32_get_kernel_syms 130 #define __NR32_quotactl 131 #define __NR32_getpgid 132 #define __NR32_fchdir 133 #define __NR32_bdflush 134 #define __NR32_sysfs 135 #define __NR32_personality 136 #define __NR32_afs_syscall 137 /* Syscall for Andrew File System */ #define __NR32_setfsuid 138 #define __NR32_setfsgid 139 #define __NR32__llseek 140 #define __NR32_getdents 141 #define __NR32__newselect 142 #define __NR32_flock 143 #define __NR32_msync 144 #define __NR32_readv 145 #define __NR32_writev 146 #define __NR32_getsid 147 #define __NR32_fdatasync 148 #define __NR32__sysctl 149 #define __NR32_mlock 150 #define __NR32_munlock 151 #define __NR32_mlockall 152 #define __NR32_munlockall 153 #define __NR32_sched_setparam 154 #define __NR32_sched_getparam 155 #define __NR32_sched_setscheduler 156 #define __NR32_sched_getscheduler 157 #define __NR32_sched_yield 158 #define __NR32_sched_get_priority_max 159 #define __NR32_sched_get_priority_min 160 #define __NR32_sched_rr_get_interval 161 #define __NR32_nanosleep 162 #define __NR32_mremap 163 #define __NR32_setresuid 164 #define __NR32_getresuid 165 #define __NR32_vm86 166 #define __NR32_query_module 167 #define __NR32_poll 168 #define __NR32_nfsservctl 169 #define __NR32_setresgid 170 #define __NR32_getresgid 171 #define __NR32_prctl 172 #define __NR32_rt_sigreturn 173 #define __NR32_rt_sigaction 174 #define __NR32_rt_sigprocmask 175 #define __NR32_rt_sigpending 176 #define __NR32_rt_sigtimedwait 177 #define __NR32_rt_sigqueueinfo 178 #define __NR32_rt_sigsuspend 179 #define __NR32_pread64 180 #define __NR32_pwrite64 181 #define __NR32_chown 182 #define __NR32_getcwd 183 #define __NR32_capget 184 #define __NR32_capset 185 #define __NR32_sigaltstack 186 #define __NR32_sendfile 187 #define __NR32_getpmsg 188 /* some people actually want streams */ #define __NR32_putpmsg 189 /* some people actually want streams */ #define __NR32_vfork 190 #define __NR32_ugetrlimit 191 /* SuS compliant getrlimit */ #define __NR32_mmap2 192 #define __NR32_truncate64 193 #define __NR32_ftruncate64 194 #define __NR32_stat64 195 #define __NR32_lstat64 196 #define __NR32_fstat64 197 #define __NR32_lchown32 198 #define __NR32_getuid32 199 #define __NR32_getgid32 200 #define __NR32_geteuid32 201 #define __NR32_getegid32 202 #define __NR32_setreuid32 203 #define __NR32_setregid32 204 #define __NR32_getgroups32 205 #define __NR32_setgroups32 206 #define __NR32_fchown32 207 #define __NR32_setresuid32 208 #define __NR32_getresuid32 209 #define __NR32_setresgid32 210 #define __NR32_getresgid32 211 #define __NR32_chown32 212 #define __NR32_setuid32 213 #define __NR32_setgid32 214 #define __NR32_setfsuid32 215 #define __NR32_setfsgid32 216 #define __NR32_pivot_root 217 #define __NR32_mincore 218 #define __NR32_madvise 219 #define __NR32_madvise1 219 /* delete when C lib stub is removed */ #define __NR32_getdents64 220 #define __NR32_fcntl64 221 /* 223 is unused */ #define __NR32_gettid 224 #define __NR32_readahead 225 #define __NR32_setxattr 226 #define __NR32_lsetxattr 227 #define __NR32_fsetxattr 228 #define __NR32_getxattr 229 #define __NR32_lgetxattr 230 #define __NR32_fgetxattr 231 #define __NR32_listxattr 232 #define __NR32_llistxattr 233 #define __NR32_flistxattr 234 #define __NR32_removexattr 235 #define __NR32_lremovexattr 236 #define __NR32_fremovexattr 237 #define __NR32_tkill 238 #define __NR32_sendfile64 239 #define __NR32_futex 240 #define __NR32_sched_setaffinity 241 #define __NR32_sched_getaffinity 242 #define __NR32_set_thread_area 243 #define __NR32_get_thread_area 244 #define __NR32_io_setup 245 #define __NR32_io_destroy 246 #define __NR32_io_getevents 247 #define __NR32_io_submit 248 #define __NR32_io_cancel 249 #define __NR32_fadvise64 250 /* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ #define __NR32_exit_group 252 #define __NR32_lookup_dcookie 253 #define __NR32_epoll_create 254 #define __NR32_epoll_ctl 255 #define __NR32_epoll_wait 256 #define __NR32_remap_file_pages 257 #define __NR32_set_tid_address 258 #define __NR32_timer_create 259 #define __NR32_timer_settime (__NR32_timer_create+1) #define __NR32_timer_gettime (__NR32_timer_create+2) #define __NR32_timer_getoverrun (__NR32_timer_create+3) #define __NR32_timer_delete (__NR32_timer_create+4) #define __NR32_clock_settime (__NR32_timer_create+5) #define __NR32_clock_gettime (__NR32_timer_create+6) #define __NR32_clock_getres (__NR32_timer_create+7) #define __NR32_clock_nanosleep (__NR32_timer_create+8) #define __NR32_statfs64 268 #define __NR32_fstatfs64 269 #define __NR32_tgkill 270 #define __NR32_utimes 271 #define __NR32_fadvise64_64 272 #define __NR32_vserver 273 #define __NR32_mbind 274 #define __NR32_get_mempolicy 275 #define __NR32_set_mempolicy 276 #define __NR32_mq_open 277 #define __NR32_mq_unlink (__NR32_mq_open+1) #define __NR32_mq_timedsend (__NR32_mq_open+2) #define __NR32_mq_timedreceive (__NR32_mq_open+3) #define __NR32_mq_notify (__NR32_mq_open+4) #define __NR32_mq_getsetattr (__NR32_mq_open+5) #define __NR32_kexec_load 283 #define __NR32_waitid 284 /* #define __NR32_sys_setaltroot 285 */ #define __NR32_add_key 286 #define __NR32_request_key 287 #define __NR32_keyctl 288 #define __NR32_ioprio_set 289 #define __NR32_ioprio_get 290 #define __NR32_inotify_init 291 #define __NR32_inotify_add_watch 292 #define __NR32_inotify_rm_watch 293 #define __NR32_migrate_pages 294 #define __NR32_openat 295 #define __NR32_mkdirat 296 #define __NR32_mknodat 297 #define __NR32_fchownat 298 #define __NR32_futimesat 299 #define __NR32_fstatat64 300 #define __NR32_unlinkat 301 #define __NR32_renameat 302 #define __NR32_linkat 303 #define __NR32_symlinkat 304 #define __NR32_readlinkat 305 #define __NR32_fchmodat 306 #define __NR32_faccessat 307 #define __NR32_pselect6 308 #define __NR32_ppoll 309 #define __NR32_unshare 310 #define __NR32_set_robust_list 311 #define __NR32_get_robust_list 312 #define __NR32_splice 313 #define __NR32_sync_file_range 314 #define __NR32_tee 315 #define __NR32_vmsplice 316 #define __NR32_move_pages 317 #define __NR32_getcpu 318 #define __NR32_epoll_pwait 319 #define __NR32_utimensat 320 #define __NR32_signalfd 321 #define __NR32_timerfd_create 322 #define __NR32_eventfd 323 #define __NR32_fallocate 324 #define __NR32_timerfd_settime 325 #define __NR32_timerfd_gettime 326 #define __NR32_signalfd4 327 #define __NR32_eventfd2 328 #define __NR32_epoll_create1 329 #define __NR32_dup3 330 #define __NR32_pipe2 331 #define __NR32_inotify_init1 332 #define __NR32_preadv 333 #define __NR32_pwritev 334 #define __NR32_rt_tgsigqueueinfo 335 #define __NR32_perf_event_open 336 #ifdef ENABLE_BINARY_INSTRUMENTATION int trace_get_bits(); #ifdef __x86_64__ #define TRACE_SYSCALL(name) (trace_get_bits() == 32 ? __NR32_##name : __NR_##name) #define MMAP_SYSCALLS (trace_get_bits() == 32 ? ((__NR32_mmap << 16) | (__NR32_mmap2)) : __NR_mmap) #elif __arm__ #define TRACE_SYSCALL(name) (__NR_##name) #define MMAP_SYSCALLS ((__NR32_mmap << 16) | (__NR32_mmap2)) #endif #endif /* ENABLE_BINARY_INSTRUMENTATION */ #ifdef __x86_64__ #define REG_STRUCT struct user_regs_struct #elif __arm__ #define REG_STRUCT struct user_regs #endif #define TRACE_SYSCALLS(name1, name2) ((TRACE_SYSCALL(name1) << 16) & TRACE_SYSCALL(name2)) eztrace-2.1/src/instrumentation/include/eztrace-instrumentation/pptrace.h000066400000000000000000000041461447213526500272110ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * pptrace.h -- Public interface of PPTrace. Used by EZTrace * * - pptrace_prepare_binary(binary): open *binary* and returns an opaque * structure that is to be used by all other methods here. * - pptrace_load_module(bin, library): add *library* to be an hijack * library. This library should have a symbolic name * _pptrace_hijack_list is an array of string (char*). * Each string contain, separated by a space, the name of symbol to hijack, * the name of the symbol in the library to write the original address, * and the name of the replacement symbol. * *bin* is the opaque structure returned by pptrace_prepare_binary(). * Returns non-zero on failure. * * - pptrace_add_debugger(bin, argv): adds the program ran by the *argv* * vector to the binary *bin* to be the program debugger. An argument * matching '{name}' will be replaced by the target binary name and * an argument matching '{pid}' will be replaced by the target program * identifier. * * - pptrace_add_preload(bin, library): adds *library* to be a preload library. * This library will be added to the preload without doing anything else. * *bin* is the opaque structure returned by pptrace_prepare_binary(). * Returns non-zero on failure. * * - pptrace_run(void *bin, char **argv, char **envp): executes the binary * with the given argv and envp (see execve). * *bin* is the opaque structure returned by pptrace_prepare_binary(). * Returns non-zero on failure and free the *bin* structure. * * Created on: 2 August 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_PPTRACE_H #define PPTRACE_PPTRACE_H void* pptrace_prepare_binary(char* binary); void pptrace_add_debugger(void* bin, char** argv); int pptrace_load_module(void* bin, char* library); int pptrace_add_preload(void* bin, char* library); int pptrace_run(void* bin, char** argv, char** envp); #endif // PPTRACE_PPTRACE_H eztrace-2.1/src/instrumentation/include/eztrace-instrumentation/tracing.h000066400000000000000000000130271447213526500272000ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * tracing.h -- API for tracing process using ptrace() or similar * * - trace_run(path, argv, envp, debug): executes a process and trace it * Arguments should be the same as execve. The returned value * is the pid of the traced process. * If path is NULL, the process is only forked and trace_run * act as fork, the traced process return 0 and the tracing * returned the pid of the traced process. debug tells * the trace_run function that we would like to debug at the * detachment of the process (so run the program in background). * - trace_detach(child): detach (stop tracing) the process *child*. * - trace_wait(child): wait for the end of the process *child*. * - trace_set_bits(bits): tells the tracing system the size of a word * in the trace process (default is the wordsize of the host process). * - get_ip(child): returns the instruction pointer of process *child*. * - set_ip(child, rip): set to *rip* the instruction pointer of process * *child*. * - trace_read(child, fromaddr, buffer, length): reads *length* bytes * into *buffer* from *child* memory starting at address *fromaddr*. * - trace_write(child, fromaddr, buffer, length): write *length* bytes * from *buffer* to *child* memory starting at address *fromaddr*. * - trace_replace(child, addr, newbyte): set the byte at address *addr* * of *child* memory to *newbyte*. The previous value of this address * is returned by this function. * - trace_copy(child, fromaddr, toaddr, length): copies *length* bytes * from address *fromaddr* to address *toaddr* of *child* memory. * - trace_singlestep(child): executes one instruction of *child* and * stops after. * - trace_continue(child): Continue the child until a signal is caught. * - trace_signal(child, signo): Continue the child until signal signo is caught. * - trace_syscall(child): Continue the child until a signal is caught or * a syscall is issued. * - trace_mmap(child, addr, length, prot): do, inside *child*, a * mmap(addr, length, prot, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0). * This function return the result of the syscall. * - trace_wait_syscall(child, retval, syscall, ...): wait for syscall number * *syscall* to happen in *child*. Result of the syscall is store in *retval*. * The arguments after are a series of SYSCALL_ARGTYPE_* ended * by SYSCALL_ARGTYPE_END. * SYSCALL_ARGTYPE_INT waits for an integer that matches the next * argument * SYSCALL_ARGTYPE_ZSTRING waits for a null terminated string that * matches the next argument * SYSCALL_ARGTYPE_ZSTRING waits for a null terminated string that * will be returned in the pointer given as next argument * SYSCALL_ARGTYPE_IGNORE waits for any argument * trace_wait_syscall returns < 0 when the wait did not encountered * the awaited syscall and 0 on success. * For use with several similar syscalls, multiple syscall numbers can be fit * together in syscall using high bits range (2 byte per syscall number) * - trace_get_regs(pid_t child, REG_STRUCT* regs): returns the registers * of process *child* into *regs*. * - trace_set_regs(pid_t child, REG_STRUCT* regs): set the registers of * process *child* to be *regs*. * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #ifndef PPTRACE_TRACING_H_ #define PPTRACE_TRACING_H_ #include #include #include //#ifndef __PPTRACE_TRACE_TYPE #include "linux.h" //#else //#if __PPTRACE_TRACE_TYPE == PPTRACE_TRACE_TYPE_BSD //#include //#elif __PPTRACE_TRACE_TYPE == PPTRACE_ARCH_TYPE_MACOSX //#include //#else // if ! (__PPTRACE_TRACE_TYPE == PPTRACE_ARCH_TYPE_MACOSX || __PPTRACE_TRACE_TYPE == PPTRACE_ARCH_TYPE_BSD) //#include //#endif // ! (__PPTRACE_TRACE_TYPE == PPTRACE_ARCH_TYPE_MACOSX || __PPTRACE_TRACE_TYPE == PPTRACE_ARCH_TYPE_BSD) //#endif // !defined(__PPTRACE_TRACE_TYPE) #define SYSCALL_ARGTYPE_END 0 #define SYSCALL_ARGTYPE_INT 1 #define SYSCALL_ARGTYPE_ZSTRING 2 #define SYSCALL_ARGTYPE_ZSTRING_RETURN 3 // Return the value of the string #define SYSCALL_ARGTYPE_IGNORE 4 pid_t trace_run(const char* path, char** argv, char** envp, int debug); void trace_detach(pid_t child); void trace_wait(pid_t child); void trace_set_bits(int bits); word_uint get_ip(pid_t child); void set_ip(pid_t child, word_uint rip); #ifdef __x86_64__ // x86_64 void trace_get_regs(pid_t child, REG_STRUCT* regs); void trace_set_regs(pid_t child, REG_STRUCT* regs); #endif void trace_read(pid_t child, word_uint fromaddr, uint8_t* buffer, size_t length); void trace_write(pid_t child, word_uint addr, uint8_t* buffer, size_t length); uint8_t trace_replace(pid_t child, word_uint addr, uint8_t newbyte); void trace_copy(pid_t child, word_uint fromaddr, word_uint toaddr, size_t length); int trace_singlestep(pid_t child); int trace_syscall(pid_t child); int trace_continue(pid_t child); word_uint trace_mmap(pid_t child, word_uint addr, size_t length, int prot); int trace_wait_syscall(pid_t child, word_uint* retval, unsigned long syscall, ...); // Wait for syscall and return the return value of the first encountered syscall void trace_wait_signal(pid_t child, int signo); void print_reg_value(pid_t, word_uint); #endif /* PPTRACE_TRACING_H_ */ eztrace-2.1/src/instrumentation/pptrace.c000066400000000000000000000610401447213526500206570ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * pptrace.c * * Public interface of the library * * Created on: 2 Aug. 2011 * Author: Damien Martin-Guillerez */ #include "eztrace-instrumentation/pptrace.h" #include "binary.h" #include "eztrace-core/eztrace_attributes.h" #include "eztrace-instrumentation/errors.h" #include "eztrace-instrumentation/tracing.h" #include "proc_maps.h" #include "eztrace-core/eztrace_config.h" #include "eztrace-core/eztrace_types.h" #include #include #include #include #include #include #include #include #include #ifdef ENABLE_BINARY_INSTRUMENTATION #include "hijack.h" #include "isize.h" #include "memory.h" #include "opcodes.h" #endif /* ENABLE_BINARY_INSTRUMENTATION */ #ifdef ENABLE_BINARY_INSTRUMENTATION // To store informations about hijack to install typedef struct _pptrace_internal_hijack { char* function; // Function to hijack zzt_symbol* funSym; // Symbol of the function in the application zzt_symbol* origSym; // Symbol of the function in eztrace library zzt_symbol* replSym; // Interceptor symbol } pptrace_internal_hijack; #endif // ENABLE_BINARY_INSTRUMENTATIOn // To store informations about libraries to load typedef struct _pptrace_internal_library { char* library; // The library name #ifdef ENABLE_BINARY_INSTRUMENTATION pptrace_internal_hijack** hijacks; // The hijacks to install #endif // ENABLE_BINARY_INSTRUMENTATIOn zzt_word baseaddr; // Double-linked list struct _pptrace_internal_library* next; struct _pptrace_internal_library* prev; } pptrace_internal_library; // And finally the binary structure typedef struct _pptrace_internal_binary { char* name; // Name of the binary void* binary; // Binary structure char** debugger; // Argument list to debugger an argument matching "{name}" will be replaced by the binary name and arguments matching "{pid}" will be replaced by the program pid zzt_word baseaddr; /* base address of the binary */ // List of libraries pptrace_internal_library* first; pptrace_internal_library* last; } pptrace_internal_binary; #define ALLOC(type) (type*)malloc(sizeof(type)); // Look out for a binary in the path static char* get_program_path(const char* name) { struct stat buf; if (stat(name, &buf) == 0) { // The address is relative return strdup(name); } // Looking in the path char* path = getenv("PATH"); if (path == NULL) return NULL; path = strdup(path); // copying to avoid corrupting the environment variable if (path == NULL) return NULL; char* ifs = getenv("IFS"); if (ifs == NULL) ifs = ":"; // for each path char* p; char rpath[1024]; for (p = strtok(path, ifs); p != NULL; p = strtok(NULL, ifs)) { // Add the path component if (p[strlen(p) - 1] != '/') snprintf(rpath, 1024, "%s/%s", p, name); else snprintf(rpath, 1024, "%s%s", p, name); // Test if it exists if (stat(rpath, &buf) == 0) { free(path); return strdup(rpath); } } free(path); return NULL; } void* pptrace_prepare_binary(char* binary) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Loading binary %s... ", binary); pptrace_clear_error(); pptrace_internal_binary* bin = ALLOC(pptrace_internal_binary); if (!bin) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); pptrace_error("Allocation failed"); return NULL; } bin->debugger = NULL; bin->first = bin->last = NULL; bin->name = get_program_path(binary); if (!(bin->name)) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); free(bin); pptrace_error("Cannot access binary %s", binary); return NULL; } #ifdef ENABLE_BINARY_INSTRUMENTATION bin->binary = open_binary(bin->name); if (!(bin->binary)) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); pptrace_error("Cannot open binary %s", binary); free(bin->name); free(bin); return NULL; } #endif pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "ok\n"); return (void*)bin; } void pptrace_add_debugger(void* bin, char** argv) { pptrace_internal_binary* ibin = bin; ibin->debugger = argv; if (argv == NULL) pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Installing debugger %s\n"); else pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Uninstalling debugger\n", argv[0]); } #ifdef ENABLE_BINARY_INSTRUMENTATION static void pptrace_free_hijack(pptrace_internal_hijack* hijack) { if (!hijack) return; free_symbol(hijack->origSym); free_symbol(hijack->replSym); free_symbol(hijack->funSym); free(hijack->function); free(hijack); } static pptrace_internal_hijack* pptrace_get_hijack(const pptrace_internal_binary* bin MAYBE_UNUSED, const char* library MAYBE_UNUSED, void* lib MAYBE_UNUSED, struct ezt_instrumented_function* function MAYBE_UNUSED, zzt_symbol* functions_symbol, int index) { pptrace_internal_hijack* hijack = ALLOC(pptrace_internal_hijack); if (!hijack) { pptrace_error("Allocation failed"); return NULL; } /* The goal of this function is to compute all the addresses needed for instrumenting a function * The name of the function to instrument (eg. foo) is in function->function_name * We need to compute: * - the address of foo in the application binary (app_foo) * - the address of foo in the eztrace library (ezt_foo) * - the address of the callback in eztrace library that will point to app_foo (callback_foo) */ pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Searching for symbol %s\n", function->function_name); hijack->origSym = hijack->replSym = hijack->funSym = NULL; hijack->function = malloc(sizeof(char)*(strlen(function->function_name)+1)); memcpy(hijack->function, function->function_name,sizeof(char)*(strlen(function->function_name)+1)); /* search for the address of the function in the application (ie. search for app_foo) */ hijack->funSym = get_symbol(bin->binary, function->function_name); if (!hijack->funSym) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Failed to find symbol %s in binary %s, ignoring!\n", hijack->function, bin->name); pptrace_free_hijack(hijack); return NULL; } pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Symbol %s in the application: %p+%p (%p)\n", hijack->funSym->symbol_name, hijack->funSym->symbol_offset, hijack->funSym->section_addr, hijack->funSym->symbol_offset+ hijack->funSym->section_addr); /* search for the address of the function in the library (ie. search for ezt_foo) */ hijack->origSym = get_symbol(lib, hijack->function); if (!hijack->origSym) { pptrace_error("Failed to find symbol %s in binary %s", hijack->function, library); pptrace_free_hijack(hijack); return NULL; } pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Symbol %s in the library: %p+%p (%p)\n", hijack->origSym->symbol_name, hijack->origSym->symbol_offset, hijack->origSym->section_addr, hijack->origSym->symbol_offset+ hijack->origSym->section_addr); /* compute the address of the callback * the callback is stored in a struct ezt_instrument_function array */ hijack->replSym = copy_symbol(functions_symbol); if(! hijack->replSym) { pptrace_error("Failed to allocate memory"); pptrace_free_hijack(hijack); return NULL; } hijack->replSym->symbol_size = sizeof(void*); hijack->replSym->symbol_offset += (index * sizeof(struct ezt_instrumented_function)) + ezt_offset_of(struct ezt_instrumented_function, callback); pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Callback %s in the library: %p+%p (%p)\n", hijack->replSym->symbol_name, hijack->replSym->symbol_offset, hijack->replSym->section_addr, hijack->replSym->symbol_offset+ hijack->replSym->section_addr); return hijack; } static void pptrace_free_hijacks(pptrace_internal_hijack** hijacks) { int i; if (!hijacks) return; for (i = 0; hijacks[i] != NULL; i++) pptrace_free_hijack(hijacks[i]); free(hijacks); } static pptrace_internal_hijack** pptrace_get_hijacks(const pptrace_internal_binary* bin, const char* library, void* lib, zzt_symbol* functions) { int i, j; void* bin_bin = open_binary(library); /* allocate an array and copy the symbol to it */ struct ezt_instrumented_function * function_array = read_function_array(bin_bin, functions); int nb_functions; for (nb_functions = 0; strcmp(function_array[nb_functions].function_name, "") != 0; nb_functions++) { } pptrace_internal_hijack** hijacks = (pptrace_internal_hijack**)malloc( sizeof(pptrace_internal_hijack*) * (nb_functions + 1)); if (!hijacks) { pptrace_error("Allocation failed"); return NULL; } for (i = 0; i < nb_functions + 1; i++) hijacks[i] = NULL; for (i = j = 0; j < nb_functions; i++, j++) { hijacks[i] = pptrace_get_hijack(bin, library, lib, &function_array[j], functions, j); if (!hijacks[i]) i--; // ignoring this line } return hijacks; } static void _pptrace_get_module_name(const char* libname, char* module_name, size_t buffer_size) { int libname_length=strlen(libname)+1; char tmp_buffer[libname_length]; memcpy(tmp_buffer, libname, libname_length); memset(module_name, '\0', buffer_size); /* a libname looks like this: liba-b-c-d.so * first, find the last part of the lib name (eg. d.so) */ char*saveptr = NULL; char* token = strtok_r(tmp_buffer, "-", &saveptr); while(token) { strncpy(module_name, token, buffer_size); token = strtok_r(NULL, "-", &saveptr); } /* now remove the suffix (".so" / ".dynlib") */ char* suffix = strstr(module_name, "."DYNLIB_SUFFIX); if (suffix) { /* found the suffix, just insert a \0 to remove it */ suffix[0]='\0'; } return; } static pptrace_internal_hijack** pptrace_load_hijacks(const pptrace_internal_binary* bin MAYBE_UNUSED, const char* library MAYBE_UNUSED, void* lib MAYBE_UNUSED) { void* bin_bin = open_binary(library); char module_name[1024]; _pptrace_get_module_name(library, module_name, 1024); char hijack_symbol[1024]; _get_pptrace_symbol_external(hijack_symbol, 1024, module_name); zzt_symbol* functions = get_symbol(bin_bin, hijack_symbol); if(!functions) { _get_pptrace_symbol_external(hijack_symbol, 1024, ""); functions = get_symbol(bin_bin, hijack_symbol); if (!functions) { pptrace_error("%s library does not contain symbol %s, probably wrong library format", library, hijack_symbol); close_binary(bin_bin); return NULL; } } close_binary(bin_bin); pptrace_internal_hijack** result = pptrace_get_hijacks(bin, library, lib, functions); free(functions); return result; } #endif // ENABLE_BINARY_INSTRUMENTATION static void pptrace_free_library(pptrace_internal_library* lib) { if (!lib) return; free(lib->library); #ifdef ENABLE_BINARY_INSTRUMENTATION pptrace_free_hijacks(lib->hijacks); #endif // ENABLE_BINARY_INSTRUMENTATION free(lib); } static void pptrace_insert_library(pptrace_internal_binary* binary, pptrace_internal_library* lib) { lib->next = NULL; lib->prev = binary->last; if (binary->last) { binary->last->next = lib; binary->last = lib; } else { binary->first = binary->last = lib; } } #ifdef ENABLE_BINARY_INSTRUMENTATION static void pptrace_remove_last_library(pptrace_internal_binary* binary) { if (binary->last) { pptrace_internal_library* lib = binary->last; binary->last = lib->prev; if (lib->prev) { lib->prev->next = NULL; } if (binary->first == lib) binary->first = NULL; } } #endif int pptrace_load_module(void* bin, char* library) { int r = pptrace_add_preload(bin, library); if (r < 0) return r; #ifdef ENABLE_BINARY_INSTRUMENTATION pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Fetching hijacks of library %s\n", library); pptrace_internal_binary* binary = (pptrace_internal_binary*)bin; pptrace_internal_library* lib = binary->last; void* libr = open_binary(library); if (!binary) { pptrace_remove_last_library(binary); pptrace_free_library(lib); pptrace_error("Failed to open library %s", library); return -1; } lib->hijacks = pptrace_load_hijacks(binary, library, libr); if (!lib->hijacks) { pptrace_remove_last_library(binary); pptrace_free_library(lib); return -1; } close_binary(libr); lib->baseaddr = 0; pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Hijacks of library %s fetched\n", library); #endif return 0; } int pptrace_add_preload(void* bin, char* library) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Loading library %s... ", library); pptrace_clear_error(); if (!bin || !library) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); pptrace_error("Invalid argument"); return -1; } pptrace_internal_binary* binary = (pptrace_internal_binary*)bin; pptrace_internal_library* lib = ALLOC(pptrace_internal_library); if (!lib) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); pptrace_error("Allocation failed"); return -1; } lib->library = strdup(library); lib->baseaddr = -1; if (!(lib->library)) { free(lib); pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "failed!\n"); pptrace_error("Allocation failed"); return -1; } #ifdef ENABLE_BINARY_INSTRUMENTATION lib->hijacks = NULL; #endif // ENABLE_BINARY_INSTRUMENTATION pptrace_insert_library(binary, lib); pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "ok\n"); return 0; } static char* pptrace_create_preload(const pptrace_internal_library* first, const char* var_name) { char* result = (char*)calloc(1024, sizeof(char)); snprintf(result, 1024, "%s=", var_name); unsigned int alloc_size = 1024; unsigned int cur_size = strlen(result); while (first != NULL) { while (alloc_size - cur_size < strlen(first->library) + 2) { alloc_size += 1024; result = (char*)realloc(result, alloc_size); } strcpy(result + cur_size, first->library); cur_size += strlen(first->library); strcpy(result + cur_size, ":"); cur_size++; first = first->next; } char* envpreload = getenv(var_name); if (envpreload != NULL) { while (alloc_size - cur_size < strlen(envpreload) + 1) { alloc_size += 1024; result = (char*)realloc(result, alloc_size); } strcpy(result + cur_size, envpreload); } else if (cur_size > 0) { cur_size--; // remove the trailing ':' result[cur_size] = 0; } return result; } /* preload the libraries, and load the application */ static pid_t pptrace_launch_preload(const char* path, char** argv, char** envp, const pptrace_internal_library* first, int debug) { // Adding LD_PRELOAD=libraries in envp int i, size = 0; while (envp[size] != NULL) size++; char** envp2 = (char**)malloc(sizeof(char*) * (size + 3)); for (i = 0; i < size; i++) envp2[i] = envp[i]; envp2[size] = pptrace_create_preload(first, "LD_PRELOAD"); envp2[size + 1] = pptrace_create_preload(first, "OMP_TOOL_LIBRARIES"); envp2[size + 2] = NULL; pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "\nLD_PRELOAD is %s\n", envp2[size]); pid_t child = trace_run(path, argv, envp2, debug); free(envp2[size]); free(envp2); return child; } static void pptrace_free_binary(pptrace_internal_binary* binary) { if (!binary) return; #ifdef ENABLE_BINARY_INSTRUMENTATION if (binary->binary) { close_binary(binary->binary); } #endif while (binary->first != NULL) { pptrace_internal_library* lib = binary->first; binary->first = lib->next; pptrace_free_library(lib); } free(binary->name); free(binary); } /* search for the base address of binary (once it is loaded) and fill * the baseaddr field of the binary structure */ static int pptrace_get_base_address(pid_t child, pptrace_internal_binary* binary) { binary->baseaddr = 0; /* the binary is mapped at this address: grep "name>$" /proc//maps |grep "r-xp"|cut -d'-' -f1 */ char cmd[4096]; snprintf(cmd, 4096, "grep \"$(basename %s)$\" /proc/%d/maps |grep \" r-xp \"|tr '-' ' '|cut -d' ' -f1,5", binary->name, child); FILE* f = popen(cmd, "r"); if (!f) { fprintf(stderr, "popen(%s) failed\n", cmd); return -1; } uint64_t offset; int fscanf_res = fscanf(f, "%lx %lx", &binary->baseaddr, &offset); pclose(f); if (fscanf_res != 2) { fprintf(stderr, "failed to read baseaddr from popen(%s)\n", cmd); return -1; } binary->baseaddr -= offset; pptrace_debug(PPTRACE_DEBUG_LEVEL_VERBOSE, "Binary base address: %p\n", binary->baseaddr); return 0; } #ifdef ENABLE_BINARY_INSTRUMENTATION static bool filter_proc_maps_entry_read_exec(struct Maps_entry const* map_entry) { return maps_entry_filter_permissions(map_entry, "rx"); } static int wait_for_libraries(pid_t pid, pptrace_internal_binary const* binary) { assert(binary != NULL); char lib_name[254]; lib_name[0] = ':'; char libs_list[8192]; if (get_mapped_file_paths_in_proc_pid_maps(pid, libs_list, sizeof(libs_list), &filter_proc_maps_entry_read_exec)) return -1; const pptrace_internal_library* current_lib = binary->first; for (; current_lib != NULL; current_lib = current_lib->next) { while (true) { /* for libPatate.so, get ":libPatate.so:" in lib_name */ char * dest = &lib_name[1]; // skip the first ':' for (char const* src_name = current_lib->library; *src_name != '\0'; ++src_name, ++dest) *dest = *src_name; dest[0] = ':'; dest[1] = '\0'; /* Search for ":libPatate.so:" in libs_list */ char const* loaded_lib = strstr(libs_list, lib_name); if (loaded_lib != NULL) break; /* If ":libPatate.so:" is not found, wait for a mmap and reload /proc/self/maps */ word_uint baseaddr = 0; trace_wait_syscall(pid, &baseaddr, MMAP_SYSCALLS, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_INT, (word_uint)(PROT_READ | PROT_EXEC), SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_IGNORE, // TODO ignore les ignore ? SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_END); // TODO can fail : if (baseaddr == 0 || r < 0) return -1 ? if (get_mapped_file_paths_in_proc_pid_maps(pid, libs_list, sizeof(libs_list), &filter_proc_maps_entry_read_exec)) return -1; } } return 0; } static int get_libraries_addresses(pid_t pid, pptrace_internal_binary* binary) { int res = 0; struct Maps_entry* maps_entries = NULL; int const maps_entries_count = get_entries_in_proc_pid_maps(pid, &maps_entries, &filter_proc_maps_entry_read_exec); if (maps_entries_count < 0) { res = -1; goto exit; } pptrace_internal_library* current_lib = binary->first; for (; current_lib != NULL; current_lib = current_lib->next) { for (int i = 0; i < maps_entries_count; ++i) { if (strcmp(current_lib->library, maps_entries[i].file) == 0) { current_lib->baseaddr = (zzt_word)maps_entries[i].stack_base_addr - maps_entries[i].offset; pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "%s (%s) is located at %p\n", current_lib->library, maps_entries[i].permissions, current_lib->baseaddr); continue; } } if (current_lib->baseaddr == 0) { res = -1; goto exit; } } exit: free(maps_entries); return res; } /* Install all the detected hijacks into the child process. * Return the number of symbols that were successfully installed * or -1 if an error occured. */ static int pptrace_install_hijacks(pid_t child MAYBE_UNUSED, const pptrace_internal_binary* binary MAYBE_UNUSED) { int nb_installed = 0; int i; pptrace_internal_library* lib; #if DEBUG char cmd[4096]; sprintf(cmd, "cat /proc/%d/maps", child); system(cmd); #endif /* Wait for the application start. In _eztrace_init (cf eztrace_core.c), a SIGUSR2 signal is sent * so that we synchronize the two processes. */ trace_wait_signal(child, SIGUSR2); for (lib = binary->first; lib != NULL; lib = lib->next) { if (lib->hijacks) { for (i = 0; lib->hijacks[i] != NULL; i++) { if (lib->hijacks[i]->funSym != NULL && lib->hijacks[i]->funSym->symbol_offset) { if (lib->hijacks[i]->funSym->flags & ZZT_FLAG_DYNAMIC) { /* the symbol is in a relocated binary (ie. compiled with * -fPIE. We need to shift the base address. */ lib->hijacks[i]->funSym->section_addr = lib->hijacks[i]->funSym->section_addr + binary->baseaddr; lib->hijacks[i]->origSym->section_addr += lib->baseaddr; lib->hijacks[i]->replSym->section_addr += lib->baseaddr; } // Replacing symbol only when the symbol is not in a dynamic library if (hijack(binary->binary, child, lib->hijacks[i]->funSym, lib->hijacks[i]->origSym, lib->hijacks[i]->replSym) < 0) { fprintf(stderr, "Failed to install hijack of symbol %s\n", lib->hijacks[i]->function); } else { nb_installed++; pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Function %s instrumented.\n", lib->hijacks[i]->function); } } } } } return nb_installed; } #endif int pptrace_run(void* bin, char** argv, char** envp) { pptrace_clear_error(); pptrace_internal_binary* binary = (pptrace_internal_binary*)bin; if (binary == NULL) { pptrace_error("Invalid argument"); goto early_error_occured; } #ifdef ENABLE_BINARY_INSTRUMENTATION trace_set_bits(get_binary_bits(binary->binary)); #endif /* Running binary */ pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Running binary %s... ", binary->name); pid_t child = pptrace_launch_preload(binary->name, argv, envp, binary->first, (binary->debugger != NULL) ? 1 : 0); if (child <= 0) { pptrace_error("Failed to run binary %s", binary->name); goto early_error_occured; } pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "ok (pid = %d)\n", child); /* Getting the binary base address */ pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Getting the binary base address\n"); if (pptrace_get_base_address(child, binary)) { pptrace_error("Failed to get the base address of the binary, exiting after detaching child process..."); goto error_occured; } #ifdef ENABLE_BINARY_INSTRUMENTATION /* Waiting all the library where loaded */ if (wait_for_libraries(child, binary)) { pptrace_error( "Failed to wait all libraries where loaded"); goto error_occured; } /* Getting libraries addresses */ pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Getting libraries' addresses\n"); if (get_libraries_addresses(child, binary)) { pptrace_error( "Failed to get libraries addresses"); goto error_occured; } /* Installing hijacks */ pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Installing hijacks\n"); if (pptrace_install_hijacks(child, binary) < 0) { pptrace_error( "Failed to install hijacks, exiting after detaching child process..."); goto error_occured; } #endif /* if a debugger is present, give the control to the debugger */ if (binary->debugger != NULL) { pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Giving the control to the debugger %s\n", binary->debugger[0]); char pid[10]; snprintf(pid, 9, "%d", child); for (int i = 0; binary->debugger[i] != NULL; i++) { if (strcmp(binary->debugger[i], "{pid}") == 0) binary->debugger[i] = pid; else if (strcmp(binary->debugger[i], "{name}") == 0) binary->debugger[i] = binary->name; } char* debugger = get_program_path(binary->debugger[0]); if (debugger == NULL){ pptrace_fubar("debugger %s was not found!", binary->debugger[0]); // calls exit(-1) } trace_detach(child); execve(debugger, binary->debugger, envp); pptrace_fubar("failed to launch debugger!"); // calls exit(-1) } /* if no debugger, free the binary, detach and wait the end of the process */ pptrace_free_binary(binary); pptrace_debug(PPTRACE_DEBUG_LEVEL_INFO, "Detaching and waiting the end of the process\n"); trace_detach(child); trace_wait(child); return 0; /* Error management */ error_occured: trace_detach(child); early_error_occured: pptrace_free_binary(binary); return -1; } eztrace-2.1/src/instrumentation/proc_maps.c000066400000000000000000000165301447213526500212100ustar00rootroot00000000000000#include "proc_maps.h" /* #include "include/eztrace-instrumentation/errors.h" */ #include #include #include #include #include #include #include /************************************************************/ /* static void reset_maps_entry(struct Maps_entry* out) { out->fields_count = 0; out->stack_end_addr = NULL; out->stack_end_addr = NULL; out->permissions[0] = '\0'; out->offset = 0; out->device1 = 0; out->device2 = 0; out->inode = 0; out->file[0] = '\0'; } */ /************************************************************/ bool maps_entry_filter_all(struct Maps_entry const* map_entry MAYBE_UNUSED) { return true; } /************************************************************/ bool maps_entry_filter_permissions(struct Maps_entry const* maps_entry, char const* permissions) { assert(permissions != NULL); assert(maps_entry != NULL); assert(maps_entry->fields_count >= 3); // check permission are presents for (; *permissions != '\0'; ++permissions) { if (strchr(maps_entry->permissions, *permissions) == NULL) return false; } return true; } /************************************************************/ static int read_fields_in_maps_line(struct Maps_entry * out, char const* buffer) { int fields_count = sscanf(buffer, "%p-%p %s %x %x:%x %d %s", &out->stack_base_addr, &out->stack_end_addr, (char*)&out->permissions, &out->offset, &out->device1, &out->device2, &out->inode, (char*)&out->file); out->fields_count = fields_count; return fields_count; } /************************************************************/ // Warning : this function doesn't allocate, the returned pointer point in maps_entry->file ! static char const* maps_entry_base_name(struct Maps_entry const* maps_entry) { char const* res = NULL; for (char const* it = maps_entry->file; *it != '\0'; ++it) if (*it == '/') res = it + 1; return res; } /************************************************************/ static char const* maps_entry_return_complete_string(struct Maps_entry const* maps_entry) { return maps_entry->file; } /************************************************************/ typedef char const* (*get_file_name_func_t)(struct Maps_entry const* maps_entry); static int generic_mapped_names_in_proc_maps(char const* name, char* out, int out_size, Maps_entry_filter_func filter, get_file_name_func_t get_file_name_func) { assert(out != NULL); assert(out_size > 3); int res = 0; char buffer[4096]; struct Maps_entry maps_entry; sprintf(buffer, "/proc/%s/maps", name); FILE * maps_file = fopen(buffer, "r"); assert(maps_file != NULL); // if there is only space for the '\0' char, exit failure #define WRITE_CHAR(c) \ if (--out_size == 1) { res = -1; goto exit; } \ else { *out = c; ++out; } while (fgets(buffer, sizeof(buffer), maps_file)) { int const fields_count = read_fields_in_maps_line(&maps_entry, buffer); if (fields_count == 8 && (*filter)(&maps_entry)) { char const * file_name = (*get_file_name_func)(&maps_entry); if (file_name != NULL) { WRITE_CHAR(':') for (; *file_name != '\0'; ++file_name) WRITE_CHAR(*file_name) } } } #undef WRITE_CHAR exit: out[0] = ':'; out[1] = '\0'; fclose(maps_file); return res; } /************************************************************/ static int generic_get_entries_in_proc_maps(char const* name, struct Maps_entry** maps_entries, Maps_entry_filter_func filter) { assert(name != NULL); assert(maps_entries != NULL); assert(*maps_entries == NULL); assert(filter != NULL); static const int min_fields_count = 7; int line_count = 0; char buffer[4096]; sprintf(buffer, "/proc/%s/maps", name); FILE * maps_file = fopen(buffer, "r"); assert(maps_file != NULL); /* count the number of lines */ while (fgets(buffer, sizeof(buffer), maps_file)) { struct Maps_entry maps_entry_buffer; int const fields_count = read_fields_in_maps_line(&maps_entry_buffer, buffer); if (fields_count >= min_fields_count && (*filter)(&maps_entry_buffer)) ++line_count; } /* back to the begining of the file */ rewind(maps_file); /* allocate memory for result */ *maps_entries = malloc(line_count * sizeof(struct Maps_entry)); if (*maps_entries == NULL) { line_count = -1; goto exit; } /* parse each buffer */ int current_line_number = 0; while (fgets(buffer, sizeof(buffer), maps_file)) { int const fields_count = read_fields_in_maps_line(&(*maps_entries)[current_line_number], buffer); if (fields_count >= min_fields_count && (*filter)(&((*maps_entries)[current_line_number]))) ++current_line_number; } assert(current_line_number == line_count); exit: fclose(maps_file); return line_count; } /************************************************************/ int get_mapped_file_names_in_proc_pid_maps(pid_t pid, char* out, int out_size, Maps_entry_filter_func filter) { char spid[10]; sprintf(spid, "%d", pid); return generic_mapped_names_in_proc_maps(spid, out, out_size, filter, &maps_entry_base_name); } /************************************************************/ int get_mapped_file_names_in_proc_name_maps(char const* name, char* out, int out_size, Maps_entry_filter_func filter) { return generic_mapped_names_in_proc_maps(name, out, out_size, filter, &maps_entry_base_name); } /************************************************************/ int get_mapped_file_paths_in_proc_pid_maps(pid_t pid, char* out, int out_size, Maps_entry_filter_func filter) { char spid[10]; sprintf(spid, "%d", pid); return generic_mapped_names_in_proc_maps(spid, out, out_size, filter, &maps_entry_return_complete_string); } /************************************************************/ int get_mapped_file_paths_in_proc_name_maps(char const* name, char* out, int out_size, Maps_entry_filter_func filter) { return generic_mapped_names_in_proc_maps(name, out, out_size, filter, &maps_entry_return_complete_string); } /************************************************************/ int get_entries_in_proc_pid_maps(pid_t pid, struct Maps_entry** maps_entries, Maps_entry_filter_func filter) { char spid[10]; sprintf(spid, "%d", pid); return generic_get_entries_in_proc_maps(spid, maps_entries, filter); } /************************************************************/ int get_entries_in_proc_name_maps(char const* name, struct Maps_entry** maps_entries, Maps_entry_filter_func filter) { return generic_get_entries_in_proc_maps(name, maps_entries, filter); } eztrace-2.1/src/instrumentation/proc_maps.h000066400000000000000000000114321447213526500212110ustar00rootroot00000000000000#ifndef PROC_MAPS_H_ #define PROC_MAPS_H_ #include #include #include /** * This struct can contain all the fields extracted from an entry in a /proc/.../maps file */ struct Maps_entry { int fields_count; void* stack_base_addr; void* stack_end_addr; char permissions[10]; unsigned offset; unsigned device1; unsigned device2; int inode; char file[4096]; }; /** * Maps_entry_filter_func is a typedef on pointers on functions used to specify if a maps entry must be listed by the proc_maps.h functions */ typedef bool (*Maps_entry_filter_func)(struct Maps_entry const*); bool maps_entry_filter_all(struct Maps_entry const* maps_entry); bool maps_entry_filter_permissions(struct Maps_entry const* map_entry, char const* permissions); /** * List all the mapped files in /proc/pid/maps under the form ":file1:file2:file3:" where "pid" is given by parameter * @param pid: the pid of the process to study * @param out: output buffer. Its original content is destroy and always replaced by a valid string, even if the function fails * @param out_size: output buffer size * @param filter: list of the permission needed ("w" implies write, "rx" implies read and exec, etc...) * @return 0 if successed, -1 if failed */ NODISCARD int get_mapped_file_names_in_proc_pid_maps(pid_t pid, char* out, int out_size, Maps_entry_filter_func filter); /** * List all the mapped files in /proc/name/maps under the form ":file1:file2:file3:" where "name" is given by parameter * @param name: name of the process to study * @param out: output buffer. Its original content is destroy and always replaced by a valid string, even if the function fails * @param out_size: output buffer size * @param filter: list of the permission needed ("w" implies write, "rx" implies read and exec, etc...) * @return 0 if successed, -1 if failed */ NODISCARD int get_mapped_file_names_in_proc_name_maps(char const* name, char* out, int out_size, Maps_entry_filter_func filter); /** * List all the mapped files in /proc/pid/maps under the form ":/path/to/file1:/path/to/file2:" where pid is given by parameter * @param pid: the pid of the process to study * @param out: output buffer. Its original content is destroy and always replaced by a valid string, even if the function fails * @param out_size: output buffer size * @param filter: list of the permission needed ("w" implies write, "rx" implies read and exec, etc...) * @return 0 if successed, -1 if failed */ NODISCARD int get_mapped_file_paths_in_proc_pid_maps(pid_t pid, char* out, int out_size, Maps_entry_filter_func filter); /** * List all the mapped files in /proc/name/maps under the form ":/path/to/file1:/path/to/file2:" where name is given by parameter * @param name: name of the process to study * @param out: output buffer. Its original content is destroy and always replaced by a valid string, even if the function fails * @param out_size: output buffer size * @param filter: list of the permission needed ("w" implies write, "rx" implies read and exec, etc...) * @return 0 if successed, -1 if failed */ NODISCARD int get_mapped_file_paths_in_proc_name_maps(char const* name, char* out, int out_size, Maps_entry_filter_func filter); /** * Parse /proc/pid/maps and return all entries in a array of _struct_entry where pid is given by parameter * @param pid: The pid of the process to study * @param maps_entries: The address of a pointer on _struct_entry. The pointer must be NULL and will be set to a newly allocated array of Maps_entry containing the result of the function. The pointer will stay at NULL if the function fails. * @param filter: a pointer on a function filter * @return The size of the out array, or -1 if the function failed */ NODISCARD int get_entries_in_proc_pid_maps(pid_t pid, struct Maps_entry** maps_entries, Maps_entry_filter_func filter); /** * Parse /proc/name/maps and return all entries in a array of _struct_entry where name is given by parameter * @param name: the name of the process to study * @param maps_entries: The address of a pointer on _struct_entry. The pointer must be NULL and will be set to a newly allocated array of Maps_entry containing the result of the function. The pointer will stay at NULL if the function fails. * @param filter: a pointer on a function filter * @return The size of the out array, or -1 if the function failed */ NODISCARD int get_entries_in_proc_name_maps(char const* name, struct Maps_entry** maps_entries, Maps_entry_filter_func filter); #endif // PROC_MAPS_H_ eztrace-2.1/src/instrumentation/tracing.c000066400000000000000000000656751447213526500206720ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * linux.c * * Implementation of the tracing interface using the linux _ptrace system call * * Created on: 2 juil. 2011 * Author: Damien Martin-Guillerez */ #include "eztrace-instrumentation/tracing.h" #include "binary.h" #include "eztrace-core/eztrace_config.h" #include "eztrace-instrumentation/errors.h" #include "eztrace-instrumentation/linux.h" #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __PPTRACE_USE_PRCTL #include #endif // __PPTRACE_USE_PRCTL #define _ptrace(req, pid, addr, data) _ptrace_(req, pid, addr, data, __FILE__, __LINE__) static inline long _ptrace_(enum __ptrace_request request, pid_t pid, void* addr, void* data, const char* file, int line); #if ENABLE_BINARY_INSTRUMENTATION #define CONTSIGNAL NULL static int ptrace_bits = __WORDSIZE; // Size of a word in the traced process #ifndef MAP_32BIT #define MAP_32BIT 0 #endif #if __x86_64__ // x86_64 #if __WORDSIZE == 64 // Registers name #define _REG_IP rip #define _REG_AX rax #define _REG_ORIG_AX orig_rax #define _REG_BX rbx #define _REG_CX rcx #define _REG_DX rdx #define _REG_SI rsi #define _REG_DI rdi #define _REG_BP rbp #define _REG_R10 r10 #define _REG_R8 r8 #define _REG_R9 r9 #define _REG_FORMAT "rip=0x%016lx rax=0x%016lx orig_rax=0x%016lx rbx=0x%016lx rcx=0x%016lx rdx=0x%016lx rsi=0x%016lx rdi=0x%016lx rbp=0x%016lx r10=0x%016lx r8=0x%016lx r9=0x%016lx" #define _REG_FORMAT_VALUES(regs) regs.rip, regs.rax, regs.orig_rax, regs.rbx, regs.rcx, regs.rdx, regs.rsi, regs.rdi, regs.rbp, regs.r10, regs.r8, regs.r9 // Debugging #define FORMAT_WORD_HEX "%02lx %02lx %02lx %02lx %02lx %02lx %02lx %02lx" #define FORMAT_WORD_POINTER "0x%016lx" #define ARG_FORMAT_WORD(data) (data) & 0xff, (data >> 8) & 0xff, (data >> 16) & 0xff, (data >> 24) & 0xff, (data >> 32) & 0xff, \ (data >> 40) & 0xff, (data >> 48) & 0xff, (data >> 56) & 0xff #else // if __WORDSIZE != 64 // Register names #define _REG_IP eip #define _REG_AX eax #define _REG_ORIG_AX orig_eax #define _REG_BX ebx #define _REG_CX ecx #define _REG_DX edx #define _REG_SI esi #define _REG_DI edi #define _REG_BP ebp #define _REG_R10 edi // dummy, doesn't exist in 32bits #define _REG_R8 esi // dummy, doesn't exist in 32bits #define _REG_R9 ebp // dummy, doesn't exist in 32bits #define _REG_FORMAT "eip=0x%08lx eax=0x%08lx orig_eax=0x%08lx ebx=0x%08lx ecx=0x%08lx edx=0x%08lx esi=0x%08lx edi=0x%08lx ebp=0x%08lx" #define _REG_FORMAT_VALUES(regs) regs.eip, regs.eax, regs.orig_eax, regs.ebx, regs.ecx, regs.edx, regs.esi, regs.edi, regs.ebp // Debugging #define FORMAT_WORD_HEX "%02lx %02lx %02lx %02lx" #define FORMAT_WORD_POINTER "0x%08lx" #define ARG_FORMAT_WORD(data) (data) & 0xff, (data >> 8) & 0xff, (data >> 16) & 0xff, (data >> 24) & 0xff #endif // __WORDSIZE == 64 #elif __arm__ // ARMv7 // Register names #define _REG_R0 ARM_r0 #define _REG_R1 ARM_r1 #define _REG_R2 ARM_r2 #define _REG_R3 ARM_r3 #define _REG_R4 ARM_r4 #define _REG_R5 ARM_r5 #define _REG_R6 ARM_r6 #define _REG_R7 ARM_r7 #define _REG_R8 ARM_r8 #define _REG_SP ARM_sp #define _REG_FP ARM_fp #define _REG_PC ARM_pc #define _REG_FORMAT "ARM_r0=0x%08lx ARM_r1=0x%08lx ARM_r2=0x%08lx ARM_r3=0x%08lx ARM_r4=0x%08lx ARM_r5=0x%08lx ARM_r6=0x%08lx ARM_r7=0x%08lx ARM_r8=0x%08lx ARM_r9=0x%08lx ARM_sp=0x%08lx ARM_fp=0x%08lx ARM_pc=0x%08lx" #define _REG_FORMAT_VALUES(regs) regs.ARM_r0, regs.ARM_r1, regs.ARM_r2, regs.ARM_r3, regs.ARM_r4, regs.ARM_r5, regs.ARM_r6, regs.ARM_r7, regs.ARM_r8, regs.ARM_sp, regs.ARM_fp, regs.ARM_pc // Debugging #define FORMAT_WORD_HEX "%02lx %02lx %02lx %02lx" #define FORMAT_WORD_POINTER "0x%08lx" #define ARG_FORMAT_WORD(data) (data) & 0xff, (data >> 8) & 0xff, (data >> 16) & 0xff, (data >> 24) & 0xff #endif // __arm__ void trace_set_bits(int bits) { ptrace_bits = bits; } int trace_get_bits() { return ptrace_bits; } word_uint get_ip(pid_t child) { REG_STRUCT regs; _ptrace(PTRACE_GETREGS, child, NULL, ®s); #if __arm__ // ARMv7 return regs._REG_PC; #elif __x86_64__ // x86_64 return regs._REG_IP; #endif } void set_ip(pid_t child, word_uint rip) { REG_STRUCT regs; _ptrace(PTRACE_GETREGS, child, NULL, ®s); #if __arm__ // ARMv7 regs._REG_PC = rip; #elif __x86_64__ // x86_64 regs._REG_IP = rip; #endif _ptrace(PTRACE_SETREGS, child, NULL, ®s); } void trace_get_regs(pid_t child, REG_STRUCT* regs) { _ptrace(PTRACE_GETREGS, child, NULL, regs); } void trace_set_regs(pid_t child, REG_STRUCT* regs) { _ptrace(PTRACE_SETREGS, child, NULL, regs); } uint8_t trace_replace(pid_t child, word_uint addr, uint8_t newbyte) { int wordsize = ptrace_bits / 8; word_uint addrmask = ~((word_uint)(wordsize - 1)); int shift = (8 * (addr % wordsize)); word_uint data64 = 0; word_uint addr64 = addr & addrmask; /* todo: does it work on 32-bit systems (eg. ARM) ? */ word_uint mask = ~(((word_uint)0xff) << shift); word_uint newvalue = newbyte; word_uint oldvalue = 0; newvalue <<= shift; data64 = _ptrace(PTRACE_PEEKTEXT, child, (void*)addr64, NULL); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Replacing [" FORMAT_WORD_HEX "] from address " FORMAT_WORD_POINTER " by ", ARG_FORMAT_WORD(data64), addr64); oldvalue = data64 >> shift; oldvalue &= 0xff; data64 = (data64 & mask) | newvalue; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "[" FORMAT_WORD_HEX "]\n", ARG_FORMAT_WORD(data64)); _ptrace(PTRACE_POKETEXT, child, (void*)addr64, (void*)data64); return (uint8_t)oldvalue; } void trace_read(pid_t child, word_uint fromaddr, uint8_t* buffer, size_t length) { word_uint data; word_uint curAddr; unsigned word_size = sizeof(word_uint); for (curAddr = 0; curAddr < length; curAddr += word_size) { data = _ptrace(PTRACE_PEEKTEXT, child, (void*)(curAddr + fromaddr), NULL); memcpy(buffer + curAddr, (void*)(&data), curAddr + word_size < length ? word_size : (length - curAddr)); } } void trace_copy(pid_t child, word_uint fromaddr, word_uint toaddr, size_t length) { word_uint data; word_uint curAddr; int extraBytes = length % sizeof(word_uint); pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Copying buffer of %ld bytes from address " FORMAT_WORD_POINTER " to address " FORMAT_WORD_POINTER "\n", length, fromaddr, toaddr); for (curAddr = 0; curAddr < length - extraBytes; curAddr += sizeof(word_uint)) { data = _ptrace(PTRACE_PEEKTEXT, child, (void*)(curAddr + fromaddr), NULL); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Copying word [" FORMAT_WORD_HEX "] from address " FORMAT_WORD_POINTER " to address " FORMAT_WORD_POINTER "\n", ARG_FORMAT_WORD(data), curAddr + fromaddr, curAddr + toaddr); _ptrace(PTRACE_POKETEXT, child, (void*)(curAddr + toaddr), (void*)data); } if (extraBytes > 0) { extraBytes <<= 3; // in bits word_uint mask = ((1L << (extraBytes)) - 1); data = _ptrace(PTRACE_PEEKTEXT, child, (void*)(curAddr + fromaddr), NULL); data &= mask; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Copying %d extra bytes (word [" FORMAT_WORD_HEX "] from address " FORMAT_WORD_POINTER " to address " FORMAT_WORD_POINTER ")\n", extraBytes >> 3, ARG_FORMAT_WORD(data), curAddr + fromaddr, curAddr + toaddr); word_uint destData = _ptrace(PTRACE_PEEKTEXT, child, (void*)(curAddr + toaddr), NULL); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Replacing [" FORMAT_WORD_HEX "] by ", ARG_FORMAT_WORD(destData)); destData &= ~(mask); destData |= data; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "[" FORMAT_WORD_HEX "]\n", ARG_FORMAT_WORD(destData)); _ptrace(PTRACE_POKETEXT, child, (void*)(curAddr + toaddr), (void*)destData); } } int trace_singlestep(pid_t child) { int status = 0; _ptrace(PTRACE_SINGLESTEP, child, NULL, NULL); waitpid(child, &status, 0); return status; } int trace_syscall(pid_t child) { int status = 0; _ptrace(PTRACE_SYSCALL, child, NULL, NULL); waitpid(child, &status, 0); return status; } int trace_continue(pid_t child) { int status = 0; _ptrace(PTRACE_CONT, child, NULL, NULL); waitpid(child, &status, 0); return status; } void trace_write(pid_t child, word_uint addr, uint8_t* buffer, size_t length) { word_uint data; word_uint curAddr; int extraBytes = length % sizeof(word_uint); pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Inserting buffer of %ld bytes at address " FORMAT_WORD_POINTER "\n", length, addr); for (curAddr = 0; curAddr < length - extraBytes; curAddr += sizeof(word_uint)) { memcpy((void*)(&data), (void*)(buffer + curAddr), sizeof(word_uint)); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Inserting word [" FORMAT_WORD_HEX "] at address " FORMAT_WORD_POINTER "\n", ARG_FORMAT_WORD(data), curAddr + addr); _ptrace(PTRACE_POKETEXT, child, (void*)(curAddr + addr), (void*)data); } if (extraBytes > 0) { data = 0; memcpy((void*)(&data), (void*)(buffer + curAddr), extraBytes); extraBytes <<= 3; // This is not needed, stupid endianness // data >>= (64 - extraBytes); word_uint mask = ((1L << (extraBytes)) - 1); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Inserting %d extra bytes (word [" FORMAT_WORD_HEX "] at address " FORMAT_WORD_POINTER ")\n", extraBytes >> 3, ARG_FORMAT_WORD(data), curAddr + addr); data &= mask; word_uint destData = _ptrace(PTRACE_PEEKTEXT, child, (void*)(curAddr + addr), NULL); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Replacing [" FORMAT_WORD_HEX "] by ", ARG_FORMAT_WORD(destData)); destData &= ~(mask); destData |= data; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "[" FORMAT_WORD_HEX "]\n", ARG_FORMAT_WORD(destData)); _ptrace(PTRACE_POKETEXT, child, (void*)(curAddr + addr), (void*)destData); } } /* push a value on the stack. * return the value that is overwritten */ static word_uint do_push(pid_t child __attribute__((unused)), word_uint* sp __attribute__((unused)), word_uint value __attribute__((unused))) { #if __arm__ // ARMv7 word_uint ret = -1; trace_read(child, *sp, (uint8_t*)&ret, sizeof(word_uint)); trace_write(child, *sp, (uint8_t*)&value, sizeof(word_uint)); *sp = *(uint8_t*)sp - sizeof(word_uint); return ret; #else /* TODO */ fprintf(stderr, "do_push not implemented on this architecture\n"); abort(); #endif } /* Undo a push: pop a value from the stack and replace it by the value that * has been overwritten by do_push * returns the popped value */ static word_uint do_pop(pid_t child __attribute__((unused)), word_uint* sp __attribute__((unused)), word_uint prev_value __attribute__((unused))) { #if __arm__ // ARMv7 word_uint ret; *sp = *(uint8_t*)sp + sizeof(word_uint); trace_read(child, *sp, (uint8_t*)&ret, sizeof(word_uint)); trace_write(child, *sp, (uint8_t*)&prev_value, sizeof(word_uint)); return ret; #else /* TODO */ fprintf(stderr, "do_pop not implemented on this architecture\n"); abort(); #endif } /* return value of a function/syscall */ static word_uint get_retval(REG_STRUCT regs) { #if __arm__ // ARMv7 return regs._REG_R0; #elif __x86_64__ // x86_64 return regs._REG_AX; #endif } /* print value stored in a register */ void print_reg_value(pid_t child, word_uint addr) { word_uint data = 0; data = _ptrace(PTRACE_PEEKTEXT, child, (void*)addr, NULL); printf("[" FORMAT_WORD_HEX "] from address " FORMAT_WORD_POINTER "\n", ARG_FORMAT_WORD(data), addr); } static char* trace_get_zstring(pid_t child, word_uint addr) { unsigned int size = 1024; unsigned int index = 0; if (addr == 0) return NULL; uint8_t* buf = (uint8_t*)malloc(size); do { if (index >= size) { size += 1024; buf = (uint8_t*)realloc(buf, size); } trace_read(child, addr + index, buf + index, 1); index++; } while (buf[index - 1]); return (char*)buf; } static int syscall_match_arg(pid_t child, int type, va_list* args, word_uint reg) { word_uint value; char* ptr; char** ptr2; char* buf; int r; switch (type) { case SYSCALL_ARGTYPE_INT: value = va_arg(*args, word_uint); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " %ld == %ld?", reg, value); return (value == reg) ? 1 : 0; case SYSCALL_ARGTYPE_ZSTRING: ptr = va_arg(*args, char*); if (ptr == NULL) { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " NULL == %p?", (void*)reg); return reg == 0 ? 1 : 0; } buf = trace_get_zstring(child, reg); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " \"%s\" (%p) == \"%s\"?", buf, (void*)reg, ptr); r = strcmp(ptr, buf); free(buf); return r == 0 ? 1 : 0; case SYSCALL_ARGTYPE_ZSTRING_RETURN: buf = trace_get_zstring(child, reg); ptr2 = va_arg(*args, char**); if (ptr2 == NULL) { *ptr2 = NULL; pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " got NULL for getting zstring..."); } else { *ptr2 = trace_get_zstring(child, reg); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " returning string %s...", *ptr2); } return 1; case SYSCALL_ARGTYPE_IGNORE: default: pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " Ignoring %lx!", reg); return 1; } } static int syscall_match_args(pid_t child, int syscall, va_list* args, REG_STRUCT regs) { int type; #define _sma_TEST_ARG(child, type, args, arg) \ do { \ type = va_arg(*args, int); \ if (type == SYSCALL_ARGTYPE_END) \ return 1; \ if (syscall_match_arg(child, type, args, arg) == 0) \ return 0; \ } while (0) // 64bits args: rdi,rsi,rdx,r10,r8,r9 // 32bits args: rbx,rcx,rdx,rsi,rdi,rbp // armv7 args: r0, r1, r2, r3, sp+12, sp+16 if (ptrace_bits == 32) { #if __arm__ // ARMv7 uint32_t buf[2]; trace_read(child, regs._REG_SP + (3 * sizeof(uint32_t)), (uint8_t*)buf, 2 * 4); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\tFound old_mmap call and reading memory from sp:\n"); pptrace_dump_buffer(PPTRACE_DEBUG_LEVEL_ALL, (uint8_t*)buf, 2 * 4); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\nArgument check: "); _sma_TEST_ARG(child, type, args, regs._REG_R0); _sma_TEST_ARG(child, type, args, regs._REG_R1); _sma_TEST_ARG(child, type, args, regs._REG_R2); _sma_TEST_ARG(child, type, args, regs._REG_R3); _sma_TEST_ARG(child, type, args, buf[0]); _sma_TEST_ARG(child, type, args, buf[1]); #elif __x86_64__ // x86_64 if (syscall == TRACE_SYSCALL(mmap)) { uint32_t buf[6]; trace_read(child, regs._REG_BX, (uint8_t*)buf, 24); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\tFound old_mmap call and reading memory from ebx:\n"); pptrace_dump_buffer(PPTRACE_DEBUG_LEVEL_ALL, (char*)buf, 24); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "\nArgument check: "); _sma_TEST_ARG(child, type, args, buf[0]); _sma_TEST_ARG(child, type, args, buf[1]); _sma_TEST_ARG(child, type, args, buf[2]); _sma_TEST_ARG(child, type, args, buf[3]); _sma_TEST_ARG(child, type, args, buf[4]); _sma_TEST_ARG(child, type, args, buf[5]); } else { _sma_TEST_ARG(child, type, args, regs._REG_BX); _sma_TEST_ARG(child, type, args, regs._REG_CX); _sma_TEST_ARG(child, type, args, regs._REG_DX); _sma_TEST_ARG(child, type, args, regs._REG_SI); _sma_TEST_ARG(child, type, args, regs._REG_DI); _sma_TEST_ARG(child, type, args, regs._REG_BP); } } else { _sma_TEST_ARG(child, type, args, regs._REG_DI); _sma_TEST_ARG(child, type, args, regs._REG_SI); _sma_TEST_ARG(child, type, args, regs._REG_DX); _sma_TEST_ARG(child, type, args, regs._REG_R10); _sma_TEST_ARG(child, type, args, regs._REG_R8); _sma_TEST_ARG(child, type, args, regs._REG_R9); #endif } return 1; } #if __WORDSIZE == 32 #define SYSCALLS_FORMAT "%u,%u" #define SYSCALLS_PRINT_ARGS(syscalls) (syscalls & 0xffff), ((syscalls >> 16) & 0xffff) #define TEST_SYSCALL(syscalls, syscall) (((syscall != 0) || (syscall == syscalls)) && (((syscalls & 0xffff) == syscall) || (((syscalls >> 16) & 0xffff) == syscall))) #else #define SYSCALLS_FORMAT "%u,%u,%u,%u" #define SYSCALLS_PRINT_ARGS(syscalls) (syscalls & 0xffff), ((syscalls >> 16) & 0xffff), ((syscalls >> 32) & 0xffff), ((syscalls >> 48) & 0xffff) #define TEST_SYSCALL(syscalls, syscall) (((syscall != 0) || (syscall == syscalls)) && (((syscalls & 0xffff) == syscall) || (((syscalls >> 16) & 0xffff) == syscall) || (((syscalls >> 32) & 0xffff) == syscall) || (((syscalls >> 48) & 0xffff) == syscall))) #endif int trace_wait_syscall(pid_t child, word_uint* retval, unsigned long syscall, ...) { // Wait for syscall and return the return value of the first encountered int status; REG_STRUCT regs; unsigned int in_syscall = 0; int in_execve = 0; va_list args; pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Looking for syscalls " SYSCALLS_FORMAT "\n", SYSCALLS_PRINT_ARGS(syscall)); for (status = trace_syscall(child); !WIFEXITED(status) && !WIFSIGNALED(status); status = trace_syscall(child)) { if (WIFSTOPPED(status)) { int signal = WSTOPSIG(status); if (signal == SIGTRAP) { _ptrace(PTRACE_GETREGS, child, NULL, ®s); if (!in_syscall) { #if __arm__ // ARMv7 in_syscall = regs._REG_R7; #elif __x86_64__ // x86_64 in_syscall = regs._REG_ORIG_AX; #endif pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Entering syscall %d\n", in_syscall); if (in_syscall == TRACE_SYSCALL(execve)) in_execve = 1; // execve generate 3 sigtraps: one at call, one at program loading and one at syscall return if (TEST_SYSCALL(syscall, in_syscall)) { pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Found syscall entry %d with registers " _REG_FORMAT "\n", in_syscall, _REG_FORMAT_VALUES(regs)); // We are in the good syscall but have we the good arguments? va_start(args, syscall); pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Checking arguments: "); if (!syscall_match_args(child, in_syscall, &args, regs)) { in_syscall = -in_syscall; // Arguments doesn't match pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " failed!\n"); } else { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, " ok\n"); } va_end(args); } } else if (in_execve) { pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "execve has stopped after loading the new program\n"); in_execve = 0; } else { // Exiting a syscall pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "Exiting syscall %d\n", in_syscall); if (TEST_SYSCALL(syscall, in_syscall)) { pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Found syscall %d with registers " _REG_FORMAT "\n", in_syscall, _REG_FORMAT_VALUES(regs)); if (retval != NULL) *retval = get_retval(regs); return 0; } in_syscall = 0; } } else if (signal == SIGSEGV || signal == SIGKILL || signal == SIGILL) { // Signal that terminates the process pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Syscalls " SYSCALLS_FORMAT " not found\n", SYSCALLS_PRINT_ARGS(syscall)); return -1; } else pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Stopped with unknown signal %d\n", signal); } else pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Waitpid returned with the process unstopped\n"); } pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Syscalls " SYSCALLS_FORMAT " not found\n", SYSCALLS_PRINT_ARGS(syscall)); return -1; } void trace_wait_signal(pid_t child, int signo) { // Wait for signal signo int status; pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Looking for signal %d\n", signo); for (status = trace_syscall(child); !WIFEXITED(status) && !WIFSIGNALED(status); status = trace_syscall(child)) { if (WIFSTOPPED(status)) { int signal = WSTOPSIG(status); if(signal == signo) { pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Stopped with expected signal %d\n", signal); return; } else { #if 0 pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "Stopped with unexpected signal %d\n", signal); #endif } } } pptrace_debug(PPTRACE_DEBUG_LEVEL_DEBUG, "signal %d not found\n", signo); } word_uint trace_mmap(pid_t child, word_uint addr, size_t length, int prot) { int i; // Save user registers REG_STRUCT regs; _ptrace(PTRACE_GETREGS, child, NULL, ®s); REG_STRUCT saved_regs; _ptrace(PTRACE_GETREGS, child, NULL, &saved_regs); #if __WORDSIZE == 64 if (ptrace_bits == 32) { #endif #if __arm__ // ARMv7 /* Linux syscall on 32-bits ARMv7 (svc #0 = 00 EF) number __NR_mmap (90) r7 = __NR_mmap r0 = arg1 => addr r1 = arg2 => length r2 = arg3 => prot r3 = arg4 => flags = MAP_ANONYMOUS | MAP_PRIVATE sp+12 = arg5 => fd = -1 sp+16 = arg6 => offset = 0 return r0 = return value = addr */ word_uint prev_val1 = -1; word_uint prev_val2 = -1; regs._REG_R7 = 192; // __NR_mmap2 32-bits regs._REG_R0 = addr; regs._REG_R1 = length; regs._REG_R2 = prot; regs._REG_R3 = MAP_ANONYMOUS | MAP_PRIVATE; // backup the values from sp prev_val1 = do_push(child, (word_uint*)&saved_regs._REG_SP, -1); prev_val2 = do_push(child, (word_uint*)&saved_regs._REG_SP, 0); #elif __x86_64__ // x86_64 /* Linux syscall on 32-bits (int 0x80 = CD 80) number __NR_mmap (90) eax = __NR_mmap ebx = arg1 => addr ecx = arg2 => length edx = arg3 => prot esi = arg4 => flags = MAP_ANONYMOUS | MAP_PRIVATE edi = arg5 => fd = -1 ebp = arg6 => offset = 0 return rax = return value = addr */ regs._REG_AX = 192; // __NR_mmap2 32-bits regs._REG_BX = addr; regs._REG_CX = length; regs._REG_DX = prot; regs._REG_SI = MAP_ANONYMOUS | MAP_PRIVATE; regs._REG_DI = -1; regs._REG_BP = 0; #endif #if __WORDSIZE == 64 } else { /* Linux syscall on 64-bits (syscall - 0f 05) number __NR_mmap (9) rax = __NR_mmap rdi = arg1 => addr rsi = arg2 => length rdx = arg3 => prot r10 = arg4 => flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT r8 = arg5 => fd = -1 r9 = arg6 => offset = 0 return rax = return value = addr */ regs._REG_AX = 9; // __NR_mmap 64-bits regs._REG_DI = addr; regs._REG_SI = length; regs._REG_DX = prot; regs._REG_R10 = MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT; regs._REG_R8 = -1; regs._REG_R9 = 0; } #endif // Pushing new user registers _ptrace(PTRACE_SETREGS, child, NULL, ®s); #if __arm__ // ARMv7 // Inserting svc #0 (00 00 00 ef) uint8_t opcode[] = {0x00, 0x00, 0x00, 0xef}; int size = 4; #elif __x86_64__ // x86_64 // Inserting syscall (0f 05) / int 0x80 (cd 80) uint8_t opcode[] = {0x0f, 0x05, 0xcd, 0x80}; int off = ptrace_bits == 32 ? 2 : 0; int size = 2; #endif for (i = 0; i < size; i++) #if __arm__ // ARMv7 opcode[i] = trace_replace(child, saved_regs._REG_PC + i, opcode[i]); #elif __x86_64__ // x86_64 opcode[i + off] = trace_replace(child, saved_regs._REG_IP + i, opcode[i + off]); #endif // Two step execution with PTRACE_SYSCALL to return _ptrace(PTRACE_SYSCALL, child, NULL, NULL); waitpid(child, NULL, 0); // The syscall was called _ptrace(PTRACE_SYSCALL, child, NULL, NULL); waitpid(child, NULL, 0); // The syscall has returned // Getting back the result from the syscall _ptrace(PTRACE_GETREGS, child, NULL, ®s); // Inserting back the original opcode for (i = 0; i < size; i++) #if __arm__ // ARMv7 opcode[i] = trace_replace(child, saved_regs._REG_PC + i, opcode[i]); #elif __x86_64__ // x86_64 opcode[i + off] = trace_replace(child, saved_regs._REG_IP + i, opcode[i + off]); #endif #if __arm__ /* restore the values that were overwritten by do_push */ do_pop(child, (word_uint*)&saved_regs._REG_SP, prev_val2); do_pop(child, (word_uint*)&saved_regs._REG_SP, prev_val1); #endif // Restoring registers _ptrace(PTRACE_SETREGS, child, NULL, &saved_regs); // Returning the result of the syscall return get_retval(regs); } #endif pid_t trace_run(const char* path, char** argv, char** envp, int debug) { int status; int fds[2]; pipe(fds); char plop; pid_t child = fork(); if (get_pptrace_debug_level() > PPTRACE_DEBUG_LEVEL_ALL) debug = 1; if ((debug == 0 && child != 0) || (debug && child == 0)) { #ifdef __PPTRACE_USE_PRCTL #ifdef PR_SET_PTRACER prctl(PR_SET_PTRACER, child, 0, 0, 0); #endif // PR_SET_PTRACER #endif // __PPTRACE_USE_PRCTL if (child == 0) _ptrace(PTRACE_TRACEME, 0, NULL, NULL); /* wait until the parent process is attached */ read(fds[0], &plop, sizeof(char)); close(fds[0]); if (path == NULL) { // No execution is asked (fork only) so return to the calling function kill(getpid(), SIGTRAP); // signal the parent to emulate execve call. return 0; } /* run the application */ pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "execve(%s, ...)\n", path); execve(path, argv, envp); pptrace_debug(PPTRACE_DEBUG_LEVEL_VERBOSE, "Execution of %s failed\n", path); exit(-1); } pid_t tpid = debug ? child : getppid(); if (debug == 0) _ptrace(PTRACE_ATTACH, tpid, NULL, NULL); /* notify the child process that we are attached */ plop = 'a'; write(fds[1], &plop, sizeof(char)); close(fds[1]); waitpid(tpid, &status, 0); while (!WIFEXITED(status) && (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGTRAP)) { _ptrace(PTRACE_CONT, tpid, NULL, NULL); waitpid(tpid, &status, 0); } pptrace_debug(PPTRACE_DEBUG_LEVEL_ALL, "execve(%s, ...) passed\n", path); if (WIFEXITED(status)) { pptrace_debug( PPTRACE_DEBUG_LEVEL_VERBOSE, "Process %d exited (probably due to execution of %s failed)\n", tpid, path); return -1; } return tpid; } void trace_detach(pid_t child) { _ptrace(PTRACE_DETACH, child, NULL, NULL); } void trace_wait(pid_t child) { int status = 0; do { waitpid(child, &status, 0); } while (!WIFEXITED(status) && !WIFSIGNALED(status)); } /* * A wrapper to test for errors * TODO: Correct error handling in that part of the code */ static inline long _ptrace_(enum __ptrace_request request, pid_t pid, void* addr, void* data, const char* file, int line) { errno = 0; long result = ptrace(request, pid, addr, data); if (errno && result == -1) { pptrace_fubar("at %s:%d: ptrace(%lu, %d, %p, %p): %s", file, line, (long)request, pid, addr, data, strerror(errno)); } return result; } eztrace-2.1/src/modules/000077500000000000000000000000001447213526500152615ustar00rootroot00000000000000eztrace-2.1/src/modules/CMakeLists.txt000066400000000000000000000016401447213526500200220ustar00rootroot00000000000000# Default modules if(EZTRACE_ENABLE_MEMORY) add_subdirectory(memory) endif() if(EZTRACE_ENABLE_POSIXIO) add_subdirectory(posixio) endif() if(EZTRACE_ENABLE_PTHREAD) add_subdirectory(pthread) endif() # Optional modules if (EZTRACE_ENABLE_MPI) add_subdirectory(mpi) endif () if (EZTRACE_ENABLE_OPENMP) add_subdirectory(omp) endif() if (EZTRACE_ENABLE_CUDA) add_subdirectory(cuda) endif () if (EZTRACE_ENABLE_STARPU) add_subdirectory(starpu) endif () if (EZTRACE_ENABLE_OMPT) add_subdirectory(ompt) endif() if(EZTRACE_ENABLE_IOTRACER) add_subdirectory(iotracer) endif() if(EZTRACE_ENABLE_PNETCDF) add_subdirectory(pnetcdf) endif() if(EZTRACE_ENABLE_NETCDF) add_subdirectory(netcdf) endif() if(EZTRACE_ENABLE_COMPILER_INSTRUMENTATION) add_subdirectory(compiler_instrumentation) endif() # Some modules have not been ported to OTF2 yet #if (EZTRACE_ENABLE_PAPI) # add_subdirectory(papi) #endif () eztrace-2.1/src/modules/compiler_instrumentation/000077500000000000000000000000001447213526500224165ustar00rootroot00000000000000eztrace-2.1/src/modules/compiler_instrumentation/CMakeLists.txt000066400000000000000000000012321447213526500251540ustar00rootroot00000000000000set(CMAKE_C_COMPILER ${MPICC}) add_library(eztrace-compiler_instrumentation SHARED compiler_instrumentation.c ) target_link_libraries(eztrace-compiler_instrumentation PUBLIC eztrace-core eztrace-lib eztrace-instrumentation ) target_include_directories(eztrace-compiler_instrumentation PUBLIC ${compiler_instrumentation_INCLUDE_DIRS} PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) #--------------------------------------------- install(TARGETS eztrace-compiler_instrumentation LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/compiler_instrumentation/compiler_instrumentation.c000066400000000000000000000156451447213526500277320ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif /* This plugin relies on compiler instrumentation * You can ask the compiler to instrument functions using -finstrument-functions (you may need to link with -rdynamic too) * In this case, the compiler calls __cyg_profile_func_enter/__cyg_profile_func_exit * at the entry/exit of instrumented functions. * * To control which functions should be traced, you can: * - specify to the compiler the functions to exclude (eg with -finstrument-functions-exclude-function-list=sym,sym,...) * - specify to EZTrace the functions to exclude with (eg set EZTRACE_EXCLUDE_LIST="sym1 sym2 ...") */ #include #include #include #include #include #include /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls to mutex_lock for example */ static volatile int _compiler_instrumentation_initialized = 0; #define CURRENT_MODULE compiler_instrumentation DECLARE_CURRENT_MODULE; static pthread_mutex_t instrumented_functions_lock = PTHREAD_MUTEX_INITIALIZER; static struct ezt_instrumented_function* instrumented_functions = NULL; static int nb_instrumented_functions = 0; static int nb_alloc_instrumented_functions = 0; static int function_in_exclude_list(const char* function_name); static struct ezt_instrumented_function* find_instrumented_function_from_addr(void* addr); /* Wrapper functions */ /* This function is called at the begining of instrumented functions */ void __cyg_profile_func_enter (void *this_fn, void *call_site MAYBE_UNUSED) { if(! _compiler_instrumentation_initialized ) return; struct ezt_instrumented_function* f = find_instrumented_function_from_addr(this_fn); if(f && f->event_id >= 0) { if(todo_get_status("eztrace") == init_complete && todo_get_status("ezt_otf2") == init_complete && _ezt_trace.status < ezt_trace_status_being_finalized) { EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), f->event_id); } } } /* This function is called at the end of instrumented functions */ void __cyg_profile_func_exit (void *this_fn, void *call_site MAYBE_UNUSED) { if(! _compiler_instrumentation_initialized ) return; struct ezt_instrumented_function* f = find_instrumented_function_from_addr(this_fn); if(f && f->event_id>=0) { if(todo_get_status("eztrace") == init_complete && todo_get_status("ezt_otf2") == init_complete && _ezt_trace.status < ezt_trace_status_being_finalized) { EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), f->event_id); } } } PPTRACE_START_INTERCEPT_FUNCTIONS(compiler_instrumentation) PPTRACE_END_INTERCEPT_FUNCTIONS(compiler_instrumentation) static char **excluded_functions = NULL; static int nb_excluded_functions = 0; static void init_exclusion_list() { char* env_str = getenv("EZTRACE_EXCLUDE_LIST "); if(!env_str) return ; env_str = strdup(env_str); char* save_ptr = NULL; char* token = strtok_r(env_str, " ", &save_ptr); while(token) { int index = nb_excluded_functions++; excluded_functions = realloc(excluded_functions, sizeof(char*) * nb_excluded_functions); excluded_functions[index] = strdup(token); eztrace_log(dbg_lvl_debug, "[EZTrace:compiler instrumentation] I will not trace %s\n", excluded_functions[index]); printf("exclusion_list[%d]: %s\n", index, excluded_functions[index]); token = strtok_r(NULL, " ", &save_ptr); } free(env_str); } static int function_in_exclude_list(const char* function_name) { for(int i=0; i= nb_alloc_instrumented_functions) { nb_alloc_instrumented_functions *= 2; instrumented_functions = realloc(instrumented_functions, sizeof(struct ezt_instrumented_function) * nb_alloc_instrumented_functions); if(!instrumented_functions) { eztrace_error("[EZTrace:compiler instrumentation] cannot allocate memory\n"); } } f = &instrumented_functions[nb_instrumented_functions++]; f->callback = addr; strncpy(f->function_name, info_fn.dli_sname, sizeof(f->function_name)); if(function_in_exclude_list(f->function_name)) { eztrace_log(dbg_lvl_debug, "[EZTrace:compiler instrumentation] Do not instrument %s as it is excluded\n", f->function_name); f->event_id = -1; } else { f->event_id = ezt_otf2_register_function(f->function_name); } out: pthread_mutex_unlock(&instrumented_functions_lock); EZTRACE_PROTECT_OFF(); return f; out_err: f = NULL; goto out; } } return NULL; } static void init_compiler_instrumentation() { INSTRUMENT_FUNCTIONS(compiler_instrumentation); init_exclusion_list(); if (eztrace_autostart_enabled()) eztrace_start(); _compiler_instrumentation_initialized = 1; } static void finalize_compiler_instrumentation() { _compiler_instrumentation_initialized = 0; eztrace_stop(); } static void _compiler_instrumentation_init(void) __attribute__((constructor)); static void _compiler_instrumentation_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_compiler_instrumentation constructor starts\n"); EZT_REGISTER_MODULE(compiler_instrumentation, "Module for tracing compiler-instrumented compilers", init_compiler_instrumentation, finalize_compiler_instrumentation); eztrace_log(dbg_lvl_debug, "eztrace_compiler_instrumentation constructor ends\n"); } eztrace-2.1/src/modules/cuda/000077500000000000000000000000001447213526500161755ustar00rootroot00000000000000eztrace-2.1/src/modules/cuda/CMakeLists.txt000066400000000000000000000025541447213526500207430ustar00rootroot00000000000000if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES 52 60 61 75 CACHE STRING "CUDA architectures" FORCE) endif() if(NOT DEFINED CMAKE_CUDA_CREATE_SHARED_LIBRARY) set(CMAKE_CUDA_CREATE_SHARED_LIBRARY ON) endif() enable_language(CXX) #enable_language(CUDA) find_package(CUDA REQUIRED) #set(CUDA_SEPARABLE_COMPILATION ON) #set(CUDA_PROPAGATE_HOST_FLAGS ON) #link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib) #link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib64) add_library(eztrace-cuda SHARED) target_sources(eztrace-cuda PRIVATE # src/cuda_cupti.cpp cuda.c cuda_runtime.c cuda_driver.c ) target_link_libraries(eztrace-cuda eztrace-core eztrace-lib ${CUDA_LIBRARIES} ${CUDA_cupti_LIBRARY} ) target_include_directories(eztrace-cuda PRIVATE ${CUDA_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) #set_target_properties(eztrace-cuda PROPERTIES # LINKER_LANGUAGE CUDA # LANGUAGE CUDA # ) #message(STATUS "CUDA_SDK_ROOT_DIR=${CUDA_SDK_ROOT_DIR}") #message(STATUS "CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}") #message(STATUS "CUDA_LIBRARIES=${CUDA_LIBRARIES}") #-------------------------------------------- install(TARGETS eztrace-cuda LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/cuda/cuda.c000066400000000000000000000313461447213526500172640ustar00rootroot00000000000000#define _REENTRANT #include #include #include #include #include #include #include #include #include #include #include #define CURRENT_MODULE cuda DECLARE_CURRENT_MODULE; #include "ezt_cuda.h" static int _cuda_initialized = 0; struct ezt_cuda_gpu { int gpu_id; uint64_t device_startTimestamp; // timestamp (in ns) of the first event uint64_t host_startTimestamp; // timestamp (in ns) of the first event int otf2_gpu_id; OTF2_DefWriter *def_writer; OTF2_EvtWriter *evt_writer; }; static struct ezt_cuda_gpu *ezt_gpus=NULL; static int ezt_nb_gpus = 0; static int otf2_cuda_unknown_kernel_id = -1; static int otf2_cuda_memcpy_id = -1; static CUpti_SubscriberHandle subscriber; uint64_t ezt_get_gputimestamp(int gpu_id, uint64_t timestamp) { return (timestamp - ezt_gpus[gpu_id].device_startTimestamp) + ezt_gpus[gpu_id].host_startTimestamp; } // This CUDA module uses 2 different mechanisms for recording events: // - CPU events are recorded using wrappers (usual mechanism in EZTrace) // - GPU events are recording using the CUPTI activity mechanism. // // For the CUPTI mechanism, we ask CUDA to record events in a buffer. When we reach a synchronization point, // eztrace reads the buffer and record the corresponding events. #define DEFAULT_BUF_SIZE (2 * 1024 * 1024) static size_t _cuda_buf_size = DEFAULT_BUF_SIZE; static int _cupti_enabled = 0; #define ALIGN_SIZE (8) #define ALIGN_BUFFER(buffer, align) \ (((uintptr_t) (buffer) &((align)-1)) ? ((buffer)+(align) - ((uintptr_t)(buffer)&((align)-1))) : (buffer)) #define CUDA_CHECK_RETVAL(__func__, __expected_retval__) \ do { \ if(__func__ != __expected_retval__) { \ eztrace_error("EZTrace: CUDA returned an error\n"); \ } \ } while(0) /**** * CUPTI-based functions ****/ /** * Allocate a new BUF_SIZE buffer for CUPTI */ static void bufferRequested(uint8_t **buffer, size_t *size, size_t *maxNumRecords) { uint8_t *bfr = (uint8_t *) malloc(_cuda_buf_size + ALIGN_SIZE); if (bfr == NULL) { eztrace_abort("Error: out of memory\n"); exit(-1); } *size = _cuda_buf_size; *buffer = ALIGN_BUFFER(bfr, ALIGN_SIZE); *maxNumRecords = 0; } /* process a memcpy event that happened on a GPU */ static void _process_memcpy_record(CUpti_ActivityMemcpy2 *memcpy_info) { int srcDeviceId = memcpy_info->deviceId; int destDeviceId = memcpy_info->dstDeviceId; size_t cpy_size = memcpy_info->bytes; char* copy_type = MEMCPY_TYPE_STR((CUpti_ActivityMemcpyKind)memcpy_info->copyKind); static OTF2_AttributeRef attr_id_type = OTF2_UNDEFINED_ATTRIBUTE; if(attr_id_type == OTF2_UNDEFINED_ATTRIBUTE) { attr_id_type = ezt_otf2_register_attribute("copyType", OTF2_TYPE_AUTO(copy_type)); } static OTF2_AttributeRef attr_id_dst = OTF2_UNDEFINED_ATTRIBUTE; if(attr_id_dst == OTF2_UNDEFINED_ATTRIBUTE) { attr_id_dst = ezt_otf2_register_attribute("destDevice", OTF2_TYPE_AUTO(destDeviceId)); } static OTF2_AttributeRef attr_id_bytes = OTF2_UNDEFINED_ATTRIBUTE; if(attr_id_bytes == OTF2_UNDEFINED_ATTRIBUTE) { attr_id_bytes = ezt_otf2_register_attribute("bytes", OTF2_TYPE_AUTO(cpy_size));} OTF2_AttributeList* attribute_list = OTF2_AttributeList_New(); ADD_ATTRIBUTE(attribute_list, attr_id_type, copy_type); ADD_ATTRIBUTE(attribute_list, attr_id_dst, destDeviceId); ADD_ATTRIBUTE(attribute_list, attr_id_bytes, cpy_size); OTF2_EvtWriter_Enter( ezt_gpus[srcDeviceId].evt_writer, attribute_list, ezt_get_gputimestamp(srcDeviceId, memcpy_info->start), otf2_cuda_memcpy_id); OTF2_EvtWriter_Leave( ezt_gpus[srcDeviceId].evt_writer, attribute_list, ezt_get_gputimestamp(srcDeviceId, memcpy_info->end), otf2_cuda_memcpy_id); } struct kernel_info_t { const char* name; const char* demangled_name; int otf2_region_id; }; static int nb_kernels = 0; static int nb_allocated_kernels = 0; static struct kernel_info_t *kernels = NULL; /* register a kernel name and return its index in the kernels array */ static int _register_kernel(const char* kernel_name) { uint32_t i; static ezt_spinlock lock = ezt_spin_unlocked; ezt_spin_lock(&lock); for(i=0; i nb_allocated_kernels) { // not enough space in the array. expand the array nb_allocated_kernels *= 2; struct kernel_info_t *ptr = (struct kernel_info_t *)realloc(kernels, nb_allocated_kernels*sizeof(struct kernel_info_t)); if(!ptr) { eztrace_error("[EZTrace] Cannot allocate memory. Aborting\n"); } kernels = ptr; } int kernel_id = nb_kernels-1; // register the kernel kernels[kernel_id].name = strdup(kernel_name); kernels[kernel_id].demangled_name = ezt_demangle(kernel_name); kernels[kernel_id].otf2_region_id = ezt_otf2_register_function(kernels[kernel_id].demangled_name); eztrace_log(dbg_lvl_debug,"[CUDA] Register kernel(%d, %s) -> %d\n", kernel_id, kernels[kernel_id].demangled_name, kernels[kernel_id].otf2_region_id); ezt_spin_unlock(&lock); return kernel_id; } /* Cupti keeps changing its API so we need to know which data structure to use */ #if CUPTI_API_VERSION < 7 typedef CUpti_ActivityKernel2 __CUpti_ActivityKernel; /* as of cupti 6.5, CUpti_ActivityKernel2 is deprecated, and CUpti_ActivityKernel3 should be used */ #elif CUPTI_API_VERSION < 9 typedef CUpti_ActivityKernel3 __CUpti_ActivityKernel ; #elif CUPTI_API_VERSION < 11 typedef CUpti_ActivityKernel4 __CUpti_ActivityKernel ; #elif CUPTI_API_VERSION <= 18 typedef CUpti_ActivityKernel7 __CUpti_ActivityKernel ; #else typedef CUpti_ActivityKernel9 __CUpti_ActivityKernel ; #endif /* process a kernel event that happened on the GPU */ static void _process_kernel_record(__CUpti_ActivityKernel *kernel) { uint32_t kernel_id = _register_kernel(kernel->name); uint32_t device_id = kernel->deviceId; OTF2_EvtWriter_Enter( ezt_gpus[device_id].evt_writer, NULL, ezt_get_gputimestamp(device_id, kernel->start), kernels[kernel_id].otf2_region_id); OTF2_EvtWriter_Leave( ezt_gpus[device_id].evt_writer, NULL, ezt_get_gputimestamp(device_id, kernel->end), kernels[kernel_id].otf2_region_id); } static ezt_spinlock _flush_lock = ezt_spin_unlocked; void CUPTIAPI eztrace_cuda_callback(void *userdata, CUpti_CallbackDomain domain, CUpti_CallbackId cbid, const void *cbdata) { const CUpti_CallbackData *cbInfo = (CUpti_CallbackData *)cbdata; if(domain == CUPTI_CB_DOMAIN_RUNTIME_API) { eztrace_cuda_runtime_callback(userdata, domain, cbid, cbdata); } else if(domain == CUPTI_CB_DOMAIN_DRIVER_API) { eztrace_cuda_driver_callback(userdata, domain, cbid, cbdata); } } void CUPTIAPI bufferCompleted(CUcontext ctx, uint32_t streamId, uint8_t *buffer, size_t size, size_t validSize) { CUptiResult status; CUpti_Activity *record = NULL; if (validSize > 0) { ezt_spin_lock(&_flush_lock); do { status = cuptiActivityGetNextRecord(buffer, validSize, &record); if(status == CUPTI_SUCCESS) { switch(record->kind) { case CUPTI_ACTIVITY_KIND_MEMCPY: { _process_memcpy_record((CUpti_ActivityMemcpy2 *)record); break; } case CUPTI_ACTIVITY_KIND_KERNEL: case CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL: { _process_kernel_record((__CUpti_ActivityKernel *)record); break; } default: eztrace_warn("unknown record type: %d\n", record->kind); break; } } else if (status == CUPTI_ERROR_MAX_LIMIT_REACHED) { break; } else { CUDA_CHECK_RETVAL(status, CUPTI_SUCCESS); } } while (1); ezt_spin_unlock(&_flush_lock); // report any records dropped from the queue size_t dropped; CUDA_CHECK_RETVAL(cuptiActivityGetNumDroppedRecords(ctx, streamId, &dropped), CUPTI_SUCCESS); if (dropped != 0) { eztrace_warn( "[EZTrace-CUDA] %u events were dropped because the buffer dedicated to CUDA events is too small (%u bytes)\n [EZTrace-CUDA]\tYou can change this buffer size by setting EZTRACE_CUDA_BUFFER_SIZE\n", (unsigned int)dropped, _cuda_buf_size); } } free(buffer); } /**** CUDA runtime interface ****/ PPTRACE_START_INTERCEPT_FUNCTIONS(cuda) PPTRACE_END_INTERCEPT_FUNCTIONS(cuda) static void _ezt_init_gpu(int gpu_id) { ezt_gpus[gpu_id].gpu_id = gpu_id; CUDA_CHECK_RETVAL(cuptiGetTimestamp(&ezt_gpus[gpu_id].device_startTimestamp), CUPTI_SUCCESS); ezt_gpus[gpu_id].host_startTimestamp = ezt_get_timestamp(); ezt_gpus[gpu_id].otf2_gpu_id = ezt_otf2_register_gpu(gpu_id); ezt_gpus[gpu_id].def_writer = OTF2_Archive_GetDefWriter( _ezt_trace.archive, ezt_gpus[gpu_id].otf2_gpu_id ); ezt_gpus[gpu_id].evt_writer = OTF2_Archive_GetEvtWriter( _ezt_trace.archive, ezt_gpus[gpu_id].otf2_gpu_id ); } static void _ezt_finalize_gpu(int gpu_id){ if(eztrace_should_trace && ezt_gpus[gpu_id].def_writer) { static ezt_spinlock archive_lock; ezt_spin_lock(&archive_lock); OTF2_Archive_CloseEvtWriter( _ezt_trace.archive, ezt_gpus[gpu_id].evt_writer ); OTF2_Archive_CloseDefWriter( _ezt_trace.archive, ezt_gpus[gpu_id].def_writer ); ezt_spin_unlock(&archive_lock); } } static void ezt_cuda_init_otf2() { if(todo_get_status("ezt_cuda_init_otf2") == init_complete) return; todo_set_status("ezt_cuda_init_otf2", init_started); cudaGetDeviceCount(&ezt_nb_gpus); printf("ezt_cuda_init_otf2(): there are %d gpus\n", ezt_nb_gpus); ezt_gpus = malloc(sizeof(struct ezt_cuda_gpu) * ezt_nb_gpus); for(int i=0; i< ezt_nb_gpus; i++) { _ezt_init_gpu(i); } otf2_cuda_unknown_kernel_id = ezt_otf2_register_function("CUDA kernel"); otf2_cuda_memcpy_id = ezt_otf2_register_function("CUDA Memcpy"); cuptiSubscribe(&subscriber, (CUpti_CallbackFunc)eztrace_cuda_callback, NULL); cuptiEnableDomain(1, subscriber, CUPTI_CB_DOMAIN_RUNTIME_API); char* str = getenv("EZTRACE_CUDA_DRIVER"); if(str) { eztrace_log(dbg_lvl_debug, "CUDA: record CUDA driver API events\n"); cuptiEnableDomain(1, subscriber, CUPTI_CB_DOMAIN_DRIVER_API); } todo_set_status("ezt_cuda_init_otf2", init_complete); } static void _init_buffer_size() { char* str = getenv("EZTRACE_CUDA_BUFFER_SIZE"); if(str) { _cuda_buf_size = atoi(str); eztrace_log(dbg_lvl_debug, "Setting CUDA buffer size to %d bytes\n", _cuda_buf_size); } } static void _init_cupti() { char* str = getenv("EZTRACE_CUDA_CUPTI_DISABLED"); if(str) { _cupti_enabled = 0; } else { _cupti_enabled = 1; } if(_cupti_enabled) { eztrace_log(dbg_lvl_debug, "[EZTrace][CUDA] CUPTI is enabled\n"); _cupti_enabled = 1; kernels = (struct kernel_info_t*) malloc(sizeof(struct kernel_info_t)*1024); nb_allocated_kernels = 1024; // device activity record is created when CUDA initializes, so we // want to enable it before cuInit() or any CUDA runtime call CUDA_CHECK_RETVAL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_KERNEL), CUPTI_SUCCESS); CUDA_CHECK_RETVAL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_MEMCPY), CUPTI_SUCCESS); CUDA_CHECK_RETVAL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_MEMSET), CUPTI_SUCCESS); // Register callbacks for buffer requests and for buffers completed by CUPTI. CUDA_CHECK_RETVAL(cuptiActivityRegisterCallbacks(bufferRequested, bufferCompleted), CUPTI_SUCCESS); ezt_spin_init(&_flush_lock); } enqueue_todo("ezt_cuda", ezt_cuda_init_otf2, "ezt_otf2", status_invalid); } // flush all pending buffers static void _ezt_cuda_flush(void*param) { if(_cupti_enabled) { CUDA_CHECK_RETVAL(cuptiActivityFlushAll(CUPTI_ACTIVITY_FLAG_FORCE_INT), CUPTI_SUCCESS); // make sure there isn't another thread that is flushing the cuda buffer ezt_spin_lock(&_flush_lock); ezt_spin_unlock(&_flush_lock); } } static void init_cuda() { INSTRUMENT_FUNCTIONS(cuda); _init_buffer_size(); _init_cupti(); // we need to flush all the pending buffers before closing the trace so that we don't lose // any event from the GPU eztrace_atexit(_ezt_cuda_flush, NULL); if (eztrace_autostart_enabled()) eztrace_start(); _cuda_initialized = 1; } static void finalize_cuda() { _cuda_initialized = 0; _ezt_cuda_flush(NULL); for(int i=0; i< ezt_nb_gpus; i++) { _ezt_finalize_gpu(i); } if(_cupti_enabled) { cuptiUnsubscribe(subscriber); } eztrace_stop(); } static void _cuda_init(void) __attribute__((constructor)); static void _cuda_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_cuda constructor starts\n"); EZT_REGISTER_MODULE(cuda, "Module for CUDA", init_cuda, finalize_cuda); eztrace_log(dbg_lvl_debug, "eztrace_cuda constructor ends\n"); } eztrace-2.1/src/modules/cuda/cuda_driver.c000066400000000000000000002370621447213526500206420ustar00rootroot00000000000000#define _REENTRANT #include #include #include #include #include #include #include /* This file intercepts calls to the CUDA driver API. * Since nvcc statically links the application against cuda by default, we cannot use the usual LD_PRELOAD method. * Instead, we use cupti callback API. */ struct cuda_driver_api_info { enum CUpti_driver_api_trace_cbid_enum id; char *function_name; OTF2_RegionRef region; }; static struct cuda_driver_api_info cuda_driver_api_info[] = { {CUPTI_DRIVER_TRACE_CBID_INVALID, "cuda::driver::INVALID", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuInit, "cuda::driver::cuInit", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDriverGetVersion, "cuda::driver::cuDriverGetVersion", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGet, "cuda::driver::cuDeviceGet", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetCount, "cuda::driver::cuDeviceGetCount", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetName, "cuda::driver::cuDeviceGetName", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceComputeCapability, "cuda::driver::cuDeviceComputeCapability", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceTotalMem, "cuda::driver::cuDeviceTotalMem", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetProperties, "cuda::driver::cuDeviceGetProperties", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetAttribute, "cuda::driver::cuDeviceGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxCreate, "cuda::driver::cuCtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxDestroy, "cuda::driver::cuCtxDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxAttach, "cuda::driver::cuCtxAttach", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxDetach, "cuda::driver::cuCtxDetach", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxPushCurrent, "cuda::driver::cuCtxPushCurrent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxPopCurrent, "cuda::driver::cuCtxPopCurrent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetDevice, "cuda::driver::cuCtxGetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxSynchronize, "cuda::driver::cuCtxSynchronize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleLoad, "cuda::driver::cuModuleLoad", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleLoadData, "cuda::driver::cuModuleLoadData", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleLoadDataEx, "cuda::driver::cuModuleLoadDataEx", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleLoadFatBinary, "cuda::driver::cuModuleLoadFatBinary", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleUnload, "cuda::driver::cuModuleUnload", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetFunction, "cuda::driver::cuModuleGetFunction", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetGlobal, "cuda::driver::cuModuleGetGlobal", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64ModuleGetGlobal, "cuda::driver::cu64ModuleGetGlobal", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetTexRef, "cuda::driver::cuModuleGetTexRef", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetInfo, "cuda::driver::cuMemGetInfo", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemGetInfo, "cuda::driver::cu64MemGetInfo", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAlloc, "cuda::driver::cuMemAlloc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemAlloc, "cuda::driver::cu64MemAlloc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocPitch, "cuda::driver::cuMemAllocPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemAllocPitch, "cuda::driver::cu64MemAllocPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemFree, "cuda::driver::cuMemFree", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemFree, "cuda::driver::cu64MemFree", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetAddressRange, "cuda::driver::cuMemGetAddressRange", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemGetAddressRange, "cuda::driver::cu64MemGetAddressRange", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocHost, "cuda::driver::cuMemAllocHost", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemFreeHost, "cuda::driver::cuMemFreeHost", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostAlloc, "cuda::driver::cuMemHostAlloc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostGetDevicePointer, "cuda::driver::cuMemHostGetDevicePointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemHostGetDevicePointer, "cuda::driver::cu64MemHostGetDevicePointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostGetFlags, "cuda::driver::cuMemHostGetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD, "cuda::driver::cuMemcpyHtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyHtoD, "cuda::driver::cu64MemcpyHtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH, "cuda::driver::cuMemcpyDtoH", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoH, "cuda::driver::cu64MemcpyDtoH", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD, "cuda::driver::cuMemcpyDtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoD, "cuda::driver::cu64MemcpyDtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA, "cuda::driver::cuMemcpyDtoA", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoA, "cuda::driver::cu64MemcpyDtoA", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD, "cuda::driver::cuMemcpyAtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyAtoD, "cuda::driver::cu64MemcpyAtoD", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA, "cuda::driver::cuMemcpyHtoA", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH, "cuda::driver::cuMemcpyAtoH", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA, "cuda::driver::cuMemcpyAtoA", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D, "cuda::driver::cuMemcpy2D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned, "cuda::driver::cuMemcpy2DUnaligned", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D, "cuda::driver::cuMemcpy3D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Memcpy3D, "cuda::driver::cu64Memcpy3D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync, "cuda::driver::cuMemcpyHtoDAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyHtoDAsync, "cuda::driver::cu64MemcpyHtoDAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync, "cuda::driver::cuMemcpyDtoHAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoHAsync, "cuda::driver::cu64MemcpyDtoHAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync, "cuda::driver::cuMemcpyDtoDAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoDAsync, "cuda::driver::cu64MemcpyDtoDAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync, "cuda::driver::cuMemcpyHtoAAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync, "cuda::driver::cuMemcpyAtoHAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync, "cuda::driver::cuMemcpy2DAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync, "cuda::driver::cuMemcpy3DAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Memcpy3DAsync, "cuda::driver::cu64Memcpy3DAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD8, "cuda::driver::cuMemsetD8", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD8, "cuda::driver::cu64MemsetD8", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD16, "cuda::driver::cuMemsetD16", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD16, "cuda::driver::cu64MemsetD16", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD32, "cuda::driver::cuMemsetD32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD32, "cuda::driver::cu64MemsetD32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8, "cuda::driver::cuMemsetD2D8", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D8, "cuda::driver::cu64MemsetD2D8", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16, "cuda::driver::cuMemsetD2D16", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D16, "cuda::driver::cu64MemsetD2D16", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32, "cuda::driver::cuMemsetD2D32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D32, "cuda::driver::cu64MemsetD2D32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncSetBlockShape, "cuda::driver::cuFuncSetBlockShape", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncSetSharedSize, "cuda::driver::cuFuncSetSharedSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncGetAttribute, "cuda::driver::cuFuncGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncSetCacheConfig, "cuda::driver::cuFuncSetCacheConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayCreate, "cuda::driver::cuArrayCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayGetDescriptor, "cuda::driver::cuArrayGetDescriptor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayDestroy, "cuda::driver::cuArrayDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArray3DCreate, "cuda::driver::cuArray3DCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArray3DGetDescriptor, "cuda::driver::cuArray3DGetDescriptor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefCreate, "cuda::driver::cuTexRefCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefDestroy, "cuda::driver::cuTexRefDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetArray, "cuda::driver::cuTexRefSetArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress, "cuda::driver::cuTexRefSetAddress", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64TexRefSetAddress, "cuda::driver::cu64TexRefSetAddress", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D, "cuda::driver::cuTexRefSetAddress2D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64TexRefSetAddress2D, "cuda::driver::cu64TexRefSetAddress2D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFormat, "cuda::driver::cuTexRefSetFormat", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddressMode, "cuda::driver::cuTexRefSetAddressMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFilterMode, "cuda::driver::cuTexRefSetFilterMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFlags, "cuda::driver::cuTexRefSetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddress, "cuda::driver::cuTexRefGetAddress", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64TexRefGetAddress, "cuda::driver::cu64TexRefGetAddress", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetArray, "cuda::driver::cuTexRefGetArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddressMode, "cuda::driver::cuTexRefGetAddressMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFilterMode, "cuda::driver::cuTexRefGetFilterMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFormat, "cuda::driver::cuTexRefGetFormat", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFlags, "cuda::driver::cuTexRefGetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuParamSetSize, "cuda::driver::cuParamSetSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuParamSeti, "cuda::driver::cuParamSeti", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuParamSetf, "cuda::driver::cuParamSetf", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuParamSetv, "cuda::driver::cuParamSetv", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuParamSetTexRef, "cuda::driver::cuParamSetTexRef", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunch, "cuda::driver::cuLaunch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchGrid, "cuda::driver::cuLaunchGrid", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchGridAsync, "cuda::driver::cuLaunchGridAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventCreate, "cuda::driver::cuEventCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventRecord, "cuda::driver::cuEventRecord", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventQuery, "cuda::driver::cuEventQuery", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventSynchronize, "cuda::driver::cuEventSynchronize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventDestroy, "cuda::driver::cuEventDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventElapsedTime, "cuda::driver::cuEventElapsedTime", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamCreate, "cuda::driver::cuStreamCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamQuery, "cuda::driver::cuStreamQuery", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSynchronize, "cuda::driver::cuStreamSynchronize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamDestroy, "cuda::driver::cuStreamDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnregisterResource, "cuda::driver::cuGraphicsUnregisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsSubResourceGetMappedArray, "cuda::driver::cuGraphicsSubResourceGetMappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedPointer, "cuda::driver::cuGraphicsResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64GraphicsResourceGetMappedPointer, "cuda::driver::cu64GraphicsResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceSetMapFlags, "cuda::driver::cuGraphicsResourceSetMapFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsMapResources, "cuda::driver::cuGraphicsMapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnmapResources, "cuda::driver::cuGraphicsUnmapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGetExportTable, "cuda::driver::cuGetExportTable", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxSetLimit, "cuda::driver::cuCtxSetLimit", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetLimit, "cuda::driver::cuCtxGetLimit", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDevice, "cuda::driver::cuD3D10GetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreate, "cuda::driver::cuD3D10CtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D10RegisterResource, "cuda::driver::cuGraphicsD3D10RegisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10RegisterResource, "cuda::driver::cuD3D10RegisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10UnregisterResource, "cuda::driver::cuD3D10UnregisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10MapResources, "cuda::driver::cuD3D10MapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10UnmapResources, "cuda::driver::cuD3D10UnmapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceSetMapFlags, "cuda::driver::cuD3D10ResourceSetMapFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedArray, "cuda::driver::cuD3D10ResourceGetMappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPointer, "cuda::driver::cuD3D10ResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedSize, "cuda::driver::cuD3D10ResourceGetMappedSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPitch, "cuda::driver::cuD3D10ResourceGetMappedPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetSurfaceDimensions, "cuda::driver::cuD3D10ResourceGetSurfaceDimensions", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDevice, "cuda::driver::cuD3D11GetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreate, "cuda::driver::cuD3D11CtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D11RegisterResource, "cuda::driver::cuGraphicsD3D11RegisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDevice, "cuda::driver::cuD3D9GetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreate, "cuda::driver::cuD3D9CtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D9RegisterResource, "cuda::driver::cuGraphicsD3D9RegisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDirect3DDevice, "cuda::driver::cuD3D9GetDirect3DDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9RegisterResource, "cuda::driver::cuD3D9RegisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9UnregisterResource, "cuda::driver::cuD3D9UnregisterResource", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9MapResources, "cuda::driver::cuD3D9MapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9UnmapResources, "cuda::driver::cuD3D9UnmapResources", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceSetMapFlags, "cuda::driver::cuD3D9ResourceSetMapFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetSurfaceDimensions, "cuda::driver::cuD3D9ResourceGetSurfaceDimensions", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedArray, "cuda::driver::cuD3D9ResourceGetMappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPointer, "cuda::driver::cuD3D9ResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedSize, "cuda::driver::cuD3D9ResourceGetMappedSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPitch, "cuda::driver::cuD3D9ResourceGetMappedPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9Begin, "cuda::driver::cuD3D9Begin", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9End, "cuda::driver::cuD3D9End", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9RegisterVertexBuffer, "cuda::driver::cuD3D9RegisterVertexBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9MapVertexBuffer, "cuda::driver::cuD3D9MapVertexBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9UnmapVertexBuffer, "cuda::driver::cuD3D9UnmapVertexBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9UnregisterVertexBuffer, "cuda::driver::cuD3D9UnregisterVertexBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLCtxCreate, "cuda::driver::cuGLCtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsGLRegisterBuffer, "cuda::driver::cuGraphicsGLRegisterBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsGLRegisterImage, "cuda::driver::cuGraphicsGLRegisterImage", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuWGLGetDevice, "cuda::driver::cuWGLGetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLInit, "cuda::driver::cuGLInit", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLRegisterBufferObject, "cuda::driver::cuGLRegisterBufferObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject, "cuda::driver::cuGLMapBufferObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLUnmapBufferObject, "cuda::driver::cuGLUnmapBufferObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLUnregisterBufferObject, "cuda::driver::cuGLUnregisterBufferObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLSetBufferObjectMapFlags, "cuda::driver::cuGLSetBufferObjectMapFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync, "cuda::driver::cuGLMapBufferObjectAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLUnmapBufferObjectAsync, "cuda::driver::cuGLUnmapBufferObjectAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuVDPAUGetDevice, "cuda::driver::cuVDPAUGetDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuVDPAUCtxCreate, "cuda::driver::cuVDPAUCtxCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsVDPAURegisterVideoSurface, "cuda::driver::cuGraphicsVDPAURegisterVideoSurface", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsVDPAURegisterOutputSurface, "cuda::driver::cuGraphicsVDPAURegisterOutputSurface", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetSurfRef, "cuda::driver::cuModuleGetSurfRef", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefCreate, "cuda::driver::cuSurfRefCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefDestroy, "cuda::driver::cuSurfRefDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefSetFormat, "cuda::driver::cuSurfRefSetFormat", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefSetArray, "cuda::driver::cuSurfRefSetArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefGetFormat, "cuda::driver::cuSurfRefGetFormat", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfRefGetArray, "cuda::driver::cuSurfRefGetArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64DeviceTotalMem, "cuda::driver::cu64DeviceTotalMem", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedPointer, "cuda::driver::cu64D3D10ResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedSize, "cuda::driver::cu64D3D10ResourceGetMappedSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedPitch, "cuda::driver::cu64D3D10ResourceGetMappedPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetSurfaceDimensions, "cuda::driver::cu64D3D10ResourceGetSurfaceDimensions", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetSurfaceDimensions, "cuda::driver::cu64D3D9ResourceGetSurfaceDimensions", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedPointer, "cuda::driver::cu64D3D9ResourceGetMappedPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedSize, "cuda::driver::cu64D3D9ResourceGetMappedSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedPitch, "cuda::driver::cu64D3D9ResourceGetMappedPitch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64D3D9MapVertexBuffer, "cuda::driver::cu64D3D9MapVertexBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64GLMapBufferObject, "cuda::driver::cu64GLMapBufferObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64GLMapBufferObjectAsync, "cuda::driver::cu64GLMapBufferObjectAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDevices, "cuda::driver::cuD3D11GetDevices", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreateOnDevice, "cuda::driver::cuD3D11CtxCreateOnDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDevices, "cuda::driver::cuD3D10GetDevices", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreateOnDevice, "cuda::driver::cuD3D10CtxCreateOnDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDevices, "cuda::driver::cuD3D9GetDevices", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreateOnDevice, "cuda::driver::cuD3D9CtxCreateOnDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemHostAlloc, "cuda::driver::cu64MemHostAlloc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD8Async, "cuda::driver::cuMemsetD8Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD8Async, "cuda::driver::cu64MemsetD8Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD16Async, "cuda::driver::cuMemsetD16Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD16Async, "cuda::driver::cu64MemsetD16Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD32Async, "cuda::driver::cuMemsetD32Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD32Async, "cuda::driver::cu64MemsetD32Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8Async, "cuda::driver::cuMemsetD2D8Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D8Async, "cuda::driver::cu64MemsetD2D8Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16Async, "cuda::driver::cuMemsetD2D16Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D16Async, "cuda::driver::cu64MemsetD2D16Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32Async, "cuda::driver::cuMemsetD2D32Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D32Async, "cuda::driver::cu64MemsetD2D32Async", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64ArrayCreate, "cuda::driver::cu64ArrayCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64ArrayGetDescriptor, "cuda::driver::cu64ArrayGetDescriptor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Array3DCreate, "cuda::driver::cu64Array3DCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Array3DGetDescriptor, "cuda::driver::cu64Array3DGetDescriptor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2D, "cuda::driver::cu64Memcpy2D", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2DUnaligned, "cuda::driver::cu64Memcpy2DUnaligned", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2DAsync, "cuda::driver::cu64Memcpy2DAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxCreate_v2, "cuda::driver::cuCtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreate_v2, "cuda::driver::cuD3D10CtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreate_v2, "cuda::driver::cuD3D11CtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreate_v2, "cuda::driver::cuD3D9CtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLCtxCreate_v2, "cuda::driver::cuGLCtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuVDPAUCtxCreate_v2, "cuda::driver::cuVDPAUCtxCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetGlobal_v2, "cuda::driver::cuModuleGetGlobal_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetInfo_v2, "cuda::driver::cuMemGetInfo_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAlloc_v2, "cuda::driver::cuMemAlloc_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocPitch_v2, "cuda::driver::cuMemAllocPitch_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemFree_v2, "cuda::driver::cuMemFree_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetAddressRange_v2, "cuda::driver::cuMemGetAddressRange_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostGetDevicePointer_v2, "cuda::driver::cuMemHostGetDevicePointer_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy_v2, "cuda::driver::cuMemcpy_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD8_v2, "cuda::driver::cuMemsetD8_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD16_v2, "cuda::driver::cuMemsetD16_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD32_v2, "cuda::driver::cuMemsetD32_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8_v2, "cuda::driver::cuMemsetD2D8_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16_v2, "cuda::driver::cuMemsetD2D16_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32_v2, "cuda::driver::cuMemsetD2D32_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress_v2, "cuda::driver::cuTexRefSetAddress_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D_v2, "cuda::driver::cuTexRefSetAddress2D_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddress_v2, "cuda::driver::cuTexRefGetAddress_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedPointer_v2, "cuda::driver::cuGraphicsResourceGetMappedPointer_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceTotalMem_v2, "cuda::driver::cuDeviceTotalMem_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPointer_v2, "cuda::driver::cuD3D10ResourceGetMappedPointer_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedSize_v2, "cuda::driver::cuD3D10ResourceGetMappedSize_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPitch_v2, "cuda::driver::cuD3D10ResourceGetMappedPitch_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetSurfaceDimensions_v2, "cuda::driver::cuD3D10ResourceGetSurfaceDimensions_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetSurfaceDimensions_v2, "cuda::driver::cuD3D9ResourceGetSurfaceDimensions_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPointer_v2, "cuda::driver::cuD3D9ResourceGetMappedPointer_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedSize_v2, "cuda::driver::cuD3D9ResourceGetMappedSize_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPitch_v2, "cuda::driver::cuD3D9ResourceGetMappedPitch_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D9MapVertexBuffer_v2, "cuda::driver::cuD3D9MapVertexBuffer_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject_v2, "cuda::driver::cuGLMapBufferObject_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync_v2, "cuda::driver::cuGLMapBufferObjectAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostAlloc_v2, "cuda::driver::cuMemHostAlloc_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayCreate_v2, "cuda::driver::cuArrayCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayGetDescriptor_v2, "cuda::driver::cuArrayGetDescriptor_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArray3DCreate_v2, "cuda::driver::cuArray3DCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArray3DGetDescriptor_v2, "cuda::driver::cuArray3DGetDescriptor_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD_v2, "cuda::driver::cuMemcpyHtoD_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync_v2, "cuda::driver::cuMemcpyHtoDAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH_v2, "cuda::driver::cuMemcpyDtoH_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync_v2, "cuda::driver::cuMemcpyDtoHAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD_v2, "cuda::driver::cuMemcpyDtoD_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync_v2, "cuda::driver::cuMemcpyDtoDAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH_v2, "cuda::driver::cuMemcpyAtoH_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync_v2, "cuda::driver::cuMemcpyAtoHAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD_v2, "cuda::driver::cuMemcpyAtoD_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA_v2, "cuda::driver::cuMemcpyDtoA_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA_v2, "cuda::driver::cuMemcpyAtoA_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D_v2, "cuda::driver::cuMemcpy2D_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned_v2, "cuda::driver::cuMemcpy2DUnaligned_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync_v2, "cuda::driver::cuMemcpy2DAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D_v2, "cuda::driver::cuMemcpy3D_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync_v2, "cuda::driver::cuMemcpy3DAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA_v2, "cuda::driver::cuMemcpyHtoA_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync_v2, "cuda::driver::cuMemcpyHtoAAsync_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocHost_v2, "cuda::driver::cuMemAllocHost_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitEvent, "cuda::driver::cuStreamWaitEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetApiVersion, "cuda::driver::cuCtxGetApiVersion", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDirect3DDevice, "cuda::driver::cuD3D10GetDirect3DDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDirect3DDevice, "cuda::driver::cuD3D11GetDirect3DDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetCacheConfig, "cuda::driver::cuCtxGetCacheConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxSetCacheConfig, "cuda::driver::cuCtxSetCacheConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostRegister, "cuda::driver::cuMemHostRegister", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostUnregister, "cuda::driver::cuMemHostUnregister", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxSetCurrent, "cuda::driver::cuCtxSetCurrent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetCurrent, "cuda::driver::cuCtxGetCurrent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy, "cuda::driver::cuMemcpy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAsync, "cuda::driver::cuMemcpyAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchKernel, "cuda::driver::cuLaunchKernel", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuProfilerStart, "cuda::driver::cuProfilerStart", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuProfilerStop, "cuda::driver::cuProfilerStop", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuPointerGetAttribute, "cuda::driver::cuPointerGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuProfilerInitialize, "cuda::driver::cuProfilerInitialize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceCanAccessPeer, "cuda::driver::cuDeviceCanAccessPeer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxEnablePeerAccess, "cuda::driver::cuCtxEnablePeerAccess", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxDisablePeerAccess, "cuda::driver::cuCtxDisablePeerAccess", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPeerRegister, "cuda::driver::cuMemPeerRegister", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPeerUnregister, "cuda::driver::cuMemPeerUnregister", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPeerGetDevicePointer, "cuda::driver::cuMemPeerGetDevicePointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeer, "cuda::driver::cuMemcpyPeer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeerAsync, "cuda::driver::cuMemcpyPeerAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeer, "cuda::driver::cuMemcpy3DPeer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeerAsync, "cuda::driver::cuMemcpy3DPeerAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxDestroy_v2, "cuda::driver::cuCtxDestroy_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxPushCurrent_v2, "cuda::driver::cuCtxPushCurrent_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxPopCurrent_v2, "cuda::driver::cuCtxPopCurrent_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventDestroy_v2, "cuda::driver::cuEventDestroy_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamDestroy_v2, "cuda::driver::cuStreamDestroy_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D_v3, "cuda::driver::cuTexRefSetAddress2D_v3", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcGetMemHandle, "cuda::driver::cuIpcGetMemHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcOpenMemHandle, "cuda::driver::cuIpcOpenMemHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcCloseMemHandle, "cuda::driver::cuIpcCloseMemHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetByPCIBusId, "cuda::driver::cuDeviceGetByPCIBusId", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetPCIBusId, "cuda::driver::cuDeviceGetPCIBusId", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLGetDevices, "cuda::driver::cuGLGetDevices", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcGetEventHandle, "cuda::driver::cuIpcGetEventHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcOpenEventHandle, "cuda::driver::cuIpcOpenEventHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxSetSharedMemConfig, "cuda::driver::cuCtxSetSharedMemConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetSharedMemConfig, "cuda::driver::cuCtxGetSharedMemConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncSetSharedMemConfig, "cuda::driver::cuFuncSetSharedMemConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexObjectCreate, "cuda::driver::cuTexObjectCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexObjectDestroy, "cuda::driver::cuTexObjectDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetResourceDesc, "cuda::driver::cuTexObjectGetResourceDesc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetTextureDesc, "cuda::driver::cuTexObjectGetTextureDesc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfObjectCreate, "cuda::driver::cuSurfObjectCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfObjectDestroy, "cuda::driver::cuSurfObjectDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSurfObjectGetResourceDesc, "cuda::driver::cuSurfObjectGetResourceDesc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamAddCallback, "cuda::driver::cuStreamAddCallback", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayCreate, "cuda::driver::cuMipmappedArrayCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetLevel, "cuda::driver::cuMipmappedArrayGetLevel", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayDestroy, "cuda::driver::cuMipmappedArrayDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmappedArray, "cuda::driver::cuTexRefSetMipmappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapFilterMode, "cuda::driver::cuTexRefSetMipmapFilterMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapLevelBias, "cuda::driver::cuTexRefSetMipmapLevelBias", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapLevelClamp, "cuda::driver::cuTexRefSetMipmapLevelClamp", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMaxAnisotropy, "cuda::driver::cuTexRefSetMaxAnisotropy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmappedArray, "cuda::driver::cuTexRefGetMipmappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapFilterMode, "cuda::driver::cuTexRefGetMipmapFilterMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapLevelBias, "cuda::driver::cuTexRefGetMipmapLevelBias", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapLevelClamp, "cuda::driver::cuTexRefGetMipmapLevelClamp", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMaxAnisotropy, "cuda::driver::cuTexRefGetMaxAnisotropy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedMipmappedArray, "cuda::driver::cuGraphicsResourceGetMappedMipmappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetResourceViewDesc, "cuda::driver::cuTexObjectGetResourceViewDesc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkCreate, "cuda::driver::cuLinkCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkAddData, "cuda::driver::cuLinkAddData", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkAddFile, "cuda::driver::cuLinkAddFile", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkComplete, "cuda::driver::cuLinkComplete", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkDestroy, "cuda::driver::cuLinkDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamCreateWithPriority, "cuda::driver::cuStreamCreateWithPriority", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetPriority, "cuda::driver::cuStreamGetPriority", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetFlags, "cuda::driver::cuStreamGetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetStreamPriorityRange, "cuda::driver::cuCtxGetStreamPriorityRange", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocManaged, "cuda::driver::cuMemAllocManaged", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGetErrorString, "cuda::driver::cuGetErrorString", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGetErrorName, "cuda::driver::cuGetErrorName", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveBlocksPerMultiprocessor, "cuda::driver::cuOccupancyMaxActiveBlocksPerMultiprocessor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCompilePtx, "cuda::driver::cuCompilePtx", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuBinaryFree, "cuda::driver::cuBinaryFree", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamAttachMemAsync, "cuda::driver::cuStreamAttachMemAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuPointerSetAttribute, "cuda::driver::cuPointerSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemHostRegister_v2, "cuda::driver::cuMemHostRegister_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceSetMapFlags_v2, "cuda::driver::cuGraphicsResourceSetMapFlags_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkCreate_v2, "cuda::driver::cuLinkCreate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkAddData_v2, "cuda::driver::cuLinkAddData_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLinkAddFile_v2, "cuda::driver::cuLinkAddFile_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialBlockSize, "cuda::driver::cuOccupancyMaxPotentialBlockSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLGetDevices_v2, "cuda::driver::cuGLGetDevices_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRetain, "cuda::driver::cuDevicePrimaryCtxRetain", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRelease, "cuda::driver::cuDevicePrimaryCtxRelease", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxSetFlags, "cuda::driver::cuDevicePrimaryCtxSetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxReset, "cuda::driver::cuDevicePrimaryCtxReset", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsEGLRegisterImage, "cuda::driver::cuGraphicsEGLRegisterImage", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetFlags, "cuda::driver::cuCtxGetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxGetState, "cuda::driver::cuDevicePrimaryCtxGetState", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerConnect, "cuda::driver::cuEGLStreamConsumerConnect", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerDisconnect, "cuda::driver::cuEGLStreamConsumerDisconnect", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerAcquireFrame, "cuda::driver::cuEGLStreamConsumerAcquireFrame", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerReleaseFrame, "cuda::driver::cuEGLStreamConsumerReleaseFrame", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD_v2_ptds, "cuda::driver::cuMemcpyHtoD_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH_v2_ptds, "cuda::driver::cuMemcpyDtoH_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD_v2_ptds, "cuda::driver::cuMemcpyDtoD_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA_v2_ptds, "cuda::driver::cuMemcpyDtoA_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD_v2_ptds, "cuda::driver::cuMemcpyAtoD_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA_v2_ptds, "cuda::driver::cuMemcpyHtoA_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH_v2_ptds, "cuda::driver::cuMemcpyAtoH_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA_v2_ptds, "cuda::driver::cuMemcpyAtoA_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D_v2_ptds, "cuda::driver::cuMemcpy2D_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned_v2_ptds, "cuda::driver::cuMemcpy2DUnaligned_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D_v2_ptds, "cuda::driver::cuMemcpy3D_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy_ptds, "cuda::driver::cuMemcpy_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeer_ptds, "cuda::driver::cuMemcpyPeer_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeer_ptds, "cuda::driver::cuMemcpy3DPeer_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD8_v2_ptds, "cuda::driver::cuMemsetD8_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD16_v2_ptds, "cuda::driver::cuMemsetD16_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD32_v2_ptds, "cuda::driver::cuMemsetD32_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8_v2_ptds, "cuda::driver::cuMemsetD2D8_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16_v2_ptds, "cuda::driver::cuMemsetD2D16_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32_v2_ptds, "cuda::driver::cuMemsetD2D32_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject_v2_ptds, "cuda::driver::cuGLMapBufferObject_v2_ptds", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAsync_ptsz, "cuda::driver::cuMemcpyAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync_v2_ptsz, "cuda::driver::cuMemcpyHtoAAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync_v2_ptsz, "cuda::driver::cuMemcpyAtoHAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync_v2_ptsz, "cuda::driver::cuMemcpyHtoDAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync_v2_ptsz, "cuda::driver::cuMemcpyDtoHAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync_v2_ptsz, "cuda::driver::cuMemcpyDtoDAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync_v2_ptsz, "cuda::driver::cuMemcpy2DAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync_v2_ptsz, "cuda::driver::cuMemcpy3DAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeerAsync_ptsz, "cuda::driver::cuMemcpyPeerAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeerAsync_ptsz, "cuda::driver::cuMemcpy3DPeerAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD8Async_ptsz, "cuda::driver::cuMemsetD8Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD16Async_ptsz, "cuda::driver::cuMemsetD16Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD32Async_ptsz, "cuda::driver::cuMemsetD32Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8Async_ptsz, "cuda::driver::cuMemsetD2D8Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16Async_ptsz, "cuda::driver::cuMemsetD2D16Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32Async_ptsz, "cuda::driver::cuMemsetD2D32Async_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetPriority_ptsz, "cuda::driver::cuStreamGetPriority_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetFlags_ptsz, "cuda::driver::cuStreamGetFlags_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitEvent_ptsz, "cuda::driver::cuStreamWaitEvent_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamAddCallback_ptsz, "cuda::driver::cuStreamAddCallback_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamAttachMemAsync_ptsz, "cuda::driver::cuStreamAttachMemAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamQuery_ptsz, "cuda::driver::cuStreamQuery_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSynchronize_ptsz, "cuda::driver::cuStreamSynchronize_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventRecord_ptsz, "cuda::driver::cuEventRecord_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchKernel_ptsz, "cuda::driver::cuLaunchKernel_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsMapResources_ptsz, "cuda::driver::cuGraphicsMapResources_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnmapResources_ptsz, "cuda::driver::cuGraphicsUnmapResources_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync_v2_ptsz, "cuda::driver::cuGLMapBufferObjectAsync_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerConnect, "cuda::driver::cuEGLStreamProducerConnect", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerDisconnect, "cuda::driver::cuEGLStreamProducerDisconnect", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerPresentFrame, "cuda::driver::cuEGLStreamProducerPresentFrame", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedEglFrame, "cuda::driver::cuGraphicsResourceGetMappedEglFrame", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuPointerGetAttributes, "cuda::driver::cuPointerGetAttributes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, "cuda::driver::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialBlockSizeWithFlags, "cuda::driver::cuOccupancyMaxPotentialBlockSizeWithFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerReturnFrame, "cuda::driver::cuEGLStreamProducerReturnFrame", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetP2PAttribute, "cuda::driver::cuDeviceGetP2PAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefSetBorderColor, "cuda::driver::cuTexRefSetBorderColor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTexRefGetBorderColor, "cuda::driver::cuTexRefGetBorderColor", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAdvise, "cuda::driver::cuMemAdvise", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32, "cuda::driver::cuStreamWaitValue32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_ptsz, "cuda::driver::cuStreamWaitValue32_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32, "cuda::driver::cuStreamWriteValue32", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_ptsz, "cuda::driver::cuStreamWriteValue32_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp, "cuda::driver::cuStreamBatchMemOp", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_ptsz, "cuda::driver::cuStreamBatchMemOp_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuNVNbufferGetPointer, "cuda::driver::cuNVNbufferGetPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuNVNtextureGetArray, "cuda::driver::cuNVNtextureGetArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuNNSetAllocator, "cuda::driver::cuNNSetAllocator", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync, "cuda::driver::cuMemPrefetchAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync_ptsz, "cuda::driver::cuMemPrefetchAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventCreateFromNVNSync, "cuda::driver::cuEventCreateFromNVNSync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerConnectWithFlags, "cuda::driver::cuEGLStreamConsumerConnectWithFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemRangeGetAttribute, "cuda::driver::cuMemRangeGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemRangeGetAttributes, "cuda::driver::cuMemRangeGetAttributes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64, "cuda::driver::cuStreamWaitValue64", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_ptsz, "cuda::driver::cuStreamWaitValue64_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64, "cuda::driver::cuStreamWriteValue64", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_ptsz, "cuda::driver::cuStreamWriteValue64_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernel, "cuda::driver::cuLaunchCooperativeKernel", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernel_ptsz, "cuda::driver::cuLaunchCooperativeKernel_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventCreateFromEGLSync, "cuda::driver::cuEventCreateFromEGLSync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernelMultiDevice, "cuda::driver::cuLaunchCooperativeKernelMultiDevice", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncSetAttribute, "cuda::driver::cuFuncSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetUuid, "cuda::driver::cuDeviceGetUuid", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx, "cuda::driver::cuStreamGetCtx", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx_ptsz, "cuda::driver::cuStreamGetCtx_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuImportExternalMemory, "cuda::driver::cuImportExternalMemory", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuExternalMemoryGetMappedBuffer, "cuda::driver::cuExternalMemoryGetMappedBuffer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuExternalMemoryGetMappedMipmappedArray, "cuda::driver::cuExternalMemoryGetMappedMipmappedArray", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDestroyExternalMemory, "cuda::driver::cuDestroyExternalMemory", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuImportExternalSemaphore, "cuda::driver::cuImportExternalSemaphore", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSignalExternalSemaphoresAsync, "cuda::driver::cuSignalExternalSemaphoresAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuSignalExternalSemaphoresAsync_ptsz, "cuda::driver::cuSignalExternalSemaphoresAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuWaitExternalSemaphoresAsync, "cuda::driver::cuWaitExternalSemaphoresAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuWaitExternalSemaphoresAsync_ptsz, "cuda::driver::cuWaitExternalSemaphoresAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDestroyExternalSemaphore, "cuda::driver::cuDestroyExternalSemaphore", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture, "cuda::driver::cuStreamBeginCapture", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_ptsz, "cuda::driver::cuStreamBeginCapture_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamEndCapture, "cuda::driver::cuStreamEndCapture", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamEndCapture_ptsz, "cuda::driver::cuStreamEndCapture_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamIsCapturing, "cuda::driver::cuStreamIsCapturing", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamIsCapturing_ptsz, "cuda::driver::cuStreamIsCapturing_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphCreate, "cuda::driver::cuGraphCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddKernelNode, "cuda::driver::cuGraphAddKernelNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetParams, "cuda::driver::cuGraphKernelNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemcpyNode, "cuda::driver::cuGraphAddMemcpyNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemcpyNodeGetParams, "cuda::driver::cuGraphMemcpyNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemsetNode, "cuda::driver::cuGraphAddMemsetNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemsetNodeGetParams, "cuda::driver::cuGraphMemsetNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemsetNodeSetParams, "cuda::driver::cuGraphMemsetNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetType, "cuda::driver::cuGraphNodeGetType", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphGetRootNodes, "cuda::driver::cuGraphGetRootNodes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependencies, "cuda::driver::cuGraphNodeGetDependencies", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependentNodes, "cuda::driver::cuGraphNodeGetDependentNodes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiate, "cuda::driver::cuGraphInstantiate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphLaunch, "cuda::driver::cuGraphLaunch", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphLaunch_ptsz, "cuda::driver::cuGraphLaunch_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecDestroy, "cuda::driver::cuGraphExecDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphDestroy, "cuda::driver::cuGraphDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddDependencies, "cuda::driver::cuGraphAddDependencies", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphRemoveDependencies, "cuda::driver::cuGraphRemoveDependencies", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemcpyNodeSetParams, "cuda::driver::cuGraphMemcpyNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetParams, "cuda::driver::cuGraphKernelNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphDestroyNode, "cuda::driver::cuGraphDestroyNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphClone, "cuda::driver::cuGraphClone", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeFindInClone, "cuda::driver::cuGraphNodeFindInClone", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddChildGraphNode, "cuda::driver::cuGraphAddChildGraphNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddEmptyNode, "cuda::driver::cuGraphAddEmptyNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchHostFunc, "cuda::driver::cuLaunchHostFunc", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchHostFunc_ptsz, "cuda::driver::cuLaunchHostFunc_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphChildGraphNodeGetGraph, "cuda::driver::cuGraphChildGraphNodeGetGraph", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddHostNode, "cuda::driver::cuGraphAddHostNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphHostNodeGetParams, "cuda::driver::cuGraphHostNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetLuid, "cuda::driver::cuDeviceGetLuid", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphHostNodeSetParams, "cuda::driver::cuGraphHostNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphGetNodes, "cuda::driver::cuGraphGetNodes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphGetEdges, "cuda::driver::cuGraphGetEdges", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo, "cuda::driver::cuStreamGetCaptureInfo", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_ptsz, "cuda::driver::cuStreamGetCaptureInfo_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecKernelNodeSetParams, "cuda::driver::cuGraphExecKernelNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_v2, "cuda::driver::cuStreamBeginCapture_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_v2_ptsz, "cuda::driver::cuStreamBeginCapture_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuThreadExchangeStreamCaptureMode, "cuda::driver::cuThreadExchangeStreamCaptureMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetNvSciSyncAttributes, "cuda::driver::cuDeviceGetNvSciSyncAttributes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyAvailableDynamicSMemPerBlock, "cuda::driver::cuOccupancyAvailableDynamicSMemPerBlock", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRelease_v2, "cuda::driver::cuDevicePrimaryCtxRelease_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxReset_v2, "cuda::driver::cuDevicePrimaryCtxReset_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxSetFlags_v2, "cuda::driver::cuDevicePrimaryCtxSetFlags_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAddressReserve, "cuda::driver::cuMemAddressReserve", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAddressFree, "cuda::driver::cuMemAddressFree", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemCreate, "cuda::driver::cuMemCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemRelease, "cuda::driver::cuMemRelease", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemMap, "cuda::driver::cuMemMap", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemUnmap, "cuda::driver::cuMemUnmap", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemSetAccess, "cuda::driver::cuMemSetAccess", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemExportToShareableHandle, "cuda::driver::cuMemExportToShareableHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemImportFromShareableHandle, "cuda::driver::cuMemImportFromShareableHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetAllocationGranularity, "cuda::driver::cuMemGetAllocationGranularity", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetAllocationPropertiesFromHandle, "cuda::driver::cuMemGetAllocationPropertiesFromHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetAccess, "cuda::driver::cuMemGetAccess", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSetFlags, "cuda::driver::cuStreamSetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSetFlags_ptsz, "cuda::driver::cuStreamSetFlags_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecUpdate, "cuda::driver::cuGraphExecUpdate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecMemcpyNodeSetParams, "cuda::driver::cuGraphExecMemcpyNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecMemsetNodeSetParams, "cuda::driver::cuGraphExecMemsetNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecHostNodeSetParams, "cuda::driver::cuGraphExecHostNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemRetainAllocationHandle, "cuda::driver::cuMemRetainAllocationHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuFuncGetModule, "cuda::driver::cuFuncGetModule", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuIpcOpenMemHandle_v2, "cuda::driver::cuIpcOpenMemHandle_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxResetPersistingL2Cache, "cuda::driver::cuCtxResetPersistingL2Cache", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeCopyAttributes, "cuda::driver::cuGraphKernelNodeCopyAttributes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetAttribute, "cuda::driver::cuGraphKernelNodeGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetAttribute, "cuda::driver::cuGraphKernelNodeSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamCopyAttributes, "cuda::driver::cuStreamCopyAttributes", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamCopyAttributes_ptsz, "cuda::driver::cuStreamCopyAttributes_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetAttribute, "cuda::driver::cuStreamGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetAttribute_ptsz, "cuda::driver::cuStreamGetAttribute_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSetAttribute, "cuda::driver::cuStreamSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamSetAttribute_ptsz, "cuda::driver::cuStreamSetAttribute_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiate_v2, "cuda::driver::cuGraphInstantiate_v2", OTF2_UNDEFINED_REGION}, #if CUPTI_API_VERSION >= 14 {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetTexture1DLinearMaxWidth, "cuda::driver::cuDeviceGetTexture1DLinearMaxWidth", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphUpload, "cuda::driver::cuGraphUpload", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphUpload_ptsz, "cuda::driver::cuGraphUpload_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayGetSparseProperties, "cuda::driver::cuArrayGetSparseProperties", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetSparseProperties, "cuda::driver::cuMipmappedArrayGetSparseProperties", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemMapArrayAsync, "cuda::driver::cuMemMapArrayAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemMapArrayAsync_ptsz, "cuda::driver::cuMemMapArrayAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecChildGraphNodeSetParams, "cuda::driver::cuGraphExecChildGraphNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventRecordWithFlags, "cuda::driver::cuEventRecordWithFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuEventRecordWithFlags_ptsz, "cuda::driver::cuEventRecordWithFlags_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddEventRecordNode, "cuda::driver::cuGraphAddEventRecordNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddEventWaitNode, "cuda::driver::cuGraphAddEventWaitNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphEventRecordNodeGetEvent, "cuda::driver::cuGraphEventRecordNodeGetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphEventWaitNodeGetEvent, "cuda::driver::cuGraphEventWaitNodeGetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphEventRecordNodeSetEvent, "cuda::driver::cuGraphEventRecordNodeSetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphEventWaitNodeSetEvent, "cuda::driver::cuGraphEventWaitNodeSetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecEventRecordNodeSetEvent, "cuda::driver::cuGraphExecEventRecordNodeSetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecEventWaitNodeSetEvent, "cuda::driver::cuGraphExecEventWaitNodeSetEvent", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayGetPlane, "cuda::driver::cuArrayGetPlane", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocAsync, "cuda::driver::cuMemAllocAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocAsync_ptsz, "cuda::driver::cuMemAllocAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemFreeAsync, "cuda::driver::cuMemFreeAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemFreeAsync_ptsz, "cuda::driver::cuMemFreeAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolTrimTo, "cuda::driver::cuMemPoolTrimTo", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolSetAttribute, "cuda::driver::cuMemPoolSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolGetAttribute, "cuda::driver::cuMemPoolGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolSetAccess, "cuda::driver::cuMemPoolSetAccess", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 14 {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetDefaultMemPool, "cuda::driver::cuDeviceGetDefaultMemPool", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolCreate, "cuda::driver::cuMemPoolCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolDestroy, "cuda::driver::cuMemPoolDestroy", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceSetMemPool, "cuda::driver::cuDeviceSetMemPool", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetMemPool, "cuda::driver::cuDeviceGetMemPool", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocFromPoolAsync, "cuda::driver::cuMemAllocFromPoolAsync", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemAllocFromPoolAsync_ptsz, "cuda::driver::cuMemAllocFromPoolAsync_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolExportToShareableHandle, "cuda::driver::cuMemPoolExportToShareableHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolImportFromShareableHandle, "cuda::driver::cuMemPoolImportFromShareableHandle", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolExportPointer, "cuda::driver::cuMemPoolExportPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolImportPointer, "cuda::driver::cuMemPoolImportPointer", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemPoolGetAccess, "cuda::driver::cuMemPoolGetAccess", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddExternalSemaphoresSignalNode, "cuda::driver::cuGraphAddExternalSemaphoresSignalNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresSignalNodeGetParams, "cuda::driver::cuGraphExternalSemaphoresSignalNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresSignalNodeSetParams, "cuda::driver::cuGraphExternalSemaphoresSignalNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddExternalSemaphoresWaitNode, "cuda::driver::cuGraphAddExternalSemaphoresWaitNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresWaitNodeGetParams, "cuda::driver::cuGraphExternalSemaphoresWaitNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresWaitNodeSetParams, "cuda::driver::cuGraphExternalSemaphoresWaitNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecExternalSemaphoresSignalNodeSetParams, "cuda::driver::cuGraphExecExternalSemaphoresSignalNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecExternalSemaphoresWaitNodeSetParams, "cuda::driver::cuGraphExecExternalSemaphoresWaitNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGetProcAddress, "cuda::driver::cuGetProcAddress", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 13 {CUPTI_DRIVER_TRACE_CBID_cuFlushGPUDirectRDMAWrites, "cuda::driver::cuFlushGPUDirectRDMAWrites", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphDebugDotPrint, "cuda::driver::cuGraphDebugDotPrint", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v2, "cuda::driver::cuStreamGetCaptureInfo_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v2_ptsz, "cuda::driver::cuStreamGetCaptureInfo_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies, "cuda::driver::cuStreamUpdateCaptureDependencies", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies_ptsz, "cuda::driver::cuStreamUpdateCaptureDependencies_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuUserObjectCreate, "cuda::driver::cuUserObjectCreate", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuUserObjectRetain, "cuda::driver::cuUserObjectRetain", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuUserObjectRelease, "cuda::driver::cuUserObjectRelease", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphRetainUserObject, "cuda::driver::cuGraphRetainUserObject", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphReleaseUserObject, "cuda::driver::cuGraphReleaseUserObject", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 14 {CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemAllocNode, "cuda::driver::cuGraphAddMemAllocNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemFreeNode, "cuda::driver::cuGraphAddMemFreeNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGraphMemTrim, "cuda::driver::cuDeviceGraphMemTrim", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetGraphMemAttribute, "cuda::driver::cuDeviceGetGraphMemAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceSetGraphMemAttribute, "cuda::driver::cuDeviceSetGraphMemAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithFlags, "cuda::driver::cuGraphInstantiateWithFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetExecAffinitySupport, "cuda::driver::cuDeviceGetExecAffinitySupport", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxCreate_v3, "cuda::driver::cuCtxCreate_v3", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetExecAffinity, "cuda::driver::cuCtxGetExecAffinity", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuDeviceGetUuid_v2, "cuda::driver::cuDeviceGetUuid_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemAllocNodeGetParams, "cuda::driver::cuGraphMemAllocNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphMemFreeNodeGetParams, "cuda::driver::cuGraphMemFreeNodeGetParams", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 16 {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeSetEnabled, "cuda::driver::cuGraphNodeSetEnabled", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetEnabled, "cuda::driver::cuGraphNodeGetEnabled", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchKernelEx, "cuda::driver::cuLaunchKernelEx", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLaunchKernelEx_ptsz, "cuda::driver::cuLaunchKernelEx_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuArrayGetMemoryRequirements, "cuda::driver::cuArrayGetMemoryRequirements", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetMemoryRequirements, "cuda::driver::cuMipmappedArrayGetMemoryRequirements", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 17 {CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithParams, "cuda::driver::cuGraphInstantiateWithParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithParams_ptsz, "cuda::driver::cuGraphInstantiateWithParams_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecGetFlags, "cuda::driver::cuGraphExecGetFlags", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_v2, "cuda::driver::cuStreamWaitValue32_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_v2_ptsz, "cuda::driver::cuStreamWaitValue32_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_v2, "cuda::driver::cuStreamWaitValue64_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_v2_ptsz, "cuda::driver::cuStreamWaitValue64_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_v2, "cuda::driver::cuStreamWriteValue32_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_v2_ptsz, "cuda::driver::cuStreamWriteValue32_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_v2, "cuda::driver::cuStreamWriteValue64_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_v2_ptsz, "cuda::driver::cuStreamWriteValue64_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_v2, "cuda::driver::cuStreamBatchMemOp_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_v2_ptsz, "cuda::driver::cuStreamBatchMemOp_v2_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddBatchMemOpNode, "cuda::driver::cuGraphAddBatchMemOpNode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphBatchMemOpNodeGetParams, "cuda::driver::cuGraphBatchMemOpNodeGetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphBatchMemOpNodeSetParams, "cuda::driver::cuGraphBatchMemOpNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecBatchMemOpNodeSetParams, "cuda::driver::cuGraphExecBatchMemOpNodeSetParams", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuModuleGetLoadingMode, "cuda::driver::cuModuleGetLoadingMode", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuMemGetHandleForAddressRange, "cuda::driver::cuMemGetHandleForAddressRange", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialClusterSize, "cuda::driver::cuOccupancyMaxPotentialClusterSize", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveClusters, "cuda::driver::cuOccupancyMaxActiveClusters", OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 19 {CUPTI_DRIVER_TRACE_CBID_cuGetProcAddress_v2, "cuda::driver::cuGetProcAddress_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryLoadData, "cuda::driver::cuLibraryLoadData", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryLoadFromFile, "cuda::driver::cuLibraryLoadFromFile", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryUnload, "cuda::driver::cuLibraryUnload", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryGetKernel, "cuda::driver::cuLibraryGetKernel", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryGetModule, "cuda::driver::cuLibraryGetModule", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuKernelGetFunction, "cuda::driver::cuKernelGetFunction", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryGetGlobal, "cuda::driver::cuLibraryGetGlobal", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryGetManaged, "cuda::driver::cuLibraryGetManaged", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuKernelGetAttribute, "cuda::driver::cuKernelGetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuKernelSetAttribute, "cuda::driver::cuKernelSetAttribute", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuKernelSetCacheConfig, "cuda::driver::cuKernelSetCacheConfig", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphAddKernelNode_v2, "cuda::driver::cuGraphAddKernelNode_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetParams_v2, "cuda::driver::cuGraphKernelNodeGetParams_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetParams_v2, "cuda::driver::cuGraphKernelNodeSetParams_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecKernelNodeSetParams_v2, "cuda::driver::cuGraphExecKernelNodeSetParams_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetId, "cuda::driver::cuStreamGetId", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuStreamGetId_ptsz, "cuda::driver::cuStreamGetId_ptsz", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuCtxGetId, "cuda::driver::cuCtxGetId", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuGraphExecUpdate_v2, "cuda::driver::cuGraphExecUpdate_v2", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTensorMapEncodeTiled, "cuda::driver::cuTensorMapEncodeTiled", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTensorMapEncodeIm2col, "cuda::driver::cuTensorMapEncodeIm2col", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuTensorMapReplaceAddress, "cuda::driver::cuTensorMapReplaceAddress", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_cuLibraryGetUnifiedFunction, "cuda::driver::cuLibraryGetUnifiedFunction", OTF2_UNDEFINED_REGION}, #endif {CUPTI_DRIVER_TRACE_CBID_SIZE, "cuda::driver::SIZE", OTF2_UNDEFINED_REGION}, {CUPTI_DRIVER_TRACE_CBID_FORCE_INT, "cuda::driver::FORCE_INT", OTF2_UNDEFINED_REGION}, }; void CUPTIAPI eztrace_cuda_driver_callback(void *userdata, CUpti_CallbackDomain domain, CUpti_CallbackId cbid, const void *cbdata) { if(domain != CUPTI_CB_DOMAIN_DRIVER_API) return; if(!EZTRACE_SAFE) return; const CUpti_CallbackData *cbInfo = (CUpti_CallbackData *)cbdata; const char* enter_leave = cbInfo->callbackSite == CUPTI_API_ENTER? "Enter":"Leave"; if(cuda_driver_api_info[cbid].region == OTF2_UNDEFINED_REGION) { cuda_driver_api_info[cbid].region = ezt_otf2_register_function(cuda_driver_api_info[cbid].function_name); if(cbInfo->callbackSite == CUPTI_API_ENTER) { EZT_OTF2_EvtWriter_Enter( evt_writer, NULL, ezt_get_timestamp(), cuda_driver_api_info[cbid].region); } else { EZT_OTF2_EvtWriter_Leave( evt_writer, NULL, ezt_get_timestamp(), cuda_driver_api_info[cbid].region); } } } eztrace-2.1/src/modules/cuda/cuda_runtime.c000066400000000000000000002123561447213526500210310ustar00rootroot00000000000000#define _REENTRANT #include #include #include #include #include #include #include /* This file intercepts calls to the CUDA runtime API. * Since nvcc statically links the application against cuda by default, we cannot use the usual LD_PRELOAD method. * Instead, we use cupti callback API. */ struct cuda_runtime_api_info { enum CUpti_runtime_api_trace_cbid_enum id; char *function_name; OTF2_RegionRef region; }; static struct cuda_runtime_api_info cuda_runtime_api_info[] = { {.id=CUPTI_RUNTIME_TRACE_CBID_INVALID, .function_name="cuda::runtime::INVALID", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDriverGetVersion_v3020, .function_name="cuda::runtime::cudaDriverGetVersion", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaRuntimeGetVersion_v3020, .function_name="cuda::runtime::cudaRuntimeGetVersion", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDeviceCount_v3020, .function_name="cuda::runtime::cudaGetDeviceCount", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDeviceProperties_v3020, .function_name="cuda::runtime::cudaGetDeviceProperties", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaChooseDevice_v3020, .function_name="cuda::runtime::cudaChooseDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetChannelDesc_v3020, .function_name="cuda::runtime::cudaGetChannelDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaCreateChannelDesc_v3020, .function_name="cuda::runtime::cudaCreateChannelDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaConfigureCall_v3020, .function_name="cuda::runtime::cudaConfigureCall", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetupArgument_v3020, .function_name="cuda::runtime::cudaSetupArgument", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetLastError_v3020, .function_name="cuda::runtime::cudaGetLastError", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaPeekAtLastError_v3020, .function_name="cuda::runtime::cudaPeekAtLastError", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetErrorString_v3020, .function_name="cuda::runtime::cudaGetErrorString", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunch_v3020, .function_name="cuda::runtime::cudaLaunch", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFuncSetCacheConfig_v3020, .function_name="cuda::runtime::cudaFuncSetCacheConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFuncGetAttributes_v3020, .function_name="cuda::runtime::cudaFuncGetAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetDevice_v3020, .function_name="cuda::runtime::cudaSetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDevice_v3020, .function_name="cuda::runtime::cudaGetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetValidDevices_v3020, .function_name="cuda::runtime::cudaSetValidDevices", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetDeviceFlags_v3020, .function_name="cuda::runtime::cudaSetDeviceFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMalloc_v3020, .function_name="cuda::runtime::cudaMalloc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocPitch_v3020, .function_name="cuda::runtime::cudaMallocPitch", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFree_v3020, .function_name="cuda::runtime::cudaFree", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocArray_v3020, .function_name="cuda::runtime::cudaMallocArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFreeArray_v3020, .function_name="cuda::runtime::cudaFreeArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocHost_v3020, .function_name="cuda::runtime::cudaMallocHost", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFreeHost_v3020, .function_name="cuda::runtime::cudaFreeHost", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaHostAlloc_v3020, .function_name="cuda::runtime::cudaHostAlloc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaHostGetDevicePointer_v3020, .function_name="cuda::runtime::cudaHostGetDevicePointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaHostGetFlags_v3020, .function_name="cuda::runtime::cudaHostGetFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemGetInfo_v3020, .function_name="cuda::runtime::cudaMemGetInfo", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy_v3020, .function_name="cuda::runtime::cudaMemcpy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2D_v3020, .function_name="cuda::runtime::cudaMemcpy2D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToArray_v3020, .function_name="cuda::runtime::cudaMemcpyToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DToArray_v3020, .function_name="cuda::runtime::cudaMemcpy2DToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromArray_v3020, .function_name="cuda::runtime::cudaMemcpyFromArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DFromArray_v3020, .function_name="cuda::runtime::cudaMemcpy2DFromArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyArrayToArray_v3020, .function_name="cuda::runtime::cudaMemcpyArrayToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DArrayToArray_v3020, .function_name="cuda::runtime::cudaMemcpy2DArrayToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToSymbol_v3020, .function_name="cuda::runtime::cudaMemcpyToSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromSymbol_v3020, .function_name="cuda::runtime::cudaMemcpyFromSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyAsync_v3020, .function_name="cuda::runtime::cudaMemcpyAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToArrayAsync_v3020, .function_name="cuda::runtime::cudaMemcpyToArrayAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromArrayAsync_v3020, .function_name="cuda::runtime::cudaMemcpyFromArrayAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DAsync_v3020, .function_name="cuda::runtime::cudaMemcpy2DAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DToArrayAsync_v3020, .function_name="cuda::runtime::cudaMemcpy2DToArrayAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DFromArrayAsync_v3020, .function_name="cuda::runtime::cudaMemcpy2DFromArrayAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToSymbolAsync_v3020, .function_name="cuda::runtime::cudaMemcpyToSymbolAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromSymbolAsync_v3020, .function_name="cuda::runtime::cudaMemcpyFromSymbolAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset_v3020, .function_name="cuda::runtime::cudaMemset", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset2D_v3020, .function_name="cuda::runtime::cudaMemset2D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemsetAsync_v3020, .function_name="cuda::runtime::cudaMemsetAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset2DAsync_v3020, .function_name="cuda::runtime::cudaMemset2DAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetSymbolAddress_v3020, .function_name="cuda::runtime::cudaGetSymbolAddress", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetSymbolSize_v3020, .function_name="cuda::runtime::cudaGetSymbolSize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaBindTexture_v3020, .function_name="cuda::runtime::cudaBindTexture", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaBindTexture2D_v3020, .function_name="cuda::runtime::cudaBindTexture2D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaBindTextureToArray_v3020, .function_name="cuda::runtime::cudaBindTextureToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaUnbindTexture_v3020, .function_name="cuda::runtime::cudaUnbindTexture", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureAlignmentOffset_v3020, .function_name="cuda::runtime::cudaGetTextureAlignmentOffset", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureReference_v3020, .function_name="cuda::runtime::cudaGetTextureReference", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaBindSurfaceToArray_v3020, .function_name="cuda::runtime::cudaBindSurfaceToArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetSurfaceReference_v3020, .function_name="cuda::runtime::cudaGetSurfaceReference", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLSetGLDevice_v3020, .function_name="cuda::runtime::cudaGLSetGLDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLRegisterBufferObject_v3020, .function_name="cuda::runtime::cudaGLRegisterBufferObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLMapBufferObject_v3020, .function_name="cuda::runtime::cudaGLMapBufferObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLUnmapBufferObject_v3020, .function_name="cuda::runtime::cudaGLUnmapBufferObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLUnregisterBufferObject_v3020, .function_name="cuda::runtime::cudaGLUnregisterBufferObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLSetBufferObjectMapFlags_v3020, .function_name="cuda::runtime::cudaGLSetBufferObjectMapFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLMapBufferObjectAsync_v3020, .function_name="cuda::runtime::cudaGLMapBufferObjectAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLUnmapBufferObjectAsync_v3020, .function_name="cuda::runtime::cudaGLUnmapBufferObjectAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaWGLGetDevice_v3020, .function_name="cuda::runtime::cudaWGLGetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsGLRegisterImage_v3020, .function_name="cuda::runtime::cudaGraphicsGLRegisterImage", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsGLRegisterBuffer_v3020, .function_name="cuda::runtime::cudaGraphicsGLRegisterBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsUnregisterResource_v3020, .function_name="cuda::runtime::cudaGraphicsUnregisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsResourceSetMapFlags_v3020, .function_name="cuda::runtime::cudaGraphicsResourceSetMapFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsMapResources_v3020, .function_name="cuda::runtime::cudaGraphicsMapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsUnmapResources_v3020, .function_name="cuda::runtime::cudaGraphicsUnmapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsResourceGetMappedPointer_v3020, .function_name="cuda::runtime::cudaGraphicsResourceGetMappedPointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsSubResourceGetMappedArray_v3020, .function_name="cuda::runtime::cudaGraphicsSubResourceGetMappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaVDPAUGetDevice_v3020, .function_name="cuda::runtime::cudaVDPAUGetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaVDPAUSetVDPAUDevice_v3020, .function_name="cuda::runtime::cudaVDPAUSetVDPAUDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsVDPAURegisterVideoSurface_v3020, .function_name="cuda::runtime::cudaGraphicsVDPAURegisterVideoSurface", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsVDPAURegisterOutputSurface_v3020, .function_name="cuda::runtime::cudaGraphicsVDPAURegisterOutputSurface", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D11GetDevice_v3020, .function_name="cuda::runtime::cudaD3D11GetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D11GetDevices_v3020, .function_name="cuda::runtime::cudaD3D11GetDevices", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D11SetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D11SetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsD3D11RegisterResource_v3020, .function_name="cuda::runtime::cudaGraphicsD3D11RegisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10GetDevice_v3020, .function_name="cuda::runtime::cudaD3D10GetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10GetDevices_v3020, .function_name="cuda::runtime::cudaD3D10GetDevices", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10SetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D10SetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsD3D10RegisterResource_v3020, .function_name="cuda::runtime::cudaGraphicsD3D10RegisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10RegisterResource_v3020, .function_name="cuda::runtime::cudaD3D10RegisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10UnregisterResource_v3020, .function_name="cuda::runtime::cudaD3D10UnregisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10MapResources_v3020, .function_name="cuda::runtime::cudaD3D10MapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10UnmapResources_v3020, .function_name="cuda::runtime::cudaD3D10UnmapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceSetMapFlags_v3020, .function_name="cuda::runtime::cudaD3D10ResourceSetMapFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceGetSurfaceDimensions_v3020, .function_name="cuda::runtime::cudaD3D10ResourceGetSurfaceDimensions", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceGetMappedArray_v3020, .function_name="cuda::runtime::cudaD3D10ResourceGetMappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceGetMappedPointer_v3020, .function_name="cuda::runtime::cudaD3D10ResourceGetMappedPointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceGetMappedSize_v3020, .function_name="cuda::runtime::cudaD3D10ResourceGetMappedSize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10ResourceGetMappedPitch_v3020, .function_name="cuda::runtime::cudaD3D10ResourceGetMappedPitch", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9GetDevice_v3020, .function_name="cuda::runtime::cudaD3D9GetDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9GetDevices_v3020, .function_name="cuda::runtime::cudaD3D9GetDevices", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9SetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D9SetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9GetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D9GetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsD3D9RegisterResource_v3020, .function_name="cuda::runtime::cudaGraphicsD3D9RegisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9RegisterResource_v3020, .function_name="cuda::runtime::cudaD3D9RegisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9UnregisterResource_v3020, .function_name="cuda::runtime::cudaD3D9UnregisterResource", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9MapResources_v3020, .function_name="cuda::runtime::cudaD3D9MapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9UnmapResources_v3020, .function_name="cuda::runtime::cudaD3D9UnmapResources", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceSetMapFlags_v3020, .function_name="cuda::runtime::cudaD3D9ResourceSetMapFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceGetSurfaceDimensions_v3020, .function_name="cuda::runtime::cudaD3D9ResourceGetSurfaceDimensions", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceGetMappedArray_v3020, .function_name="cuda::runtime::cudaD3D9ResourceGetMappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceGetMappedPointer_v3020, .function_name="cuda::runtime::cudaD3D9ResourceGetMappedPointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceGetMappedSize_v3020, .function_name="cuda::runtime::cudaD3D9ResourceGetMappedSize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9ResourceGetMappedPitch_v3020, .function_name="cuda::runtime::cudaD3D9ResourceGetMappedPitch", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9Begin_v3020, .function_name="cuda::runtime::cudaD3D9Begin", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9End_v3020, .function_name="cuda::runtime::cudaD3D9End", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9RegisterVertexBuffer_v3020, .function_name="cuda::runtime::cudaD3D9RegisterVertexBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9UnregisterVertexBuffer_v3020, .function_name="cuda::runtime::cudaD3D9UnregisterVertexBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9MapVertexBuffer_v3020, .function_name="cuda::runtime::cudaD3D9MapVertexBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D9UnmapVertexBuffer_v3020, .function_name="cuda::runtime::cudaD3D9UnmapVertexBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadExit_v3020, .function_name="cuda::runtime::cudaThreadExit", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetDoubleForDevice_v3020, .function_name="cuda::runtime::cudaSetDoubleForDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSetDoubleForHost_v3020, .function_name="cuda::runtime::cudaSetDoubleForHost", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadSynchronize_v3020, .function_name="cuda::runtime::cudaThreadSynchronize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadGetLimit_v3020, .function_name="cuda::runtime::cudaThreadGetLimit", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadSetLimit_v3020, .function_name="cuda::runtime::cudaThreadSetLimit", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamCreate_v3020, .function_name="cuda::runtime::cudaStreamCreate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamDestroy_v3020, .function_name="cuda::runtime::cudaStreamDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSynchronize_v3020, .function_name="cuda::runtime::cudaStreamSynchronize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamQuery_v3020, .function_name="cuda::runtime::cudaStreamQuery", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventCreate_v3020, .function_name="cuda::runtime::cudaEventCreate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventCreateWithFlags_v3020, .function_name="cuda::runtime::cudaEventCreateWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventRecord_v3020, .function_name="cuda::runtime::cudaEventRecord", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventDestroy_v3020, .function_name="cuda::runtime::cudaEventDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventSynchronize_v3020, .function_name="cuda::runtime::cudaEventSynchronize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventQuery_v3020, .function_name="cuda::runtime::cudaEventQuery", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventElapsedTime_v3020, .function_name="cuda::runtime::cudaEventElapsedTime", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMalloc3D_v3020, .function_name="cuda::runtime::cudaMalloc3D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMalloc3DArray_v3020, .function_name="cuda::runtime::cudaMalloc3DArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset3D_v3020, .function_name="cuda::runtime::cudaMemset3D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset3DAsync_v3020, .function_name="cuda::runtime::cudaMemset3DAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3D_v3020, .function_name="cuda::runtime::cudaMemcpy3D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DAsync_v3020, .function_name="cuda::runtime::cudaMemcpy3DAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadSetCacheConfig_v3020, .function_name="cuda::runtime::cudaThreadSetCacheConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamWaitEvent_v3020, .function_name="cuda::runtime::cudaStreamWaitEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D11GetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D11GetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaD3D10GetDirect3DDevice_v3020, .function_name="cuda::runtime::cudaD3D10GetDirect3DDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadGetCacheConfig_v3020, .function_name="cuda::runtime::cudaThreadGetCacheConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaPointerGetAttributes_v4000, .function_name="cuda::runtime::cudaPointerGetAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaHostRegister_v4000, .function_name="cuda::runtime::cudaHostRegister", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaHostUnregister_v4000, .function_name="cuda::runtime::cudaHostUnregister", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceCanAccessPeer_v4000, .function_name="cuda::runtime::cudaDeviceCanAccessPeer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceEnablePeerAccess_v4000, .function_name="cuda::runtime::cudaDeviceEnablePeerAccess", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceDisablePeerAccess_v4000, .function_name="cuda::runtime::cudaDeviceDisablePeerAccess", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaPeerRegister_v4000, .function_name="cuda::runtime::cudaPeerRegister", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaPeerUnregister_v4000, .function_name="cuda::runtime::cudaPeerUnregister", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaPeerGetDevicePointer_v4000, .function_name="cuda::runtime::cudaPeerGetDevicePointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyPeer_v4000, .function_name="cuda::runtime::cudaMemcpyPeer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyPeerAsync_v4000, .function_name="cuda::runtime::cudaMemcpyPeerAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DPeer_v4000, .function_name="cuda::runtime::cudaMemcpy3DPeer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DPeerAsync_v4000, .function_name="cuda::runtime::cudaMemcpy3DPeerAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceReset_v3020, .function_name="cuda::runtime::cudaDeviceReset", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSynchronize_v3020, .function_name="cuda::runtime::cudaDeviceSynchronize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetLimit_v3020, .function_name="cuda::runtime::cudaDeviceGetLimit", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSetLimit_v3020, .function_name="cuda::runtime::cudaDeviceSetLimit", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetCacheConfig_v3020, .function_name="cuda::runtime::cudaDeviceGetCacheConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSetCacheConfig_v3020, .function_name="cuda::runtime::cudaDeviceSetCacheConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaProfilerInitialize_v4000, .function_name="cuda::runtime::cudaProfilerInitialize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaProfilerStart_v4000, .function_name="cuda::runtime::cudaProfilerStart", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaProfilerStop_v4000, .function_name="cuda::runtime::cudaProfilerStop", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetByPCIBusId_v4010, .function_name="cuda::runtime::cudaDeviceGetByPCIBusId", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetPCIBusId_v4010, .function_name="cuda::runtime::cudaDeviceGetPCIBusId", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGLGetDevices_v4010, .function_name="cuda::runtime::cudaGLGetDevices", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaIpcGetEventHandle_v4010, .function_name="cuda::runtime::cudaIpcGetEventHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaIpcOpenEventHandle_v4010, .function_name="cuda::runtime::cudaIpcOpenEventHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaIpcGetMemHandle_v4010, .function_name="cuda::runtime::cudaIpcGetMemHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaIpcOpenMemHandle_v4010, .function_name="cuda::runtime::cudaIpcOpenMemHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaIpcCloseMemHandle_v4010, .function_name="cuda::runtime::cudaIpcCloseMemHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaArrayGetInfo_v4010, .function_name="cuda::runtime::cudaArrayGetInfo", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFuncSetSharedMemConfig_v4020, .function_name="cuda::runtime::cudaFuncSetSharedMemConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetSharedMemConfig_v4020, .function_name="cuda::runtime::cudaDeviceGetSharedMemConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSetSharedMemConfig_v4020, .function_name="cuda::runtime::cudaDeviceSetSharedMemConfig", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaCreateTextureObject_v5000, .function_name="cuda::runtime::cudaCreateTextureObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDestroyTextureObject_v5000, .function_name="cuda::runtime::cudaDestroyTextureObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureObjectResourceDesc_v5000, .function_name="cuda::runtime::cudaGetTextureObjectResourceDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureObjectTextureDesc_v5000, .function_name="cuda::runtime::cudaGetTextureObjectTextureDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaCreateSurfaceObject_v5000, .function_name="cuda::runtime::cudaCreateSurfaceObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDestroySurfaceObject_v5000, .function_name="cuda::runtime::cudaDestroySurfaceObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetSurfaceObjectResourceDesc_v5000, .function_name="cuda::runtime::cudaGetSurfaceObjectResourceDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocMipmappedArray_v5000, .function_name="cuda::runtime::cudaMallocMipmappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetMipmappedArrayLevel_v5000, .function_name="cuda::runtime::cudaGetMipmappedArrayLevel", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFreeMipmappedArray_v5000, .function_name="cuda::runtime::cudaFreeMipmappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaBindTextureToMipmappedArray_v5000, .function_name="cuda::runtime::cudaBindTextureToMipmappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsResourceGetMappedMipmappedArray_v5000, .function_name="cuda::runtime::cudaGraphicsResourceGetMappedMipmappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamAddCallback_v5000, .function_name="cuda::runtime::cudaStreamAddCallback", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamCreateWithFlags_v5000, .function_name="cuda::runtime::cudaStreamCreateWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureObjectResourceViewDesc_v5000, .function_name="cuda::runtime::cudaGetTextureObjectResourceViewDesc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetAttribute_v5000, .function_name="cuda::runtime::cudaDeviceGetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamDestroy_v5050, .function_name="cuda::runtime::cudaStreamDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamCreateWithPriority_v5050, .function_name="cuda::runtime::cudaStreamCreateWithPriority", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetPriority_v5050, .function_name="cuda::runtime::cudaStreamGetPriority", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetFlags_v5050, .function_name="cuda::runtime::cudaStreamGetFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetStreamPriorityRange_v5050, .function_name="cuda::runtime::cudaDeviceGetStreamPriorityRange", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocManaged_v6000, .function_name="cuda::runtime::cudaMallocManaged", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6000, .function_name="cuda::runtime::cudaOccupancyMaxActiveBlocksPerMultiprocessor", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamAttachMemAsync_v6000, .function_name="cuda::runtime::cudaStreamAttachMemAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetErrorName_v6050, .function_name="cuda::runtime::cudaGetErrorName", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6050, .function_name="cuda::runtime::cudaOccupancyMaxActiveBlocksPerMultiprocessor", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchKernel_v7000, .function_name="cuda::runtime::cudaLaunchKernel", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDeviceFlags_v7000, .function_name="cuda::runtime::cudaGetDeviceFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunch_ptsz_v7000, .function_name="cuda::runtime::cudaLaunch_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchKernel_ptsz_v7000, .function_name="cuda::runtime::cudaLaunchKernel_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2D_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy2D_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpyToArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DToArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy2DToArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpyFromArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DFromArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy2DFromArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyArrayToArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpyArrayToArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DArrayToArray_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy2DArrayToArray_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToSymbol_ptds_v7000, .function_name="cuda::runtime::cudaMemcpyToSymbol_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromSymbol_ptds_v7000, .function_name="cuda::runtime::cudaMemcpyFromSymbol_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpyAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToArrayAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpyToArrayAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromArrayAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpyFromArrayAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpy2DAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DToArrayAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpy2DToArrayAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy2DFromArrayAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpy2DFromArrayAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyToSymbolAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpyToSymbolAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyFromSymbolAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpyFromSymbolAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset_ptds_v7000, .function_name="cuda::runtime::cudaMemset_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset2D_ptds_v7000, .function_name="cuda::runtime::cudaMemset2D_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemsetAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemsetAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset2DAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemset2DAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetPriority_ptsz_v7000, .function_name="cuda::runtime::cudaStreamGetPriority_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetFlags_ptsz_v7000, .function_name="cuda::runtime::cudaStreamGetFlags_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSynchronize_ptsz_v7000, .function_name="cuda::runtime::cudaStreamSynchronize_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamQuery_ptsz_v7000, .function_name="cuda::runtime::cudaStreamQuery_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamAttachMemAsync_ptsz_v7000, .function_name="cuda::runtime::cudaStreamAttachMemAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventRecord_ptsz_v7000, .function_name="cuda::runtime::cudaEventRecord_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset3D_ptds_v7000, .function_name="cuda::runtime::cudaMemset3D_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemset3DAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemset3DAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3D_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy3D_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpy3DAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamWaitEvent_ptsz_v7000, .function_name="cuda::runtime::cudaStreamWaitEvent_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamAddCallback_ptsz_v7000, .function_name="cuda::runtime::cudaStreamAddCallback_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DPeer_ptds_v7000, .function_name="cuda::runtime::cudaMemcpy3DPeer_ptds", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy3DPeerAsync_ptsz_v7000, .function_name="cuda::runtime::cudaMemcpy3DPeerAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_v7000, .function_name="cuda::runtime::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPrefetchAsync_v8000, .function_name="cuda::runtime::cudaMemPrefetchAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPrefetchAsync_ptsz_v8000, .function_name="cuda::runtime::cudaMemPrefetchAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemAdvise_v8000, .function_name="cuda::runtime::cudaMemAdvise", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetP2PAttribute_v8000, .function_name="cuda::runtime::cudaDeviceGetP2PAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsEGLRegisterImage_v7000, .function_name="cuda::runtime::cudaGraphicsEGLRegisterImage", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamConsumerConnect_v7000, .function_name="cuda::runtime::cudaEGLStreamConsumerConnect", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamConsumerDisconnect_v7000, .function_name="cuda::runtime::cudaEGLStreamConsumerDisconnect", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamConsumerAcquireFrame_v7000, .function_name="cuda::runtime::cudaEGLStreamConsumerAcquireFrame", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamConsumerReleaseFrame_v7000, .function_name="cuda::runtime::cudaEGLStreamConsumerReleaseFrame", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamProducerConnect_v7000, .function_name="cuda::runtime::cudaEGLStreamProducerConnect", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamProducerDisconnect_v7000, .function_name="cuda::runtime::cudaEGLStreamProducerDisconnect", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamProducerPresentFrame_v7000, .function_name="cuda::runtime::cudaEGLStreamProducerPresentFrame", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamProducerReturnFrame_v7000, .function_name="cuda::runtime::cudaEGLStreamProducerReturnFrame", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphicsResourceGetMappedEglFrame_v7000, .function_name="cuda::runtime::cudaGraphicsResourceGetMappedEglFrame", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemRangeGetAttribute_v8000, .function_name="cuda::runtime::cudaMemRangeGetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemRangeGetAttributes_v8000, .function_name="cuda::runtime::cudaMemRangeGetAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEGLStreamConsumerConnectWithFlags_v7000, .function_name="cuda::runtime::cudaEGLStreamConsumerConnectWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchCooperativeKernel_v9000, .function_name="cuda::runtime::cudaLaunchCooperativeKernel", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchCooperativeKernel_ptsz_v9000, .function_name="cuda::runtime::cudaLaunchCooperativeKernel_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventCreateFromEGLSync_v9000, .function_name="cuda::runtime::cudaEventCreateFromEGLSync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchCooperativeKernelMultiDevice_v9000, .function_name="cuda::runtime::cudaLaunchCooperativeKernelMultiDevice", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFuncSetAttribute_v9000, .function_name="cuda::runtime::cudaFuncSetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaImportExternalMemory_v10000, .function_name="cuda::runtime::cudaImportExternalMemory", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaExternalMemoryGetMappedBuffer_v10000, .function_name="cuda::runtime::cudaExternalMemoryGetMappedBuffer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaExternalMemoryGetMappedMipmappedArray_v10000, .function_name="cuda::runtime::cudaExternalMemoryGetMappedMipmappedArray", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDestroyExternalMemory_v10000, .function_name="cuda::runtime::cudaDestroyExternalMemory", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaImportExternalSemaphore_v10000, .function_name="cuda::runtime::cudaImportExternalSemaphore", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSignalExternalSemaphoresAsync_v10000, .function_name="cuda::runtime::cudaSignalExternalSemaphoresAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSignalExternalSemaphoresAsync_ptsz_v10000, .function_name="cuda::runtime::cudaSignalExternalSemaphoresAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaWaitExternalSemaphoresAsync_v10000, .function_name="cuda::runtime::cudaWaitExternalSemaphoresAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaWaitExternalSemaphoresAsync_ptsz_v10000, .function_name="cuda::runtime::cudaWaitExternalSemaphoresAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDestroyExternalSemaphore_v10000, .function_name="cuda::runtime::cudaDestroyExternalSemaphore", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchHostFunc_v10000, .function_name="cuda::runtime::cudaLaunchHostFunc", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchHostFunc_ptsz_v10000, .function_name="cuda::runtime::cudaLaunchHostFunc_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphCreate_v10000, .function_name="cuda::runtime::cudaGraphCreate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphKernelNodeGetParams_v10000, .function_name="cuda::runtime::cudaGraphKernelNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphKernelNodeSetParams_v10000, .function_name="cuda::runtime::cudaGraphKernelNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddKernelNode_v10000, .function_name="cuda::runtime::cudaGraphAddKernelNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemcpyNode_v10000, .function_name="cuda::runtime::cudaGraphAddMemcpyNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemcpyNodeGetParams_v10000, .function_name="cuda::runtime::cudaGraphMemcpyNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemcpyNodeSetParams_v10000, .function_name="cuda::runtime::cudaGraphMemcpyNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemsetNode_v10000, .function_name="cuda::runtime::cudaGraphAddMemsetNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemsetNodeGetParams_v10000, .function_name="cuda::runtime::cudaGraphMemsetNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemsetNodeSetParams_v10000, .function_name="cuda::runtime::cudaGraphMemsetNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddHostNode_v10000, .function_name="cuda::runtime::cudaGraphAddHostNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphHostNodeGetParams_v10000, .function_name="cuda::runtime::cudaGraphHostNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddChildGraphNode_v10000, .function_name="cuda::runtime::cudaGraphAddChildGraphNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphChildGraphNodeGetGraph_v10000, .function_name="cuda::runtime::cudaGraphChildGraphNodeGetGraph", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddEmptyNode_v10000, .function_name="cuda::runtime::cudaGraphAddEmptyNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphClone_v10000, .function_name="cuda::runtime::cudaGraphClone", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeFindInClone_v10000, .function_name="cuda::runtime::cudaGraphNodeFindInClone", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeGetType_v10000, .function_name="cuda::runtime::cudaGraphNodeGetType", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphGetRootNodes_v10000, .function_name="cuda::runtime::cudaGraphGetRootNodes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeGetDependencies_v10000, .function_name="cuda::runtime::cudaGraphNodeGetDependencies", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeGetDependentNodes_v10000, .function_name="cuda::runtime::cudaGraphNodeGetDependentNodes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddDependencies_v10000, .function_name="cuda::runtime::cudaGraphAddDependencies", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphRemoveDependencies_v10000, .function_name="cuda::runtime::cudaGraphRemoveDependencies", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphDestroyNode_v10000, .function_name="cuda::runtime::cudaGraphDestroyNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphInstantiate_v10000, .function_name="cuda::runtime::cudaGraphInstantiate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphLaunch_v10000, .function_name="cuda::runtime::cudaGraphLaunch", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphLaunch_ptsz_v10000, .function_name="cuda::runtime::cudaGraphLaunch_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecDestroy_v10000, .function_name="cuda::runtime::cudaGraphExecDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphDestroy_v10000, .function_name="cuda::runtime::cudaGraphDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamBeginCapture_v10000, .function_name="cuda::runtime::cudaStreamBeginCapture", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamBeginCapture_ptsz_v10000, .function_name="cuda::runtime::cudaStreamBeginCapture_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamIsCapturing_v10000, .function_name="cuda::runtime::cudaStreamIsCapturing", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamIsCapturing_ptsz_v10000, .function_name="cuda::runtime::cudaStreamIsCapturing_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamEndCapture_v10000, .function_name="cuda::runtime::cudaStreamEndCapture", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamEndCapture_ptsz_v10000, .function_name="cuda::runtime::cudaStreamEndCapture_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphHostNodeSetParams_v10000, .function_name="cuda::runtime::cudaGraphHostNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphGetNodes_v10000, .function_name="cuda::runtime::cudaGraphGetNodes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphGetEdges_v10000, .function_name="cuda::runtime::cudaGraphGetEdges", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetCaptureInfo_v10010, .function_name="cuda::runtime::cudaStreamGetCaptureInfo", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetCaptureInfo_ptsz_v10010, .function_name="cuda::runtime::cudaStreamGetCaptureInfo_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecKernelNodeSetParams_v10010, .function_name="cuda::runtime::cudaGraphExecKernelNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaThreadExchangeStreamCaptureMode_v10010, .function_name="cuda::runtime::cudaThreadExchangeStreamCaptureMode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetNvSciSyncAttributes_v10020, .function_name="cuda::runtime::cudaDeviceGetNvSciSyncAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyAvailableDynamicSMemPerBlock_v10200, .function_name="cuda::runtime::cudaOccupancyAvailableDynamicSMemPerBlock", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSetFlags_v10200, .function_name="cuda::runtime::cudaStreamSetFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSetFlags_ptsz_v10200, .function_name="cuda::runtime::cudaStreamSetFlags_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecMemcpyNodeSetParams_v10020, .function_name="cuda::runtime::cudaGraphExecMemcpyNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecMemsetNodeSetParams_v10020, .function_name="cuda::runtime::cudaGraphExecMemsetNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecHostNodeSetParams_v10020, .function_name="cuda::runtime::cudaGraphExecHostNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecUpdate_v10020, .function_name="cuda::runtime::cudaGraphExecUpdate", .region=OTF2_UNDEFINED_REGION}, #if CUPTI_API_VERSION >= 13 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetFuncBySymbol_v11000, .function_name="cuda::runtime::cudaGetFuncBySymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaCtxResetPersistingL2Cache_v11000, .function_name="cuda::runtime::cudaCtxResetPersistingL2Cache", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphKernelNodeCopyAttributes_v11000, .function_name="cuda::runtime::cudaGraphKernelNodeCopyAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphKernelNodeGetAttribute_v11000, .function_name="cuda::runtime::cudaGraphKernelNodeGetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphKernelNodeSetAttribute_v11000, .function_name="cuda::runtime::cudaGraphKernelNodeSetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamCopyAttributes_v11000, .function_name="cuda::runtime::cudaStreamCopyAttributes", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamCopyAttributes_ptsz_v11000, .function_name="cuda::runtime::cudaStreamCopyAttributes_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetAttribute_v11000, .function_name="cuda::runtime::cudaStreamGetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetAttribute_ptsz_v11000, .function_name="cuda::runtime::cudaStreamGetAttribute_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSetAttribute_v11000, .function_name="cuda::runtime::cudaStreamSetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamSetAttribute_ptsz_v11000, .function_name="cuda::runtime::cudaStreamSetAttribute_ptsz", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 14 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetTexture1DLinearMaxWidth_v11010, .function_name="cuda::runtime::cudaDeviceGetTexture1DLinearMaxWidth", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphUpload_v10000, .function_name="cuda::runtime::cudaGraphUpload", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphUpload_ptsz_v10000, .function_name="cuda::runtime::cudaGraphUpload_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemcpyNodeToSymbol_v11010, .function_name="cuda::runtime::cudaGraphAddMemcpyNodeToSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemcpyNodeFromSymbol_v11010, .function_name="cuda::runtime::cudaGraphAddMemcpyNodeFromSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemcpyNode1D_v11010, .function_name="cuda::runtime::cudaGraphAddMemcpyNode1D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemcpyNodeSetParamsToSymbol_v11010, .function_name="cuda::runtime::cudaGraphMemcpyNodeSetParamsToSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemcpyNodeSetParamsFromSymbol_v11010, .function_name="cuda::runtime::cudaGraphMemcpyNodeSetParamsFromSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemcpyNodeSetParams1D_v11010, .function_name="cuda::runtime::cudaGraphMemcpyNodeSetParams1D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecMemcpyNodeSetParamsToSymbol_v11010, .function_name="cuda::runtime::cudaGraphExecMemcpyNodeSetParamsToSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecMemcpyNodeSetParamsFromSymbol_v11010, .function_name="cuda::runtime::cudaGraphExecMemcpyNodeSetParamsFromSymbol", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecMemcpyNodeSetParams1D_v11010, .function_name="cuda::runtime::cudaGraphExecMemcpyNodeSetParams1D", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaArrayGetSparseProperties_v11010, .function_name="cuda::runtime::cudaArrayGetSparseProperties", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMipmappedArrayGetSparseProperties_v11010, .function_name="cuda::runtime::cudaMipmappedArrayGetSparseProperties", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecChildGraphNodeSetParams_v11010, .function_name="cuda::runtime::cudaGraphExecChildGraphNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddEventRecordNode_v11010, .function_name="cuda::runtime::cudaGraphAddEventRecordNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphEventRecordNodeGetEvent_v11010, .function_name="cuda::runtime::cudaGraphEventRecordNodeGetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphEventRecordNodeSetEvent_v11010, .function_name="cuda::runtime::cudaGraphEventRecordNodeSetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddEventWaitNode_v11010, .function_name="cuda::runtime::cudaGraphAddEventWaitNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphEventWaitNodeGetEvent_v11010, .function_name="cuda::runtime::cudaGraphEventWaitNodeGetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphEventWaitNodeSetEvent_v11010, .function_name="cuda::runtime::cudaGraphEventWaitNodeSetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecEventRecordNodeSetEvent_v11010, .function_name="cuda::runtime::cudaGraphExecEventRecordNodeSetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecEventWaitNodeSetEvent_v11010, .function_name="cuda::runtime::cudaGraphExecEventWaitNodeSetEvent", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventRecordWithFlags_v11010, .function_name="cuda::runtime::cudaEventRecordWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaEventRecordWithFlags_ptsz_v11010, .function_name="cuda::runtime::cudaEventRecordWithFlags_ptsz", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 14 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetDefaultMemPool_v11020, .function_name="cuda::runtime::cudaDeviceGetDefaultMemPool", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocAsync_v11020, .function_name="cuda::runtime::cudaMallocAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocAsync_ptsz_v11020, .function_name="cuda::runtime::cudaMallocAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFreeAsync_v11020, .function_name="cuda::runtime::cudaFreeAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaFreeAsync_ptsz_v11020, .function_name="cuda::runtime::cudaFreeAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolTrimTo_v11020, .function_name="cuda::runtime::cudaMemPoolTrimTo", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolSetAttribute_v11020, .function_name="cuda::runtime::cudaMemPoolSetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolGetAttribute_v11020, .function_name="cuda::runtime::cudaMemPoolGetAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolSetAccess_v11020, .function_name="cuda::runtime::cudaMemPoolSetAccess", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaArrayGetPlane_v11020, .function_name="cuda::runtime::cudaArrayGetPlane", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolGetAccess_v11020, .function_name="cuda::runtime::cudaMemPoolGetAccess", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolCreate_v11020, .function_name="cuda::runtime::cudaMemPoolCreate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolDestroy_v11020, .function_name="cuda::runtime::cudaMemPoolDestroy", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSetMemPool_v11020, .function_name="cuda::runtime::cudaDeviceSetMemPool", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetMemPool_v11020, .function_name="cuda::runtime::cudaDeviceGetMemPool", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolExportToShareableHandle_v11020, .function_name="cuda::runtime::cudaMemPoolExportToShareableHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolImportFromShareableHandle_v11020, .function_name="cuda::runtime::cudaMemPoolImportFromShareableHandle", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolExportPointer_v11020, .function_name="cuda::runtime::cudaMemPoolExportPointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMemPoolImportPointer_v11020, .function_name="cuda::runtime::cudaMemPoolImportPointer", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocFromPoolAsync_v11020, .function_name="cuda::runtime::cudaMallocFromPoolAsync", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMallocFromPoolAsync_ptsz_v11020, .function_name="cuda::runtime::cudaMallocFromPoolAsync_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSignalExternalSemaphoresAsync_v2_v11020, .function_name="cuda::runtime::cudaSignalExternalSemaphoresAsync_v2", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaSignalExternalSemaphoresAsync_v2_ptsz_v11020, .function_name="cuda::runtime::cudaSignalExternalSemaphoresAsync_v2_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaWaitExternalSemaphoresAsync_v2_v11020, .function_name="cuda::runtime::cudaWaitExternalSemaphoresAsync_v2", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaWaitExternalSemaphoresAsync_v2_ptsz_v11020, .function_name="cuda::runtime::cudaWaitExternalSemaphoresAsync_v2_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddExternalSemaphoresSignalNode_v11020, .function_name="cuda::runtime::cudaGraphAddExternalSemaphoresSignalNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExternalSemaphoresSignalNodeGetParams_v11020, .function_name="cuda::runtime::cudaGraphExternalSemaphoresSignalNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExternalSemaphoresSignalNodeSetParams_v11020, .function_name="cuda::runtime::cudaGraphExternalSemaphoresSignalNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddExternalSemaphoresWaitNode_v11020, .function_name="cuda::runtime::cudaGraphAddExternalSemaphoresWaitNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExternalSemaphoresWaitNodeGetParams_v11020, .function_name="cuda::runtime::cudaGraphExternalSemaphoresWaitNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExternalSemaphoresWaitNodeSetParams_v11020, .function_name="cuda::runtime::cudaGraphExternalSemaphoresWaitNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecExternalSemaphoresSignalNodeSetParams_v11020, .function_name="cuda::runtime::cudaGraphExecExternalSemaphoresSignalNodeSetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecExternalSemaphoresWaitNodeSetParams_v11020, .function_name="cuda::runtime::cudaGraphExecExternalSemaphoresWaitNodeSetParams", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 13 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceFlushGPUDirectRDMAWrites_v11030, .function_name="cuda::runtime::cudaDeviceFlushGPUDirectRDMAWrites", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDriverEntryPoint_v11030, .function_name="cuda::runtime::cudaGetDriverEntryPoint", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDriverEntryPoint_ptsz_v11030, .function_name="cuda::runtime::cudaGetDriverEntryPoint_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphDebugDotPrint_v11030, .function_name="cuda::runtime::cudaGraphDebugDotPrint", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetCaptureInfo_v2_v11030, .function_name="cuda::runtime::cudaStreamGetCaptureInfo_v2", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetCaptureInfo_v2_ptsz_v11030, .function_name="cuda::runtime::cudaStreamGetCaptureInfo_v2_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamUpdateCaptureDependencies_v11030, .function_name="cuda::runtime::cudaStreamUpdateCaptureDependencies", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamUpdateCaptureDependencies_ptsz_v11030, .function_name="cuda::runtime::cudaStreamUpdateCaptureDependencies_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaUserObjectCreate_v11030, .function_name="cuda::runtime::cudaUserObjectCreate", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaUserObjectRetain_v11030, .function_name="cuda::runtime::cudaUserObjectRetain", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaUserObjectRelease_v11030, .function_name="cuda::runtime::cudaUserObjectRelease", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphRetainUserObject_v11030, .function_name="cuda::runtime::cudaGraphRetainUserObject", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphReleaseUserObject_v11030, .function_name="cuda::runtime::cudaGraphReleaseUserObject", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 14 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphInstantiateWithFlags_v11040, .function_name="cuda::runtime::cudaGraphInstantiateWithFlags", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemAllocNode_v11040, .function_name="cuda::runtime::cudaGraphAddMemAllocNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemAllocNodeGetParams_v11040, .function_name="cuda::runtime::cudaGraphMemAllocNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphAddMemFreeNode_v11040, .function_name="cuda::runtime::cudaGraphAddMemFreeNode", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphMemFreeNodeGetParams_v11040, .function_name="cuda::runtime::cudaGraphMemFreeNodeGetParams", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGraphMemTrim_v11040, .function_name="cuda::runtime::cudaDeviceGraphMemTrim", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceGetGraphMemAttribute_v11040, .function_name="cuda::runtime::cudaDeviceGetGraphMemAttribute", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaDeviceSetGraphMemAttribute_v11040, .function_name="cuda::runtime::cudaDeviceSetGraphMemAttribute", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 16 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeSetEnabled_v11060, .function_name="cuda::runtime::cudaGraphNodeSetEnabled", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphNodeGetEnabled_v11060, .function_name="cuda::runtime::cudaGraphNodeGetEnabled", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaArrayGetMemoryRequirements_v11060, .function_name="cuda::runtime::cudaArrayGetMemoryRequirements", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaMipmappedArrayGetMemoryRequirements_v11060, .function_name="cuda::runtime::cudaMipmappedArrayGetMemoryRequirements", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 18 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchKernelExC_v11060, .function_name="cuda::runtime::cudaLaunchKernelExC", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaLaunchKernelExC_ptsz_v11060, .function_name="cuda::runtime::cudaLaunchKernelExC_ptsz", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyMaxPotentialClusterSize_v11070, .function_name="cuda::runtime::cudaOccupancyMaxPotentialClusterSize", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaOccupancyMaxActiveClusters_v11070, .function_name="cuda::runtime::cudaOccupancyMaxActiveClusters", .region=OTF2_UNDEFINED_REGION}, #endif #if CUPTI_API_VERSION >= 19 {.id=CUPTI_RUNTIME_TRACE_CBID_cudaCreateTextureObject_v2_v11080, .function_name="cuda::runtime::cudaCreateTextureObject_v2_v11080", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetTextureObjectTextureDesc_v2_v11080, .function_name="cuda::runtime::cudaGetTextureObjectTextureDesc_v2_v11080", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphInstantiateWithParams_v12000, .function_name="cuda::runtime::cudaGraphInstantiateWithParams_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphInstantiateWithParams_ptsz_v12000, .function_name="cuda::runtime::cudaGraphInstantiateWithParams_ptsz_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphExecGetFlags_v12000, .function_name="cuda::runtime::cudaGraphExecGetFlags_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cuda439_v12000, .function_name="cuda::runtime::cuda439_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGetDeviceProperties_v2_v12000, .function_name="cuda::runtime::cudaGetDeviceProperties_v2_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetId_v12000, .function_name="cuda::runtime::cudaStreamGetId_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaStreamGetId_ptsz_v12000, .function_name="cuda::runtime::cudaStreamGetId_ptsz_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cudaGraphInstantiate_v12000, .function_name="cuda::runtime::cudaGraphInstantiate_v12000", .region=OTF2_UNDEFINED_REGION}, {.id=CUPTI_RUNTIME_TRACE_CBID_cuda444_v12000, .function_name="cuda::runtime::cuda444_v12000", .region=OTF2_UNDEFINED_REGION}, #endif }; void CUPTIAPI eztrace_cuda_runtime_callback(void *userdata, CUpti_CallbackDomain domain, CUpti_CallbackId cbid, const void *cbdata) { if(domain != CUPTI_CB_DOMAIN_RUNTIME_API) return; if(!EZTRACE_SAFE) return; const CUpti_CallbackData *cbInfo = (CUpti_CallbackData *)cbdata; const char* enter_leave = cbInfo->callbackSite == CUPTI_API_ENTER? "Enter":"Leave"; if(cuda_runtime_api_info[cbid].region == OTF2_UNDEFINED_REGION) { cuda_runtime_api_info[cbid].region = ezt_otf2_register_function(cuda_runtime_api_info[cbid].function_name); } if(cbInfo->callbackSite == CUPTI_API_ENTER) { EZT_OTF2_EvtWriter_Enter( evt_writer, NULL, ezt_get_timestamp(), cuda_runtime_api_info[cbid].region); } else { EZT_OTF2_EvtWriter_Leave( evt_writer, NULL, ezt_get_timestamp(), cuda_runtime_api_info[cbid].region); } } eztrace-2.1/src/modules/cuda/ezt_cuda.h000066400000000000000000000105721447213526500201510ustar00rootroot00000000000000#ifndef EZT_CUDA_H #define EZT_CUDA_H #ifdef __cplusplus extern "C" { #endif #include typedef uint32_t kernel_id_t; typedef size_t ezt_cuda_size_t; enum ezt_cudaMemcpyKind { CUDA_MEMCPY_KIND_HTOD = 1, CUDA_MEMCPY_KIND_DTOH = 2, CUDA_MEMCPY_KIND_HTOA = 3, CUDA_MEMCPY_KIND_ATOH = 4, CUDA_MEMCPY_KIND_ATOA = 5, CUDA_MEMCPY_KIND_ATOD = 6, CUDA_MEMCPY_KIND_DTOA = 7, CUDA_MEMCPY_KIND_DTOD = 8, CUDA_MEMCPY_KIND_HTOH = 9, CUDA_MEMCPY_KIND_UNKNOWN = -1 }; #define memoryTypesToCpyKind(srcType, destType) \ (((srcType)== CU_MEMORYTYPE_HOST && (destType)== CU_MEMORYTYPE_HOST)? CUDA_MEMCPY_KIND_HTOH : \ ((srcType)== CU_MEMORYTYPE_HOST && (destType)== CU_MEMORYTYPE_DEVICE)? CUDA_MEMCPY_KIND_HTOD : \ ((srcType)== CU_MEMORYTYPE_HOST && (destType)== CU_MEMORYTYPE_ARRAY)? CUDA_MEMCPY_KIND_HTOA : \ ((srcType)== CU_MEMORYTYPE_DEVICE && (destType)== CU_MEMORYTYPE_HOST)? CUDA_MEMCPY_KIND_DTOH : \ ((srcType)== CU_MEMORYTYPE_DEVICE && (destType)== CU_MEMORYTYPE_DEVICE)? CUDA_MEMCPY_KIND_DTOD : \ ((srcType)== CU_MEMORYTYPE_DEVICE && (destType)== CU_MEMORYTYPE_ARRAY)? CUDA_MEMCPY_KIND_DTOA : \ ((srcType)== CU_MEMORYTYPE_ARRAY && (destType)== CU_MEMORYTYPE_HOST)? CUDA_MEMCPY_KIND_ATOH : \ ((srcType)== CU_MEMORYTYPE_ARRAY && (destType)== CU_MEMORYTYPE_DEVICE)? CUDA_MEMCPY_KIND_ATOD : \ ((srcType)== CU_MEMORYTYPE_ARRAY && (destType)== CU_MEMORYTYPE_ARRAY)? CUDA_MEMCPY_KIND_ATOA : \ CUDA_MEMCPY_KIND_UNKNOWN) #define CUDA_MEMCPY_KIND_TO_EZT(kind) \ ((kind)==cudaMemcpyHostToHost?CUDA_MEMCPY_KIND_HTOH: \ ((kind)==cudaMemcpyHostToDevice?CUDA_MEMCPY_KIND_HTOD: \ ((kind)==cudaMemcpyDeviceToDevice?CUDA_MEMCPY_KIND_DTOD: \ ((kind)==cudaMemcpyDeviceToHost?CUDA_MEMCPY_KIND_DTOH: \ CUDA_MEMCPY_KIND_UNKNOWN)))) #define CUPTI_ACTIVITY_MEMCPY_KIND_TO_EZT(kind) \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_HTOD ? CUDA_MEMCPY_KIND_HTOD: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_DTOH ? CUDA_MEMCPY_KIND_DTOH: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_HTOA ? CUDA_MEMCPY_KIND_HTOA: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_ATOH ? CUDA_MEMCPY_KIND_ATOH: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_ATOA ? CUDA_MEMCPY_KIND_ATOA: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_ATOD ? CUDA_MEMCPY_KIND_ATOD: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_DTOA ? CUDA_MEMCPY_KIND_DTOA: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_DTOD ? CUDA_MEMCPY_KIND_DTOD: \ ((kind) == CUPTI_ACTIVITY_MEMCPY_KIND_HTOH ? CUDA_MEMCPY_KIND_HTOH: \ CUDA_MEMCPY_KIND_UNKNOWN))))))))) /* return true if the transfer starts from the CPU */ #define IS_FROM_CPU(kind) \ (((kind) == CUDA_MEMCPY_KIND_HTOD) || \ ((kind) == CUDA_MEMCPY_KIND_HTOA) || \ ((kind) == CUDA_MEMCPY_KIND_HTOH)) /* return true if the transfer starts from the GPU */ #define IS_FROM_GPU(kind) \ (((kind) == CUDA_MEMCPY_KIND_DTOH) || \ ((kind) == CUDA_MEMCPY_KIND_ATOH) || \ ((kind) == CUDA_MEMCPY_KIND_ATOA) || \ ((kind) == CUDA_MEMCPY_KIND_ATOD) || \ ((kind) == CUDA_MEMCPY_KIND_DTOA) || \ ((kind) == CUDA_MEMCPY_KIND_DTOD)) /* return true if the transfer ends to the CPU */ #define IS_TO_CPU(kind) \ (((kind) == CUDA_MEMCPY_KIND_DTOH) || \ ((kind) == CUDA_MEMCPY_KIND_ATOH) || \ ((kind) == CUDA_MEMCPY_KIND_HTOH)) /* return true if the transfer ends to the GPU */ #define IS_TO_GPU(kind) \ (((kind) == CUDA_MEMCPY_KIND_HTOD) || \ ((kind) == CUDA_MEMCPY_KIND_HTOA) || \ ((kind) == CUDA_MEMCPY_KIND_ATOD) || \ ((kind) == CUDA_MEMCPY_KIND_ATOA) || \ ((kind) == CUDA_MEMCPY_KIND_DTOA) || \ ((kind) == CUDA_MEMCPY_KIND_DTOD)) #define MEMCPY_TYPE_STR(kind) \ ((IS_FROM_CPU(kind) && IS_TO_CPU(kind))? "HToH_memcpy": \ (IS_FROM_CPU(kind) && IS_TO_GPU(kind))? "HToD_memcpy": \ (IS_FROM_GPU(kind) && IS_TO_CPU(kind))? "DToH_memcpy": \ (IS_FROM_GPU(kind) && IS_TO_GPU(kind))? "DToD_memcpy": "Unknown") extern int __ezt_cuda_initialized; void __ezt_cuda_initialize(); #define EZT_CUDA_INITIALIZE do { if(!__ezt_cuda_initialized) { __ezt_cuda_initialize(); } } while(0) void CUPTIAPI eztrace_cuda_driver_callback(void *userdata, CUpti_CallbackDomain domain, CUpti_CallbackId cbid, const void *cbdata); void CUPTIAPI eztrace_cuda_runtime_callback(void *userdata, CUpti_CallbackDomain domain, CUpti_CallbackId cbid, const void *cbdata); #ifdef __cplusplus } #endif #endif /* EZT_CUDA_H */ eztrace-2.1/src/modules/iotracer/000077500000000000000000000000001447213526500170715ustar00rootroot00000000000000eztrace-2.1/src/modules/iotracer/CMakeLists.txt000066400000000000000000000010341447213526500216270ustar00rootroot00000000000000add_library(eztrace-iotracer SHARED iotracer.c iotracer_to_otf2.c ) target_link_libraries(eztrace-iotracer PRIVATE atomic dl eztrace-core eztrace-lib eztrace-instrumentation ) target_include_directories(eztrace-iotracer PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) #--------------------------------------------- install(TARGETS eztrace-iotracer LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/iotracer/iotracer.c000066400000000000000000000137611447213526500210550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include #include #include #include #include "iotracer_to_otf2.h" /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls to mutex_lock for example */ static volatile int _iotracer_initialized = 0; /* PID of the iotracer process */ static pid_t iotracer_pid = 0; #define CURRENT_MODULE iotracer DECLARE_CURRENT_MODULE; #define DATA_SIZE 512 static char * getTracedTaskName(){ /* trace the current process */ char * exec_path = malloc(DATA_SIZE); memset(exec_path, 0, DATA_SIZE); ssize_t s = readlink("/proc/self/exe", exec_path, DATA_SIZE); if(s < 0) return NULL; char* traced_task = basename(exec_path); strncpy(exec_path, traced_task, DATA_SIZE); return exec_path; } static char * getTracedFileName() { char * traced_file = getenv("IOTRACER_TRACED_FILE"); if(traced_file == NULL){ eztrace_error( "IOtracer: please set the IOTRACER_TRACED_FILE environment variable!\nIf you are using sudo, please the -E option to get environment variables!\n"); } FILE *f = fopen(traced_file,"r"); if(f == NULL){ eztrace_error( "IOtracer: IOTRACER_TRACED_FILE: %s doesn't exist!\n", traced_file); } fclose(f); return traced_file; } static char * getTraceFilter() { char * traced_filter = getenv("IOTRACER_TRACED_FILTER"); if(traced_filter == NULL){ eztrace_error( "IOtracer: please set the IOTRACER_TRACED_FILTER environment variable : f/file or d/dir!\nIf you are using sudo, please the -E option to get environment variables!\n"); } return traced_filter; } static char * getTracedInode(){ char * traced_inode = getenv("IOTRACER_TRACED_INODE"); if(traced_inode == NULL){ eztrace_error( "IOtracer: please set the IOTRACER_TRACED_INODE environment variable!\nIf you are using sudo, please the -E option to get environment variables!\n"); } /* * To do: check the existence of the related file/directory */ return traced_inode; } void run_iotracer() { char * traced_task = getTracedTaskName(); char * trace_filter = getTraceFilter(); char * trace_filter_option = malloc(strlen(trace_filter)+3); strcpy(trace_filter_option, "--"); strcat(trace_filter_option, trace_filter); char * traced_inode = getTracedInode(); printf("traced_task:%s\n", traced_task); printf("trace_filter:%s\n", trace_filter_option); printf("traced_inode:%s\n", traced_inode); /* create a child process to run iotracer */ if((iotracer_pid=fork()) == 0) { /* the child process */ #define STR_SIZE 1024 int iotracer_trace_file = -1; char trace_path[STR_SIZE]; char* res = getenv("EZTRACE_TRACE_DIR"); if (!res) { strncpy(trace_path, IOTRACER_TRACE_PATH, STR_SIZE); } else { strncpy(trace_path, res, STR_SIZE); strncat(trace_path, "/", STR_SIZE-1); strncat(trace_path, IOTRACER_TRACE_PATH, STR_SIZE-1); } iotracer_trace_file = open(trace_path, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); if(iotracer_trace_file < 0) { eztrace_error("IOtracer: could not create trace file %s\n", IOTRACER_TRACE_PATH); exit(EXIT_FAILURE); } /* redirect stdout to the trace file */ if(dup2(iotracer_trace_file, STDOUT_FILENO) <0 ){ eztrace_error("IOtracer: could not redirect output\n"); exit(EXIT_FAILURE); } close(iotracer_trace_file); close(STDERR_FILENO); execl("/usr/bin/sudo", "sudo", "python", IOTRACER_PATH, "-t", traced_task, trace_filter_option, "-i", traced_inode, "-l", "vpfb", NULL); //execl("/usr/bin/sudo", "sudo", "python", "/bcc_iotracer.py", "-t", traced_task, //trace_filter_option, "-i", traced_inode, "-l", "vpfb", NULL); eztrace_error("IOtracer: could not start IOTracer: %s\n", strerror(errno)); exit(EXIT_FAILURE); } /* crappy synchronization: we need to make sure that iotracer started before continuing */ sleep(1); } static void iotracer_start(){ eztrace_log(dbg_lvl_normal, "Starting IOtracer\n"); /* we're about to spawn a process. remove LD_PRELOAD from the environment so that the spawn * process is not instrumented with eztrace */ unset_ld_preload(); run_iotracer(); reset_ld_preload(); } static void iotracer_stop() { unset_ld_preload(); // stop the iotracer process assert(iotracer_pid > 0); if(kill(iotracer_pid, SIGKILL) < 0) { eztrace_error("IOtracer: could not kill iotracer process (PID: %d).\n", iotracer_pid); } /* wait until iotracer stops */ int status; pid_t pid = waitpid(iotracer_pid, &status, 0); if( pid != iotracer_pid) { eztrace_error("IOTrace: failed to wait for the IOTracer process\n"); } EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); convert_iotracer_log_to_otf2(); EZTRACE_PROTECT_OFF(); } reset_ld_preload(); eztrace_log(dbg_lvl_normal, "IOtracer: stop\n"); } PPTRACE_START_INTERCEPT_FUNCTIONS(iotracer) PPTRACE_END_INTERCEPT_FUNCTIONS(iotracer); static void init_iotracer() { INSTRUMENT_FUNCTIONS(iotracer); if (eztrace_autostart_enabled()) eztrace_start(); /* * get activate or not the utilisation of iotracer by checking an env variable */ iotracer_start(); _iotracer_initialized = 1; } static void finalize_iotracer() { _iotracer_initialized = 0; iotracer_stop(); eztrace_stop(); } static void _iotracer_init(void) __attribute__((constructor)); static void _iotracer_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_iotracer constructor starts\n"); EZT_REGISTER_MODULE(iotracer, "Module for tracing kernel I/O events", init_iotracer, finalize_iotracer); eztrace_log(dbg_lvl_debug, "eztrace_ends constructor starts\n"); } eztrace-2.1/src/modules/iotracer/iotracer.h000066400000000000000000000003131447213526500210470ustar00rootroot00000000000000#ifndef IOTRACER #define IOTRACER #error plop #include "iotracer_to_otf2.h" void iotracer_start(); void iotracer_stop(); char * get_commande_add(); char * get_commande_remove(); #endif /* IOTRACER */ eztrace-2.1/src/modules/iotracer/iotracer_to_otf2.c000066400000000000000000000444231447213526500225100ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "eztrace-lib/eztrace_otf2.h" #include "eztrace-lib/eztrace.h" #include "iotracer_to_otf2.h" static _Atomic int next_string_id = 11; #define NB_ATTRIBUTE 10 static char * attr_names [NB_ATTRIBUTE] = {"TimeStamp","Level", "Type", "Address","Size", "Probe", "Pid", "Command","inode", "p-inode"}; static char * attr_types [NB_ATTRIBUTE]= { "long", "string","string","long", "long", "int", "int", "string", "long", "long"}; //#define ENOUGH ((CHAR_BIT * sizeof(int) - 1) / 3 + 2) #if 0 typedef struct String_value String_value; struct String_value { int id; int attr_id; int len; char * buffer; String_value *suivant; }; #endif static int vfs_write_id = -1; static int vfs_read_id = -1; static int fs_write_id = -1; static int fs_read_id = -1; static int blk_write_id = -1; static int blk_read_id = -1; static char ** getAttributes(char * line); static void RegisterAttrValueAndAddAttribute(OTF2_GlobalDefWriter* global_def_writer, OTF2_AttributeValue attr, char * type, char * value, OTF2_AttributeList* attr_list, OTF2_AttributeRef attr_id); static int getRegion(char * level, char * request); static char * getProbeName(int i); static OTF2_TimeStamp gettimestamp( char * time ); static OTF2_FlushType pre_flush( void* userData, OTF2_FileType fileType, OTF2_LocationRef location, void* callerData, bool final ); static OTF2_TimeStamp post_flush( void* userData, OTF2_FileType fileType, OTF2_LocationRef location ); static char ** getAttributes(char * line){ char ** attributes; attributes=malloc(NB_ATTRIBUTE * sizeof(char *)); int index = 0; char * token = strtok(line, "\t"); while( token != NULL ) { attributes[index] = token; index++; //printf( " %s\n", token ); //printing each token token = strtok(NULL, "\t"); } return attributes; } static char * getProbeName(int i){ switch (i) { case 0: return "VFS_write\0"; case 1: return "VFS_read\0"; case 2: return "generic_perform_write\0"; case 3: return "generic_file_write_iter\0"; case 4: return "generic_file_read_iter\0"; case 5: return "submit_bio\0"; case 6: return "submit_bio_noacct\0"; case 7: return "bio_endio\0"; default: eztrace_error( "Cannot find probe name for i=%d!\n",i); exit(EXIT_FAILURE); } //return string_liste; return NULL; } struct registered_string { char string[256]; uint32_t string_ref; }; #define NB_STRING_MAX 128 static struct registered_string registered_strings[NB_STRING_MAX]; static int nb_registered_strings = 0; static int register_string(OTF2_GlobalDefWriter* global_def_writer, char* str); static uint32_t _register_string(OTF2_GlobalDefWriter* global_def_writer, char* str) { for(int i=0; i< nb_registered_strings; i++) { if(strcmp(str, registered_strings[i].string) == 0) return registered_strings[i].string_ref; } uint32_t string_ref = (uint32_t) register_string(global_def_writer, str); if(nb_registered_stringsthread_rank = ezt_info->thread_rank; infos->tid = tid; strncpy(infos->thread_name, ezt_info->thread_name, 50); infos->otf2_thread_id = ezt_info->otf2_thread_id; eztrace_log(dbg_lvl_normal,"TOOTF2: New Thread: rank=%d, tid=%d, name=%s\n", infos->thread_rank, infos->tid, infos->thread_name); infos->evt_writer = OTF2_Archive_GetEvtWriter( archive, infos->otf2_thread_id); assert(infos->evt_writer); return infos; } void convert_iotracer_log_to_otf2(){ #define STR_SIZE 1024 char iotracer_trace_path[STR_SIZE]; char otf2_trace_path[STR_SIZE]; char* res = getenv("EZTRACE_TRACE_DIR"); if (!res) { strncpy(iotracer_trace_path, IOTRACER_TRACE_PATH, STR_SIZE); strncpy(otf2_trace_path, "IOtracer_output", STR_SIZE); } else { strncpy(iotracer_trace_path, res, STR_SIZE); strncat(iotracer_trace_path, "/", STR_SIZE-1); strncat(iotracer_trace_path, IOTRACER_TRACE_PATH, STR_SIZE-1); strncpy(otf2_trace_path, res, STR_SIZE); strncat(otf2_trace_path, "/IOtracer_output", STR_SIZE-1); } eztrace_log(dbg_lvl_normal, "IOtracer: converting IOtracer log file (%s) to otf2 format (%s)\n", iotracer_trace_path, otf2_trace_path); OTF2_Archive* archive = OTF2_Archive_Open( otf2_trace_path, "log", OTF2_FILEMODE_WRITE, 1024 * 1024 /* event chunk size */, 4 * 1024 * 1024 /* def chunk size */, OTF2_SUBSTRATE_POSIX, OTF2_COMPRESSION_NONE ); OTF2_Archive_SetFlushCallbacks( archive, &flush_callbacks, NULL ); OTF2_Archive_SetSerialCollectiveCallbacks( archive ); OTF2_Archive_OpenEvtFiles( archive ); /*** IOtracer log format: TimeStamp, Level, Type, Address, Size, Probe, Pid, Command, inode, P-inode IOtracer log example:63072550856527, 282959872, 8192, V, W, 14237, dd, 1, 1712052, 1703937 IOtracer log file path: iotracer_trace.txt ***/ char *line = NULL; size_t len = 0; ssize_t read; char ** attr_values; FILE * iotracer_log_f; iotracer_log_f = fopen(iotracer_trace_path , "r"); if (iotracer_log_f == NULL){ eztrace_error( "IOtracer: cannot open the IOtracer log file"); exit(EXIT_FAILURE); } // OTF2_EvtWriter* evt_writer = OTF2_Archive_GetEvtWriter( archive, 0 ); OTF2_GlobalDefWriter* global_def_writer = OTF2_Archive_GetGlobalDefWriter( archive ); OTF2_GlobalDefWriter_WriteClockProperties( global_def_writer, 1e9 /* 1 tick per nanosecond */, 0 /* epoch */, 2 /* length */ #if OTF2_MAJOR_VERSION >= 3 , OTF2_UNDEFINED_TIMESTAMP #endif ); ////////////////////////////////////////////////////// int program_str_id = register_string(global_def_writer, "Program"); vfs_write_id = register_function(global_def_writer, "VFS_WRITE"); vfs_read_id = register_function(global_def_writer, "VFS_READ"); fs_write_id = register_function(global_def_writer, "FS_WRITE"); fs_read_id = register_function(global_def_writer, "FS_READ"); blk_write_id = register_function(global_def_writer, "BLK_WRITE"); blk_read_id = register_function(global_def_writer, "BLK_READ"); unsigned long nb_events=0; while ((read = getline(&line, &len, iotracer_log_f)) != -1) { nb_events++; int attr_id = 0; attr_values = getAttributes(line); OTF2_AttributeList* attribute_list = OTF2_AttributeList_New(); for(int i=0; i= 0); // pid_t tid = syscall(__NR_gettid); /* TODO: read the tid from the trace */ pid_t tid = atoi(attr_values[7]); struct tootf2_thread_info* thread_info = get_thread(archive, tid); OTF2_EvtWriter_Enter( thread_info->evt_writer, attribute_list, gettimestamp(attr_values[0]), getRegion(attr_values[1], attr_values[2]) /* region */ ); OTF2_EvtWriter_Leave(thread_info->evt_writer, attribute_list, gettimestamp(attr_values[0]), getRegion(attr_values[1], attr_values[2]) /* region */ ); free(attr_values); } eztrace_log(dbg_lvl_normal,"%lu IOTrace events\n", nb_events); free(line); fclose(iotracer_log_f); ///////////////////////////////////////////////////// //int ezt_otf2_register_attribute(char* name, OTF2_Type type); int str_id_addr = register_string(global_def_writer, "Address"); int str_id_size = register_string(global_def_writer, "Size"); int str_id_probe = register_string(global_def_writer, "Probe"); int str_id_pid = register_string(global_def_writer, "Pid"); int str_id_comm = register_string(global_def_writer, "Comm"); int str_id_f_inode = register_string(global_def_writer, "F-inode"); int str_id_d_inode = register_string(global_def_writer, "D-inode"); //address OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 0, str_id_addr, 0, OTF2_TYPE_UINT64 ); //size OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 1, str_id_size, 0, OTF2_TYPE_UINT64 ); //probe OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 2, str_id_probe, 0, OTF2_TYPE_UINT64 ); //pid OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 3, str_id_pid, 0, OTF2_TYPE_UINT64 ); //command OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 4, str_id_comm, 0, OTF2_TYPE_STRING ); //f_inode OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 5, str_id_f_inode, 0, OTF2_TYPE_UINT64 ); //d_ionde OTF2_GlobalDefWriter_WriteAttribute ( global_def_writer, 6, str_id_d_inode, 0, OTF2_TYPE_UINT64 ); ///////////////////////////////////////// int program_id = 0; int process_id = 0; int thread_id = 0; OTF2_GlobalDefWriter_WriteSystemTreeNode( global_def_writer, program_id /* id */, program_str_id /* name */, 7 /* class */, OTF2_UNDEFINED_SYSTEM_TREE_NODE /* parent */ ); char process_name[128]; snprintf(process_name, 128, "P#%d", ezt_mpi_rank); int process_string = register_string(global_def_writer, process_name); OTF2_GlobalDefWriter_WriteLocationGroup( global_def_writer, process_id /* id */, process_string /* name */, OTF2_LOCATION_GROUP_TYPE_PROCESS, program_id /* system tree */ #if OTF2_MAJOR_VERSION >= 3 , OTF2_UNDEFINED_LOCATION_GROUP #endif ); eztrace_log(dbg_lvl_normal, "registering %d threads\n", nb_registered_threads); for(int thread_id =0; thread_id < nb_registered_threads; thread_id++) { struct tootf2_thread_info *info = &thread_infos[thread_id]; eztrace_log(dbg_lvl_normal, "t[%d]: rank=%d, tid=%d, name=%s\n", thread_id, info->thread_rank, info->tid, info->thread_name); OTF2_StringRef thread_string = register_string(global_def_writer, info->thread_name); OTF2_GlobalDefWriter_WriteLocation( global_def_writer, info->otf2_thread_id /* id */, thread_string /* name */, OTF2_LOCATION_TYPE_CPU_THREAD, 2 /* # events */, process_id /* location group */ ); OTF2_DefWriter *def_writer = OTF2_Archive_GetDefWriter(archive, info->otf2_thread_id); OTF2_Archive_CloseDefWriter( archive, def_writer ); OTF2_Archive_CloseEvtWriter( archive, info->evt_writer ); } OTF2_Archive_CloseEvtFiles( archive ); OTF2_Archive_CloseGlobalDefWriter( archive, global_def_writer ); OTF2_Archive_Close( archive ); //return EXIT_SUCCESS; } eztrace-2.1/src/modules/iotracer/iotracer_to_otf2.h000066400000000000000000000005161447213526500225100ustar00rootroot00000000000000#ifndef IOTRACER_TO_OTF2 #define IOTRACER_TO_OTF2 #include #include #include #include #include #include #include #include #include #include void convert_iotracer_log_to_otf2(); #endif /* IOTRACER_TO_OTF2 */ eztrace-2.1/src/modules/memory/000077500000000000000000000000001447213526500165715ustar00rootroot00000000000000eztrace-2.1/src/modules/memory/CMakeLists.txt000066400000000000000000000010021447213526500213220ustar00rootroot00000000000000 #libeztrace-memory.so add_library(eztrace-memory SHARED memory.c ) target_link_libraries(eztrace-memory PRIVATE dl eztrace-core eztrace-lib ) target_compile_options(eztrace-memory PRIVATE -D_GNU_SOURCE ) target_include_directories(eztrace-memory PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) install(TARGETS eztrace-memory LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/memory/memory.c000066400000000000000000000255511447213526500202550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include //#include #include #include #include #include /* set to 1 when all the hooks are set. * This is useful in order to avoid recursive calls */ static int _memory_initialized = 0; #define CURRENT_MODULE memory DECLARE_CURRENT_MODULE; #define MAGIC_PATTERN 0xdeadbeef /* when a buffer is allocated with eztrace, it has the following pattern: * PADDING BLOCK_INFO USER_BLOCK * block_info has to be right-aligned because of calloc. * the address should be a multiple of 8 bytes in order to avoid bugs * (if not aligned, some weird bugs may happen when using -O3) */ enum _memory_type { MEM_TYPE_MALLOC, MEM_TYPE_CUSTOM_MALLOC }; /* todo: we could add information like: * - date of malloc * - thread id that allocated the block * - NUMA node ? */ struct mem_block_info { void* u_ptr; /* address of the user block */ void* p_ptr; /* address of the padding */ enum _memory_type mem_type; size_t total_size; /* size allocated (including this structure) */ size_t size; /* size of the buffer (not including this structure) */ /* WARNING: this must be the last field of the structure */ uint32_t canary; /* this is used for checking that we malloc'ed the buffer */ } __attribute__((__packed__)); /* size of the padding + mem_info structure */ #define GET_HEADER_SIZE() (sizeof(struct mem_block_info)) #define CANARY_OK(u_ptr) ((*(uint32_t*)((u_ptr) - sizeof(uint32_t))) == MAGIC_PATTERN) /* converts a pointer to a user_block into a pointer to the block info */ #define USER_PTR_TO_BLOCK_INFO(u_ptr, b_ptr) \ do { \ if (!CANARY_OK(u_ptr)) { \ /* we didn't malloc this buffer */ \ (b_ptr) = NULL; \ break; \ } \ b_ptr = (void*)(ptr - (void*)sizeof(struct mem_block_info)); \ } while (0) /* converts a pointer to a user_block into a pointer to the padding */ #define USER_PTR_TO_PADDING(u_ptr, p_ptr) \ do { \ struct mem_block_info* b_ptr; \ USER_PTR_TO_BLOCK_INFO(u_ptr, b_ptr); \ if (!b_ptr) { \ (p_ptr) = NULL; \ break; \ } \ (p_ptr) = b_ptr->p_ptr; \ } while (0) /* fill a mem_info structure * @param p_mem the mem_info* structure to fill * @param ptr the address returned by (m,c,re)alloc * @param nmemb the number of elements * @param block_size the size of 1 element */ #define INIT_MEM_INFO(p_mem, ptr, nmemb, block_size) \ do { \ unsigned int nb_memb_header = GET_HEADER_SIZE() / block_size; \ if (block_size * nb_memb_header < GET_HEADER_SIZE()) \ nb_memb_header++; \ void* u_ptr = ptr + (block_size * nb_memb_header); \ p_mem = u_ptr - sizeof(struct mem_block_info); \ p_mem->p_ptr = ptr; \ p_mem->total_size = (nmemb + nb_memb_header) * block_size; \ p_mem->size = nmemb * block_size; \ p_mem->u_ptr = u_ptr; \ p_mem->canary = MAGIC_PATTERN; \ } while (0) /* todo: also implement mmap and munmap ? */ void* (*libcalloc)(size_t nmemb, size_t size) = NULL; void* (*libmalloc)(size_t size) = NULL; void (*libfree)(void* ptr) = NULL; void* (*librealloc)(void* ptr, size_t size) = NULL; static int malloc_protect_on = 0; /* Custom malloc function. It is used when libmalloc=NULL (e.g. during startup) * This function is not thread-safe and is very likely to be bogus, so use with * caution */ static void* hand_made_malloc(size_t size) { /* allocate a 1MB buffer */ #define POOL_SIZE (1024 * 1024) static char mem[POOL_SIZE] = {'\0'}; /* since this function is only used before we found libmalloc, there's no * fancy memory management mechanism (block reuse, etc.) */ static char* next_slot = &mem[0]; static int total_alloc = 0; if (libmalloc) /* let's use the real malloc */ return malloc(size); struct mem_block_info* p_block = NULL; INIT_MEM_INFO(p_block, next_slot, size, 1); p_block->mem_type = MEM_TYPE_CUSTOM_MALLOC; total_alloc += size; next_slot = next_slot + p_block->total_size; return p_block->u_ptr; } void* malloc(size_t size) { /* if memory_init hasn't been called yet, we need to get libc's malloc * address */ if (!libmalloc) { if (malloc_protect_on) /* protection flag says that malloc is already trying to retrieve the * address of malloc. * If we call dlsym now, there will be an infinite recursion, so let's * allocate memory 'by hand' */ return hand_made_malloc(size); /* set the protection flag and retrieve the address of malloc. * If dlsym calls malloc, memory will be allocated 'by hand' */ malloc_protect_on = 1; INTERCEPT_FUNCTION("malloc", libmalloc); /* it is now safe to call libmalloc */ malloc_protect_on = 0; } void* return_value = NULL; FUNCTION_ENTRY_WITH_ARGS(size); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); void* pptr = libmalloc(size + GET_HEADER_SIZE()); struct mem_block_info* p_block = NULL; INIT_MEM_INFO(p_block, pptr, size, 1); p_block->mem_type = MEM_TYPE_MALLOC; // EZTRACE_EVENT_PACKED_2(EZTRACE_MEMORY_MALLOC, p_block->size, (app_ptr)p_block->u_ptr); #if 0 /* for debugging purpose only */ uint32_t* canary = p_block->u_ptr-sizeof(uint32_t); if(*canary != MAGIC_PATTERN) { eztrace_warn( "warning: canary = %x instead of %x\n", *canary, MAGIC_PATTERN); } #endif return_value=p_block->u_ptr; EZTRACE_PROTECT_OFF(); goto out; } return_value = libmalloc(size); out: FUNCTION_EXIT_WITH_ARGS(return_value); return return_value; } void* realloc(void* ptr, size_t size) { /* if ptr is NULL, realloc behaves like malloc */ if (!ptr) return malloc(size); /* if size=0 and ptr isn't NULL, realloc behaves like free */ if (!size && ptr) { free(ptr); return NULL; } INTERCEPT_FUNCTION("realloc", librealloc); if (!CANARY_OK(ptr)) { /* we didn't malloc'ed this buffer */ return librealloc(ptr, size); } FUNCTION_ENTRY_WITH_ARGS(ptr, size); void* return_value = NULL; EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); struct mem_block_info* p_block; USER_PTR_TO_BLOCK_INFO(ptr, p_block); size_t old_size = p_block->size; size_t header_size = p_block->total_size - p_block->size; if (p_block->mem_type != MEM_TYPE_MALLOC) { eztrace_warn( "Warning: realloc a ptr that was allocated by hand_made_malloc\n"); } void* pptr = librealloc(p_block->p_ptr, size + header_size); if (!p_block) { EZTRACE_PROTECT_OFF(); return NULL; } INIT_MEM_INFO(p_block, pptr, size + header_size, 1); p_block->mem_type = MEM_TYPE_MALLOC; // EZTRACE_EVENT_PACKED_3(EZTRACE_MEMORY_REALLOC, old_size, p_block->size, (app_ptr)p_block->u_ptr); return_value = p_block->u_ptr; EZTRACE_PROTECT_OFF(); goto out; } return_value = librealloc(ptr, size); out: FUNCTION_EXIT_WITH_ARGS(return_value); return return_value; } void* calloc(size_t nmemb, size_t size) { if (!libcalloc) { void* ret = hand_made_malloc(nmemb * size); if (ret) { memset(ret, 0, nmemb * size); } return ret; } void* return_value = NULL; FUNCTION_ENTRY_WITH_ARGS(nmemb, size); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); /* compute the number of blocks for header */ int nb_memb_header = sizeof(struct mem_block_info) / size; if (size * nb_memb_header < sizeof(struct mem_block_info)) nb_memb_header++; /* allocate buffer + header */ void* p_ptr = libcalloc(nmemb + nb_memb_header, size); struct mem_block_info* p_block = NULL; INIT_MEM_INFO(p_block, p_ptr, nmemb, size); p_block->mem_type = MEM_TYPE_MALLOC; // EZTRACE_EVENT_PACKED_2(EZTRACE_MEMORY_MALLOC, p_block->size, (app_ptr)p_block->u_ptr); #if 0 /* for debugging purpose only */ uint32_t* canary = p_block->u_ptr-sizeof(uint32_t); if(*canary != MAGIC_PATTERN) { eztrace_warn("warning: canary = %x instead of %x\n", *canary, MAGIC_PATTERN); } #endif return_value = p_block->u_ptr; EZTRACE_PROTECT_OFF(); goto out; } return_value = libcalloc(nmemb, size); out: FUNCTION_EXIT_WITH_ARGS(return_value); return return_value; } void free(void* ptr) { if (!ptr) { return; } if (!libfree) { static int plop=0; if(plop++ > 10) { plop=0; return; } INTERCEPT_FUNCTION("free", libfree); if(!libfree) { /* dlsym failed, so it is not safe to call libfree. Don't free the memory */ return; } plop--; } /* first, check wether we malloc'ed the buffer */ if (!CANARY_OK(ptr)) { /* we didn't malloc this buffer */ libfree(ptr); return; } FUNCTION_ENTRY_WITH_ARGS(ptr); /* retrieve the block information and free it */ EZTRACE_PROTECT { struct mem_block_info* p_block; USER_PTR_TO_BLOCK_INFO(ptr, p_block); if (p_block->mem_type == MEM_TYPE_MALLOC) { // EZTRACE_EVENT_PACKED_2(EZTRACE_MEMORY_FREE, p_block->size, (app_ptr)p_block->u_ptr); libfree(p_block->p_ptr); } else { /* the buffer was allocated by hand_made_malloc, there's nothing to free */ } } FUNCTION_EXIT; } PPTRACE_START_INTERCEPT_FUNCTIONS(memory) INTERCEPT3("free", libfree) INTERCEPT3("malloc", libmalloc) INTERCEPT3("calloc", libcalloc) INTERCEPT3("realloc", librealloc) PPTRACE_END_INTERCEPT_FUNCTIONS(memory) static void init_memory() { malloc_protect_on = 1; INSTRUMENT_FUNCTIONS(memory); if (eztrace_autostart_enabled()) eztrace_start(); malloc_protect_on = 0; _memory_initialized = 1; } static void finalize_memory(void) { _memory_initialized = 0; eztrace_stop(); } static void _memory_init(void) __attribute__((constructor)); static void _memory_init(void) { malloc_protect_on = 1; eztrace_log(dbg_lvl_debug, "eztrace_memory constructor starts\n"); EZT_REGISTER_MODULE(memory, "Module for dynamic memory (malloc, free, etc.)", init_memory, finalize_memory); eztrace_log(dbg_lvl_debug, "eztrace_memory constructor ends\n"); malloc_protect_on = 0; } eztrace-2.1/src/modules/mpi/000077500000000000000000000000001447213526500160465ustar00rootroot00000000000000eztrace-2.1/src/modules/mpi/CMakeLists.txt000066400000000000000000000027631447213526500206160ustar00rootroot00000000000000file(GLOB mpi_function_files mpi_funcs/*.c mpi_funcs/*.h) set(eztrace-mpi_SOURCES ${mpi_function_files} mpi.c mpi_eztrace.h ) # Compile this module with mpicc/mpif90 set(CMAKE_C_COMPILER ${MPICC}) set(CMAKE_Fortran_COMPILER ${MPIF90}) if(CMAKE_Fortran_COMPILER) # mpif.h may define a bunch of unused parameter which would generate lots of warnings set(eztrace-mpi_SOURCES ${eztrace-mpi_SOURCES} mpi3_f.f90 fortran_utils.f90 mpi_f.f90 mpi_fortran.c) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wno-unused-parameter") endif() add_library(eztrace-mpi SHARED ${eztrace-mpi_SOURCES} ) target_include_directories(eztrace-mpi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) target_link_libraries(eztrace-mpi PRIVATE ${INTERCEPT_LIB} eztrace-core eztrace-lib ) target_compile_options(eztrace-mpi PRIVATE -Wall -Wextra -DUSE_MPI3 -DLD_PRELOAD_NAME=\"${LD_PRELOAD_NAME}\" -DMPI_MODULE_NAME=${MPI_MODULE_NAME} -Wno-error=incompatible-pointer-types # TODO -Wno-error=pointer-arith # TODO -Wno-error=int-conversion # TODO ) set_target_properties(eztrace-mpi PROPERTIES OUTPUT_NAME eztrace-${MPI_MODULE_NAME} ) #---------------------------------------------------- install(TARGETS eztrace-mpi LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/mpi/fortran_utils.f90000066400000000000000000000004761447213526500212700ustar00rootroot00000000000000! Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis ! See COPYING in top-level directory. integer function ezt_mpi_is_in_place( i ) include 'mpif.h' integer i ezt_mpi_is_in_place = 0 if( loc(i) .eq. loc(mpi_in_place) ) ezt_mpi_is_in_place = 1 return end function ezt_mpi_is_in_place eztrace-2.1/src/modules/mpi/mpi.c000066400000000000000000001402341447213526500170030ustar00rootroot00000000000000/* -*- C-File-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #include */ #include "mpi_eztrace.h" #include #include int mpi_verbose = 0; /* pointers to actual MPI functions (C version) */ int (*libMPI_Init)(int*, char***); int (*libMPI_Init_thread)(int*, char***, int, int*); int (*libMPI_Comm_size)(MPI_Comm, int*); int (*libMPI_Comm_rank)(MPI_Comm, int*); int (*libMPI_Comm_get_parent)(MPI_Comm* parent) = NULL; int (*libMPI_Finalize)(void); int (*libMPI_Initialized)(int*); int (*libMPI_Abort)(MPI_Comm, int); int (*libMPI_Type_size)(MPI_Datatype datatype, int* size); int (*libMPI_Cancel)(MPI_Request*); int (*libMPI_Comm_disconnect)(MPI_Comm* comm); int (*libMPI_Comm_free)(MPI_Comm* comm); int (*libMPI_Comm_create)(MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm); int (*libMPI_Comm_create_group)(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm* newcomm); int (*libMPI_Comm_split)(MPI_Comm comm, int color, int key, MPI_Comm* newcomm); int (*libMPI_Comm_dup)(MPI_Comm comm, MPI_Comm* newcomm); int (*libMPI_Comm_dup_with_info)(MPI_Comm comm, MPI_Info info, MPI_Comm* newcomm); int (*libMPI_Comm_split_type)(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm* newcomm); int (*libMPI_Intercomm_create)(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* newintercomm); int (*libMPI_Intercomm_merge)(MPI_Comm intercomm, int high, MPI_Comm* newintracomm); int (*libMPI_Cart_sub)(MPI_Comm old_comm, CONST int* belongs, MPI_Comm* new_comm); int (*libMPI_Cart_create)(MPI_Comm comm_old, int ndims, CONST int* dims, CONST int* periods, int reorder, MPI_Comm* comm_cart); int (*libMPI_Graph_create)(MPI_Comm comm_old, int nnodes, CONST int* index, CONST int* edges, int reorder, MPI_Comm* comm_graph); int (*libMPI_Dist_graph_create_adjacent)(MPI_Comm comm_old, int indegree, CONST int sources[], CONST int sourceweights[], int outdegree, CONST int destinations[], CONST int destweights[], MPI_Info info, int reorder, MPI_Comm* comm_dist_graph); int (*libMPI_Dist_graph_create)(MPI_Comm comm_old, int n, CONST int sources[], CONST int degrees[], CONST int destinations[], CONST int weights[], MPI_Info info, int reorder, MPI_Comm* comm_dist_graph); int (*libMPI_Send)(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); int (*libMPI_Recv)(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status); int (*libMPI_Bsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); int (*libMPI_Ssend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); int (*libMPI_Rsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); int (*libMPI_Isend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Ibsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Issend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Irsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Irecv)(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Sendrecv)(CONST void*, int, MPI_Datatype, int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*); int (*libMPI_Sendrecv_replace)(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*); int (*libMPI_Send_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Bsend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Ssend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Rsend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Recv_init)(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); int (*libMPI_Start)(MPI_Request*); int (*libMPI_Startall)(int, MPI_Request*); int (*libMPI_Wait)(MPI_Request*, MPI_Status*); int (*libMPI_Test)(MPI_Request*, int*, MPI_Status*); int (*libMPI_Waitany)(int, MPI_Request*, int*, MPI_Status*); int (*libMPI_Testany)(int, MPI_Request*, int*, int*, MPI_Status*); int (*libMPI_Waitall)(int, MPI_Request*, MPI_Status*); int (*libMPI_Testall)(int, MPI_Request*, int*, MPI_Status*); int (*libMPI_Waitsome)(int, MPI_Request*, int*, int*, MPI_Status*); int (*libMPI_Testsome)(int, MPI_Request*, int*, int*, MPI_Status*); int (*libMPI_Probe)(int source, int tag, MPI_Comm comm, MPI_Status* status); int (*libMPI_Iprobe)(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status); int (*libMPI_Barrier)(MPI_Comm); int (*libMPI_Bcast)(void*, int, MPI_Datatype, int, MPI_Comm); int (*libMPI_Gather)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); int (*libMPI_Gatherv)(CONST void*, int, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, int, MPI_Comm); int (*libMPI_Scatter)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); int (*libMPI_Scatterv)(CONST void*, CONST int*, CONST int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); int (*libMPI_Allgather)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm); int (*libMPI_Allgatherv)(CONST void*, int, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, MPI_Comm); int (*libMPI_Alltoall)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm); int (*libMPI_Alltoallv)(CONST void*, CONST int*, CONST int*, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, MPI_Comm); int (*libMPI_Reduce)(CONST void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm); int (*libMPI_Allreduce)(CONST void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm); int (*libMPI_Reduce_scatter)(CONST void*, void*, CONST int*, MPI_Datatype, MPI_Op, MPI_Comm); int (*libMPI_Scan)(CONST void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm); /* non-blocking collective (available since MPI 3.0) */ #ifdef USE_MPI3 int (*libMPI_Ibarrier)(MPI_Comm, MPI_Request*); int (*libMPI_Ibcast)(void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); int (*libMPI_Igather)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); int (*libMPI_Igatherv)(const void*, int, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, int, MPI_Comm, MPI_Request*); int (*libMPI_Iscatter)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); int (*libMPI_Iscatterv)(const void*, const int*, const int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); int (*libMPI_Iallgather)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*); int (*libMPI_Iallgatherv)(const void*, int, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, MPI_Comm, MPI_Request*); int (*libMPI_Ialltoall)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*); int (*libMPI_Ialltoallv)(const void*, const int*, const int*, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, MPI_Comm, MPI_Request*); int (*libMPI_Ireduce)(const void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm, MPI_Request*); int (*libMPI_Iallreduce)(const void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); int (*libMPI_Ireduce_scatter)(const void*, void*, const int*, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); int (*libMPI_Iscan)(const void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); #endif int (*libMPI_Get)(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); int (*libMPI_Put)(CONST void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); int (*libMPI_Get)(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); int (*libMPI_Put)(CONST void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); int (*libMPI_Comm_spawn)(CONST char* command, char* argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* intercomm, int array_of_errcodes[]); /* fortran bindings */ void (*libmpi_init_)(int* e); void (*libmpi_init_thread_)(int*, int*, int*); void (*libmpi_finalize_)(int*); void (*libmpi_barrier_)(MPI_Comm*, int*); void (*libmpi_comm_size_)(MPI_Comm*, int*, int*); void (*libmpi_comm_rank_)(MPI_Comm*, int*, int*); void (*libmpi_comm_get_parent_)(MPI_Comm*, int*); void (*libmpi_type_size_)(MPI_Datatype*, int*, int*); void (*libmpi_cancel_)(MPI_Request*, int*); int (*libmpi_comm_create_)(int*, int*, int*, int*); int (*libmpi_comm_create_group_)(int*, int*, int*, int*, int*); int (*libmpi_comm_split_)(int*, int*, int*, int*, int*); int (*libmpi_comm_dup_)(int*, int*, int*); int (*libmpi_comm_dup_with_info_)(int*, int*, int*, int*); int (*libmpi_comm_split_type_)(int*, int*, int*, int*, int*); int (*libmpi_intercomm_create_)(int*, int*, int*, int*, int*, int*, int*); int (*libmpi_intercomm_merge_)(int*, int*, int*, int*); int (*libmpi_cart_sub_)(int*, int*, int*, int*); int (*libmpi_cart_create_)(int*, int*, int*, int*, int*, int*, int*); int (*libmpi_graph_create_)(int*, int*, int*, int*, int*, int*, int*); int (*libmpi_dist_graph_create_adjacent_)(int*, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*); int (*libmpi_dist_graph_create_)(int*, int*, int*, int*, int*, int*, int*, int*, int*, int*); void (*libmpi_send_)(void*, int*, MPI_Datatype*, int*, int*, int*); void (*libmpi_recv_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Status*, int*); void (*libmpi_sendrecv_)(void*, int, MPI_Datatype, int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*, int*); void (*libmpi_sendrecv_replace_)(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*, int*); void (*libmpi_bsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); void (*libmpi_ssend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); void (*libmpi_rsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); void (*libmpi_isend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_ibsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_issend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_irsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_irecv_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_wait_)(MPI_Request*, MPI_Status*, int*); void (*libmpi_test_)(MPI_Request*, int*, MPI_Status*, int*); void (*libmpi_waitany_)(int*, MPI_Request*, int*, MPI_Status*, int*); void (*libmpi_testany_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); void (*libmpi_waitall_)(int*, MPI_Request*, MPI_Status*, int*); void (*libmpi_testall_)(int*, MPI_Request*, int*, MPI_Status*, int*); void (*libmpi_waitsome_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); void (*libmpi_testsome_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); void (*libmpi_probe_)(int* source, int* tag, MPI_Comm* comm, MPI_Status* status, int* err); void (*libmpi_iprobe_)(int* source, int* tag, MPI_Comm* comm, int* flag, MPI_Status* status, int* err); void (*libmpi_get_)(void*, int*, MPI_Datatype*, int*, MPI_Aint*, int*, MPI_Datatype*, MPI_Win*, int*); void (*libmpi_put_)(void*, int*, MPI_Datatype*, int*, MPI_Aint*, int*, MPI_Datatype*, MPI_Win*, int*); void (*libmpi_bcast_)(void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); void (*libmpi_gather_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); void (*libmpi_gatherv_)(void*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, int*, MPI_Comm*); void (*libmpi_scatter_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); void (*libmpi_scatterv_)(void*, int*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); void (*libmpi_allgather_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, MPI_Comm*, int*); void (*libmpi_allgatherv_)(void*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm*); void (*libmpi_alltoall_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, MPI_Comm*, int*); void (*libmpi_alltoallv_)(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm*, int*); void (*libmpi_reduce_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, int*, MPI_Comm*, int*); void (*libmpi_allreduce_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); void (*libmpi_reduce_scatter_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); void (*libmpi_scan_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); #ifdef USE_MPI3 /* non-blocking collective (available since MPI 3.0) */ void (*libmpi_ibarrier_)(MPI_Fint*, MPI_Fint*, int*); void (*libmpi_ibcast_)(void*, int*, MPI_Fint*, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_igather_)(const void*, int*, MPI_Fint*, void*, int*, MPI_Fint*, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_igatherv_)(const void*, int*, MPI_Fint*, void*, const int*, const int*, MPI_Fint*, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iscatter_)(const void*, int*, MPI_Fint*, void*, int*, MPI_Fint*, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iscatterv_)(const void*, const int*, const int*, MPI_Fint*, void*, int*, MPI_Fint*, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iallgather_)(const void*, int*, MPI_Fint*, void*, int*, MPI_Fint*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iallgatherv_)(const void*, int*, MPI_Fint*, void*, const int*, const int*, MPI_Fint*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_ialltoall_)(const void*, int*, MPI_Fint*, void*, int*, MPI_Fint*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_ialltoallv_)(const void*, const int*, const int*, MPI_Fint*, void*, const int*, const int*, MPI_Fint*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_ireduce_)(const void*, void*, int*, MPI_Fint*, MPI_Op, int*, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iallreduce_)(const void*, void*, int*, MPI_Fint*, MPI_Op, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_ireduce_scatter_)(const void*, void*, const int*, MPI_Fint*, MPI_Op, MPI_Fint*, MPI_Fint*, int*); void (*libmpi_iscan_)(const void*, void*, int*, MPI_Fint*, MPI_Op, MPI_Fint*, MPI_Fint*, int*); #endif void (*libmpi_comm_spawn_)(char* command, char** argv, int* maxprocs, MPI_Info* info, int* root, MPI_Comm* comm, MPI_Comm* intercomm, int* array_of_errcodes, int* error); void (*libmpi_send_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_bsend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_ssend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_rsend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_recv_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); void (*libmpi_start_)(MPI_Request*, int*); void (*libmpi_startall_)(int*, MPI_Request*, int*); struct _ezt_mpi_info { int rank; int size; int mpi_any_source; int mpi_any_tag; app_ptr mpi_request_null; int mpi_proc_null; app_ptr mpi_comm_world; app_ptr mpi_comm_self; int ppid; struct ezt_hashtable mpi_communicators; // match MPI communicators with OTF2 communicator IDs struct ezt_hashtable ezt_mpi_requests; struct ezt_hashtable ezt_mpi_persistent_requests; /* Process identifier. * It corresponds to the global MPI rank unless the process was spawned. * In that case, the identifier is the concatenation of the parent process id * and the global rank. * For example process id 0_1_3 has a global rank of 3 and is has been spawned by process 0_1 * Process 0_1 has a global rank of 1 and was spawned by process 0 */ char* proc_id; }; static int _mpi_init_called = 0; static struct _ezt_mpi_info mpi_infos; static hashkey_t _ezt_hash_mpi_comm(MPI_Comm c) { uint64_t key = (uint64_t)c; return hash_function_int64(key); } static void _ezt_new_mpi_comm(MPI_Comm comm); static void _ezt_mpi_delete_comm(MPI_Comm c); /* Functions that intercept MPI calls * Basically each function create an event this the arguments * passed to the function. * It then call the actual MPI function (using the appropriate * callback) with the same args */ int MPI_Comm_spawn(CONST char* command MAYBE_UNUSED, char* argv[] MAYBE_UNUSED, int maxprocs MAYBE_UNUSED, MPI_Info info MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Comm* intercomm MAYBE_UNUSED, int array_of_errcodes[] MAYBE_UNUSED) { /* TODO */ #if 0 /* Instead of running command argv, we have to run 'env LD_PRELOAD=xxx command argv' Thus, we have to provide a new argv array */ /* retrieve LD_PRELOAD command set by EZTrace */ char* ld_preload = getenv(LD_PRELOAD_NAME); char* ld_preload_str = NULL; int ret __attribute__((__unused__)); ret = asprintf(&ld_preload_str, "%s=%s", LD_PRELOAD_NAME, ld_preload); /* count the number of args */ int argc = 0; if (argv != MPI_ARGV_NULL) for (argc = 0; argv[argc] != NULL; argc++) { } /* create a new argv array */ int new_argc = argc + 3; char** new_argv = (char**)malloc(sizeof(char*) * new_argc); new_argv[0] = ld_preload_str; ret = asprintf(&new_argv[1], "%s", command); int i; for (i = 0; i < argc; i++) new_argv[i + 2] = argv[i]; new_argv[i + 2] = NULL; ret = libMPI_Comm_spawn("env", new_argv, maxprocs, info, root, comm, intercomm, array_of_errcodes); /* Now that the processes are launched, tell them our proc_id so that the filenames are not messed up */ int f_size; /* number of children actually created */ int proc_id_len = strlen(mpi_infos.proc_id) + 1; int my_pid = getpid(); MPI_Comm_remote_size(*intercomm, &f_size); EZTRACE_EVENT_FORCE_RECORD_PACKED_2(EZTRACE_MPI_SPAWN, my_pid, f_size); for (i = 0; i < f_size; i++) { MPI_Send(&proc_id_len, 1, MPI_INT, i, 0, *intercomm); MPI_Send(mpi_infos.proc_id, proc_id_len, MPI_CHAR, i, 0, *intercomm); MPI_Send(&my_pid, 1, MPI_INT, i, 0, *intercomm); } /* Here, we shall not free ld_preload, since it may modify the environment of the process ! (man getenv) */ free(new_argv); free(ld_preload_str); FUNCTION_ENTRY; return ret; #endif return 0; } int MPI_Comm_get_parent(MPI_Comm* parent) { if (!libMPI_Comm_get_parent) { /* MPI_Comm_get_parent was not found. Let's assume the application doesn't use it. */ *parent = MPI_COMM_NULL; return MPI_SUCCESS; } return libMPI_Comm_get_parent(parent); } int MPI_Comm_size(MPI_Comm c, int* s) { return libMPI_Comm_size(c, s); } int MPI_Comm_rank(MPI_Comm c, int* r) { return libMPI_Comm_rank(c, r); } int MPI_Type_size(MPI_Datatype datatype, int* size) { return libMPI_Type_size(datatype, size); } int MPI_Finalize() { eztrace_stop(); return libMPI_Finalize(); } void ezt_mpi_initialize_trace(); /* internal function * This function is used by the various MPI_Init* functions (C * and Fortran versions) * This function add informations to the trace (rank, etc.) * and set the trace filename. */ void _mpi_init_generic() { if(_mpi_init_called) return; int ret __attribute__((__unused__)); MPI_Comm parentcomm; MPI_Comm_get_parent(&parentcomm); libMPI_Comm_size(MPI_COMM_WORLD, &mpi_infos.size); libMPI_Comm_rank(MPI_COMM_WORLD, &mpi_infos.rank); if (parentcomm == MPI_COMM_NULL) { /* This process is a 'normal' process (ie. it wasn't spawned) */ ret = asprintf(&mpi_infos.proc_id, "%d", mpi_infos.rank); mpi_infos.ppid = -1; } else { /* This process was spawned. * We have to get the parent process information */ char* father_proc_id; int father_proc_id_len = -1; /* Get the parent process id */ libMPI_Recv(&father_proc_id_len, 1, MPI_INT, 0, 0, parentcomm, MPI_STATUS_IGNORE); father_proc_id = (char*)malloc(sizeof(char) * father_proc_id_len); libMPI_Recv(father_proc_id, father_proc_id_len, MPI_CHAR, 0, 0, parentcomm, MPI_STATUS_IGNORE); libMPI_Recv(&mpi_infos.ppid, 1, MPI_INT, 0, 0, parentcomm, MPI_STATUS_IGNORE); ret = asprintf(&mpi_infos.proc_id, "%s_%d", father_proc_id, mpi_infos.rank); free(father_proc_id); } // First, let's synchronize the MPI ranks clocks libMPI_Barrier(MPI_COMM_WORLD); first_timestamp = 0; // This initialize first_timestamps. From now on, the timestamps will be relative to the current timestamp ezt_get_timestamp(); mpi_infos.mpi_any_source = MPI_ANY_SOURCE; mpi_infos.mpi_any_tag = MPI_ANY_TAG; mpi_infos.mpi_proc_null = MPI_PROC_NULL; mpi_infos.mpi_request_null = (app_ptr)MPI_REQUEST_NULL; mpi_infos.mpi_comm_world = (app_ptr)MPI_COMM_WORLD; mpi_infos.mpi_comm_self = (app_ptr)MPI_COMM_SELF; /* initialize communicators */ int hashtable_size = 128; /* todo: make that limit configurable ? */ ezt_hashtable_init(&mpi_infos.mpi_communicators, hashtable_size); todo_set_status("mpi_init", init_complete); ezt_otf2_set_mpi_rank(mpi_infos.rank, mpi_infos.size); todo_wait("ezt_otf2", init_complete); /* now mpi_comm_world has been registered to OTF2 */ ezt_hashtable_insert(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(MPI_COMM_WORLD), &comm_world_ref); _ezt_new_mpi_comm(MPI_COMM_SELF); _mpi_init_called = 1; } /* This function record initialization events. It is called during mpi_init if * autostart is enabled or when eztrace_start is reached */ void ezt_mpi_initialize_trace() { static int mpi_trace_initialized = 0; if (_ezt_trace.status == ezt_trace_status_running || _ezt_trace.status == ezt_trace_status_paused) { if (!mpi_trace_initialized) { assert(_mpi_init_called); mpi_trace_initialized = 1; } } } int MPI_Init_thread(int* argc, char*** argv, int required, int* provided) { eztrace_log(dbg_lvl_debug, "MPI_Init_thread intercepted\n"); INTERCEPT_FUNCTION("MPI_Init_thread", libMPI_Init_thread); int ret = libMPI_Init_thread(argc, argv, required, provided); _mpi_init_generic(); eztrace_log(dbg_lvl_debug, "End of MPI_Init_thread interception\n"); return ret; } int MPI_Init(int* argc, char*** argv) { eztrace_log(dbg_lvl_debug, "MPI_Init intercepted\n"); INSTRUMENT_FUNCTIONS(MPI_MODULE_NAME); int ret = libMPI_Init(argc, argv); _mpi_init_generic(); eztrace_log(dbg_lvl_debug, "End of MPI_Init interception\n"); return ret; } void print_comm(MPI_Comm comm); OTF2_CommRef MPI_TO_OTF_COMMUNICATOR(MPI_Comm c) { void* ret = ezt_hashtable_get(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(c)); if(!ret) { if(c==MPI_COMM_NULL) { eztrace_error("Trying to convert MPI_COMM_NULL\n"); } eztrace_error("Cannot find MPI Communicator %lx\n", (long unsigned int)c); } OTF2_CommRef *ref = (OTF2_CommRef*)ret; return *ref; } static void _ezt_mpi_delete_comm(MPI_Comm c) { ezt_hashtable_remove(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(c)); } static void _ezt_register_mpi_communicator(MPI_Comm comm, OTF2_CommRef *comm_ref) { MPI_Group world_group, group; int gsize; /* size of the group */ MPI_Comm_group(MPI_COMM_WORLD, &world_group); MPI_Comm_group(comm, &group); MPI_Group_size(group, &gsize); int* local_ranks = malloc(sizeof(int) * gsize); int* global_ranks = malloc(sizeof(int) * gsize); uint64_t* members = malloc(sizeof(uint64_t) * gsize); int i; for (i = 0; i < gsize; i++) local_ranks[i] = i; /* translate the ranks of the local group into rank of the world group */ MPI_Group_translate_ranks(group, gsize, local_ranks, world_group, global_ranks); for (i = 0; i < gsize; i++) members[i] = (uint64_t)global_ranks[i]; /* the superleader registers the communicator and gets a communicator id*/ *comm_ref = ezt_otf2_register_mpi_comm(gsize, members); free(members); free(global_ranks); free(local_ranks); } static void _ezt_new_mpi_intercomm(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm MAYBE_UNUSED, int remote_leader MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm* newintercomm) { if (*newintercomm == MPI_COMM_NULL) return; int local_my_rank = -1; int local_comm_size = -1; MPI_Comm_rank(local_comm, &local_my_rank); MPI_Comm_size(local_comm, &local_comm_size); OTF2_CommRef *comm_ref = malloc(sizeof(OTF2_CommRef)); int intercomm_my_rank = -1; int intercomm_size = -1; if(local_my_rank == local_leader) { /* First, the superleader (rank0 in the intercommunicator) generates a comm_ref */ MPI_Comm_rank(*newintercomm, &intercomm_my_rank); MPI_Comm_size(*newintercomm, &intercomm_size); if(intercomm_my_rank == 0) { /* I'm the superleader */ _ezt_register_mpi_communicator(*newintercomm, comm_ref); } } /* exchange the comm_ref within the local_comm */ libMPI_Bcast(comm_ref, 1, MPI_INT, local_leader, local_comm); ezt_hashtable_insert(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(*newintercomm), comm_ref); assert(MPI_TO_OTF_COMMUNICATOR(*newintercomm) == *comm_ref); } static void _ezt_mpi_comm_dup(MPI_Comm comm, MPI_Comm newcomm) { if (newcomm == MPI_COMM_NULL) return; OTF2_CommRef *comm_ref = malloc(sizeof(OTF2_CommRef)); comm_ref = (OTF2_CommRef*) ezt_hashtable_get(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(comm)); if(!comm_ref) { /* the old_comm is not registered yet. Create it before creating newcomm */ _ezt_new_mpi_comm(comm); comm_ref = (OTF2_CommRef*) ezt_hashtable_get(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(comm)); if(!comm_ref) { eztrace_error("Cannot find MPI Communicator %lx\n", (long unsigned int) comm); } } ezt_hashtable_insert(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(newcomm), comm_ref); } static void _ezt_new_mpi_comm(MPI_Comm comm) { if (comm == MPI_COMM_NULL) return; int my_rank = -1; int comm_size = -1; MPI_Comm_rank(comm, &my_rank); MPI_Comm_size(comm, &comm_size); OTF2_CommRef *comm_ref = malloc(sizeof(OTF2_CommRef)); if(my_rank == 0) { _ezt_register_mpi_communicator(comm, comm_ref); } /* broadcast the communicator id to the other ranks */ libMPI_Bcast(comm_ref, 1, MPI_INT, 0, comm); ezt_hashtable_insert(&mpi_infos.mpi_communicators, _ezt_hash_mpi_comm(comm), comm_ref); assert(MPI_TO_OTF_COMMUNICATOR(comm) == *comm_ref); } #ifdef DEBUG #define CHECK_COMMUNICATOR(newcomm, comm) \ do { \ if ((newcomm) == MPI_COMM_NULL) { \ int rank, size; \ MPI_Comm_rank(MPI_COMM_WORLD, &rank); \ MPI_Comm_size(MPI_COMM_WORLD, &size); \ eztrace_warn(" New communicator (%x) is NULL ! This communicator was created from communicator %x using %s\n", \ (void*)(newcomm), (void*)(comm), __func__); \ } \ } while (0) #else #define CHECK_COMMUNICATOR(newcomm, comm) (void)(0) #endif #define _EZT_NEW_COMM(new_comm, old_comm) \ do { \ if (ret == MPI_SUCCESS) { \ CHECK_COMMUNICATOR(new_comm, old_comm); \ _ezt_new_mpi_comm(new_comm); \ } else { \ eztrace_warn(" %s returned %d\n", __func__, ret); \ } \ } while (0) int MPI_Comm_disconnect(MPI_Comm* comm) { FUNCTION_ENTRY; if (comm) _ezt_mpi_delete_comm(*comm); int ret = libMPI_Comm_disconnect(comm); FUNCTION_EXIT; return ret; } int MPI_Comm_free(MPI_Comm* comm) { FUNCTION_ENTRY; if (comm) _ezt_mpi_delete_comm(*comm); int ret = libMPI_Comm_free(comm); FUNCTION_EXIT; return ret; } int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_create(comm, group, newcomm); if(newcomm) _EZT_NEW_COMM(*newcomm, comm); FUNCTION_EXIT; return ret; } int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_create_group(comm, group, tag, newcomm); if(newcomm) _EZT_NEW_COMM(*newcomm, comm); FUNCTION_EXIT; return ret; } int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_split(comm, color, key, newcomm); if(newcomm) { _EZT_NEW_COMM(*newcomm, comm); } FUNCTION_EXIT; return ret; } int MPI_Comm_dup(MPI_Comm comm, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_dup(comm, newcomm); if(newcomm) _ezt_mpi_comm_dup(comm, *newcomm); FUNCTION_EXIT; return ret; } int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_dup_with_info(comm, info, newcomm); if(newcomm) _ezt_mpi_comm_dup(comm, *newcomm); FUNCTION_EXIT; return ret; } int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm* newcomm) { FUNCTION_ENTRY; int ret = libMPI_Comm_split_type(comm, split_type, key, info, newcomm); if(newcomm) _EZT_NEW_COMM(*newcomm, comm); FUNCTION_EXIT; return ret; } int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* newintercomm) { FUNCTION_ENTRY; int ret = libMPI_Intercomm_create(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); if(newintercomm) { _ezt_new_mpi_intercomm(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); } FUNCTION_EXIT; return ret; } int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm* newintracomm) { FUNCTION_ENTRY; int ret = libMPI_Intercomm_merge(intercomm, high, newintracomm); if(newintracomm) _EZT_NEW_COMM(*newintracomm, intercomm); FUNCTION_EXIT; return ret; } int MPI_Cart_sub(MPI_Comm old_comm, CONST int* belongs, MPI_Comm* new_comm) { FUNCTION_ENTRY; int ret = libMPI_Cart_sub(old_comm, belongs, new_comm); if(new_comm) _EZT_NEW_COMM(*new_comm, old_comm); FUNCTION_EXIT; return ret; } int MPI_Cart_create(MPI_Comm comm_old, int ndims, CONST int* dims, CONST int* periods, int reorder, MPI_Comm* comm_cart) { FUNCTION_ENTRY; int ret = libMPI_Cart_create(comm_old, ndims, dims, periods, reorder, comm_cart); if(comm_cart) _EZT_NEW_COMM(*comm_cart, comm_old); FUNCTION_EXIT; return ret; } int MPI_Graph_create(MPI_Comm comm_old, int nnodes, CONST int* index, CONST int* edges, int reorder, MPI_Comm* comm_graph) { FUNCTION_ENTRY; int ret = libMPI_Graph_create(comm_old, nnodes, index, edges, reorder, comm_graph); if(comm_graph) _EZT_NEW_COMM(*comm_graph, comm_old); FUNCTION_EXIT; return ret; } int MPI_Dist_graph_create(MPI_Comm comm_old, int n, CONST int sources[], CONST int degrees[], CONST int destinations[], CONST int weights[], MPI_Info info, int reorder, MPI_Comm* comm_dist_graph) { FUNCTION_ENTRY; int ret = libMPI_Dist_graph_create(comm_old, n, sources, degrees, destinations, weights, info, reorder, comm_dist_graph); if(comm_dist_graph) _EZT_NEW_COMM(*comm_dist_graph, comm_old); FUNCTION_EXIT; return ret; } int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, int indegree, CONST int sources[], CONST int sourceweights[], int outdegree, CONST int destinations[], CONST int destweights[], MPI_Info info, int reorder, MPI_Comm* comm_dist_graph) { FUNCTION_ENTRY; int ret = libMPI_Dist_graph_create_adjacent(comm_old, indegree, sources, sourceweights, outdegree, destinations, destweights, info, reorder, comm_dist_graph); if(comm_dist_graph) _EZT_NEW_COMM(*comm_dist_graph, comm_old); FUNCTION_EXIT; return ret; } static int _EZT_MPI_Recv(void* buffer, size_t size, int src, int tag) { if(mpi_verbose) eztrace_log(dbg_lvl_verbose, "[%d] %s(buffer=%p, size=%lu, src=%d, tag=%x)\n", mpi_infos.rank, __func__, buffer, size, src, tag); int ret = libMPI_Recv(buffer, size, MPI_BYTE, src, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if(ret == MPI_SUCCESS) return 0; eztrace_warn("%s failed\n", __func__); return 1; } static int _EZT_MPI_Send(void* buffer, size_t size, int dest, int tag) { if(mpi_verbose) eztrace_log(dbg_lvl_verbose, "[%d] %s(buffer=%p, size=%lu, dest=%d, tag=%x)\n", mpi_infos.rank, __func__, buffer, size, dest, tag); int ret = libMPI_Send(buffer, size, MPI_BYTE, dest, tag, MPI_COMM_WORLD); if(ret == MPI_SUCCESS) return 0; eztrace_warn("%s failed\n", __func__); return 1; } static int _EZT_MPI_Reduce(const void *sendbuf, void *recvbuf, int count, enum EZT_MPI_Datatype datatype, enum EZT_MPI_Op op, int root) { if(mpi_verbose) { eztrace_log(dbg_lvl_normal, "[%d] %s(sendbuf=%p, recvbuf=%p, count=%d, type=%x, op=%x, root=%d)\n", mpi_infos.rank, __func__, sendbuf, recvbuf, count, datatype, op, root); } int ret = libMPI_Reduce(sendbuf, recvbuf, count, EZT_DATATYPE_TO_MPI(datatype), EZT_OP_TO_MPI(op), root, MPI_COMM_WORLD); if(ret == MPI_SUCCESS) return 0; eztrace_warn("%s failed\n", __func__); return 1; } static int _EZT_MPI_SetMPICollectiveCallbacks(OTF2_Archive *archive) { OTF2_ErrorCode err = OTF2_MPI_Archive_SetCollectiveCallbacks(archive, MPI_COMM_WORLD, MPI_COMM_SELF); if(err == OTF2_SUCCESS) return 0; eztrace_warn("%s failed\n", __func__); return 1; } static int _EZT_MPI_Barrier() { int ret = libMPI_Barrier(MPI_COMM_WORLD); if(ret == MPI_SUCCESS) return 0; eztrace_warn("%s failed\n", __func__); return 1; } static double _EZT_MPI_Wtime() { return MPI_Wtime(); } PPTRACE_START_INTERCEPT_FUNCTIONS(MPI_MODULE_NAME) INTERCEPT3("MPI_Init_thread", libMPI_Init_thread) INTERCEPT3("MPI_Init", libMPI_Init) INTERCEPT3("MPI_Finalize", libMPI_Finalize) INTERCEPT3("MPI_Barrier", libMPI_Barrier) INTERCEPT3("MPI_Comm_size", libMPI_Comm_size) INTERCEPT3("MPI_Comm_rank", libMPI_Comm_rank) INTERCEPT3("MPI_Comm_get_parent", libMPI_Comm_get_parent) INTERCEPT3("MPI_Type_size", libMPI_Type_size) INTERCEPT3("MPI_Cancel", libMPI_Cancel) INTERCEPT3("MPI_Comm_disconnect", libMPI_Comm_disconnect) INTERCEPT3("MPI_Comm_free", libMPI_Comm_free) INTERCEPT3("MPI_Comm_create", libMPI_Comm_create) INTERCEPT3("MPI_Comm_create_group", libMPI_Comm_create_group) INTERCEPT3("MPI_Comm_split", libMPI_Comm_split) INTERCEPT3("MPI_Comm_dup", libMPI_Comm_dup) INTERCEPT3("MPI_Comm_dup_with_info", libMPI_Comm_dup_with_info) INTERCEPT3("MPI_Comm_split_type", libMPI_Comm_split_type) INTERCEPT3("MPI_Intercomm_create", libMPI_Intercomm_create) INTERCEPT3("MPI_Intercomm_merge", libMPI_Intercomm_merge) INTERCEPT3("MPI_Cart_sub", libMPI_Cart_sub) INTERCEPT3("MPI_Cart_create", libMPI_Cart_create) INTERCEPT3("MPI_Graph_create", libMPI_Graph_create) INTERCEPT3("MPI_Dist_graph_create", libMPI_Dist_graph_create) INTERCEPT3("MPI_Dist_graph_create_adjacent", libMPI_Dist_graph_create_adjacent) INTERCEPT3("MPI_Send", libMPI_Send) INTERCEPT3("MPI_Recv", libMPI_Recv) INTERCEPT3("MPI_Sendrecv", libMPI_Sendrecv) INTERCEPT3("MPI_Sendrecv_replace", libMPI_Sendrecv_replace) INTERCEPT3("MPI_Bsend", libMPI_Bsend) INTERCEPT3("MPI_Ssend", libMPI_Ssend) INTERCEPT3("MPI_Rsend", libMPI_Rsend) INTERCEPT3("MPI_Isend", libMPI_Isend) INTERCEPT3("MPI_Ibsend", libMPI_Ibsend) INTERCEPT3("MPI_Issend", libMPI_Issend) INTERCEPT3("MPI_Irsend", libMPI_Irsend) INTERCEPT3("MPI_Irecv", libMPI_Irecv) INTERCEPT3("MPI_Wait", libMPI_Wait) INTERCEPT3("MPI_Waitall", libMPI_Waitall) INTERCEPT3("MPI_Waitany", libMPI_Waitany) INTERCEPT3("MPI_Waitsome", libMPI_Waitsome) INTERCEPT3("MPI_Test", libMPI_Test) INTERCEPT3("MPI_Testall", libMPI_Testall) INTERCEPT3("MPI_Testany", libMPI_Testany) INTERCEPT3("MPI_Testsome", libMPI_Testsome) INTERCEPT3("MPI_Iprobe", libMPI_Iprobe) INTERCEPT3("MPI_Probe", libMPI_Probe) INTERCEPT3("MPI_Get", libMPI_Get) INTERCEPT3("MPI_Put", libMPI_Put) INTERCEPT3("MPI_Bcast", libMPI_Bcast) INTERCEPT3("MPI_Gather", libMPI_Gather) INTERCEPT3("MPI_Gatherv", libMPI_Gatherv) INTERCEPT3("MPI_Scatter", libMPI_Scatter) INTERCEPT3("MPI_Scatterv", libMPI_Scatterv) INTERCEPT3("MPI_Allgather", libMPI_Allgather) INTERCEPT3("MPI_Allgatherv", libMPI_Allgatherv) INTERCEPT3("MPI_Alltoall", libMPI_Alltoall) INTERCEPT3("MPI_Alltoallv", libMPI_Alltoallv) INTERCEPT3("MPI_Reduce", libMPI_Reduce) INTERCEPT3("MPI_Allreduce", libMPI_Allreduce) INTERCEPT3("MPI_Reduce_scatter", libMPI_Reduce_scatter) INTERCEPT3("MPI_Scan", libMPI_Scan) #ifdef USE_MPI3 INTERCEPT3("MPI_Ibarrier", libMPI_Ibarrier) INTERCEPT3("MPI_Ibcast", libMPI_Ibcast) INTERCEPT3("MPI_Igather", libMPI_Igather) INTERCEPT3("MPI_Igatherv", libMPI_Igatherv) INTERCEPT3("MPI_Iscatter", libMPI_Iscatter) INTERCEPT3("MPI_Iscatterv", libMPI_Iscatterv) INTERCEPT3("MPI_Iallgather", libMPI_Iallgather) INTERCEPT3("MPI_Iallgatherv", libMPI_Iallgatherv) INTERCEPT3("MPI_Ialltoall", libMPI_Ialltoall) INTERCEPT3("MPI_Ialltoallv", libMPI_Ialltoallv) INTERCEPT3("MPI_Ireduce", libMPI_Ireduce) INTERCEPT3("MPI_Iallreduce", libMPI_Iallreduce) INTERCEPT3("MPI_Ireduce_scatter", libMPI_Ireduce_scatter) INTERCEPT3("MPI_Iscan", libMPI_Iscan) #endif INTERCEPT3("MPI_Comm_spawn", libMPI_Comm_spawn) INTERCEPT3("MPI_Send_init", libMPI_Send_init) INTERCEPT3("MPI_Bsend_init", libMPI_Bsend_init) INTERCEPT3("MPI_Ssend_init", libMPI_Ssend_init) INTERCEPT3("MPI_Rsend_init", libMPI_Rsend_init) INTERCEPT3("MPI_Recv_init", libMPI_Recv_init) INTERCEPT3("MPI_Start", libMPI_Start) INTERCEPT3("MPI_Startall", libMPI_Startall) /* fortran binding */ INTERCEPT3("mpi_init_", libmpi_init_) INTERCEPT3("mpi_init_thread_", libmpi_init_thread_) INTERCEPT3("mpi_init_", libmpi_init_) INTERCEPT3("mpi_finalize_", libmpi_finalize_) INTERCEPT3("mpi_barrier_", libmpi_barrier_) INTERCEPT3("mpi_comm_size_", libmpi_comm_size_) INTERCEPT3("mpi_comm_rank_", libmpi_comm_rank_) INTERCEPT3("mpi_comm_get_parent_", libmpi_comm_get_parent_) INTERCEPT3("mpi_type_size_", libmpi_type_size_) INTERCEPT3("mpi_cancel_", libmpi_cancel_) INTERCEPT3("mpi_comm_create_", libmpi_comm_create_) INTERCEPT3("mpi_comm_create_group_", libmpi_comm_create_group_) INTERCEPT3("mpi_comm_split_", libmpi_comm_split_) INTERCEPT3("mpi_comm_dup_", libmpi_comm_dup_) INTERCEPT3("mpi_comm_dup_with_info_", libmpi_comm_dup_with_info_) INTERCEPT3("mpi_comm_split_type_", libmpi_comm_split_type_) INTERCEPT3("mpi_intercomm_create_", libmpi_intercomm_create_) INTERCEPT3("mpi_intercomm_merge_", libmpi_intercomm_merge_) INTERCEPT3("mpi_cart_sub_", libmpi_cart_sub_) INTERCEPT3("mpi_cart_create_", libmpi_cart_create_) INTERCEPT3("mpi_graph_create_", libmpi_graph_create_) INTERCEPT3("mpi_dist_graph_create_", libmpi_dist_graph_create_) INTERCEPT3("mpi_dist_graph_create_adjacent_", libmpi_dist_graph_create_adjacent_) INTERCEPT3("mpi_send_", libmpi_send_) INTERCEPT3("mpi_recv_", libmpi_recv_) INTERCEPT3("mpi_sendrecv_", libmpi_sendrecv_) INTERCEPT3("mpi_sendrecv_replace_", libmpi_sendrecv_replace_) INTERCEPT3("mpi_bsend_", libmpi_bsend_) INTERCEPT3("mpi_ssend_", libmpi_ssend_) INTERCEPT3("mpi_rsend_", libmpi_rsend_) INTERCEPT3("mpi_isend_", libmpi_isend_) INTERCEPT3("mpi_ibsend_", libmpi_ibsend_) INTERCEPT3("mpi_issend_", libmpi_issend_) INTERCEPT3("mpi_irsend_", libmpi_irsend_) INTERCEPT3("mpi_irecv_", libmpi_irecv_) INTERCEPT3("mpi_wait_", libmpi_wait_) INTERCEPT3("mpi_waitall_", libmpi_waitall_) INTERCEPT3("mpi_waitany_", libmpi_waitany_) INTERCEPT3("mpi_waitsome_", libmpi_waitsome_) INTERCEPT3("mpi_test_", libmpi_test_) INTERCEPT3("mpi_testall_", libmpi_testall_) INTERCEPT3("mpi_testany_", libmpi_testany_) INTERCEPT3("mpi_testsome_", libmpi_testsome_) INTERCEPT3("mpi_probe_", libmpi_probe_) INTERCEPT3("mpi_iprobe_", libmpi_iprobe_) INTERCEPT3("mpi_get_", libmpi_get_) INTERCEPT3("mpi_put_", libmpi_put_) INTERCEPT3("mpi_bcast_", libmpi_bcast_) INTERCEPT3("mpi_gather_", libmpi_gather_) INTERCEPT3("mpi_gatherv_", libmpi_gatherv_) INTERCEPT3("mpi_scatter_", libmpi_scatter_) INTERCEPT3("mpi_scatterv_", libmpi_scatterv_) INTERCEPT3("mpi_allgather_", libmpi_allgather_) INTERCEPT3("mpi_allgatherv_", libmpi_allgatherv_) INTERCEPT3("mpi_alltoall_", libmpi_alltoall_) INTERCEPT3("mpi_alltoallv_", libmpi_alltoallv_) INTERCEPT3("mpi_reduce_", libmpi_reduce_) INTERCEPT3("mpi_allreduce_", libmpi_allreduce_) INTERCEPT3("mpi_reduce_scatter_", libmpi_reduce_scatter_) INTERCEPT3("mpi_scan_", libmpi_scan_) #ifdef USE_MPI3 INTERCEPT3("mpi_ibarrier_", libmpi_ibarrier_) INTERCEPT3("mpi_ibarrier_", libmpi_ibarrier_) INTERCEPT3("mpi_ibcast_", libmpi_ibcast_) INTERCEPT3("mpi_igather_", libmpi_igather_) INTERCEPT3("mpi_igatherv_", libmpi_igatherv_) INTERCEPT3("mpi_iscatter_", libmpi_iscatter_) INTERCEPT3("mpi_iscatterv_", libmpi_iscatterv_) INTERCEPT3("mpi_iallgather_", libmpi_iallgather_) INTERCEPT3("mpi_iallgatherv_", libmpi_iallgatherv_) INTERCEPT3("mpi_ialltoall_", libmpi_ialltoall_) INTERCEPT3("mpi_ialltoallv_", libmpi_ialltoallv_) INTERCEPT3("mpi_ireduce_", libmpi_ireduce_) INTERCEPT3("mpi_iallreduce_", libmpi_iallreduce_) INTERCEPT3("mpi_ireduce_scatter_", libmpi_ireduce_scatter_) INTERCEPT3("mpi_iscan_", libmpi_iscan_) #endif INTERCEPT3("mpi_comm_spawn_", libmpi_comm_spawn_) INTERCEPT3("mpi_send_init_", libmpi_send_init_) INTERCEPT3("mpi_bsend_init_", libmpi_bsend_init_) INTERCEPT3("mpi_ssend_init_", libmpi_ssend_init_) INTERCEPT3("mpi_rsend_init_", libmpi_rsend_init_) INTERCEPT3("mpi_recv_init_", libmpi_recv_init_) INTERCEPT3("mpi_start_", libmpi_start_) INTERCEPT3("mpi_startall_", libmpi_startall_) PPTRACE_END_INTERCEPT_FUNCTIONS(MPI_MODULE_NAME) struct ezt_mpi_request* ezt_mpi_get_request_type(MPI_Request *req, int persistent) { struct ezt_hashtable* ht = &mpi_infos.ezt_mpi_requests; if(persistent) ht = &mpi_infos.ezt_mpi_persistent_requests; struct ezt_mpi_request* r = ezt_hashtable_get(ht, hash_function_ptr(req)); return r; } void ezt_mpi_set_persistent_request_type(MPI_Request* req, enum mpi_request_type type, MPI_Comm comm, int dest, int tag, int len) { struct ezt_hashtable* ht = &mpi_infos.ezt_mpi_persistent_requests; struct ezt_mpi_request* r = ezt_hashtable_get(ht, hash_function_ptr(req)); if(!r) { r = malloc(sizeof(struct ezt_mpi_request)); } r->req = req; r->type = type; r->comm = comm; r->root = -1; r->send_size = -1; r->recv_size = -1; r->dest = dest; r->tag = tag; r->len = len; r->persistent = 1; ezt_hashtable_insert(ht, hash_function_ptr(req), r); } void ezt_mpi_set_request_type(MPI_Request* req, enum mpi_request_type type, MPI_Comm comm, int root, int send_size, int recv_size) { struct ezt_hashtable* ht = &mpi_infos.ezt_mpi_requests; struct ezt_mpi_request* r = ezt_hashtable_get(ht, hash_function_ptr(req)); if(!r) { r = malloc(sizeof(struct ezt_mpi_request)); } r->req = req; r->type = type; r->comm = comm; r->root = root; r->send_size = send_size; r->recv_size = recv_size; r->dest = -1; r->tag = -1; r->len = -1; r->persistent = 0; ezt_hashtable_insert(ht, hash_function_ptr(req), r); } static void init_mpi() { INSTRUMENT_FUNCTIONS(MPI_MODULE_NAME); ezt_hashtable_init(&mpi_infos.ezt_mpi_requests, 128); ezt_hashtable_init(&mpi_infos.ezt_mpi_persistent_requests, 128); if (eztrace_autostart_enabled()) eztrace_start(); } static void finalize_mpi() { eztrace_stop(); ezt_hashtable_finalize(&mpi_infos.mpi_communicators); ezt_hashtable_finalize(&mpi_infos.ezt_mpi_requests); free(mpi_infos.proc_id); } void ezt_mpi_init() { todo_set_status("ezt_mpi", init_started); EZT_MPI_Recv = _EZT_MPI_Recv; EZT_MPI_Send = _EZT_MPI_Send; EZT_MPI_Reduce = _EZT_MPI_Reduce; EZT_MPI_SetMPICollectiveCallbacks = _EZT_MPI_SetMPICollectiveCallbacks; EZT_MPI_Barrier = _EZT_MPI_Barrier; EZT_MPI_Wtime = _EZT_MPI_Wtime; todo_set_status("ezt_mpi", init_complete); } OTF2_ErrorCode errorCallbackIn (void *userData MAYBE_UNUSED, const char *file MAYBE_UNUSED, uint64_t line MAYBE_UNUSED, const char *function MAYBE_UNUSED, OTF2_ErrorCode errorCode MAYBE_UNUSED, const char *msgFormatString MAYBE_UNUSED, va_list va MAYBE_UNUSED) { eztrace_error("OTF2 error in %s (%s: %" PRIu64 ")\n", function, file, line); return OTF2_SUCCESS; } void libinit(void) __attribute__((constructor)); void libinit(void) { eztrace_log(dbg_lvl_debug, "eztrace_mpi constructor starts\n"); enqueue_todo("ezt_mpi", ezt_mpi_init, NULL, status_invalid); EZT_REGISTER_MODULE(MPI_MODULE_NAME, "Module for MPI functions", init_mpi, finalize_mpi); eztrace_log(dbg_lvl_debug, "eztrace_mpi constructor ends\n"); } eztrace-2.1/src/modules/mpi/mpi3_f.f90000066400000000000000000000040041447213526500175410ustar00rootroot00000000000000! These routines are specific to MPI3 subroutine MPI_IBarrier(COMM, REQ, IERROR) call MPIF_IBarrier(COMM, REQ, IERROR) return end subroutine MPI_IBCast(BUFFER, COUNT, DATATYPE, ROOT, COMM, REQ, IERROR) call MPIF_IBCast(BUFFER, COUNT, DATATYPE, ROOT, COMM, REQ, IERROR) return end subroutine MPI_IGather(SBUF,SCNT,STYPE,RBUF,RCNT, RTYPE, R, C, REQ, E) call MPIF_IGather(SBUF, SCNT, STYPE, RBUF, RCNT, RTYPE, R, C, REQ, E) return end subroutine MPI_IGatherv(SBUF,SCNT,STYPE,RBUF,RCNT,DSP,RTYPE,R,C,REQ,E) call MPIF_IGatherv(SBUF,SCNT,STYPE,RBUF,RCNT,DSP,RTYPE,R,C,REQ,E) return end subroutine MPI_IScatter(SBUF,SCNT,STYPE,RBUF,RCNT,RTYPE,R,C,REQ,E) call MPIF_IScatter(SBUF, SCNT, STYPE, RBUF, RCNT, RTYPE, R, C,REQ, E) return end subroutine MPI_IScatterv(SBUF,SCNT,DSP,SDTYP,RBUF,RCNT,RTYP,R,C,REQ,E) call MPIF_IScatterv(SBUF,SCNT,DSP,SDTYP,RBUF, RCNT, RTYP, R, C, REQ,E) return end subroutine MPI_IAllgather(SBUF, SCNT, STYP, RBUF, RCNT, RTYP, C, REQ, E) call MPIF_IAllgather(SBUF, SCNT, STYP, RBUF, RCNT, RTYP, C, REQ, E) return end subroutine MPI_IAllgatherv(SB, SC, ST, RB, RC, D, RT, C, REQ,IERROR) call MPIF_IAllgatherv(SB, SC, ST, RB, RC, D, RT, C, REQ,IERROR) return end subroutine MPI_IAlltoall(SB, SC, ST, RB, RC, RT, COMM, REQ,IERROR) call MPIF_IAlltoall(SB, SC, ST, RB, RC, RT, COMM, REQ,IERROR) return end subroutine MPI_IAlltoallv(SB, SC, SD, ST, RB, RC, RD, RT, C, REQ,ERROR) call MPIF_IAlltoallv(SB, SC, SD, ST, RB, RC, RD, RT, C, REQ,ERROR) return end subroutine MPI_IReduce(SBUF, RBUF, CNT, D, OP, ROOT, COMM, REQ,IERROR) call MPIF_IReduce(SBUF, RBUF, CNT, D, OP, ROOT, COMM, REQ,IERROR) return end subroutine MPI_IAllreduce(SBUF, RBUF, CNT, D, OP, COMM, REQ,IERROR) call MPIF_IAllreduce(SBUF, RBUF, CNT, D, OP, COMM, REQ,IERROR) return end subroutine MPI_IReduce_scatter(SBUF, RBUF, RCNT, D, OP, C, REQ,IERROR) call MPIF_IReduce_scatter(SBUF, RBUF, RCNT, D, OP, C, REQ,IERROR) return end subroutine MPI_IScan(SBUF, RBUF, CNT, D, OP, COMM, REQ,IERROR) call MPIF_IScan(SBUF, RBUF, CNT, D, OP, COMM, REQ,IERROR) return end eztrace-2.1/src/modules/mpi/mpi_eztrace.h000066400000000000000000000540541447213526500205310ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef MPI_EZTRACE_H #define MPI_EZTRACE_H #include #include #include #include #if MPI_VERSION >= 3 /* Use MPI 3 */ /* In MPI3, the prototype of some MPI functions have change. * For instance, in MPI2.X, the prototype of MPI_Send was: * int MPI_Send(void* buffer, [...]); * In MPI3, MPI_Send is defined as: * int MPI_Send(const void* buffer, [...]); * In order to fix this prototype issue, let's define a CONST macro */ #define CONST const #ifndef USE_MPI3 #define USE_MPI3 #endif #else /* This is MPI 2.X */ #define CONST #ifdef USE_MPI3 #undef USE_MPI3 #endif #endif #ifndef MPI_MODULE_NAME #define MPI_MODULE_NAME mpi #endif #define CURRENT_MODULE MPI_MODULE_NAME DECLARE_CURRENT_MODULE; /* maximum number of items to be allocated statically * if the application need more than this, a dynamic array * is allocated using malloc() */ #define MAX_REQS 128 /* allocate a number of elements using a static array if possible * if not possible (ie. count>MAX_REQS) use a dynamic array (ie. malloc) */ #define ALLOCATE_ITEMS(type, count, static_var, dyn_var) \ type static_var[MAX_REQS]; \ type* dyn_var = static_var; \ if ((count) > MAX_REQS) \ dyn_var = (type*)alloca(sizeof(type) * (count)) #define GET_ARRAY_ITEM(_base_addr, _size, _index) \ (void*)(((uintptr_t)(_base_addr)) + ((_size)*(_index))) /* convert a C request (ie. a pointer to a MPI_Request structure) * to an integer */ //#define EZTRACE_REQ(r) MPI_Request_c2f(*(r)) /* pointers to actual MPI functions (C version) */ extern int (*libMPI_Init)(int*, char***); extern int (*libMPI_Init_thread)(int*, char***, int, int*); extern int (*libMPI_Comm_size)(MPI_Comm, int*); extern int (*libMPI_Comm_rank)(MPI_Comm, int*); extern int (*libMPI_Finalize)(void); extern int (*libMPI_Initialized)(int*); extern int (*libMPI_Abort)(MPI_Comm, int); extern int (*libMPI_Cancel)(MPI_Request*); extern int (*libMPI_Send)(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); extern int (*libMPI_Recv)(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status); extern int (*libMPI_Bsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); extern int (*libMPI_Ssend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); extern int (*libMPI_Rsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm); extern int (*libMPI_Isend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Ibsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Issend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Irsend)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Irecv)(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Sendrecv)(CONST void*, int, MPI_Datatype, int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*); extern int (*libMPI_Sendrecv_replace)(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*); extern int (*libMPI_Send_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Bsend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Ssend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Rsend_init)(CONST void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Recv_init)(void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Start)(MPI_Request*); extern int (*libMPI_Startall)(int, MPI_Request*); extern int (*libMPI_Wait)(MPI_Request*, MPI_Status*); extern int (*libMPI_Test)(MPI_Request*, int*, MPI_Status*); extern int (*libMPI_Waitany)(int, MPI_Request*, int*, MPI_Status*); extern int (*libMPI_Testany)(int, MPI_Request*, int*, int*, MPI_Status*); extern int (*libMPI_Waitall)(int, MPI_Request*, MPI_Status*); extern int (*libMPI_Testall)(int, MPI_Request*, int*, MPI_Status*); extern int (*libMPI_Waitsome)(int, MPI_Request*, int*, int*, MPI_Status*); extern int (*libMPI_Testsome)(int, MPI_Request*, int*, int*, MPI_Status*); extern int (*libMPI_Probe)(int source, int tag, MPI_Comm comm, MPI_Status* status); extern int (*libMPI_Iprobe)(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status); extern int (*libMPI_Barrier)(MPI_Comm); extern int (*libMPI_Bcast)(void*, int, MPI_Datatype, int, MPI_Comm); extern int (*libMPI_Gather)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); extern int (*libMPI_Gatherv)(CONST void*, int, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, int, MPI_Comm); extern int (*libMPI_Scatter)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); extern int (*libMPI_Scatterv)(CONST void*, CONST int*, CONST int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm); extern int (*libMPI_Allgather)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm); extern int (*libMPI_Allgatherv)(CONST void*, int, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, MPI_Comm); extern int (*libMPI_Alltoall)(CONST void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm); extern int (*libMPI_Alltoallv)(CONST void*, CONST int*, CONST int*, MPI_Datatype, void*, CONST int*, CONST int*, MPI_Datatype, MPI_Comm); extern int (*libMPI_Reduce)(CONST void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm); extern int (*libMPI_Allreduce)(CONST void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm); extern int (*libMPI_Reduce_scatter)(CONST void*, void*, CONST int*, MPI_Datatype, MPI_Op, MPI_Comm); extern int (*libMPI_Scan)(CONST void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm); #ifdef USE_MPI3 extern int (*libMPI_Ibarrier)(MPI_Comm, MPI_Request*); extern int (*libMPI_Ibcast)(void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Igather)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Igatherv)(const void*, int, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Iscatter)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Iscatterv)(const void*, const int*, const int*, MPI_Datatype, void*, int, MPI_Datatype, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Iallgather)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*); extern int (*libMPI_Iallgatherv)(const void*, int, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, MPI_Comm, MPI_Request*); extern int (*libMPI_Ialltoall)(const void*, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm, MPI_Request*); extern int (*libMPI_Ialltoallv)(const void*, const int*, const int*, MPI_Datatype, void*, const int*, const int*, MPI_Datatype, MPI_Comm, MPI_Request*); extern int (*libMPI_Ireduce)(const void*, void*, int, MPI_Datatype, MPI_Op, int, MPI_Comm, MPI_Request*); extern int (*libMPI_Iallreduce)(const void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); extern int (*libMPI_Ireduce_scatter)(const void*, void*, const int*, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); extern int (*libMPI_Iscan)(const void*, void*, int, MPI_Datatype, MPI_Op, MPI_Comm, MPI_Request*); #endif extern int (*libMPI_Get)(void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); extern int (*libMPI_Put)(CONST void*, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win); extern int (*libMPI_Comm_spawn)(CONST char* command, char* argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* intercomm, int array_of_errcodes[]); /* fortran bindings */ extern void (*libmpi_init_)(int* e); extern void (*libmpi_init_thread_)(int*, int*, int*); extern void (*libmpi_finalize_)(int*); extern void (*libmpi_barrier_)(MPI_Comm*, int*); extern void (*libmpi_comm_size_)(MPI_Comm*, int*, int*); extern void (*libmpi_comm_rank_)(MPI_Comm*, int*, int*); extern void (*libmpi_cancel_)(MPI_Request*, int*); extern void (*libmpi_send_)(void*, int*, MPI_Datatype*, int*, int*, int*); extern void (*libmpi_recv_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Status*, int*); extern void (*libmpi_sendrecv_)(void*, int, MPI_Datatype, int, int, void*, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status*, int*); extern void (*libmpi_sendrecv_replace_)(void*, int, MPI_Datatype, int, int, int, int, MPI_Comm, MPI_Status*, int*); extern void (*libmpi_bsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); extern void (*libmpi_ssend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); extern void (*libmpi_rsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, int*); extern void (*libmpi_isend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_ibsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_issend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_irsend_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_irecv_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_wait_)(MPI_Request*, MPI_Status*, int*); extern void (*libmpi_test_)(MPI_Request*, int*, MPI_Status*, int*); extern void (*libmpi_waitany_)(int*, MPI_Request*, int*, MPI_Status*, int*); extern void (*libmpi_testany_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); extern void (*libmpi_waitall_)(int*, MPI_Request*, MPI_Status*, int*); extern void (*libmpi_testall_)(int*, MPI_Request*, int*, MPI_Status*, int*); extern void (*libmpi_waitsome_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); extern void (*libmpi_testsome_)(int*, MPI_Request*, int*, int*, MPI_Status*, int*); extern void (*libmpi_probe_)(int* source, int* tag, MPI_Comm* comm, MPI_Status* status, int* err); extern void (*libmpi_iprobe_)(int* source, int* tag, MPI_Comm* comm, int* flag, MPI_Status* status, int* err); extern void (*libmpi_get_)(void*, int*, MPI_Datatype*, int*, MPI_Aint*, int*, MPI_Datatype*, MPI_Win*, int*); extern void (*libmpi_put_)(void*, int*, MPI_Datatype*, int*, MPI_Aint*, int*, MPI_Datatype*, MPI_Win*, int*); extern void (*libmpi_bcast_)(void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); extern void (*libmpi_gather_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); extern void (*libmpi_gatherv_)(void*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, int*, MPI_Comm*); extern void (*libmpi_scatter_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); extern void (*libmpi_scatterv_)(void*, int*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, int*, MPI_Comm*, int*); extern void (*libmpi_allgather_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, MPI_Comm*, int*); extern void (*libmpi_allgatherv_)(void*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm*); extern void (*libmpi_alltoall_)(void*, int*, MPI_Datatype*, void*, int*, MPI_Datatype*, MPI_Comm*, int*); extern void (*libmpi_alltoallv_)(void*, int*, int*, MPI_Datatype*, void*, int*, int*, MPI_Datatype*, MPI_Comm*, int*); extern void (*libmpi_reduce_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, int*, MPI_Comm*, int*); extern void (*libmpi_allreduce_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); extern void (*libmpi_reduce_scatter_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); extern void (*libmpi_scan_)(void*, void*, int*, MPI_Datatype*, MPI_Op*, MPI_Comm*, int*); extern void (*libmpi_comm_spawn_)(char* command, char** argv, int* maxprocs, MPI_Info* info, int* root, MPI_Comm* comm, MPI_Comm* intercomm, int* array_of_errcodes, int* error); extern void (*libmpi_send_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_bsend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_ssend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_rsend_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_recv_init_)(void*, int*, MPI_Datatype*, int*, int*, MPI_Comm*, MPI_Request*, int*); extern void (*libmpi_start_)(MPI_Request*, int*); extern void (*libmpi_startall_)(int*, MPI_Request*, int*); /* return 1 if buf corresponds to the Fotran MPI_IN_PLACE * return 0 otherwise */ int ezt_mpi_is_in_place_(void* buf); /* check the value of a Fortran pointer and return MPI_IN_PLACE or p */ #define CHECK_MPI_IN_PLACE(p) (ezt_mpi_is_in_place_(p) ? MPI_IN_PLACE : (p)) /* in some cases (eg on some architectures, or with some MPI implementations), some MPI datatypes * are not defined :/ */ #ifdef MPI_INTEGER1 #define _EZT_MPI_INTEGER1 MPI_INTEGER1 #else #define _EZT_MPI_INTEGER1 MPI_DATATYPE_NULL #endif #ifdef MPI_INTEGER2 #define _EZT_MPI_INTEGER2 MPI_INTEGER2 #else #define _EZT_MPI_INTEGER2 MPI_DATATYPE_NULL #endif #ifdef MPI_INTEGER4 #define _EZT_MPI_INTEGER4 MPI_INTEGER4 #else #define _EZT_MPI_INTEGER4 MPI_DATATYPE_NULL #endif #ifdef MPI_INTEGER8 #define _EZT_MPI_INTEGER8 MPI_INTEGER8 #else #define _EZT_MPI_INTEGER8 MPI_DATATYPE_NULL #endif #ifdef MPI_INTEGER16 #define _EZT_MPI_INTEGER16 MPI_INTEGER16 #else #define _EZT_MPI_INTEGER16 MPI_DATATYPE_NULL #endif #ifdef MPI_REAL4 #define _EZT_MPI_REAL4 MPI_REAL4 #else #define _EZT_MPI_REAL4 MPI_DATATYPE_NULL #endif #ifdef MPI_REAL8 #define _EZT_MPI_REAL8 MPI_REAL8 #else #define _EZT_MPI_REAL8 MPI_DATATYPE_NULL #endif #ifdef MPI_REAL16 #define _EZT_MPI_REAL16 MPI_REAL16 #else #define _EZT_MPI_REAL16 MPI_DATATYPE_NULL #endif #ifdef MPI_COMPLEX8 #define _EZT_MPI_COMPLEX8 MPI_COMPLEX8 #else #define _EZT_MPI_COMPLEX8 MPI_DATATYPE_NULL #endif #ifdef MPI_COMPLEX16 #define _EZT_MPI_COMPLEX16 MPI_COMPLEX16 #else #define _EZT_MPI_COMPLEX16 MPI_DATATYPE_NULL #endif #ifdef MPI_COMPLEX32 #define _EZT_MPI_COMPLEX32 MPI_COMPLEX32 #else #define _EZT_MPI_COMPLEX32 MPI_DATATYPE_NULL #endif #define EZT_DATATYPE_TO_MPI(ezt_datatype) \ ezt_datatype == EZT_MPI_DATATYPE_NULL ? MPI_DATATYPE_NULL: \ ezt_datatype == EZT_MPI_CHAR ? MPI_CHAR : \ ezt_datatype == EZT_MPI_UNSIGNED_CHAR ? MPI_UNSIGNED_CHAR : \ ezt_datatype == EZT_MPI_SHORT ? MPI_SHORT : \ ezt_datatype == EZT_MPI_UNSIGNED_SHORT ? MPI_UNSIGNED_SHORT : \ ezt_datatype == EZT_MPI_INT ? MPI_INT : \ ezt_datatype == EZT_MPI_UNSIGNED ? MPI_UNSIGNED : \ ezt_datatype == EZT_MPI_LONG ? MPI_LONG : \ ezt_datatype == EZT_MPI_UNSIGNED_LONG ? MPI_UNSIGNED_LONG : \ ezt_datatype == EZT_MPI_LONG_LONG_INT ? MPI_LONG_LONG_INT : \ ezt_datatype == EZT_MPI_LONG_LONG ? MPI_LONG_LONG : \ ezt_datatype == EZT_MPI_FLOAT ? MPI_FLOAT : \ ezt_datatype == EZT_MPI_DOUBLE ? MPI_DOUBLE : \ ezt_datatype == EZT_MPI_LONG_DOUBLE ? MPI_LONG_DOUBLE : \ ezt_datatype == EZT_MPI_BYTE ? MPI_BYTE : \ ezt_datatype == EZT_MPI_WCHAR ? MPI_WCHAR : \ ezt_datatype == EZT_MPI_PACKED ? MPI_PACKED : \ ezt_datatype == EZT_MPI_C_COMPLEX ? MPI_C_COMPLEX : \ ezt_datatype == EZT_MPI_C_FLOAT_COMPLEX ? MPI_C_FLOAT_COMPLEX : \ ezt_datatype == EZT_MPI_C_DOUBLE_COMPLEX ? MPI_C_DOUBLE_COMPLEX : \ ezt_datatype == EZT_MPI_C_LONG_DOUBLE_COMPLEX ? MPI_C_LONG_DOUBLE_COMPLEX : \ ezt_datatype == EZT_MPI_2INT ? MPI_2INT : \ ezt_datatype == EZT_MPI_C_BOOL ? MPI_C_BOOL : \ ezt_datatype == EZT_MPI_SIGNED_CHAR ? MPI_SIGNED_CHAR : \ ezt_datatype == EZT_MPI_UNSIGNED_LONG_LONG ? MPI_UNSIGNED_LONG_LONG : \ ezt_datatype == EZT_MPI_CHARACTER ? MPI_CHARACTER : \ ezt_datatype == EZT_MPI_INTEGER ? MPI_INTEGER : \ ezt_datatype == EZT_MPI_REAL ? MPI_REAL : \ ezt_datatype == EZT_MPI_LOGICAL ? MPI_LOGICAL : \ ezt_datatype == EZT_MPI_COMPLEX ? MPI_COMPLEX : \ ezt_datatype == EZT_MPI_DOUBLE_PRECISION ? MPI_DOUBLE_PRECISION : \ ezt_datatype == EZT_MPI_2INTEGER ? MPI_2INTEGER : \ ezt_datatype == EZT_MPI_2REAL ? MPI_2REAL : \ ezt_datatype == EZT_MPI_DOUBLE_COMPLEX ? MPI_DOUBLE_COMPLEX : \ ezt_datatype == EZT_MPI_2DOUBLE_PRECISION ? MPI_2DOUBLE_PRECISION : \ ezt_datatype == EZT_MPI_REAL4 ? _EZT_MPI_REAL4 : \ ezt_datatype == EZT_MPI_COMPLEX8 ? _EZT_MPI_COMPLEX8 : \ ezt_datatype == EZT_MPI_REAL8 ? _EZT_MPI_REAL8 : \ ezt_datatype == EZT_MPI_COMPLEX16 ? _EZT_MPI_COMPLEX16 : \ ezt_datatype == EZT_MPI_REAL16 ? _EZT_MPI_REAL16 : \ ezt_datatype == EZT_MPI_COMPLEX32 ? _EZT_MPI_COMPLEX32 : \ ezt_datatype == EZT_MPI_INTEGER1 ? _EZT_MPI_INTEGER1 : \ ezt_datatype == EZT_MPI_INTEGER2 ? _EZT_MPI_INTEGER2 : \ ezt_datatype == EZT_MPI_INTEGER4 ? _EZT_MPI_INTEGER4 : \ ezt_datatype == EZT_MPI_INTEGER8 ? _EZT_MPI_INTEGER8 : \ ezt_datatype == EZT_MPI_INTEGER16 ? _EZT_MPI_INTEGER16 : \ ezt_datatype == EZT_MPI_INT8_T ? MPI_INT8_T : \ ezt_datatype == EZT_MPI_INT16_T ? MPI_INT16_T : \ ezt_datatype == EZT_MPI_INT32_T ? MPI_INT32_T : \ ezt_datatype == EZT_MPI_INT64_T ? MPI_INT64_T : \ ezt_datatype == EZT_MPI_UINT8_T ? MPI_UINT8_T : \ ezt_datatype == EZT_MPI_UINT16_T ? MPI_UINT16_T : \ ezt_datatype == EZT_MPI_UINT32_T ? MPI_UINT32_T : \ ezt_datatype == EZT_MPI_UINT64_T ? MPI_UINT64_T : \ ezt_datatype == EZT_MPI_AINT ? MPI_AINT : \ ezt_datatype == EZT_MPI_OFFSET ? MPI_OFFSET : \ ezt_datatype == EZT_MPI_FLOAT_INT ? MPI_FLOAT_INT : \ ezt_datatype == EZT_MPI_DOUBLE_INT ? MPI_DOUBLE_INT : \ ezt_datatype == EZT_MPI_LONG_INT ? MPI_LONG_INT : \ ezt_datatype == EZT_MPI_SHORT_INT ? MPI_SHORT_INT : \ ezt_datatype == EZT_MPI_LONG_DOUBLE_INT ? MPI_LONG_DOUBLE_INT : \ EZT_MPI_DATATYPE_NULL #define EZT_OP_TO_MPI(ezt_op) \ ezt_op == EZT_MPI_MAX ? MPI_MAX : \ ezt_op == EZT_MPI_MIN ? MPI_MIN : \ ezt_op == EZT_MPI_SUM ? MPI_SUM : \ ezt_op == EZT_MPI_PROD ? MPI_PROD : \ ezt_op == EZT_MPI_LAND ? MPI_LAND : \ ezt_op == EZT_MPI_BAND ? MPI_BAND : \ ezt_op == EZT_MPI_LOR ? MPI_LOR : \ ezt_op == EZT_MPI_BOR ? MPI_BOR : \ ezt_op == EZT_MPI_LXOR ? MPI_LXOR : \ ezt_op == EZT_MPI_BXOR ? MPI_BXOR : \ ezt_op == EZT_MPI_MAXLOC ? MPI_MAXLOC : \ MPI_MINLOC extern OTF2_CommRef comm_world_ref; OTF2_CommRef MPI_TO_OTF_COMMUNICATOR(MPI_Comm comm __attribute__((unused))); enum mpi_request_type { /* P2P operations*/ recv, send, bsend, rsend, ssend, /* Collective operations */ ibarrier, ibcast, igather, igatherv, iscatter, iscatterv, iallgather, iallgatherv, ialltoall, ialltoallv, ialltoallw, iallreduce, ireduce, ireduce_scatter, }; struct ezt_mpi_request { MPI_Request *req; enum mpi_request_type type; MPI_Comm comm; /* only used for collective: */ int root; int send_size; int recv_size; /* only used for persistent */ int dest; int tag; int len; int persistent; }; struct ezt_mpi_request* ezt_mpi_get_request_type(MPI_Request *req, int persistent); void ezt_mpi_set_request_type(MPI_Request *req, enum mpi_request_type type, MPI_Comm comm, int root, int send_size, int recv_size); void ezt_mpi_set_persistent_request_type(MPI_Request* req, enum mpi_request_type type, MPI_Comm comm, int dest, int tag, int len); void mpi_complete_request(MPI_Fint* req, MPI_Status* s); // if a datatype is MPI_DATATYPE_NULL, calling MPI_Type_size is invalid and some MPI // implementations (eg OpenMPI) generate an error #define _EZT_MPI_Type_size(_type, _size) do { \ if((void*)_size != NULL) *(_size) = 0; \ if( (_type) != MPI_DATATYPE_NULL ) \ MPI_Type_size(_type, _size); \ } while(0) #endif /* MPI_EZTRACE_H */ eztrace-2.1/src/modules/mpi/mpi_f.f90000066400000000000000000000201131447213526500174550ustar00rootroot00000000000000! Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis ! See COPYING in top-level directory. subroutine MPI_COMM_SPAWN(CMD, ARGV, M, I, R, C, INTERCOMM, A, E) call MPIF_COMM_SPAWN(CMD, ARGV, M, I, R, C, INTERCOMM, A, E) return end subroutine MPI_INIT(error) call MPIF_INIT(error) return end subroutine MPI_Init_thread(REQUIRED, PROVIDED, IERROR) call MPIF_Init_thread(REQUIRED, PROVIDED, IERROR) return end subroutine MPI_Finalize(IERROR) call MPIF_Finalize(IERROR) return end subroutine MPI_Barrier(COMM, IERROR) call MPIF_Barrier(COMM, IERROR) return end subroutine MPI_Comm_size(COMM, SIZE, IERROR) call MPIF_Comm_size(COMM, SIZE, IERROR) return end subroutine MPI_Comm_rank(COMM, RANK, IERROR) call MPIF_Comm_rank(COMM, RANK, IERROR) return end subroutine MPI_Comm_create(COMM, GROUP, NEWCOMM, IERROR) call MPIF_Comm_create(COMM, GROUP, NEWCOMM, IERROR) return end subroutine MPI_Comm_create_group(COMM, GROUP, TAG, NEWCOMM, IERROR) call MPIF_Comm_create_group(COMM, GROUP, TAG, NEWCOMM, IERROR) return end subroutine MPI_Comm_split(COMM, COLOR, KEY, NEWCOMM, IERROR) call MPIF_Comm_split(COMM, COLOR, KEY, NEWCOMM, IERROR) return end subroutine MPI_Comm_dup(COMM, NEWCOMM, IERROR) call MPIF_Comm_dup(COMM, NEWCOMM, IERROR) return end subroutine MPI_Comm_dup_with_info(COMM, info, NEWCOMM, IERROR) call MPIF_Comm_dup_with_info(COMM, info, NEWCOMM, IERROR) return end subroutine MPI_COMM_SPLIT_TYPE(COMM, SPLIT_TYPE, KEY, INFO, NEWCOMM, IERROR) call MPIF_COMM_SPLIT_TYPE(COMM, SPLIT_TYPE, KEY, INFO, NEWCOMM, IERROR) return end subroutine MPI_Intercomm_create(LOCAL_COMM, LOCAL_LEADER, PEER_COMM, REMOTE_LEADER, TAG, NEWINTERCOMM, IERROR) call MPIF_Intercomm_create(LOCAL_COMM, LOCAL_LEADER, PEER_COMM, REMOTE_LEADER, TAG, NEWINTERCOMM, IERROR) return end subroutine MPI_INTERCOMM_MERGE(INTERCOMM, HIGH, NEWINTRACOMM, IERROR) call MPIF_INTERCOMM_MERGE(INTERCOMM, HIGH, NEWINTRACOMM, IERROR) return end subroutine MPI_CART_SUB(COMM, REMAIN_DIMS, COMM_NEW, IERROR) call MPIF_CART_SUB(COMM, REMAIN_DIMS, COMM_NEW, IERROR) return end subroutine MPI_CART_CREATE(COMM_OLD, NDIMS, DIMS, PERIODS, REORDER, COMM_CART, IERROR) call MPIF_CART_CREATE(COMM_OLD, NDIMS, DIMS, PERIODS, REORDER, COMM_CART, IERROR) return end subroutine MPI_GRAPH_CREATE(COMM_OLD, NNODES, INDEX, EDGES, REORDER, COMM_GRAPH, IERROR) call MPIF_GRAPH_CREATE(COMM_OLD, NNODES, INDEX, EDGES, REORDER, COMM_GRAPH, IERROR) return end subroutine MPI_DIST_GRAPH_CREATE(COMM_OLD, N, SOURCES, DEGREES, DESTINATIONS, WEIGHTS,& INFO, REORDER, COMM_DIST_GRAPH, IERROR) call MPIF_DIST_GRAPH_CREATE(COMM_OLD, N, SOURCES, DEGREES, DESTINATIONS, WEIGHTS,& INFO, REORDER, COMM_DIST_GRAPH, IERROR) return end subroutine MPI_DIST_GRAPH_CREATE_ADJACENT(COMM_OLD, INDEGREE, SOURCES, SOURCEWEIGHTS, & OUTDEGREE, DESTINATIONS, DESTWEIGHTS, INFO, REORDER, COMM_DIST_GRAPH, IERROR) call MPIF_DIST_GRAPH_CREATE_ADJACENT(COMM_OLD, INDEGREE, SOURCES, SOURCEWEIGHTS, & OUTDEGREE, DESTINATIONS, DESTWEIGHTS, INFO, REORDER, COMM_DIST_GRAPH, IERROR) return end subroutine MPI_Send(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR) call MPIF_Send(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR) return end subroutine MPI_Recv(BUF, COUNT, D, SRC, TAG, COMM, STATUS, IERROR) call MPIF_Recv(BUF, COUNT, D, SRC, TAG, COMM, STATUS, IERROR) return end subroutine MPI_Sendrecv(SBUF, SCOUNT, STYPE, DST, STAG, RBUF, RCOUNT, RTYPE, SRC, RTAG, COMM, STATUS, ERROR) call MPIF_Sendrecv(SBUF, SCOUNT, STYPE, DST, STAG, RBUF, RCOUNT, RTYPE, SRC, RTAG, COMM, STATUS, ERROR) return end subroutine MPI_Sendecv_replace(BUF, COUNT, TYPE, DST, STAG, SRC, RTAG, COMM, STATUS, ERROR) call MPIF_Sendrecv_replace(BUF, COUNT, TYPE, DST, STAG, SRC, RTAG, COMM, STATUS, ERROR) return end subroutine MPI_Bsend(BUF, COUNT,DATATYPE, DEST, TAG, COMM, IERROR) call MPIF_Bsend(BUF, COUNT,DATATYPE, DEST, TAG, COMM, IERROR) return end subroutine MPI_Ssend(BUF, COUNT, D, DEST, TAG, COMM, IERROR) call MPIF_Ssend(BUF, COUNT, D, DEST, TAG, COMM, IERROR) return end subroutine MPI_Rsend(BUF, COUNT, D, DEST, TAG, COMM, IERROR) call MPIF_Rsend(BUF, COUNT, D, DEST, TAG, COMM, IERROR) return end subroutine MPI_Isend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) call MPIF_Isend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) return end subroutine MPI_Ibsend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) call MPIF_Ibsend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) return end subroutine MPI_Issend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) call MPIF_Issend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) return end subroutine MPI_Irsend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) call MPIF_Irsend(BUF, COUNT, D, DST, TAG, COMM, REQ, IERROR) return end subroutine MPI_Irecv(B, CNT, D, SRC, TAG, COMM, REQ, IERROR) call MPIF_Irecv(B, CNT, D, SRC, TAG, COMM, REQ, IERROR) return end subroutine MPI_Wait(REQUEST, STATUS, IERROR) call MPIF_Wait(REQUEST, STATUS, IERROR) return end subroutine MPI_WAITALL(COUNT, R, S, IERROR) call MPIF_Waitall(COUNT, R, S, IERROR) return end subroutine MPI_WAITANY(COUNT, R, S, INDEX, IERROR) call MPIF_Waitany(COUNT, R, S, INDEX, IERROR) return end subroutine MPI_WAITSOME(IC, R, OC, INDEX, S, IERROR) call MPIF_Waitsome(IC, R, OC, INDEX, S, IERROR) return end subroutine MPI_TESTSOME(IC, R, OC, INDEX, S, IERROR) call MPIF_Testsome(IC, R, OC, INDEX, S, IERROR) return end subroutine MPI_PROBE(S, T, C, STAT, IERROR) call MPIF_PROBE(S, T, C, STAT, IERROR) return end subroutine MPI_IPROBE(S, T, C, FLAG, STAT, IERROR) call MPIF_IPROBE(S, T, C, FLAG, STAT, IERROR) return end subroutine MPI_Test(REQUEST, FLAG, STATUS, IERROR) call MPIF_Test(REQUEST, FLAG, STATUS, IERROR) return end subroutine MPI_Testall(C, REQUEST, INDEX, STATUS, IERROR) call MPIF_Testall(C, REQUEST, INDEX, STATUS, IERROR) return end subroutine MPI_Testany(C, REQUEST, INDEX, F, STATUS, IERROR) call MPIF_Testany(C, REQUEST, INDEX, F, STATUS, IERROR) return end subroutine MPI_Get(O_A, O_C, O_D, T_R, T_DS, T_C, T_D, W, ERROR) call MPIF_Get(O_A, O_C, O_D, T_R, T_DS, T_C, T_D, W, ERROR) return end subroutine MPI_Put(O_A, O_C, O_D, T_R, T_DS, T_C, T_D, W, ERROR) call MPIF_Put(O_A, O_C, O_D, T_R, T_DS, T_C, T_D, W, ERROR) return end subroutine MPI_BCast(BUFFER, COUNT, DATATYPE, ROOT, COMM, IERROR) call MPIF_BCast(BUFFER, COUNT, DATATYPE, ROOT, COMM, IERROR) return end subroutine MPI_Gather(SBUF,SCNT,STYPE,RBUF,RCNT, RTYPE, R, C, E) call MPIF_Gather(SBUF, SCNT, STYPE, RBUF, RCNT, RTYPE, R, C, E) return end subroutine MPI_Gatherv(SBUF,SCNT,STYPE,RBUF,RCNT,DSP,RTYPE,R,C,E) call MPIF_Gatherv(SBUF,SCNT,STYPE,RBUF,RCNT,DSP,RTYPE,R,C,E) return end subroutine MPI_Scatter(SBUF,SCNT,STYPE,RBUF,RCNT,RTYPE,R,C,E) call MPIF_Scatter(SBUF, SCNT, STYPE, RBUF, RCNT, RTYPE, R, C, E) return end subroutine MPI_Scatterv(SBUF,SCNT,DSP,SDTYP,RBUF,RCNT,RTYP,R,C,E) call MPIF_Scatterv(SBUF,SCNT,DSP,SDTYP,RBUF, RCNT, RTYP, R, C, E) return end subroutine MPI_Allgather(SBUF, SCNT, STYP, RBUF, RCNT, RTYP, C, E) call MPIF_Allgather(SBUF, SCNT, STYP, RBUF, RCNT, RTYP, C, E) return end subroutine MPI_Allgatherv(SB, SC, ST, RB, RC, D, RT, C, IERROR) call MPIF_Allgatherv(SB, SC, ST, RB, RC, D, RT, C, IERROR) return end subroutine MPI_Alltoall(SB, SC, ST, RB, RC, RT, COMM, IERROR) call MPIF_Alltoall(SB, SC, ST, RB, RC, RT, COMM, IERROR) return end subroutine MPI_Alltoallv(SB, SC, SD, ST, RB, RC, RD, RT, C, ERROR) call MPIF_Alltoallv(SB, SC, SD, ST, RB, RC, RD, RT, C, ERROR) return end subroutine MPI_Reduce(SBUF, RBUF, CNT, D, OP, ROOT, COMM, IERROR) call MPIF_Reduce(SBUF, RBUF, CNT, D, OP, ROOT, COMM, IERROR) return end subroutine MPI_Allreduce(SBUF, RBUF, CNT, D, OP, COMM, IERROR) call MPIF_Allreduce(SBUF, RBUF, CNT, D, OP, COMM, IERROR) return end subroutine MPI_Reduce_scatter(SBUF, RBUF, RCNT, D, OP, C, IERROR) call MPIF_Reduce_scatter(SBUF, RBUF, RCNT, D, OP, C, IERROR) return end subroutine MPI_Scan(SBUF, RBUF, CNT, D, OP, COMM, IERROR) call MPIF_Scan(SBUF, RBUF, CNT, D, OP, COMM, IERROR) return end subroutine MPI_Scan subroutine MPI_CANCEL(REQUEST, IERROR) call MPIF_Cancel(REQUEST, IERROR) return end subroutine MPI_CANCEL subroutine MPI_TYPE_SIZE(TYPE, SIZE, IERROR) call MPIF_TYPE_SIZE(TYPE, SIZE, IERROR) return end subroutine MPI_TYPE_SIZE eztrace-2.1/src/modules/mpi/mpi_fortran.c000066400000000000000000000157031447213526500205400ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #include "mpi_eztrace.h" #include #include /* For MPI_Init and MPI_Init_thread, we *have* to call the Fortran version * of the function. Once it is done, we can call the _mpi_init_generic function */ void _mpi_init_generic(); void mpif_init_(void* error) { libmpi_init_((int*)error); _mpi_init_generic(); } void mpif_init_thread_(int* r, int* p, int* error) { libmpi_init_thread_(r, p, error); _mpi_init_generic(); } /* For all the remaining Fortran functions, we can just call the C version */ void mpif_finalize_(int* error) { *error = MPI_Finalize(); } void mpif_comm_size_(MPI_Fint* c, int* s, int* error) { MPI_Comm c_comm = MPI_Comm_f2c(*c); *error = MPI_Comm_size(c_comm, s); } void mpif_comm_rank_(MPI_Fint* c, int* r, int* error) { MPI_Comm c_comm = MPI_Comm_f2c(*c); *error = MPI_Comm_rank(c_comm, r); } void mpif_comm_spawn_(char* command, char** argv, int* maxprocs, MPI_Fint* info, int* root, MPI_Fint* comm, MPI_Fint* intercomm, int* array_of_errcodes, int* error) { MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Info c_info = MPI_Info_f2c(*info); ALLOCATE_ITEMS(MPI_Comm, *maxprocs, c_intercomm, p_intercomm); int i; for (i = 0; i < *maxprocs; i++) p_intercomm[i] = MPI_Comm_f2c(intercomm[i]); *error = MPI_Comm_spawn(command, argv, *maxprocs, c_info, *root, c_comm, p_intercomm, array_of_errcodes); for (i = 0; i < *maxprocs; i++) intercomm[i] = MPI_Comm_c2f(p_intercomm[i]); } void mpif_comm_create_(MPI_Fint* comm, MPI_Fint* group, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; MPI_Group group_c = MPI_Group_f2c(*group); *error = MPI_Comm_create(comm_c, group_c, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_comm_create_group_(MPI_Fint* comm, MPI_Fint* group, MPI_Fint* tag, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; MPI_Group group_c = MPI_Group_f2c(*group); *error = MPI_Comm_create_group(comm_c, group_c, *tag, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_comm_split_(MPI_Fint* comm, int* color, int* key, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; *error = MPI_Comm_split(comm_c, *color, *key, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_comm_dup_(MPI_Fint* comm, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; *error = MPI_Comm_dup(comm_c, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_comm_dup_with_info_(MPI_Fint* comm, MPI_Fint* info, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; MPI_Info info_c = MPI_Info_f2c(*info); *error = MPI_Comm_dup_with_info(comm_c, info_c, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_comm_split_type_(MPI_Fint* comm, int* split_type, int* key, int* info, MPI_Fint* newcomm, int* error) { MPI_Comm comm_c = MPI_Comm_f2c(*comm); MPI_Comm newcomm_c; MPI_Info info_c = MPI_Info_f2c(*info); *error = MPI_Comm_split_type(comm_c, *split_type, *key, info_c, &newcomm_c); *newcomm = MPI_Comm_c2f(newcomm_c); } void mpif_intercomm_create_(MPI_Fint* local_comm, int* local_leader, MPI_Fint* peer_comm, int* remote_leader, int* tag, MPI_Fint* newintercomm, int* error) { MPI_Comm local_comm_c = MPI_Comm_f2c(*local_comm); MPI_Comm peer_comm_c = MPI_Comm_f2c(*peer_comm); MPI_Comm newintercomm_c; *error = MPI_Intercomm_create(local_comm_c, *local_leader, peer_comm_c, *remote_leader, *tag, &newintercomm_c); *newintercomm = MPI_Comm_c2f(newintercomm_c); } void mpif_intercomm_merge_(MPI_Fint* intercomm, int* high, MPI_Fint* newintracomm, int* error) { MPI_Comm intercomm_c = MPI_Comm_f2c(*intercomm); MPI_Comm newintracomm_c; *error = MPI_Intercomm_merge(intercomm_c, *high, &newintracomm_c); *newintracomm = MPI_Comm_c2f(newintracomm_c); } void mpif_cart_sub_(MPI_Fint* old_comm, int* belongs, MPI_Fint* new_comm, int* error) { MPI_Comm old_comm_c = MPI_Comm_f2c(*old_comm); MPI_Comm new_comm_c; *error = MPI_Cart_sub(old_comm_c, belongs, &new_comm_c); *new_comm = MPI_Comm_c2f(new_comm_c); } void mpif_cart_create_(MPI_Fint* comm_old, int* ndims, int* dims, int* periods, int* reorder, MPI_Fint* comm_cart, int* error) { MPI_Comm comm_old_c = MPI_Comm_f2c(*comm_old); MPI_Comm comm_cart_c; *error = MPI_Cart_create(comm_old_c, *ndims, dims, periods, *reorder, &comm_cart_c); *comm_cart = MPI_Comm_c2f(comm_cart_c); } void mpif_graph_create_(MPI_Fint* comm_old, int* nnodes, int* index, int* edges, int* reorder, MPI_Fint* comm_graph, int* error) { MPI_Comm comm_old_c = MPI_Comm_f2c(*comm_old); MPI_Comm comm_graph_c; *error = MPI_Graph_create(comm_old_c, *nnodes, index, edges, *reorder, &comm_graph_c); *comm_graph = MPI_Comm_c2f(comm_graph_c); } void mpif_dist_graph_create_(MPI_Fint* comm_old, int* n, int* sources, int* degrees, int* destinations, int* weights, int* info, int* reorder, MPI_Fint* comm_dist_graph, int* error) { MPI_Comm comm_old_c = MPI_Comm_f2c(*comm_old); MPI_Comm comm_dist_graph_c; MPI_Info info_c = MPI_Info_f2c(*info); *error = MPI_Dist_graph_create(comm_old_c, *n, sources, degrees, destinations, weights, info_c, *reorder, &comm_dist_graph_c); *comm_dist_graph = MPI_Comm_c2f(comm_dist_graph_c); } void mpif_dist_graph_create_adjacent_(MPI_Fint* comm_old, int* indegree, int* sources, int* sourceweights, int* outdegree, int* destinations, int* destweights, int* info, int* reorder, MPI_Fint* comm_dist_graph, int* error) { MPI_Comm comm_old_c = MPI_Comm_f2c(*comm_old); MPI_Comm comm_dist_graph_c; MPI_Info info_c = MPI_Info_f2c(*info); *error = MPI_Dist_graph_create_adjacent(comm_old_c, *indegree, sources, sourceweights, *outdegree, destinations, destweights, info_c, *reorder, &comm_dist_graph_c); *comm_dist_graph = MPI_Comm_c2f(comm_dist_graph_c); } void mpif_type_size_(int* datatype, int* size, MPI_Fint* error) { MPI_Datatype datatype_c = MPI_Type_f2c(*datatype); *error = MPI_Type_size(datatype_c, size); } eztrace-2.1/src/modules/mpi/mpi_funcs/000077500000000000000000000000001447213526500200315ustar00rootroot00000000000000eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_allgather.c000066400000000000000000000074641447213526500230200ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Allgather_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Allgather_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { return libMPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); } static void MPI_Allgather_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent = 0; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv = 0; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcount; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_ALLGATHER, MPI_TO_OTF_COMMUNICATOR(comm), OTF2_UNDEFINED_UINT32, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Allgather(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Allgather_prolog(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); int ret = MPI_Allgather_core(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); MPI_Allgather_epilog(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); FUNCTION_EXIT; return ret; } void mpif_allgather_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_allgather_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Allgather_prolog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); *error = MPI_Allgather_core(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); MPI_Allgather_epilog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); FUNCTION_EXIT_("mpi_allgather_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_allgatherv.c000066400000000000000000000107231447213526500231760ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Allgatherv_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcounts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Allgatherv_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, CONST int* recvcounts, CONST int* displs, MPI_Datatype recvtype, MPI_Comm comm) { return libMPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm); } static void MPI_Allgatherv_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcounts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Allreduce_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Allreduce_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return libMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm); } static void MPI_Allreduce_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_ALLREDUCE, MPI_TO_OTF_COMMUNICATOR(comm), OTF2_UNDEFINED_UINT32, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Allreduce(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Allreduce_prolog(sendbuf, recvbuf, count, datatype, op, comm); int ret = MPI_Allreduce_core(sendbuf, recvbuf, count, datatype, op, comm); MPI_Allreduce_epilog(sendbuf, recvbuf, count, datatype, op, comm); FUNCTION_EXIT; return ret; } void mpif_allreduce_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_allreduce_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Allreduce_prolog(c_sbuf, c_rbuf, *count, c_type, c_op, c_comm); *error = MPI_Allreduce_core(c_sbuf, c_rbuf, *count, c_type, c_op, c_comm); MPI_Allreduce_epilog(c_sbuf, c_rbuf, *count, c_type, c_op, c_comm); FUNCTION_EXIT_("mpi_allreduce_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_alltoall.c000066400000000000000000000074751447213526500226630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Alltoall_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Alltoall_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm) { return libMPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm); } static void MPI_Alltoall_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcnt; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_ALLTOALL, MPI_TO_OTF_COMMUNICATOR(comm), OTF2_UNDEFINED_UINT32, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Alltoall(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Alltoall_prolog(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm); int ret = MPI_Alltoall_core(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm); MPI_Alltoall_epilog(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm); FUNCTION_EXIT; return ret; } void mpif_alltoall_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_alltoall_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Alltoall_prolog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); *error = MPI_Alltoall_core(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); MPI_Alltoall_epilog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, c_comm); FUNCTION_EXIT_("mpi_alltoall_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_alltoallv.c000066400000000000000000000113631447213526500230400ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Alltoallv_prolog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* sdispls MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* rdispls MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Alltoallv_core(CONST void* sendbuf, CONST int* sendcnts, CONST int* sdispls, MPI_Datatype sendtype, void* recvbuf, CONST int* recvcnts, CONST int* rdispls, MPI_Datatype recvtype, MPI_Comm comm) { return libMPI_Alltoallv(sendbuf, sendcnts, sdispls, sendtype, recvbuf, recvcnts, rdispls, recvtype, comm); } static void MPI_Alltoallv_epilog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* sdispls MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* rdispls MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int sendcount = 0; int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Barrier_prolog(MPI_Comm c MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Barrier_core(MPI_Comm c) { return libMPI_Barrier(c); } static void MPI_Barrier_epilog(MPI_Comm c MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_BARRIER, MPI_TO_OTF_COMMUNICATOR(c), OTF2_UNDEFINED_UINT32, 0, 0); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Barrier(MPI_Comm c) { FUNCTION_ENTRY; MPI_Barrier_prolog(c); int ret = MPI_Barrier_core(c); MPI_Barrier_epilog(c); FUNCTION_EXIT; return ret; } void mpif_barrier_(MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_barrier_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Barrier_prolog(c_comm); *error = MPI_Barrier_core(c_comm); MPI_Barrier_epilog(c_comm); FUNCTION_EXIT_("mpi_barrier_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_bcast.c000066400000000000000000000053121447213526500221370ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Bcast_prolog(void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Bcast_core(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { return libMPI_Bcast(buffer, count, datatype, root, comm); } static void MPI_Bcast_epilog(void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_BCAST, MPI_TO_OTF_COMMUNICATOR(comm), root, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Bcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Bcast_prolog(buffer, count, datatype, root, comm); int ret = MPI_Bcast_core(buffer, count, datatype, root, comm); MPI_Bcast_epilog(buffer, count, datatype, root, comm); FUNCTION_EXIT; return ret; } void mpif_bcast_(void* buf, int* count, MPI_Fint* d, int* root, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_bcast_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Bcast_prolog(buf, *count, c_type, *root, c_comm); *error = MPI_Bcast_core(buf, *count, c_type, *root, c_comm); MPI_Bcast_epilog(buf, *count, c_type, *root, c_comm); FUNCTION_EXIT_("mpi_bcast_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_bsend.c000066400000000000000000000052161447213526500221410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Bsend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL)return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiSend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Bsend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { return libMPI_Bsend(buf, count, datatype, dest, tag, comm); } static void MPI_Bsend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } int MPI_Bsend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Bsend_prolog(buf, count, datatype, dest, tag, comm); int ret = MPI_Bsend_core(buf, count, datatype, dest, tag, comm); MPI_Bsend_epilog(buf, count, datatype, dest, tag, comm); FUNCTION_EXIT; return ret; } void mpif_bsend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_bsend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Bsend_prolog(buf, *count, c_type, *dest, *tag, c_comm); *error = MPI_Bsend_core(buf, *count, c_type, *dest, *tag, c_comm); MPI_Bsend_epilog(buf, *count, c_type, *dest, *tag, c_comm); FUNCTION_EXIT_("mpi_bsend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_bsend_init.c000066400000000000000000000043511447213526500231630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static int MPI_Bsend_init_core(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { int length; _EZT_MPI_Type_size(type, &length); length *= count; ezt_mpi_set_persistent_request_type(req, bsend, comm, dest, tag, length); return libMPI_Bsend_init(buffer, count, type, dest, tag, comm, req); } static void MPI_Bsend_init_epilog(CONST void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* req MAYBE_UNUSED) { } int MPI_Bsend_init(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; int ret = MPI_Bsend_init_core(buffer, count, type, dest, tag, comm, req); MPI_Bsend_init_epilog(buffer, count, type, dest, tag, comm, (void*)req); FUNCTION_EXIT; return ret; } void mpif_bsend_init_(void* buffer, int* count, MPI_Fint* type, int* dest, int* tag, MPI_Fint* comm, MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_bsend_init_"); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Bsend_init_core(buffer, *count, c_type, *dest, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Bsend_init_epilog(buffer, *count, c_type, *dest, *tag, c_comm, (MPI_Request*)req); FUNCTION_EXIT_("mpi_bsend_init_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_cancel.c000066400000000000000000000017571447213526500223010ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Cancel_prolog(MPI_Fint* req MAYBE_UNUSED) { } static int MPI_Cancel_core(MPI_Request* request) { return libMPI_Cancel(request); } int MPI_Cancel(MPI_Request* req) { FUNCTION_ENTRY; MPI_Cancel_prolog((MPI_Fint*)req); int ret = MPI_Cancel_core(req); FUNCTION_EXIT; return ret; } void mpif_cancel_(MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_cancel_"); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Cancel_prolog(r); *error = MPI_Cancel_core(&c_req); FUNCTION_EXIT_("mpi_cancel_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_gather.c000066400000000000000000000077421447213526500223260ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Gather_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Gather_core(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { return libMPI_Gather(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm); } static void MPI_Gather_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcount; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_GATHER, MPI_TO_OTF_COMMUNICATOR(comm), root, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Gather(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Gather_prolog(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm); int ret = MPI_Gather_core(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm); MPI_Gather_epilog(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm); FUNCTION_EXIT; return ret; } void mpif_gather_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, int* root, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_gather_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Gather_prolog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); *error = MPI_Gather_core(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); MPI_Gather_epilog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); FUNCTION_EXIT_("mpi_gather_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_gatherv.c000066400000000000000000000106741447213526500225120ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Gatherv_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Gatherv_core(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, CONST int* recvcnts, CONST int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm) { return libMPI_Gatherv(sendbuf, sendcnt, sendtype, recvbuf, recvcnts, displs, recvtype, root, comm); } static void MPI_Gatherv_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Get_prolog(void* origin_addr MAYBE_UNUSED, int origin_count MAYBE_UNUSED, MPI_Datatype origin_datatype MAYBE_UNUSED, int target_rank MAYBE_UNUSED, MPI_Aint target_disp MAYBE_UNUSED, int target_count MAYBE_UNUSED, MPI_Datatype target_datatype MAYBE_UNUSED, MPI_Win win MAYBE_UNUSED) { } static int MPI_Get_core(void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { return libMPI_Get(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); } static void MPI_Get_epilog(void* origin_addr MAYBE_UNUSED, int origin_count MAYBE_UNUSED, MPI_Datatype origin_datatype MAYBE_UNUSED, int target_rank MAYBE_UNUSED, MPI_Aint target_disp MAYBE_UNUSED, int target_count MAYBE_UNUSED, MPI_Datatype target_datatype MAYBE_UNUSED, MPI_Win win MAYBE_UNUSED) { } int MPI_Get(void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { FUNCTION_ENTRY; MPI_Get_prolog(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); int ret = MPI_Get_core(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); MPI_Get_epilog(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); FUNCTION_EXIT; return ret; } void mpif_get_(void* o_addr, int* o_count, MPI_Fint* o_d, int* t_rank, MPI_Aint* t_disp, int* t_count, MPI_Fint* t_d, MPI_Fint* win, int* error) { FUNCTION_ENTRY_("mpi_get_"); MPI_Datatype c_otype = MPI_Type_f2c(*o_d); MPI_Datatype c_ttype = MPI_Type_f2c(*t_d); MPI_Win c_win = MPI_Win_f2c(*win); MPI_Get_prolog(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); *error = MPI_Get_core(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); MPI_Get_epilog(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); FUNCTION_EXIT_("mpi_get_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_iallgather.c000066400000000000000000000074431447213526500231660ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iallgather_prolog(CONST void * sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void * recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcount; ezt_mpi_set_request_type((MPI_Request*)r, iallgather, comm, -1, size_sent, size_recv); } static int MPI_Iallgather_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* r) { return libMPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, r); } static void MPI_Iallgather_epilog(CONST void * sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void * recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Iallgather(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Iallgather_prolog(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, r); int ret = MPI_Iallgather_core(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, r); MPI_Iallgather_epilog(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, r); FUNCTION_EXIT; return ret; } void mpif_iallgather_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_iallgather_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Iallgather_prolog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, (MPI_Request*)r); *error = MPI_Iallgather_core(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Iallgather_epilog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_iallgather_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_iallgatherv.c000066400000000000000000000106201447213526500233430ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iallgatherv_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcounts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iallreduce_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; ezt_mpi_set_request_type((MPI_Request*)r, iallreduce, comm, -1, size_sent, size_recv); } static int MPI_Iallreduce_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* r) { return libMPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, r); } static void MPI_Iallreduce_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Iallreduce(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Iallreduce_prolog(sendbuf, recvbuf, count, datatype, op, comm, r); int ret = MPI_Iallreduce_core(sendbuf, recvbuf, count, datatype, op, comm, r); MPI_Iallreduce_epilog(sendbuf, recvbuf, count, datatype, op, comm, r); FUNCTION_EXIT; return ret; } void mpif_iallreduce_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_iallreduce_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Iallreduce_prolog(sbuf, rbuf, *count, c_type, c_op, c_comm, (MPI_Request*)r); *error = MPI_Iallreduce_core(sbuf, rbuf, *count, c_type, c_op, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Iallreduce_epilog(sbuf, rbuf, *count, c_type, c_op, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_iallreduce_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ialltoall.c000066400000000000000000000074201447213526500230220ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ialltoall_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcount; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcnt; ezt_mpi_set_request_type((MPI_Request*)r, ialltoall, comm, -1, size_sent, size_recv); } static int MPI_Ialltoall_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* r) { return libMPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm, r); } static void MPI_Ialltoall_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; } int MPI_Ialltoall(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Ialltoall_prolog(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm, r); int ret = MPI_Ialltoall_core(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm, r); MPI_Ialltoall_epilog(sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm, r); FUNCTION_EXIT; return ret; } void mpif_ialltoall_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_ialltoall_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Ialltoall_prolog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, (MPI_Request*)r); *error = MPI_Ialltoall_core(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Ialltoall_epilog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_ialltoall_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ialltoallv.c000066400000000000000000000111311447213526500232020ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ialltoallv_prolog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* sdispls MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* rdispls MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int sendcount = 0; int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ibarrier_prolog(MPI_Comm comm MAYBE_UNUSED, MPI_Fint* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } ezt_mpi_set_request_type((MPI_Request*)r, ibarrier, comm, -1, -1, -1); } static int MPI_Ibarrier_core(MPI_Comm c, MPI_Request* r) { return libMPI_Ibarrier(c, r); } static void MPI_Ibarrier_epilog(MPI_Comm c MAYBE_UNUSED, MPI_Fint* r MAYBE_UNUSED) { } int MPI_Ibarrier(MPI_Comm c, MPI_Request* req) { FUNCTION_ENTRY; MPI_Ibarrier_prolog(c, (MPI_Fint*)req); int ret = MPI_Ibarrier_core(c, req); MPI_Ibarrier_epilog(c, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_ibarrier_(MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_ibarrier_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Ibarrier_prolog(c_comm, r); *error = MPI_Ibarrier_core(c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Ibarrier_epilog(c_comm, r); FUNCTION_EXIT_("mpi_ibarrier_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ibcast.c000066400000000000000000000055071447213526500223160ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ibcast_prolog(void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; ezt_mpi_set_request_type((MPI_Request*)r, ibcast, comm, root, size_sent, size_recv); } static int MPI_Ibcast_core(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request* r) { return libMPI_Ibcast(buffer, count, datatype, root, comm, r); } static void MPI_Ibcast_epilog(void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Ibcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Ibcast_prolog(buffer, count, datatype, root, comm, r); int ret = MPI_Ibcast_core(buffer, count, datatype, root, comm, r); MPI_Ibcast_epilog(buffer, count, datatype, root, comm, r); FUNCTION_EXIT; return ret; } void mpif_ibcast_(void* buf, int* count, MPI_Fint* d, int* root, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_ibcast_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Ibcast_prolog(buf, *count, c_type, *root, c_comm, (MPI_Request*)r); *error = MPI_Ibcast_core(buf, *count, c_type, *root, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Ibcast_epilog(buf, *count, c_type, *root, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_ibcast_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ibsend.c000066400000000000000000000061511447213526500223110ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Ibsend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL) return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiIsend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length, (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } ezt_mpi_set_request_type((MPI_Request*)req, send, comm, -1, -1, -1); } static int MPI_Ibsend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { return libMPI_Ibsend(buf, count, datatype, dest, tag, comm, req); } static void MPI_Ibsend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Ibsend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; MPI_Ibsend_prolog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); int ret = MPI_Ibsend_core(buf, count, datatype, dest, tag, comm, req); MPI_Ibsend_epilog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_ibsend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_ibsend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Ibsend_prolog(buf, *count, c_type, *dest, *tag, c_comm, r); *error = MPI_Ibsend_core(buf, *count, c_type, *dest, *tag, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Ibsend_epilog(buf, *count, c_type, *dest, *tag, c_comm, r); FUNCTION_EXIT_("mpi_ibsend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_igather.c000066400000000000000000000074701447213526500224750ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Igather_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcount; ezt_mpi_set_request_type((MPI_Request*)r, igather, comm, root, size_sent, size_recv); } static int MPI_Igather_core(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* r) { return libMPI_Igather(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm, r); } static void MPI_Igather_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Igather(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Igather_prolog(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm, r); int ret = MPI_Igather_core(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm, r); MPI_Igather_epilog(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm, r); FUNCTION_EXIT; return ret; } void mpif_igather_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, int* root, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_igather_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Igather_prolog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, (MPI_Request*)r); *error = MPI_Igather_core(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Igather_epilog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_igather_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_igatherv.c000066400000000000000000000105261447213526500226570ustar00rootroot00000000000000 /* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Igatherv_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); int recvcount = 0; int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static int MPI_Iprobe_core(int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, int* flag MAYBE_UNUSED, MPI_Status* status) { return libMPI_Iprobe(source, tag, comm, flag, status); } static void MPI_Iprobe_epilog(int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, int* flag MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED) { } int MPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) { FUNCTION_ENTRY; int ret = MPI_Iprobe_core(source, tag, comm, flag, status); MPI_Iprobe_epilog(source, tag, comm, flag, status); FUNCTION_EXIT; return ret; } void mpif_iprobe_(int* source, int* tag, MPI_Fint* comm, int* flag, MPI_Status* status, int* err) { FUNCTION_ENTRY_("mpi_iprobe_"); MPI_Comm c_comm = MPI_Comm_f2c(*comm); *err = MPI_Iprobe_core(*source, *tag, c_comm, flag, status); MPI_Iprobe_epilog(*source, *tag, c_comm, flag, status); FUNCTION_EXIT_("mpi_iprobe_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_irecv.c000066400000000000000000000052571447213526500221630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Irecv_prolog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int src MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; ezt_mpi_set_request_type((MPI_Request*)req, recv, comm, -1, -1, -1); } static int MPI_Irecv_core(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request* req) { return libMPI_Irecv(buf, count, datatype, src, tag, comm, req); } static void MPI_Irecv_epilog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int src MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { OTF2_ErrorCode err = OTF2_EvtWriter_MpiIrecvRequest(evt_writer, NULL, ezt_get_timestamp(), (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; MPI_Irecv_prolog(buf, count, datatype, src, tag, comm, (MPI_Fint*)req); int ret = MPI_Irecv_core(buf, count, datatype, src, tag, comm, req); MPI_Irecv_epilog(buf, count, datatype, src, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_irecv_(void* buf, int* count, MPI_Fint* d, int* src, int* tag, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_irecv_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Irecv_prolog(buf, *count, c_type, *src, *tag, c_comm, r); *error = MPI_Irecv_core(buf, *count, c_type, *src, *tag, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Irecv_epilog(buf, *count, c_type, *src, *tag, c_comm, r); FUNCTION_EXIT_("mpi_irecv_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ireduce.c000066400000000000000000000066031447213526500224670ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ireduce_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; ezt_mpi_set_request_type((MPI_Request*)r, ireduce, comm, root, size_sent, size_recv); } static int MPI_Ireduce_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* r) { return libMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, r); } static void MPI_Ireduce_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Ireduce(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Ireduce_prolog(sendbuf, recvbuf, count, datatype, op, root, comm, r); int ret = MPI_Ireduce_core(sendbuf, recvbuf, count, datatype, op, root, comm, r); MPI_Ireduce_epilog(sendbuf, recvbuf, count, datatype, op, root, comm, r); FUNCTION_EXIT; return ret; } void mpif_ireduce_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, int* root, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_ireduce_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Ireduce_prolog(sbuf, rbuf, *count, c_type, c_op, *root, c_comm, (MPI_Request*)r); *error = MPI_Ireduce_core(sbuf, rbuf, *count, c_type, c_op, *root, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Ireduce_epilog(sbuf, rbuf, *count, c_type, c_op, *root, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_ireduce_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ireduce_scatter.c000066400000000000000000000072001447213526500242060ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Ireduce_scatter_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); int comm_size; int count = 0; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Irsend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL) return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiSend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length); if(err != OTF2_SUCCESS) { eztrace_error("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } ezt_mpi_set_request_type((MPI_Request*)req, send, comm, -1, -1, -1); } static int MPI_Irsend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { return libMPI_Irsend(buf, count, datatype, dest, tag, comm, req); } static void MPI_Irsend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Irsend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; MPI_Irsend_prolog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); int ret = MPI_Irsend_core(buf, count, datatype, dest, tag, comm, req); MPI_Irsend_epilog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_irsend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_irsend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Irsend_prolog(buf, *count, c_type, *dest, *tag, c_comm, r); *error = MPI_Irsend_core(buf, *count, c_type, *dest, *tag, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Irsend_epilog(buf, *count, c_type, *dest, *tag, c_comm, r); FUNCTION_EXIT_("mpi_irsend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_iscan.c000066400000000000000000000052271447213526500221450ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iscan_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } static int MPI_Iscan_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* r) { return libMPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, r); } static void MPI_Iscan_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Iscan(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Iscan_prolog(sendbuf, recvbuf, count, datatype, op, comm, r); int ret = MPI_Iscan_core(sendbuf, recvbuf, count, datatype, op, comm, r); MPI_Iscan_epilog(sendbuf, recvbuf, count, datatype, op, comm, r); FUNCTION_EXIT; return ret; } void mpif_iscan_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_iscan_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Iscan_prolog(sbuf, rbuf, *count, c_type, c_op, c_comm, (MPI_Request*)r); *error = MPI_Iscan_core(sbuf, rbuf, *count, c_type, c_op, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Iscan_epilog(sbuf, rbuf, *count, c_type, c_op, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_iscan_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_iscatter.c000066400000000000000000000077241447213526500226720ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iscatter_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcnt; ezt_mpi_set_request_type((MPI_Request*)r, iscatter, comm, root, size_sent, size_recv); } static int MPI_Iscatter_core(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* r) { return libMPI_Iscatter(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm, r); } static void MPI_Iscatter_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { } int MPI_Iscatter(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* r) { FUNCTION_ENTRY; MPI_Iscatter_prolog(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm, r); int ret = MPI_Iscatter_core(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm, r); MPI_Iscatter_epilog(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm, r); FUNCTION_EXIT; return ret; } void mpif_iscatter_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, int* root, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_iscatter_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Iscatter_prolog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, (MPI_Request*)r); *error = MPI_Iscatter_core(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Iscatter_epilog(sbuf, *scount, c_stype, rbuf, *rcount, c_rtype, *root, c_comm, (MPI_Request*)r); FUNCTION_EXIT_("mpi_iscatter_"); } #endif eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_iscatterv.c000066400000000000000000000113721447213526500230520ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright © CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI3 static void MPI_Iscatterv_prolog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Request* r MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } int size_sent; int sendcount = 0; _EZT_MPI_Type_size(sendtype, &size_sent); int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Isend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL) return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiIsend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length, (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } ezt_mpi_set_request_type((MPI_Request*)req, send, comm, -1, -1, -1); } static int MPI_Isend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { return libMPI_Isend(buf, count, datatype, dest, tag, comm, req); } static void MPI_Isend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Isend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; MPI_Isend_prolog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); int ret = MPI_Isend_core(buf, count, datatype, dest, tag, comm, req); MPI_Isend_epilog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_isend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_isend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Isend_prolog(buf, *count, c_type, *dest, *tag, c_comm, r); *error = MPI_Isend_core(buf, *count, c_type, *dest, *tag, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Isend_epilog(buf, *count, c_type, *dest, *tag, c_comm, r); FUNCTION_EXIT_("mpi_isend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_issend.c000066400000000000000000000061301447213526500223270ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Issend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL) return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiIsend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length, (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } ezt_mpi_set_request_type((MPI_Request*)req, send, comm, -1, -1, -1); } static int MPI_Issend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { return libMPI_Issend(buf, count, datatype, dest, tag, comm, req); } static void MPI_Issend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Issend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; MPI_Issend_prolog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); int ret = MPI_Issend_core(buf, count, datatype, dest, tag, comm, req); MPI_Issend_epilog(buf, count, datatype, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_issend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, MPI_Fint* r, int* error) { FUNCTION_ENTRY_("mpi_issend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Request c_req = MPI_Request_f2c(*r); MPI_Issend_prolog(buf, *count, c_type, *dest, *tag, c_comm, r); *error = MPI_Issend_core(buf, *count, c_type, *dest, *tag, c_comm, &c_req); *r = MPI_Request_c2f(c_req); MPI_Issend_epilog(buf, *count, c_type, *dest, *tag, c_comm, r); FUNCTION_EXIT_("mpi_issend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_probe.c000066400000000000000000000034061447213526500221540ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Probe_prolog(int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED ) { } static int MPI_Probe_core(int source, int tag, MPI_Comm comm, MPI_Status* status) { return libMPI_Probe(source, tag, comm, status); } static void MPI_Probe_epilog(int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED ) { } int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) { FUNCTION_ENTRY; MPI_Probe_prolog(source, tag, comm, status); int ret = MPI_Probe_core(source, tag, comm, status); MPI_Probe_epilog(source, tag, comm, status); FUNCTION_EXIT; return ret; } void mpif_probe_(int* source, int* tag, MPI_Fint* comm, MPI_Status* status, int* err) { FUNCTION_ENTRY_("mpi_probe_"); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Probe_prolog(*source, *tag, c_comm, status); *err = MPI_Probe_core(*source, *tag, c_comm, status); MPI_Probe_epilog(*source, *tag, c_comm, status); FUNCTION_EXIT_("mpi_probe_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_put.c000066400000000000000000000065111447213526500216550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Put_prolog(CONST void* origin_addr MAYBE_UNUSED, int origin_count MAYBE_UNUSED, MPI_Datatype origin_datatype MAYBE_UNUSED, int target_rank MAYBE_UNUSED, MPI_Aint target_disp MAYBE_UNUSED, int target_count MAYBE_UNUSED, MPI_Datatype target_datatype MAYBE_UNUSED, MPI_Win win MAYBE_UNUSED ) { } static int MPI_Put_core(CONST void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { return libMPI_Put(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); } static void MPI_Put_epilog(CONST void* origin_addr MAYBE_UNUSED, int origin_count MAYBE_UNUSED, MPI_Datatype origin_datatype MAYBE_UNUSED, int target_rank MAYBE_UNUSED, MPI_Aint target_disp MAYBE_UNUSED, int target_count MAYBE_UNUSED, MPI_Datatype target_datatype MAYBE_UNUSED, MPI_Win win MAYBE_UNUSED ) { } int MPI_Put(CONST void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { FUNCTION_ENTRY; MPI_Put_prolog(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); int ret = MPI_Put_core(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); MPI_Put_epilog(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win); FUNCTION_EXIT; return ret; } void mpif_put_(void* o_addr, int* o_count, MPI_Fint* o_d, int* t_rank, MPI_Aint* t_disp, int* t_count, MPI_Fint* t_d, MPI_Fint* win, int* error) { FUNCTION_ENTRY_("mpi_put_"); MPI_Datatype c_otype = MPI_Type_f2c(*o_d); MPI_Datatype c_ttype = MPI_Type_f2c(*t_d); MPI_Win c_win = MPI_Win_f2c(*win); MPI_Put_prolog(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); *error = MPI_Put_core(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); MPI_Put_epilog(o_addr, *o_count, c_otype, *t_rank, *t_disp, *t_count, c_ttype, c_win); FUNCTION_EXIT_("mpi_put_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_recv.c000066400000000000000000000055421447213526500220070ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Recv_prolog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED ) { } static int MPI_Recv_core(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) { return libMPI_Recv(buf, count, datatype, source, tag, comm, status); } static void MPI_Recv_epilog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int source MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int received_bytes; MPI_Get_count(status, MPI_BYTE, &received_bytes); OTF2_ErrorCode err= OTF2_EvtWriter_MpiRecv(evt_writer, NULL, ezt_get_timestamp(), status->MPI_SOURCE, MPI_TO_OTF_COMMUNICATOR(comm), status->MPI_TAG, received_bytes); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) { FUNCTION_ENTRY; MPI_Status ezt_mpi_status; if(!status || status == MPI_STATUS_IGNORE) status = &ezt_mpi_status; MPI_Recv_prolog(buf, count, datatype, source, tag, comm, status); int ret = MPI_Recv_core(buf, count, datatype, source, tag, comm, status); MPI_Recv_epilog(buf, count, datatype, source, tag, comm, status); FUNCTION_EXIT; return ret; } void mpif_recv_(void* buf, int* count, MPI_Fint* d, int* src, int* tag, MPI_Fint* c, MPI_Fint* s, int* error) { FUNCTION_ENTRY_("mpi_recv_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Status c_status; MPI_Recv_prolog(buf, *count, c_type, *src, *tag, c_comm, &c_status); *error = MPI_Recv_core(buf, *count, c_type, *src, *tag, c_comm, &c_status); MPI_Status_c2f(&c_status, s); MPI_Recv_epilog(buf, *count, c_type, *src, *tag, c_comm, &c_status); FUNCTION_EXIT_("mpi_recv_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_recv_init.c000066400000000000000000000040151447213526500230240ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static int MPI_Recv_init_core(void* buffer, int count, MPI_Datatype type, int src, int tag, MPI_Comm comm, MPI_Request* req) { int length; _EZT_MPI_Type_size(type, &length); length *= count; ezt_mpi_set_persistent_request_type(req, recv, comm, src, tag, length); return libMPI_Recv_init(buffer, count, type, src, tag, comm, req); } static void MPI_Recv_init_epilog(void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int src MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Recv_init(void* buffer, int count, MPI_Datatype type, int src, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; int ret = MPI_Recv_init_core(buffer, count, type, src, tag, comm, req); MPI_Recv_init_epilog(buffer, count, type, src, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_recv_init_(void* buffer, int* count, MPI_Fint* type, int* src, int* tag, MPI_Fint* comm, MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_recv_init_"); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Recv_init_core(buffer, *count, c_type, *src, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Recv_init_epilog(buffer, *count, c_type, *src, *tag, c_comm, req); FUNCTION_EXIT_("mpi_recv_init_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_reduce.c000066400000000000000000000066621447213526500223230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Reduce_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Reduce_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { return libMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm); } static void MPI_Reduce_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); size_sent *= count; int size_recv = size_sent; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_REDUCE, MPI_TO_OTF_COMMUNICATOR(comm), root, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Reduce(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Reduce_prolog(sendbuf, recvbuf, count, datatype, op, root, comm); int ret = MPI_Reduce_core(sendbuf, recvbuf, count, datatype, op, root, comm); MPI_Reduce_epilog(sendbuf, recvbuf, count, datatype, op, root, comm); FUNCTION_EXIT; return ret; } void mpif_reduce_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, int* root, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_reduce_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Reduce_prolog(c_sbuf, c_rbuf, *count, c_type, c_op, *root, c_comm); *error = MPI_Reduce_core(c_sbuf, c_rbuf, *count, c_type, c_op, *root, c_comm); MPI_Reduce_epilog(c_sbuf, c_rbuf, *count, c_type, c_op, *root, c_comm); FUNCTION_EXIT_("mpi_reduce_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_reduce_scatter.c000066400000000000000000000072321447213526500240420ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Reduce_scatter_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Reduce_scatter_core(CONST void* sendbuf, void* recvbuf, CONST int* recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return libMPI_Reduce_scatter(sendbuf, recvbuf, recvcnts, datatype, op, comm); } static void MPI_Reduce_scatter_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, CONST int* recvcnts MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(datatype, &size_sent); int comm_size; int count = 0; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Rsend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL)return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiSend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Rsend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { return libMPI_Rsend(buf, count, datatype, dest, tag, comm); } static void MPI_Rsend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } int MPI_Rsend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Rsend_prolog(buf, count, datatype, dest, tag, comm); int ret = MPI_Rsend_core(buf, count, datatype, dest, tag, comm); MPI_Rsend_epilog(buf, count, datatype, dest, tag, comm); FUNCTION_EXIT; return ret; } void mpif_rsend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_rsend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Rsend_prolog(buf, *count, c_type, *dest, *tag, c_comm); *error = MPI_Rsend_core(buf, *count, c_type, *dest, *tag, c_comm); MPI_Rsend_epilog(buf, *count, c_type, *dest, *tag, c_comm); FUNCTION_EXIT_("mpi_rsend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_rsend_init.c000066400000000000000000000041411447213526500232000ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static int MPI_Rsend_init_core(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { int length; _EZT_MPI_Type_size(type, &length); length *= count; ezt_mpi_set_persistent_request_type(req, rsend, comm, dest, tag, length); return libMPI_Rsend_init(buffer, count, type, dest, tag, comm, req); } static void MPI_Rsend_init_epilog(CONST void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Rsend_init(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; int ret = MPI_Rsend_init_core(buffer, count, type, dest, tag, comm, req); MPI_Rsend_init_epilog(buffer, count, type, dest, tag, comm, (MPI_Fint*)req); return ret; } void mpif_rsend_init_(void* buffer, int* count, MPI_Fint* type, int* dest, int* tag, MPI_Fint* comm, MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_rsend_init_"); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Rsend_init_core(buffer, *count, c_type, *dest, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Rsend_init_epilog(buffer, *count, c_type, *dest, *tag, c_comm, req); FUNCTION_EXIT_("mpi_rsend_init_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_scan.c000066400000000000000000000043501447213526500217700ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Scan_prolog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } static int MPI_Scan_core(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return libMPI_Scan(sendbuf, recvbuf, count, datatype, op, comm); } static void MPI_Scan_epilog(CONST void* sendbuf MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, MPI_Op op MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } int MPI_Scan(CONST void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Scan_prolog(sendbuf, recvbuf, count, datatype, op, comm); int ret = MPI_Scan_core(sendbuf, recvbuf, count, datatype, op, comm); MPI_Scan_epilog(sendbuf, recvbuf, count, datatype, op, comm); FUNCTION_EXIT; return ret; } void mpif_scan_(void* sbuf, void* rbuf, int* count, MPI_Fint* d, MPI_Fint* op, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_scan_"); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Op c_op = MPI_Op_f2c(*op); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Scan_prolog(sbuf, rbuf, *count, c_type, c_op, c_comm); *error = MPI_Scan_core(sbuf, rbuf, *count, c_type, c_op, c_comm); MPI_Scan_epilog(sbuf, rbuf, *count, c_type, c_op, c_comm); FUNCTION_EXIT_("mpi_scan_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_scatter.c000066400000000000000000000077611447213526500225220ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Scatter_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Scatter_core(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) { return libMPI_Scatter(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm); } static void MPI_Scatter_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcnt MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; _EZT_MPI_Type_size(sendtype, &size_sent); size_sent *= sendcnt; int size_recv; _EZT_MPI_Type_size(recvtype, &size_recv); size_recv *= recvcnt; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_COLLECTIVE_OP_SCATTER, MPI_TO_OTF_COMMUNICATOR(comm), root, size_sent, size_recv); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } int MPI_Scatter(CONST void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Scatter_prolog(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm); int ret = MPI_Scatter_core(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm); MPI_Scatter_epilog(sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm); FUNCTION_EXIT; return ret; } void mpif_scatter_(void* sbuf, int* scount, MPI_Fint* sd, void* rbuf, int* rcount, MPI_Fint* rd, int* root, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_scatter_"); MPI_Datatype c_stype = MPI_Type_f2c(*sd); MPI_Datatype c_rtype = MPI_Type_f2c(*rd); MPI_Comm c_comm = MPI_Comm_f2c(*c); void* c_sbuf = CHECK_MPI_IN_PLACE(sbuf); void* c_rbuf = CHECK_MPI_IN_PLACE(rbuf); MPI_Scatter_prolog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); *error = MPI_Scatter_core(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); MPI_Scatter_epilog(c_sbuf, *scount, c_stype, c_rbuf, *rcount, c_rtype, *root, c_comm); FUNCTION_EXIT_("mpi_scatter_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_scatterv.c000066400000000000000000000113321447213526500226750ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Scatterv_prolog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveBegin(evt_writer, NULL, ezt_get_timestamp()); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Scatterv_core(CONST void* sendbuf, CONST int* sendcnts, CONST int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm) { return libMPI_Scatterv(sendbuf, sendcnts, displs, sendtype, recvbuf, recvcnt, recvtype, root, comm); } static void MPI_Scatterv_epilog(CONST void* sendbuf MAYBE_UNUSED, CONST int* sendcnts MAYBE_UNUSED, CONST int* displs MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcnt MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int root MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; int size_sent; int sendcount = 0; _EZT_MPI_Type_size(sendtype, &size_sent); int comm_size; MPI_Comm_size(comm, &comm_size); for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Send_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL)return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiSend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Send_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { return libMPI_Send(buf, count, datatype, dest, tag, comm); } static void MPI_Send_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } int MPI_Send(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Send_prolog(buf, count, datatype, dest, tag, comm); int ret = MPI_Send_core(buf, count, datatype, dest, tag, comm); MPI_Send_epilog(buf, count, datatype, dest, tag, comm); FUNCTION_EXIT; return ret; } void mpif_send_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_send_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Send_prolog(buf, *count, c_type, *dest, *tag, c_comm); *error = MPI_Send_core(buf, *count, c_type, *dest, *tag, c_comm); MPI_Send_epilog(buf, *count, c_type, *dest, *tag, c_comm); FUNCTION_EXIT_("mpi_send_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_send_init.c000066400000000000000000000041151447213526500230170ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static int MPI_Send_init_core(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { int length; _EZT_MPI_Type_size(type, &length); length *= count; ezt_mpi_set_persistent_request_type(req, send, comm, dest, tag, length); return libMPI_Send_init(buffer, count, type, dest, tag, comm, req); } static void MPI_Send_init_epilog(CONST void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Send_init(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; int ret = MPI_Send_init_core(buffer, count, type, dest, tag, comm, req); MPI_Send_init_epilog(buffer, count, type, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_send_init_(void* buffer, int* count, MPI_Fint* type, int* dest, int* tag, MPI_Fint* comm, MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_send_init_"); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Send_init_core(buffer, *count, c_type, *dest, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Send_init_epilog(buffer, *count, c_type, *dest, *tag, c_comm, req); FUNCTION_EXIT_("mpi_send_init_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_sendrecv.c000066400000000000000000000102271447213526500226550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Sendrecv_prolog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, int dest MAYBE_UNUSED, int sendtag MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int src MAYBE_UNUSED, int recvtag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED) { } static int MPI_Sendrecv_core(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status) { return libMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm, status); } static void MPI_Sendrecv_epilog(CONST void* sendbuf MAYBE_UNUSED, int sendcount MAYBE_UNUSED, MPI_Datatype sendtype MAYBE_UNUSED, int dest MAYBE_UNUSED, int sendtag MAYBE_UNUSED, void* recvbuf MAYBE_UNUSED, int recvcount MAYBE_UNUSED, MPI_Datatype recvtype MAYBE_UNUSED, int src MAYBE_UNUSED, int recvtag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED ) { } int MPI_Sendrecv(CONST void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status) { FUNCTION_ENTRY; MPI_Sendrecv_prolog(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm, status); int ret = MPI_Sendrecv_core(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm, status); MPI_Sendrecv_epilog(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm, status); FUNCTION_EXIT; return ret; } void mpif_sendrecv_(void* sendbuf, int* sendcount, MPI_Fint* sendtype, int* dest, int* sendtag, void* recvbuf, int* recvcount, MPI_Fint* recvtype, int* src, int* recvtag, MPI_Fint* comm, MPI_Status* status, int* error) { FUNCTION_ENTRY_("mpi_sendrecv_"); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Datatype c_stype = MPI_Type_f2c(*sendtype); MPI_Datatype c_rtype = MPI_Type_f2c(*recvtype); MPI_Sendrecv_prolog(sendbuf, *sendcount, c_stype, *dest, *sendtag, recvbuf, *recvcount, c_rtype, *src, *recvtag, c_comm, status); *error = MPI_Sendrecv_core(sendbuf, *sendcount, c_stype, *dest, *sendtag, recvbuf, *recvcount, c_rtype, *src, *recvtag, c_comm, status); MPI_Sendrecv_epilog(sendbuf, *sendcount, c_stype, *dest, *sendtag, recvbuf, *recvcount, c_rtype, *src, *recvtag, c_comm, status); FUNCTION_EXIT_("mpi_sendrecv_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_sendrecv_replace.c000066400000000000000000000067141447213526500243560ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Sendrecv_replace_prolog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int sendtag MAYBE_UNUSED, int src MAYBE_UNUSED, int recvtag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED ) { } static int MPI_Sendrecv_replace_core(void* buf, int count, MPI_Datatype type, int dest, int sendtag, int src, int recvtag, MPI_Comm comm, MPI_Status* status) { return libMPI_Sendrecv_replace(buf, count, type, dest, sendtag, src, recvtag, comm, status); } static void MPI_Sendrecv_replace_epilog(void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int sendtag MAYBE_UNUSED, int src MAYBE_UNUSED, int recvtag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED) { } int MPI_Sendrecv_replace(void* buf, int count, MPI_Datatype type, int dest, int sendtag, int src, int recvtag, MPI_Comm comm, MPI_Status* status) { FUNCTION_ENTRY; MPI_Sendrecv_replace_prolog(buf, count, type, dest, sendtag, src, recvtag, comm, status); int ret = MPI_Sendrecv_replace_core(buf, count, type, dest, sendtag, src, recvtag, comm, status); MPI_Sendrecv_replace_epilog(buf, count, type, dest, sendtag, src, recvtag, comm, status); FUNCTION_EXIT; return ret; } void mpif_sendrecv_replace_(void* buf, int* count, MPI_Fint* type, int* dest, int* sendtag, int* src, int* recvtag, MPI_Fint* comm, MPI_Status* status, int* error) { FUNCTION_ENTRY_("mpi_sendrecv_replace_"); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Sendrecv_replace_prolog(buf, *count, c_type, *dest, *sendtag, *src, *recvtag, c_comm, status); *error = MPI_Sendrecv_replace_core(buf, *count, c_type, *dest, *sendtag, *src, *recvtag, c_comm, status); MPI_Sendrecv_replace_epilog(buf, *count, c_type, *dest, *sendtag, *src, *recvtag, c_comm, status); FUNCTION_EXIT_("mpi_sendrecv_replace_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ssend.c000066400000000000000000000051721447213526500221630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Ssend_prolog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; if(comm == MPI_COMM_NULL)return; int length; _EZT_MPI_Type_size(datatype, &length); length *= count; OTF2_ErrorCode err = OTF2_EvtWriter_MpiSend(evt_writer, NULL, ezt_get_timestamp(), dest, MPI_TO_OTF_COMMUNICATOR(comm), tag, length); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } static int MPI_Ssend_core(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { return libMPI_Ssend(buf, count, datatype, dest, tag, comm); } static void MPI_Ssend_epilog(CONST void* buf MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype datatype MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED) { } int MPI_Ssend(CONST void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { FUNCTION_ENTRY; MPI_Ssend_prolog(buf, count, datatype, dest, tag, comm); int ret = MPI_Ssend_core(buf, count, datatype, dest, tag, comm); MPI_Ssend_epilog(buf, count, datatype, dest, tag, comm); FUNCTION_EXIT; return ret; } void mpif_ssend_(void* buf, int* count, MPI_Fint* d, int* dest, int* tag, MPI_Fint* c, int* error) { FUNCTION_ENTRY_("mpi_ssend_"); MPI_Comm c_comm = MPI_Comm_f2c(*c); MPI_Datatype c_type = MPI_Type_f2c(*d); MPI_Ssend_prolog(buf, *count, c_type, *dest, *tag, c_comm); *error = MPI_Ssend_core(buf, *count, c_type, *dest, *tag, c_comm); MPI_Ssend_epilog(buf, *count, c_type, *dest, *tag, c_comm); FUNCTION_EXIT_("mpi_ssend_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_ssend_init.c000066400000000000000000000041631447213526500232050ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static int MPI_Ssend_init_core(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { int length; _EZT_MPI_Type_size(type, &length); length *= count; ezt_mpi_set_persistent_request_type(req, ssend, comm, dest, tag, length); return libMPI_Ssend_init(buffer, count, type, dest, tag, comm, req); } static void MPI_Ssend_init_epilog(CONST void* buffer MAYBE_UNUSED, int count MAYBE_UNUSED, MPI_Datatype type MAYBE_UNUSED, int dest MAYBE_UNUSED, int tag MAYBE_UNUSED, MPI_Comm comm MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED) { } int MPI_Ssend_init(CONST void* buffer, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm, MPI_Request* req) { FUNCTION_ENTRY; int ret = MPI_Ssend_init_core(buffer, count, type, dest, tag, comm, req); MPI_Ssend_init_epilog(buffer, count, type, dest, tag, comm, (MPI_Fint*)req); FUNCTION_EXIT; return ret; } void mpif_ssend_init_(void* buffer, int* count, MPI_Fint* type, int* dest, int* tag, MPI_Fint* comm, MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_ssend_init_"); MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Ssend_init_core(buffer, *count, c_type, *dest, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Ssend_init_epilog(buffer, *count, c_type, *dest, *tag, c_comm, req); FUNCTION_EXIT_("mpi_ssend_init_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_start.c000066400000000000000000000040121447213526500221740ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include void _ezt_MPI_Start_request(MPI_Request* req) { if(!EZTRACE_SAFE) return; if(*req == MPI_REQUEST_NULL) return; struct ezt_mpi_request* r = ezt_mpi_get_request_type((MPI_Request*)req, 1); if(!r) return; if(r->type == recv) { OTF2_ErrorCode err = OTF2_EvtWriter_MpiIrecvRequest(evt_writer, NULL, ezt_get_timestamp(), (uint64_t)r->req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } else if(r->type == send || r->type == bsend || r->type == rsend || r->type == ssend ) { OTF2_ErrorCode err = OTF2_EvtWriter_MpiIsend(evt_writer, NULL, ezt_get_timestamp(), r->dest, MPI_TO_OTF_COMMUNICATOR(r->comm), r->tag, r->len, (uint64_t)r->req); if(err != OTF2_SUCCESS) { eztrace_warn("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } } static void MPI_Start_prolog(MPI_Fint* req) { _ezt_MPI_Start_request((MPI_Request*)req); } static int MPI_Start_core(MPI_Request* req) { return libMPI_Start(req); } int MPI_Start(MPI_Request* req) { FUNCTION_ENTRY; MPI_Start_prolog((MPI_Fint*)req); int ret = MPI_Start_core(req); FUNCTION_EXIT; return ret; } void mpif_start_(MPI_Fint* req, int* error) { FUNCTION_ENTRY_("mpi_start_"); MPI_Request c_req = MPI_Request_f2c(*req); MPI_Start_prolog(req); *error = MPI_Start_core(&c_req); *req = MPI_Request_c2f(c_req); FUNCTION_EXIT_("mpi_start_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_startall.c000066400000000000000000000030021447213526500226630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include /* defined in mpi_start.c */ void _ezt_MPI_Start_request(MPI_Request* req); static void MPI_Startall_prolog(int count, void* req, size_t size) { for(int i=0; i #include #include #include #include #include #include #include #include #include #include static int MPI_Test_core(MPI_Request* req, int* a, MPI_Status* s) { return libMPI_Test(req, a, s); } static void MPI_Test_epilog(MPI_Fint* req MAYBE_UNUSED, int* a MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, int isvalid) { if(isvalid && *a) mpi_complete_request(req, s); } int MPI_Test(MPI_Request* req, int* a, MPI_Status* s) { FUNCTION_ENTRY; int isvalid = *req!= MPI_REQUEST_NULL; MPI_Status ezt_mpi_status; if(!s || s == MPI_STATUS_IGNORE) s = &ezt_mpi_status; int res = MPI_Test_core(req, a, s); MPI_Test_epilog((MPI_Fint*)req, a, s, isvalid); FUNCTION_EXIT; return res; } void mpif_test_(MPI_Fint* r, int* f, MPI_Fint* s, int* error) { FUNCTION_ENTRY_("mpi_test_"); MPI_Request c_req = MPI_Request_f2c(*r); int isvalid = c_req != MPI_REQUEST_NULL; MPI_Status c_status; *error = MPI_Test_core(&c_req, f, &c_status); *r = MPI_Request_c2f(c_req); if (*f) { MPI_Status_c2f(&c_status, s); } MPI_Test_epilog(r, f, &c_status, isvalid); FUNCTION_EXIT_("mpi_test_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_testall.c000066400000000000000000000052711447213526500225170ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Testall_prolog(int count MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* flag MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Testany_prolog(int count MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* index MAYBE_UNUSED, int* flag MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Testsome_prolog(int incount MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* outcount MAYBE_UNUSED, int* indexes MAYBE_UNUSED, MPI_Status* statuses MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { for(int i=0; i #include #include #include #include #include #include #include #include #include #include void mpi_complete_request(MPI_Fint* req MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED) { if(!EZTRACE_SAFE) return; struct ezt_mpi_request* r = ezt_mpi_get_request_type((MPI_Request*)req, 0); if(!r) { // This may be a persistent request r = ezt_mpi_get_request_type((MPI_Request*)req, 1); } if(!r) { /* This may happen if the request was cancelled */ return; } if(r->type == recv) { int received_bytes; MPI_Get_count(s, MPI_BYTE, &received_bytes); OTF2_ErrorCode err = OTF2_EvtWriter_MpiIrecv( evt_writer, NULL, ezt_get_timestamp(), s->MPI_SOURCE, 0, //MPI_TO_OTF_COMMUNICATOR(comm) s->MPI_TAG, received_bytes, (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_error("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } else if(r->type == send || r->type == bsend || r->type == rsend || r->type == ssend ) { /* send: nothing to do */ OTF2_ErrorCode err = OTF2_EvtWriter_MpiIsendComplete( evt_writer, NULL, ezt_get_timestamp(), (uint64_t)req); if(err != OTF2_SUCCESS) { eztrace_error("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } else { /* collective */ int root = OTF2_UNDEFINED_UINT32; OTF2_CollectiveOp coll_type = 0; switch(r->type) { case ibarrier: coll_type = OTF2_COLLECTIVE_OP_BARRIER; break; case ibcast: coll_type = OTF2_COLLECTIVE_OP_BCAST; break; case igather: coll_type = OTF2_COLLECTIVE_OP_GATHER; break; case igatherv: coll_type = OTF2_COLLECTIVE_OP_GATHERV; break; case iscatter: coll_type = OTF2_COLLECTIVE_OP_SCATTER; break; case iscatterv: coll_type = OTF2_COLLECTIVE_OP_SCATTERV; break; case iallgather: coll_type = OTF2_COLLECTIVE_OP_ALLGATHER; break; case iallgatherv: coll_type = OTF2_COLLECTIVE_OP_ALLGATHERV; break; case ialltoall: coll_type = OTF2_COLLECTIVE_OP_ALLTOALL; break; case ialltoallv: coll_type = OTF2_COLLECTIVE_OP_ALLTOALLV; break; case ialltoallw: coll_type = OTF2_COLLECTIVE_OP_ALLTOALLW; break; case iallreduce: coll_type = OTF2_COLLECTIVE_OP_ALLREDUCE; break; case ireduce: coll_type = OTF2_COLLECTIVE_OP_REDUCE; break; case ireduce_scatter: coll_type = OTF2_COLLECTIVE_OP_REDUCE_SCATTER; break; default: eztrace_error("unknown colltype: %x\n", r->type); } if(r->type == ibcast || r->type == igather || r->type == igatherv || r->type == iscatter || r->type == iscatterv || r->type == ireduce || r->type == ireduce_scatter) { root = r->root; } OTF2_ErrorCode err = OTF2_EvtWriter_MpiCollectiveEnd(evt_writer, NULL, ezt_get_timestamp(), coll_type, MPI_TO_OTF_COMMUNICATOR(r->comm), root, r->send_size, r->recv_size); if(err != OTF2_SUCCESS) { eztrace_error("OTF2 error: %s: %s\n", OTF2_Error_GetName(err), OTF2_Error_GetDescription(err)); } } } static void MPI_Wait_prolog(MPI_Fint* req MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, int* isvalid MAYBE_UNUSED) { } static int MPI_Wait_core(MPI_Request* req, MPI_Status* s) { return libMPI_Wait(req, s); } static void MPI_Wait_epilog(MPI_Fint* req MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, int* isvalid) { if(isvalid) mpi_complete_request(req, s); } int MPI_Wait(MPI_Request* req, MPI_Status* s) { FUNCTION_ENTRY; int isvalid = *req != MPI_REQUEST_NULL; MPI_Status ezt_mpi_status; if(!s || s == MPI_STATUS_IGNORE) s = &ezt_mpi_status; MPI_Wait_prolog((MPI_Fint*)req, s, &isvalid); int ret = MPI_Wait_core(req, s); MPI_Wait_epilog((MPI_Fint*)req, s, &isvalid); FUNCTION_EXIT; return ret; } void mpif_wait_(MPI_Fint* r, MPI_Fint* s, int* error) { FUNCTION_ENTRY_("mpi_wait_"); MPI_Request c_req = MPI_Request_f2c(*r); int isvalid = c_req != MPI_REQUEST_NULL; MPI_Status c_status; MPI_Wait_prolog(r, &c_status, &isvalid); *error = MPI_Wait_core(&c_req, &c_status); MPI_Status_c2f(&c_status, s); MPI_Wait_epilog(r, &c_status, &isvalid); FUNCTION_EXIT_("mpi_wait_"); } eztrace-2.1/src/modules/mpi/mpi_funcs/mpi_waitall.c000066400000000000000000000053371447213526500225070ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "mpi_eztrace.h" #include #include #include #include #include #include #include #include #include #include #include static void MPI_Waitall_prolog(int count MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid MAYBE_UNUSED) { } static int MPI_Waitall_core(int count, MPI_Request* req, MPI_Status* s) { return libMPI_Waitall(count, req, s); } static void MPI_Waitall_epilog(int count MAYBE_UNUSED, MPI_Fint* req MAYBE_UNUSED, MPI_Status* s MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { for(int i=0; i #include #include #include #include #include #include #include #include #include #include static void MPI_Waitany_prolog(int count MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* index MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid MAYBE_UNUSED) { } static int MPI_Waitany_core(int count, MPI_Request* reqs, int* index, MPI_Status* status) { return libMPI_Waitany(count, reqs, index, status); } static void MPI_Waitany_epilog(int count MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* index MAYBE_UNUSED, MPI_Status* status MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { if(isvalid[*index]) mpi_complete_request(GET_ARRAY_ITEM(reqs, size, *index), &status[*index]); } int MPI_Waitany(int count, MPI_Request* reqs, int* index, MPI_Status* status) { FUNCTION_ENTRY; ALLOCATE_ITEMS(int, count, isvalid_static, isvalid); MPI_Status ezt_mpi_status[count]; if(status == MPI_STATUSES_IGNORE) status = ezt_mpi_status; for(int i=0; i #include #include #include #include #include #include #include #include #include /* todo: implement this function ! */ #include static void MPI_Waitsome_prolog(int incount MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* outcount MAYBE_UNUSED, int* array_of_indices MAYBE_UNUSED, MPI_Status* array_of_statuses MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid MAYBE_UNUSED) { } static int MPI_Waitsome_core(int incount, MPI_Request* reqs, int* outcount, int* array_of_indices, MPI_Status* array_of_statuses) { return libMPI_Waitsome(incount, reqs, outcount, array_of_indices, array_of_statuses); } static void MPI_Waitsome_epilog(int incount MAYBE_UNUSED, MPI_Fint* reqs MAYBE_UNUSED, int* outcount MAYBE_UNUSED, int* array_of_indices MAYBE_UNUSED, MPI_Status* array_of_statuses MAYBE_UNUSED, size_t size MAYBE_UNUSED, int* isvalid) { for(int i=0; i< *outcount; i++) { int index = array_of_indices[i]; if(isvalid[index]) mpi_complete_request(GET_ARRAY_ITEM(reqs, size, index), &array_of_statuses[index]); } } int MPI_Waitsome(int incount, MPI_Request* reqs, int* outcount, int* array_of_indices, MPI_Status* array_of_statuses) { FUNCTION_ENTRY; ALLOCATE_ITEMS(int, incount, isvalid_static, isvalid); MPI_Status ezt_mpi_status[incount]; if(array_of_statuses == MPI_STATUSES_IGNORE) array_of_statuses = ezt_mpi_status; for(int i=0; i #include #include #include #include "mpi.h" #include "netcdf.h" /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls to mutex_lock for example */ static volatile int _netcdf_initialized = 0; #define CURRENT_MODULE netcdf DECLARE_CURRENT_MODULE; /* pointers to actual netcdf functions */ int (*libnc_def_user_format)(int mode_flag, NC_Dispatch * dispatch_table, char *magic_number) = NULL; int (*libnc_inq_user_format)(int mode_flag, NC_Dispatch ** dispatch_table, char *magic_number) = NULL; int (*libnc_set_alignment)(int threshold, int alignment) = NULL; int (*libnc_get_alignment)(int *thresholdp, int *alignmentp) = NULL; int (*libnc__create)(const char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp) = NULL; int (*libnc_create)(const char *path, int cmode, int *ncidp) = NULL; int (*libnc__open)(const char *path, int mode, size_t *chunksizehintp, int *ncidp) = NULL; int (*libnc_open)(const char *path, int mode, int *ncidp) = NULL; int (*libnc_inq_path)(int ncid, size_t *pathlen, char *path) = NULL; int (*libnc_inq_ncid)(int ncid, const char *name, int *grp_ncid) = NULL; int (*libnc_inq_grps)(int ncid, int *numgrps, int *ncids) = NULL; int (*libnc_inq_grpname)(int ncid, char *name) = NULL; int (*libnc_inq_grpname_full)(int ncid, size_t *lenp, char *full_name) = NULL; int (*libnc_inq_grpname_len)(int ncid, size_t *lenp) = NULL; int (*libnc_inq_grp_parent)(int ncid, int *parent_ncid) = NULL; int (*libnc_inq_grp_ncid)(int ncid, const char *grp_name, int *grp_ncid) = NULL; int (*libnc_inq_grp_full_ncid)(int ncid, const char *full_name, int *grp_ncid) = NULL; int (*libnc_inq_varids)(int ncid, int *nvars, int *varids) = NULL; int (*libnc_inq_dimids)(int ncid, int *ndims, int *dimids, int include_parents) = NULL; int (*libnc_inq_typeids)(int ncid, int *ntypes, int *typeids) = NULL; int (*libnc_inq_type_equal)(int ncid1, nc_type typeid1, int ncid2, nc_type typeid2, int *equal) = NULL; int (*libnc_def_grp)(int parent_ncid, const char *name, int *new_ncid) = NULL; int (*libnc_rename_grp)(int grpid, const char *name) = NULL; int (*libnc_def_compound)(int ncid, size_t size, const char *name, nc_type * typeidp) = NULL; int (*libnc_insert_compound)(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid) = NULL; int (*libnc_insert_array_compound)(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes) = NULL; int (*libnc_inq_type)(int ncid, nc_type xtype, char *name, size_t *size) = NULL; int (*libnc_inq_typeid)(int ncid, const char *name, nc_type * typeidp) = NULL; int (*libnc_inq_compound)(int ncid, nc_type xtype, char *name, size_t *sizep, size_t *nfieldsp) = NULL; int (*libnc_inq_compound_name)(int ncid, nc_type xtype, char *name) = NULL; int (*libnc_inq_compound_size)(int ncid, nc_type xtype, size_t *sizep) = NULL; int (*libnc_inq_compound_nfields)(int ncid, nc_type xtype, size_t *nfieldsp) = NULL; int (*libnc_inq_compound_field)(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type * field_typeidp, int *ndimsp, int *dim_sizesp) = NULL; int (*libnc_inq_compound_fieldname)(int ncid, nc_type xtype, int fieldid, char *name) = NULL; int (*libnc_inq_compound_fieldindex)(int ncid, nc_type xtype, const char *name, int *fieldidp) = NULL; int (*libnc_inq_compound_fieldoffset)(int ncid, nc_type xtype, int fieldid, size_t *offsetp) = NULL; int (*libnc_inq_compound_fieldtype)(int ncid, nc_type xtype, int fieldid, nc_type * field_typeidp) = NULL; int (*libnc_inq_compound_fieldndims)(int ncid, nc_type xtype, int fieldid, int *ndimsp) = NULL; int (*libnc_inq_compound_fielddim_sizes)(int ncid, nc_type xtype, int fieldid, int *dim_sizes) = NULL; int (*libnc_def_vlen)(int ncid, const char *name, nc_type base_typeid, nc_type * xtypep) = NULL; int (*libnc_inq_vlen)(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type * base_nc_typep) = NULL; int (*libnc_free_vlen)(nc_vlen_t * vl) = NULL; int (*libnc_free_vlens)(size_t len, nc_vlen_t vlens[]) = NULL; int (*libnc_put_vlen_element)(int ncid, int typeid1, void *vlen_element, size_t len, const void *data) = NULL; int (*libnc_get_vlen_element)(int ncid, int typeid1, const void *vlen_element, size_t *len, void *data) = NULL; int (*libnc_free_string)(size_t len, char **data) = NULL; int (*libnc_inq_user_type)(int ncid, nc_type xtype, char *name, size_t *size, nc_type * base_nc_typep, size_t *nfieldsp, int *classp) = NULL; int (*libnc_put_att)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const void *op) = NULL; int (*libnc_get_att)(int ncid, int varid, const char *name, void *ip) = NULL; int (*libnc_def_enum)(int ncid, nc_type base_typeid, const char *name, nc_type * typeidp) = NULL; int (*libnc_insert_enum)(int ncid, nc_type xtype, const char *name, const void *value) = NULL; int (*libnc_inq_enum)(int ncid, nc_type xtype, char *name, nc_type * base_nc_typep, size_t *base_sizep, size_t *num_membersp) = NULL; int (*libnc_inq_enum_member)(int ncid, nc_type xtype, int idx, char *name, void *value) = NULL; int (*libnc_inq_enum_ident)(int ncid, nc_type xtype, long long value, char *identifier) = NULL; int (*libnc_def_opaque)(int ncid, size_t size, const char *name, nc_type * xtypep) = NULL; int (*libnc_inq_opaque)(int ncid, nc_type xtype, char *name, size_t *sizep) = NULL; int (*libnc_put_var)(int ncid, int varid, const void *op) = NULL; int (*libnc_get_var)(int ncid, int varid, void *ip) = NULL; int (*libnc_put_var1)(int ncid, int varid, const size_t *indexp, const void *op) = NULL; int (*libnc_get_var1)(int ncid, int varid, const size_t *indexp, void *ip) = NULL; int (*libnc_put_vara)(int ncid, int varid, const size_t *startp, const size_t *countp, const void *op) = NULL; int (*libnc_get_vara)(int ncid, int varid, const size_t *startp, const size_t *countp, void *ip) = NULL; int (*libnc_put_vars)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op) = NULL; int (*libnc_get_vars)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip) = NULL; int (*libnc_put_varm)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op) = NULL; int (*libnc_get_varm)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip) = NULL; int (*libnc_def_var_quantize)(int ncid, int varid, int quantize_mode, int nsd) = NULL; int (*libnc_inq_var_quantize)(int ncid, int varid, int *quantize_modep, int *nsdp) = NULL; int (*libnc_def_var_deflate)(int ncid, int varid, int shuffle, int deflate, int deflate_level) = NULL; int (*libnc_inq_var_deflate)(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp) = NULL; int (*libnc_def_var_szip)(int ncid, int varid, int options_mask, int pixels_per_block) = NULL; int (*libnc_inq_var_szip)(int ncid, int varid, int *options_maskp, int *pixels_per_blockp) = NULL; int (*libnc_def_var_fletcher32)(int ncid, int varid, int fletcher32) = NULL; int (*libnc_inq_var_fletcher32)(int ncid, int varid, int *fletcher32p) = NULL; int (*libnc_def_var_chunking)(int ncid, int varid, int storage, const size_t *chunksizesp) = NULL; int (*libnc_inq_var_chunking)(int ncid, int varid, int *storagep, size_t *chunksizesp) = NULL; int (*libnc_def_var_fill)(int ncid, int varid, int no_fill, const void *fill_value) = NULL; int (*libnc_inq_var_fill)(int ncid, int varid, int *no_fill, void *fill_valuep) = NULL; int (*libnc_def_var_endian)(int ncid, int varid, int endian) = NULL; int (*libnc_inq_var_endian)(int ncid, int varid, int *endianp) = NULL; int (*libnc_def_var_filter)(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int *parms) = NULL; int (*libnc_inq_var_filter)(int ncid, int varid, unsigned int *idp, size_t *nparams, unsigned int *params) = NULL; int (*libnc_set_fill)(int ncid, int fillmode, int *old_modep) = NULL; int (*libnc_set_default_format)(int format, int *old_formatp) = NULL; int (*libnc_set_chunk_cache)(size_t size, size_t nelems, float preemption) = NULL; int (*libnc_get_chunk_cache)(size_t *sizep, size_t *nelemsp, float *preemptionp) = NULL; int (*libnc_set_var_chunk_cache)(int ncid, int varid, size_t size, size_t nelems, float preemption) = NULL; int (*libnc_get_var_chunk_cache)(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp) = NULL; int (*libnc_redef)(int ncid) = NULL; int (*libnc__enddef)(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align) = NULL; int (*libnc_enddef)(int ncid) = NULL; int (*libnc_sync)(int ncid) = NULL; int (*libnc_abort)(int ncid) = NULL; int (*libnc_close)(int ncid) = NULL; int (*libnc_inq)(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp) = NULL; int (*libnc_inq_ndims)(int ncid, int *ndimsp) = NULL; int (*libnc_inq_nvars)(int ncid, int *nvarsp) = NULL; int (*libnc_inq_natts)(int ncid, int *nattsp) = NULL; int (*libnc_inq_unlimdim)(int ncid, int *unlimdimidp) = NULL; int (*libnc_inq_unlimdims)(int ncid, int *nunlimdimsp, int *unlimdimidsp) = NULL; int (*libnc_inq_format)(int ncid, int *formatp) = NULL; int (*libnc_inq_format_extended)(int ncid, int *formatp, int *modep) = NULL; int (*libnc_def_dim)(int ncid, const char *name, size_t len, int *idp) = NULL; int (*libnc_inq_dimid)(int ncid, const char *name, int *idp) = NULL; int (*libnc_inq_dim)(int ncid, int dimid, char *name, size_t *lenp) = NULL; int (*libnc_inq_dimname)(int ncid, int dimid, char *name) = NULL; int (*libnc_inq_dimlen)(int ncid, int dimid, size_t *lenp) = NULL; int (*libnc_rename_dim)(int ncid, int dimid, const char *name) = NULL; int (*libnc_inq_att)(int ncid, int varid, const char *name, nc_type * xtypep, size_t *lenp) = NULL; int (*libnc_inq_attid)(int ncid, int varid, const char *name, int *idp) = NULL; int (*libnc_inq_atttype)(int ncid, int varid, const char *name, nc_type * xtypep) = NULL; int (*libnc_inq_attlen)(int ncid, int varid, const char *name, size_t *lenp) = NULL; int (*libnc_inq_attname)(int ncid, int varid, int attnum, char *name) = NULL; int (*libnc_copy_att)(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out) = NULL; int (*libnc_rename_att)(int ncid, int varid, const char *name, const char *newname) = NULL; int (*libnc_del_att)(int ncid, int varid, const char *name) = NULL; int (*libnc_put_att_text)(int ncid, int varid, const char *name, size_t len, const char *op) = NULL; int (*libnc_get_att_text)(int ncid, int varid, const char *name, char *ip) = NULL; int (*libnc_put_att_string)(int ncid, int varid, const char *name, size_t len, const char **op) = NULL; int (*libnc_get_att_string)(int ncid, int varid, const char *name, char **ip) = NULL; int (*libnc_put_att_uchar)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op) = NULL; int (*libnc_get_att_uchar)(int ncid, int varid, const char *name, unsigned char *ip) = NULL; int (*libnc_put_att_schar)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const signed char *op) = NULL; int (*libnc_get_att_schar)(int ncid, int varid, const char *name, signed char *ip) = NULL; int (*libnc_put_att_short)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const short *op) = NULL; int (*libnc_get_att_short)(int ncid, int varid, const char *name, short *ip) = NULL; int (*libnc_put_att_int)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const int *op) = NULL; int (*libnc_get_att_int)(int ncid, int varid, const char *name, int *ip) = NULL; int (*libnc_put_att_long)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long *op) = NULL; int (*libnc_get_att_long)(int ncid, int varid, const char *name, long *ip) = NULL; int (*libnc_put_att_float)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const float *op) = NULL; int (*libnc_get_att_float)(int ncid, int varid, const char *name, float *ip) = NULL; int (*libnc_put_att_double)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const double *op) = NULL; int (*libnc_get_att_double)(int ncid, int varid, const char *name, double *ip) = NULL; int (*libnc_put_att_ushort)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned short *op) = NULL; int (*libnc_get_att_ushort)(int ncid, int varid, const char *name, unsigned short *ip) = NULL; int (*libnc_put_att_uint)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned int *op) = NULL; int (*libnc_get_att_uint)(int ncid, int varid, const char *name, unsigned int *ip) = NULL; int (*libnc_put_att_longlong)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long long *op) = NULL; int (*libnc_get_att_longlong)(int ncid, int varid, const char *name, long long *ip) = NULL; int (*libnc_put_att_ulonglong)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned long long *op) = NULL; int (*libnc_get_att_ulonglong)(int ncid, int varid, const char *name, unsigned long long *ip) = NULL; int (*libnc_def_var)(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp) = NULL; int (*libnc_inq_var)(int ncid, int varid, char *name, nc_type * xtypep, int *ndimsp, int *dimidsp, int *nattsp) = NULL; int (*libnc_inq_varid)(int ncid, const char *name, int *varidp) = NULL; int (*libnc_inq_varname)(int ncid, int varid, char *name) = NULL; int (*libnc_inq_vartype)(int ncid, int varid, nc_type * xtypep) = NULL; int (*libnc_inq_varndims)(int ncid, int varid, int *ndimsp) = NULL; int (*libnc_inq_vardimid)(int ncid, int varid, int *dimidsp) = NULL; int (*libnc_inq_varnatts)(int ncid, int varid, int *nattsp) = NULL; int (*libnc_rename_var)(int ncid, int varid, const char *name) = NULL; int (*libnc_copy_var)(int ncid_in, int varid, int ncid_out) = NULL; int (*libnc_put_var1_text)(int ncid, int varid, const size_t *indexp, const char *op) = NULL; int (*libnc_get_var1_text)(int ncid, int varid, const size_t *indexp, char *ip) = NULL; int (*libnc_put_var1_uchar)(int ncid, int varid, const size_t *indexp, const unsigned char *op) = NULL; int (*libnc_get_var1_uchar)(int ncid, int varid, const size_t *indexp, unsigned char *ip) = NULL; int (*libnc_put_var1_schar)(int ncid, int varid, const size_t *indexp, const signed char *op) = NULL; int (*libnc_get_var1_schar)(int ncid, int varid, const size_t *indexp, signed char *ip) = NULL; int (*libnc_put_var1_short)(int ncid, int varid, const size_t *indexp, const short *op) = NULL; int (*libnc_get_var1_short)(int ncid, int varid, const size_t *indexp, short *ip) = NULL; int (*libnc_put_var1_int)(int ncid, int varid, const size_t *indexp, const int *op) = NULL; int (*libnc_get_var1_int)(int ncid, int varid, const size_t *indexp, int *ip) = NULL; int (*libnc_put_var1_long)(int ncid, int varid, const size_t *indexp, const long *op) = NULL; int (*libnc_get_var1_long)(int ncid, int varid, const size_t *indexp, long *ip) = NULL; int (*libnc_put_var1_float)(int ncid, int varid, const size_t *indexp, const float *op) = NULL; int (*libnc_get_var1_float)(int ncid, int varid, const size_t *indexp, float *ip) = NULL; int (*libnc_put_var1_double)(int ncid, int varid, const size_t *indexp, const double *op) = NULL; int (*libnc_get_var1_double)(int ncid, int varid, const size_t *indexp, double *ip) = NULL; int (*libnc_put_var1_ushort)(int ncid, int varid, const size_t *indexp, const unsigned short *op) = NULL; int (*libnc_get_var1_ushort)(int ncid, int varid, const size_t *indexp, unsigned short *ip) = NULL; int (*libnc_put_var1_uint)(int ncid, int varid, const size_t *indexp, const unsigned int *op) = NULL; int (*libnc_get_var1_uint)(int ncid, int varid, const size_t *indexp, unsigned int *ip) = NULL; int (*libnc_put_var1_longlong)(int ncid, int varid, const size_t *indexp, const long long *op) = NULL; int (*libnc_get_var1_longlong)(int ncid, int varid, const size_t *indexp, long long *ip) = NULL; int (*libnc_put_var1_ulonglong)(int ncid, int varid, const size_t *indexp, const unsigned long long *op) = NULL; int (*libnc_get_var1_ulonglong)(int ncid, int varid, const size_t *indexp, unsigned long long *ip) = NULL; int (*libnc_put_var1_string)(int ncid, int varid, const size_t *indexp, const char **op) = NULL; int (*libnc_get_var1_string)(int ncid, int varid, const size_t *indexp, char **ip) = NULL; int (*libnc_put_vara_text)(int ncid, int varid, const size_t *startp, const size_t *countp, const char *op) = NULL; int (*libnc_get_vara_text)(int ncid, int varid, const size_t *startp, const size_t *countp, char *ip) = NULL; int (*libnc_put_vara_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op) = NULL; int (*libnc_get_vara_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip) = NULL; int (*libnc_put_vara_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, const signed char *op) = NULL; int (*libnc_get_vara_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, signed char *ip) = NULL; int (*libnc_put_vara_short)(int ncid, int varid, const size_t *startp, const size_t *countp, const short *op) = NULL; int (*libnc_get_vara_short)(int ncid, int varid, const size_t *startp, const size_t *countp, short *ip) = NULL; int (*libnc_put_vara_int)(int ncid, int varid, const size_t *startp, const size_t *countp, const int *op) = NULL; int (*libnc_get_vara_int)(int ncid, int varid, const size_t *startp, const size_t *countp, int *ip) = NULL; int (*libnc_put_vara_long)(int ncid, int varid, const size_t *startp, const size_t *countp, const long *op) = NULL; int (*libnc_get_vara_long)(int ncid, int varid, const size_t *startp, const size_t *countp, long *ip) = NULL; int (*libnc_put_vara_float)(int ncid, int varid, const size_t *startp, const size_t *countp, const float *op) = NULL; int (*libnc_get_vara_float)(int ncid, int varid, const size_t *startp, const size_t *countp, float *ip) = NULL; int (*libnc_put_vara_double)(int ncid, int varid, const size_t *startp, const size_t *countp, const double *op) = NULL; int (*libnc_get_vara_double)(int ncid, int varid, const size_t *startp, const size_t *countp, double *ip) = NULL; int (*libnc_put_vara_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned short *op) = NULL; int (*libnc_get_vara_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned short *ip) = NULL; int (*libnc_put_vara_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned int *op) = NULL; int (*libnc_get_vara_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned int *ip) = NULL; int (*libnc_put_vara_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, const long long *op) = NULL; int (*libnc_get_vara_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, long long *ip) = NULL; int (*libnc_put_vara_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned long long *op) = NULL; int (*libnc_get_vara_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned long long *ip) = NULL; int (*libnc_put_vara_string)(int ncid, int varid, const size_t *startp, const size_t *countp, const char **op) = NULL; int (*libnc_get_vara_string)(int ncid, int varid, const size_t *startp, const size_t *countp, char **ip) = NULL; int (*libnc_put_vars_text)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char *op) = NULL; int (*libnc_get_vars_text)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char *ip) = NULL; int (*libnc_put_vars_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op) = NULL; int (*libnc_get_vars_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip) = NULL; int (*libnc_put_vars_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const signed char *op) = NULL; int (*libnc_get_vars_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, signed char *ip) = NULL; int (*libnc_put_vars_short)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const short *op) = NULL; int (*libnc_get_vars_short)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, short *ip) = NULL; int (*libnc_put_vars_int)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const int *op) = NULL; int (*libnc_get_vars_int)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int *ip) = NULL; int (*libnc_put_vars_long)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long *op) = NULL; int (*libnc_get_vars_long)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long *ip) = NULL; int (*libnc_put_vars_float)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const float *op) = NULL; int (*libnc_get_vars_float)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, float *ip) = NULL; int (*libnc_put_vars_double)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const double *op) = NULL; int (*libnc_get_vars_double)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip) = NULL; int (*libnc_put_vars_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned short *op) = NULL; int (*libnc_get_vars_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned short *ip) = NULL; int (*libnc_put_vars_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned int *op) = NULL; int (*libnc_get_vars_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned int *ip) = NULL; int (*libnc_put_vars_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long long *op) = NULL; int (*libnc_get_vars_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long long *ip) = NULL; int (*libnc_put_vars_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned long long *op) = NULL; int (*libnc_get_vars_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned long long *ip) = NULL; int (*libnc_put_vars_string)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char **op) = NULL; int (*libnc_get_vars_string)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char **ip) = NULL; int (*libnc_put_varm_text)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char *op) = NULL; int (*libnc_get_varm_text)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char *ip) = NULL; int (*libnc_put_varm_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op) = NULL; int (*libnc_get_varm_uchar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip) = NULL; int (*libnc_put_varm_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const signed char *op) = NULL; int (*libnc_get_varm_schar)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, signed char *ip) = NULL; int (*libnc_put_varm_short)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const short *op) = NULL; int (*libnc_get_varm_short)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, short *ip) = NULL; int (*libnc_put_varm_int)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const int *op) = NULL; int (*libnc_get_varm_int)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, int *ip) = NULL; int (*libnc_put_varm_long)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long *op) = NULL; int (*libnc_get_varm_long)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long *ip) = NULL; int (*libnc_put_varm_float)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const float *op) = NULL; int (*libnc_get_varm_float)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, float *ip) = NULL; int (*libnc_put_varm_double)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const double *op) = NULL; int (*libnc_get_varm_double)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, double *ip) = NULL; int (*libnc_put_varm_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned short *op) = NULL; int (*libnc_get_varm_ushort)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned short *ip) = NULL; int (*libnc_put_varm_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned int *op) = NULL; int (*libnc_get_varm_uint)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned int *ip) = NULL; int (*libnc_put_varm_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long long *op) = NULL; int (*libnc_get_varm_longlong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long long *ip) = NULL; int (*libnc_put_varm_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned long long *op) = NULL; int (*libnc_get_varm_ulonglong)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned long long *ip) = NULL; int (*libnc_put_varm_string)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char **op) = NULL; int (*libnc_get_varm_string)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char **ip) = NULL; int (*libnc_put_var_text)(int ncid, int varid, const char *op) = NULL; int (*libnc_get_var_text)(int ncid, int varid, char *ip) = NULL; int (*libnc_put_var_uchar)(int ncid, int varid, const unsigned char *op) = NULL; int (*libnc_get_var_uchar)(int ncid, int varid, unsigned char *ip) = NULL; int (*libnc_put_var_schar)(int ncid, int varid, const signed char *op) = NULL; int (*libnc_get_var_schar)(int ncid, int varid, signed char *ip) = NULL; int (*libnc_put_var_short)(int ncid, int varid, const short *op) = NULL; int (*libnc_get_var_short)(int ncid, int varid, short *ip) = NULL; int (*libnc_put_var_int)(int ncid, int varid, const int *op) = NULL; int (*libnc_get_var_int)(int ncid, int varid, int *ip) = NULL; int (*libnc_put_var_long)(int ncid, int varid, const long *op) = NULL; int (*libnc_get_var_long)(int ncid, int varid, long *ip) = NULL; int (*libnc_put_var_float)(int ncid, int varid, const float *op) = NULL; int (*libnc_get_var_float)(int ncid, int varid, float *ip) = NULL; int (*libnc_put_var_double)(int ncid, int varid, const double *op) = NULL; int (*libnc_get_var_double)(int ncid, int varid, double *ip) = NULL; int (*libnc_put_var_ushort)(int ncid, int varid, const unsigned short *op) = NULL; int (*libnc_get_var_ushort)(int ncid, int varid, unsigned short *ip) = NULL; int (*libnc_put_var_uint)(int ncid, int varid, const unsigned int *op) = NULL; int (*libnc_get_var_uint)(int ncid, int varid, unsigned int *ip) = NULL; int (*libnc_put_var_longlong)(int ncid, int varid, const long long *op) = NULL; int (*libnc_get_var_longlong)(int ncid, int varid, long long *ip) = NULL; int (*libnc_put_var_ulonglong)(int ncid, int varid, const unsigned long long *op) = NULL; int (*libnc_get_var_ulonglong)(int ncid, int varid, unsigned long long *ip) = NULL; int (*libnc_put_var_string)(int ncid, int varid, const char **op) = NULL; int (*libnc_get_var_string)(int ncid, int varid, char **ip) = NULL; int (*libnc_reclaim_data)(int ncid, nc_type xtypeid, void *memory, size_t count) = NULL; int (*libnc_reclaim_data_all)(int ncid, nc_type xtypeid, void *memory, size_t count) = NULL; int (*libnc_copy_data)(int ncid, nc_type xtypeid, const void *memory, size_t count, void *copy) = NULL; int (*libnc_copy_data_all)(int ncid, nc_type xtypeid, const void *memory, size_t count, void **copyp) = NULL; int (*libnc_dump_data)(int ncid, nc_type xtypeid, void *memory, size_t count, char **buf) = NULL; int (*libnc_put_att_ubyte)(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op) = NULL; int (*libnc_get_att_ubyte)(int ncid, int varid, const char *name, unsigned char *ip) = NULL; int (*libnc_put_var1_ubyte)(int ncid, int varid, const size_t *indexp, const unsigned char *op) = NULL; int (*libnc_get_var1_ubyte)(int ncid, int varid, const size_t *indexp, unsigned char *ip) = NULL; int (*libnc_put_vara_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op) = NULL; int (*libnc_get_vara_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip) = NULL; int (*libnc_put_vars_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op) = NULL; int (*libnc_get_vars_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip) = NULL; int (*libnc_put_varm_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op) = NULL; int (*libnc_get_varm_ubyte)(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip) = NULL; int (*libnc_put_var_ubyte)(int ncid, int varid, const unsigned char *op) = NULL; int (*libnc_get_var_ubyte)(int ncid, int varid, unsigned char *ip) = NULL; int (*libnc_set_log_level)(int new_level) = NULL; int (*libnc_show_metadata)(int ncid) = NULL; int (*libnc_delete)(const char *path) = NULL; int (*libnc__create_mp)(const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int *ncidp) = NULL; int (*libnc__open_mp)(const char *path, int mode, int basepe, size_t *chunksizehintp, int *ncidp) = NULL; int (*libnc_delete_mp)(const char *path, int basepe) = NULL; int (*libnc_set_base_pe)(int ncid, int pe) = NULL; int (*libnc_inq_base_pe)(int ncid, int *pe) = NULL; int (*libnctypelen)(nc_type datatype) = NULL; int (*libnccreate)(const char *path, int cmode) = NULL; int (*libncopen)(const char *path, int mode) = NULL; int (*libncsetfill)(int ncid, int fillmode) = NULL; int (*libncredef)(int ncid) = NULL; int (*libncendef)(int ncid) = NULL; int (*libncsync)(int ncid) = NULL; int (*libncabort)(int ncid) = NULL; int (*libncclose)(int ncid) = NULL; int (*libncinquire)(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp) = NULL; int (*libncdimdef)(int ncid, const char *name, long len) = NULL; int (*libncdimid)(int ncid, const char *name) = NULL; int (*libncdiminq)(int ncid, int dimid, char *name, long *lenp) = NULL; int (*libncdimrename)(int ncid, int dimid, const char *name) = NULL; int (*libncattput)(int ncid, int varid, const char *name, nc_type xtype, int len, const void *op) = NULL; int (*libncattinq)(int ncid, int varid, const char *name, nc_type * xtypep, int *lenp) = NULL; int (*libncattget)(int ncid, int varid, const char *name, void *ip) = NULL; int (*libncattcopy)(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out) = NULL; int (*libncattname)(int ncid, int varid, int attnum, char *name) = NULL; int (*libncattrename)(int ncid, int varid, const char *name, const char *newname) = NULL; int (*libncattdel)(int ncid, int varid, const char *name) = NULL; int (*libncvardef)(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp) = NULL; int (*libncvarid)(int ncid, const char *name) = NULL; int (*libncvarinq)(int ncid, int varid, char *name, nc_type * xtypep, int *ndimsp, int *dimidsp, int *nattsp) = NULL; int (*libncvarput1)(int ncid, int varid, const long *indexp, const void *op) = NULL; int (*libncvarget1)(int ncid, int varid, const long *indexp, void *ip) = NULL; int (*libncvarput)(int ncid, int varid, const long *startp, const long *countp, const void *op) = NULL; int (*libncvarget)(int ncid, int varid, const long *startp, const long *countp, void *ip) = NULL; int (*libncvarputs)(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const void *op) = NULL; int (*libncvargets)(int ncid, int varid, const long *startp, const long *countp, const long *stridep, void *ip) = NULL; int (*libncvarputg)(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, const void *op) = NULL; int (*libncvargetg)(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, void *ip) = NULL; int (*libncvarrename)(int ncid, int varid, const char *name) = NULL; int (*libncrecinq)(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp) = NULL; int (*libncrecget)(int ncid, long recnum, void **datap) = NULL; int (*libncrecput)(int ncid, long recnum, void *const *datap) = NULL; int (*libnc_initialize)(void) = NULL; int (*libnc_finalize)(void) = NULL; int (*libnc_rc_set)(const char *key, const char *value) = NULL; /* Wrapper functions */ int nc_def_user_format(int mode_flag, NC_Dispatch * dispatch_table, char *magic_number) { FUNCTION_ENTRY; int ret = libnc_def_user_format(mode_flag, dispatch_table, magic_number); FUNCTION_EXIT; return ret; } int nc_inq_user_format(int mode_flag, NC_Dispatch ** dispatch_table, char *magic_number) { FUNCTION_ENTRY; int ret = libnc_inq_user_format(mode_flag, dispatch_table, magic_number); FUNCTION_EXIT; return ret; } int nc_set_alignment(int threshold, int alignment) { FUNCTION_ENTRY; int ret = libnc_set_alignment(threshold, alignment); FUNCTION_EXIT; return ret; } int nc_get_alignment(int *thresholdp, int *alignmentp) { FUNCTION_ENTRY; int ret = libnc_get_alignment(thresholdp, alignmentp); FUNCTION_EXIT; return ret; } int nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp) { FUNCTION_ENTRY; int ret = libnc__create(path, cmode, initialsz, chunksizehintp, ncidp); FUNCTION_EXIT; return ret; } int nc_create(const char *path, int cmode, int *ncidp) { FUNCTION_ENTRY; int ret = libnc_create(path, cmode, ncidp); FUNCTION_EXIT; return ret; } int nc__open(const char *path, int mode, size_t *chunksizehintp, int *ncidp) { FUNCTION_ENTRY; int ret = libnc__open(path, mode, chunksizehintp, ncidp); FUNCTION_EXIT; return ret; } int nc_open(const char *path, int mode, int *ncidp) { FUNCTION_ENTRY; int ret = libnc_open(path, mode, ncidp); FUNCTION_EXIT; return ret; } int nc_inq_path(int ncid, size_t *pathlen, char *path) { FUNCTION_ENTRY; int ret = libnc_inq_path(ncid, pathlen, path); FUNCTION_EXIT; return ret; } int nc_inq_ncid(int ncid, const char *name, int *grp_ncid) { FUNCTION_ENTRY; int ret = libnc_inq_ncid(ncid, name, grp_ncid); FUNCTION_EXIT; return ret; } int nc_inq_grps(int ncid, int *numgrps, int *ncids) { FUNCTION_ENTRY; int ret = libnc_inq_grps(ncid, numgrps, ncids); FUNCTION_EXIT; return ret; } int nc_inq_grpname(int ncid, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_grpname(ncid, name); FUNCTION_EXIT; return ret; } int nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name) { FUNCTION_ENTRY; int ret = libnc_inq_grpname_full(ncid, lenp, full_name); FUNCTION_EXIT; return ret; } int nc_inq_grpname_len(int ncid, size_t *lenp) { FUNCTION_ENTRY; int ret = libnc_inq_grpname_len(ncid, lenp); FUNCTION_EXIT; return ret; } int nc_inq_grp_parent(int ncid, int *parent_ncid) { FUNCTION_ENTRY; int ret = libnc_inq_grp_parent(ncid, parent_ncid); FUNCTION_EXIT; return ret; } int nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid) { FUNCTION_ENTRY; int ret = libnc_inq_grp_ncid(ncid, grp_name, grp_ncid); FUNCTION_EXIT; return ret; } int nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid) { FUNCTION_ENTRY; int ret = libnc_inq_grp_full_ncid(ncid, full_name, grp_ncid); FUNCTION_EXIT; return ret; } int nc_inq_varids(int ncid, int *nvars, int *varids) { FUNCTION_ENTRY; int ret = libnc_inq_varids(ncid, nvars, varids); FUNCTION_EXIT; return ret; } int nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents) { FUNCTION_ENTRY; int ret = libnc_inq_dimids(ncid, ndims, dimids, include_parents); FUNCTION_EXIT; return ret; } int nc_inq_typeids(int ncid, int *ntypes, int *typeids) { FUNCTION_ENTRY; int ret = libnc_inq_typeids(ncid, ntypes, typeids); FUNCTION_EXIT; return ret; } int nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, nc_type typeid2, int *equal) { FUNCTION_ENTRY; int ret = libnc_inq_type_equal(ncid1, typeid1, ncid2, typeid2, equal); FUNCTION_EXIT; return ret; } int nc_def_grp(int parent_ncid, const char *name, int *new_ncid) { FUNCTION_ENTRY; int ret = libnc_def_grp(parent_ncid, name, new_ncid); FUNCTION_EXIT; return ret; } int nc_rename_grp(int grpid, const char *name) { FUNCTION_ENTRY; int ret = libnc_rename_grp(grpid, name); FUNCTION_EXIT; return ret; } int nc_def_compound(int ncid, size_t size, const char *name, nc_type * typeidp) { FUNCTION_ENTRY; int ret = libnc_def_compound(ncid, size, name, typeidp); FUNCTION_EXIT; return ret; } int nc_insert_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid) { FUNCTION_ENTRY; int ret = libnc_insert_compound(ncid, xtype, name, offset, field_typeid); FUNCTION_EXIT; return ret; } int nc_insert_array_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes) { FUNCTION_ENTRY; int ret = libnc_insert_array_compound(ncid, xtype, name, offset, field_typeid, ndims, dim_sizes); FUNCTION_EXIT; return ret; } int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size) { FUNCTION_ENTRY; int ret = libnc_inq_type(ncid, xtype, name, size); FUNCTION_EXIT; return ret; } int nc_inq_typeid(int ncid, const char *name, nc_type * typeidp) { FUNCTION_ENTRY; int ret = libnc_inq_typeid(ncid, name, typeidp); FUNCTION_EXIT; return ret; } int nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, size_t *nfieldsp) { FUNCTION_ENTRY; int ret = libnc_inq_compound(ncid, xtype, name, sizep, nfieldsp); FUNCTION_EXIT; return ret; } int nc_inq_compound_name(int ncid, nc_type xtype, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_compound_name(ncid, xtype, name); FUNCTION_EXIT; return ret; } int nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep) { FUNCTION_ENTRY; int ret = libnc_inq_compound_size(ncid, xtype, sizep); FUNCTION_EXIT; return ret; } int nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_nfields(ncid, xtype, nfieldsp); FUNCTION_EXIT; return ret; } int nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type * field_typeidp, int *ndimsp, int *dim_sizesp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_field(ncid, xtype, fieldid, name, offsetp, field_typeidp, ndimsp, dim_sizesp); FUNCTION_EXIT; return ret; } int nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fieldname(ncid, xtype, fieldid, name); FUNCTION_EXIT; return ret; } int nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, int *fieldidp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fieldindex(ncid, xtype, name, fieldidp); FUNCTION_EXIT; return ret; } int nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, size_t *offsetp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fieldoffset(ncid, xtype, fieldid, offsetp); FUNCTION_EXIT; return ret; } int nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, nc_type * field_typeidp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fieldtype(ncid, xtype, fieldid, field_typeidp); FUNCTION_EXIT; return ret; } int nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, int *ndimsp) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fieldndims(ncid, xtype, fieldid, ndimsp); FUNCTION_EXIT; return ret; } int nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, int *dim_sizes) { FUNCTION_ENTRY; int ret = libnc_inq_compound_fielddim_sizes(ncid, xtype, fieldid, dim_sizes); FUNCTION_EXIT; return ret; } int nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type * xtypep) { FUNCTION_ENTRY; int ret = libnc_def_vlen(ncid, name, base_typeid, xtypep); FUNCTION_EXIT; return ret; } int nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type * base_nc_typep) { FUNCTION_ENTRY; int ret = libnc_inq_vlen(ncid, xtype, name, datum_sizep, base_nc_typep); FUNCTION_EXIT; return ret; } int nc_free_vlen(nc_vlen_t * vl) { FUNCTION_ENTRY; int ret = libnc_free_vlen(vl); FUNCTION_EXIT; return ret; } int nc_free_vlens(size_t len, nc_vlen_t vlens[]) { FUNCTION_ENTRY; int ret = libnc_free_vlens(len, vlens); FUNCTION_EXIT; return ret; } int nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, size_t len, const void *data) { FUNCTION_ENTRY; int ret = libnc_put_vlen_element(ncid, typeid1, vlen_element, len, data); FUNCTION_EXIT; return ret; } int nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element, size_t *len, void *data) { FUNCTION_ENTRY; int ret = libnc_get_vlen_element(ncid, typeid1, vlen_element, len, data); FUNCTION_EXIT; return ret; } int nc_free_string(size_t len, char **data) { FUNCTION_ENTRY; int ret = libnc_free_string(len, data); FUNCTION_EXIT; return ret; } int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type * base_nc_typep, size_t *nfieldsp, int *classp) { FUNCTION_ENTRY; int ret = libnc_inq_user_type(ncid, xtype, name, size, base_nc_typep, nfieldsp, classp); FUNCTION_EXIT; return ret; } int nc_put_att(int ncid, int varid, const char *name, nc_type xtype, size_t len, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_att(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att(int ncid, int varid, const char *name, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_att(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_def_enum(int ncid, nc_type base_typeid, const char *name, nc_type * typeidp) { FUNCTION_ENTRY; int ret = libnc_def_enum(ncid, base_typeid, name, typeidp); FUNCTION_EXIT; return ret; } int nc_insert_enum(int ncid, nc_type xtype, const char *name, const void *value) { FUNCTION_ENTRY; int ret = libnc_insert_enum(ncid, xtype, name, value); FUNCTION_EXIT; return ret; } int nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type * base_nc_typep, size_t *base_sizep, size_t *num_membersp) { FUNCTION_ENTRY; int ret = libnc_inq_enum(ncid, xtype, name, base_nc_typep, base_sizep, num_membersp); FUNCTION_EXIT; return ret; } int nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, void *value) { FUNCTION_ENTRY; int ret = libnc_inq_enum_member(ncid, xtype, idx, name, value); FUNCTION_EXIT; return ret; } int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier) { FUNCTION_ENTRY; int ret = libnc_inq_enum_ident(ncid, xtype, value, identifier); FUNCTION_EXIT; return ret; } int nc_def_opaque(int ncid, size_t size, const char *name, nc_type * xtypep) { FUNCTION_ENTRY; int ret = libnc_def_opaque(ncid, size, name, xtypep); FUNCTION_EXIT; return ret; } int nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep) { FUNCTION_ENTRY; int ret = libnc_inq_opaque(ncid, xtype, name, sizep); FUNCTION_EXIT; return ret; } int nc_put_var(int ncid, int varid, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_var(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var(int ncid, int varid, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_var(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_var1(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara(int ncid, int varid, const size_t *startp, const size_t *countp, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_vara(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara(int ncid, int varid, const size_t *startp, const size_t *countp, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_vars(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op) { FUNCTION_ENTRY; int ret = libnc_put_varm(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_def_var_quantize(int ncid, int varid, int quantize_mode, int nsd) { FUNCTION_ENTRY; int ret = libnc_def_var_quantize(ncid, varid, quantize_mode, nsd); FUNCTION_EXIT; return ret; } int nc_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp) { FUNCTION_ENTRY; int ret = libnc_inq_var_quantize(ncid, varid, quantize_modep, nsdp); FUNCTION_EXIT; return ret; } int nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, int deflate_level) { FUNCTION_ENTRY; int ret = libnc_def_var_deflate(ncid, varid, shuffle, deflate, deflate_level); FUNCTION_EXIT; return ret; } int nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp) { FUNCTION_ENTRY; int ret = libnc_inq_var_deflate(ncid, varid, shufflep, deflatep, deflate_levelp); FUNCTION_EXIT; return ret; } int nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block) { FUNCTION_ENTRY; int ret = libnc_def_var_szip(ncid, varid, options_mask, pixels_per_block); FUNCTION_EXIT; return ret; } int nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp) { FUNCTION_ENTRY; int ret = libnc_inq_var_szip(ncid, varid, options_maskp, pixels_per_blockp); FUNCTION_EXIT; return ret; } int nc_def_var_fletcher32(int ncid, int varid, int fletcher32) { FUNCTION_ENTRY; int ret = libnc_def_var_fletcher32(ncid, varid, fletcher32); FUNCTION_EXIT; return ret; } int nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p) { FUNCTION_ENTRY; int ret = libnc_inq_var_fletcher32(ncid, varid, fletcher32p); FUNCTION_EXIT; return ret; } int nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp) { FUNCTION_ENTRY; int ret = libnc_def_var_chunking(ncid, varid, storage, chunksizesp); FUNCTION_EXIT; return ret; } int nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp) { FUNCTION_ENTRY; int ret = libnc_inq_var_chunking(ncid, varid, storagep, chunksizesp); FUNCTION_EXIT; return ret; } int nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value) { FUNCTION_ENTRY; int ret = libnc_def_var_fill(ncid, varid, no_fill, fill_value); FUNCTION_EXIT; return ret; } int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep) { FUNCTION_ENTRY; int ret = libnc_inq_var_fill(ncid, varid, no_fill, fill_valuep); FUNCTION_EXIT; return ret; } int nc_def_var_endian(int ncid, int varid, int endian) { FUNCTION_ENTRY; int ret = libnc_def_var_endian(ncid, varid, endian); FUNCTION_EXIT; return ret; } int nc_inq_var_endian(int ncid, int varid, int *endianp) { FUNCTION_ENTRY; int ret = libnc_inq_var_endian(ncid, varid, endianp); FUNCTION_EXIT; return ret; } int nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int *parms) { FUNCTION_ENTRY; int ret = libnc_def_var_filter(ncid, varid, id, nparams, parms); FUNCTION_EXIT; return ret; } int nc_inq_var_filter(int ncid, int varid, unsigned int *idp, size_t *nparams, unsigned int *params) { FUNCTION_ENTRY; int ret = libnc_inq_var_filter(ncid, varid, idp, nparams, params); FUNCTION_EXIT; return ret; } int nc_set_fill(int ncid, int fillmode, int *old_modep) { FUNCTION_ENTRY; int ret = libnc_set_fill(ncid, fillmode, old_modep); FUNCTION_EXIT; return ret; } int nc_set_default_format(int format, int *old_formatp) { FUNCTION_ENTRY; int ret = libnc_set_default_format(format, old_formatp); FUNCTION_EXIT; return ret; } int nc_set_chunk_cache(size_t size, size_t nelems, float preemption) { FUNCTION_ENTRY; int ret = libnc_set_chunk_cache(size, nelems, preemption); FUNCTION_EXIT; return ret; } int nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp) { FUNCTION_ENTRY; int ret = libnc_get_chunk_cache(sizep, nelemsp, preemptionp); FUNCTION_EXIT; return ret; } int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption) { FUNCTION_ENTRY; int ret = libnc_set_var_chunk_cache(ncid, varid, size, nelems, preemption); FUNCTION_EXIT; return ret; } int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp) { FUNCTION_ENTRY; int ret = libnc_get_var_chunk_cache(ncid, varid, sizep, nelemsp, preemptionp); FUNCTION_EXIT; return ret; } int nc_redef(int ncid) { FUNCTION_ENTRY; int ret = libnc_redef(ncid); FUNCTION_EXIT; return ret; } int nc__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align) { FUNCTION_ENTRY; int ret = libnc__enddef(ncid, h_minfree, v_align, v_minfree, r_align); FUNCTION_EXIT; return ret; } int nc_enddef(int ncid) { FUNCTION_ENTRY; int ret = libnc_enddef(ncid); FUNCTION_EXIT; return ret; } int nc_sync(int ncid) { FUNCTION_ENTRY; int ret = libnc_sync(ncid); FUNCTION_EXIT; return ret; } int nc_abort(int ncid) { FUNCTION_ENTRY; int ret = libnc_abort(ncid); FUNCTION_EXIT; return ret; } int nc_close(int ncid) { FUNCTION_ENTRY; int ret = libnc_close(ncid); FUNCTION_EXIT; return ret; } int nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp) { FUNCTION_ENTRY; int ret = libnc_inq(ncid, ndimsp, nvarsp, nattsp, unlimdimidp); FUNCTION_EXIT; return ret; } int nc_inq_ndims(int ncid, int *ndimsp) { FUNCTION_ENTRY; int ret = libnc_inq_ndims(ncid, ndimsp); FUNCTION_EXIT; return ret; } int nc_inq_nvars(int ncid, int *nvarsp) { FUNCTION_ENTRY; int ret = libnc_inq_nvars(ncid, nvarsp); FUNCTION_EXIT; return ret; } int nc_inq_natts(int ncid, int *nattsp) { FUNCTION_ENTRY; int ret = libnc_inq_natts(ncid, nattsp); FUNCTION_EXIT; return ret; } int nc_inq_unlimdim(int ncid, int *unlimdimidp) { FUNCTION_ENTRY; int ret = libnc_inq_unlimdim(ncid, unlimdimidp); FUNCTION_EXIT; return ret; } int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp) { FUNCTION_ENTRY; int ret = libnc_inq_unlimdims(ncid, nunlimdimsp, unlimdimidsp); FUNCTION_EXIT; return ret; } int nc_inq_format(int ncid, int *formatp) { FUNCTION_ENTRY; int ret = libnc_inq_format(ncid, formatp); FUNCTION_EXIT; return ret; } int nc_inq_format_extended(int ncid, int *formatp, int *modep) { FUNCTION_ENTRY; int ret = libnc_inq_format_extended(ncid, formatp, modep); FUNCTION_EXIT; return ret; } int nc_def_dim(int ncid, const char *name, size_t len, int *idp) { FUNCTION_ENTRY; int ret = libnc_def_dim(ncid, name, len, idp); FUNCTION_EXIT; return ret; } int nc_inq_dimid(int ncid, const char *name, int *idp) { FUNCTION_ENTRY; int ret = libnc_inq_dimid(ncid, name, idp); FUNCTION_EXIT; return ret; } int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp) { FUNCTION_ENTRY; int ret = libnc_inq_dim(ncid, dimid, name, lenp); FUNCTION_EXIT; return ret; } int nc_inq_dimname(int ncid, int dimid, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_dimname(ncid, dimid, name); FUNCTION_EXIT; return ret; } int nc_inq_dimlen(int ncid, int dimid, size_t *lenp) { FUNCTION_ENTRY; int ret = libnc_inq_dimlen(ncid, dimid, lenp); FUNCTION_EXIT; return ret; } int nc_rename_dim(int ncid, int dimid, const char *name) { FUNCTION_ENTRY; int ret = libnc_rename_dim(ncid, dimid, name); FUNCTION_EXIT; return ret; } int nc_inq_att(int ncid, int varid, const char *name, nc_type * xtypep, size_t *lenp) { FUNCTION_ENTRY; int ret = libnc_inq_att(ncid, varid, name, xtypep, lenp); FUNCTION_EXIT; return ret; } int nc_inq_attid(int ncid, int varid, const char *name, int *idp) { FUNCTION_ENTRY; int ret = libnc_inq_attid(ncid, varid, name, idp); FUNCTION_EXIT; return ret; } int nc_inq_atttype(int ncid, int varid, const char *name, nc_type * xtypep) { FUNCTION_ENTRY; int ret = libnc_inq_atttype(ncid, varid, name, xtypep); FUNCTION_EXIT; return ret; } int nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp) { FUNCTION_ENTRY; int ret = libnc_inq_attlen(ncid, varid, name, lenp); FUNCTION_EXIT; return ret; } int nc_inq_attname(int ncid, int varid, int attnum, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_attname(ncid, varid, attnum, name); FUNCTION_EXIT; return ret; } int nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out) { FUNCTION_ENTRY; int ret = libnc_copy_att(ncid_in, varid_in, name, ncid_out, varid_out); FUNCTION_EXIT; return ret; } int nc_rename_att(int ncid, int varid, const char *name, const char *newname) { FUNCTION_ENTRY; int ret = libnc_rename_att(ncid, varid, name, newname); FUNCTION_EXIT; return ret; } int nc_del_att(int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libnc_del_att(ncid, varid, name); FUNCTION_EXIT; return ret; } int nc_put_att_text(int ncid, int varid, const char *name, size_t len, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_att_text(ncid, varid, name, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_text(int ncid, int varid, const char *name, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_text(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_string(int ncid, int varid, const char *name, size_t len, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_att_string(ncid, varid, name, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_string(int ncid, int varid, const char *name, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_att_string(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_att_uchar(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_uchar(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_att_schar(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_schar(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, size_t len, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_att_short(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_short(int ncid, int varid, const char *name, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_short(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, size_t len, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_att_int(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_int(int ncid, int varid, const char *name, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_int(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_att_long(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_long(int ncid, int varid, const char *name, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_long(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, size_t len, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_att_float(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_float(int ncid, int varid, const char *name, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_float(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, size_t len, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_att_double(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_double(int ncid, int varid, const char *name, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_double(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_att_ushort(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_ushort(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_att_uint(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_uint(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_att_longlong(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_longlong(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_att_ulonglong(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_ulonglong(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp) { FUNCTION_ENTRY; int ret = libnc_def_var(ncid, name, xtype, ndims, dimidsp, varidp); FUNCTION_EXIT; return ret; } int nc_inq_var(int ncid, int varid, char *name, nc_type * xtypep, int *ndimsp, int *dimidsp, int *nattsp) { FUNCTION_ENTRY; int ret = libnc_inq_var(ncid, varid, name, xtypep, ndimsp, dimidsp, nattsp); FUNCTION_EXIT; return ret; } int nc_inq_varid(int ncid, const char *name, int *varidp) { FUNCTION_ENTRY; int ret = libnc_inq_varid(ncid, name, varidp); FUNCTION_EXIT; return ret; } int nc_inq_varname(int ncid, int varid, char *name) { FUNCTION_ENTRY; int ret = libnc_inq_varname(ncid, varid, name); FUNCTION_EXIT; return ret; } int nc_inq_vartype(int ncid, int varid, nc_type * xtypep) { FUNCTION_ENTRY; int ret = libnc_inq_vartype(ncid, varid, xtypep); FUNCTION_EXIT; return ret; } int nc_inq_varndims(int ncid, int varid, int *ndimsp) { FUNCTION_ENTRY; int ret = libnc_inq_varndims(ncid, varid, ndimsp); FUNCTION_EXIT; return ret; } int nc_inq_vardimid(int ncid, int varid, int *dimidsp) { FUNCTION_ENTRY; int ret = libnc_inq_vardimid(ncid, varid, dimidsp); FUNCTION_EXIT; return ret; } int nc_inq_varnatts(int ncid, int varid, int *nattsp) { FUNCTION_ENTRY; int ret = libnc_inq_varnatts(ncid, varid, nattsp); FUNCTION_EXIT; return ret; } int nc_rename_var(int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libnc_rename_var(ncid, varid, name); FUNCTION_EXIT; return ret; } int nc_copy_var(int ncid_in, int varid, int ncid_out) { FUNCTION_ENTRY; int ret = libnc_copy_var(ncid_in, varid, ncid_out); FUNCTION_EXIT; return ret; } int nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_text(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_text(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_uchar(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_uchar(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_schar(int ncid, int varid, const size_t *indexp, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_schar(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_schar(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_short(int ncid, int varid, const size_t *indexp, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_short(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_short(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_int(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_int(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_long(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_long(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_float(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_float(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_double(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_double(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_ushort(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_ushort(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_uint(int ncid, int varid, const size_t *indexp, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_uint(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_uint(int ncid, int varid, const size_t *indexp, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_uint(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_longlong(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_longlong(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_ulonglong(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_ulonglong(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_string(int ncid, int varid, const size_t *indexp, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_var1_string(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_string(int ncid, int varid, const size_t *indexp, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_string(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_text(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_text(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_uchar(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_uchar(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_schar(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_schar(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_short(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_short(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_int(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_int(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_long(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_long(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_float(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_float(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_double(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_double(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_ushort(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_ushort(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_uint(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_uint(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_longlong(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_longlong(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_ulonglong(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_ulonglong(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_vara_string(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_string(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_text(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_text(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_uchar(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_uchar(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_schar(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_schar(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_short(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_short(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_int(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_int(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_long(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_long(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_float(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_float(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_double(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_double(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_ushort(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_ushort(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_uint(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_uint(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_longlong(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_longlong(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_ulonglong(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_ulonglong(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_vars_string(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_string(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_text(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_text(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_uchar(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_uchar(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_schar(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_schar(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_short(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_short(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_int(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_int(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_long(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_long(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_float(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_float(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_double(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_double(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_ushort(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_ushort(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_uint(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_uint(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_longlong(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_longlong(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_ulonglong(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_ulonglong(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_varm_string(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_string(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_var_text(int ncid, int varid, const char *op) { FUNCTION_ENTRY; int ret = libnc_put_var_text(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_text(int ncid, int varid, char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_text(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_uchar(int ncid, int varid, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_var_uchar(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_uchar(int ncid, int varid, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_uchar(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_schar(int ncid, int varid, const signed char *op) { FUNCTION_ENTRY; int ret = libnc_put_var_schar(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_schar(int ncid, int varid, signed char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_schar(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_short(int ncid, int varid, const short *op) { FUNCTION_ENTRY; int ret = libnc_put_var_short(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_short(int ncid, int varid, short *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_short(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_int(int ncid, int varid, const int *op) { FUNCTION_ENTRY; int ret = libnc_put_var_int(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_int(int ncid, int varid, int *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_int(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_long(int ncid, int varid, const long *op) { FUNCTION_ENTRY; int ret = libnc_put_var_long(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_long(int ncid, int varid, long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_long(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_float(int ncid, int varid, const float *op) { FUNCTION_ENTRY; int ret = libnc_put_var_float(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_float(int ncid, int varid, float *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_float(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_double(int ncid, int varid, const double *op) { FUNCTION_ENTRY; int ret = libnc_put_var_double(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_double(int ncid, int varid, double *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_double(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_ushort(int ncid, int varid, const unsigned short *op) { FUNCTION_ENTRY; int ret = libnc_put_var_ushort(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_ushort(int ncid, int varid, unsigned short *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_ushort(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_uint(int ncid, int varid, const unsigned int *op) { FUNCTION_ENTRY; int ret = libnc_put_var_uint(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_uint(int ncid, int varid, unsigned int *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_uint(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_longlong(int ncid, int varid, const long long *op) { FUNCTION_ENTRY; int ret = libnc_put_var_longlong(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_longlong(int ncid, int varid, long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_longlong(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libnc_put_var_ulonglong(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_ulonglong(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_put_var_string(int ncid, int varid, const char **op) { FUNCTION_ENTRY; int ret = libnc_put_var_string(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_string(int ncid, int varid, char **ip) { FUNCTION_ENTRY; int ret = libnc_get_var_string(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_reclaim_data(int ncid, nc_type xtypeid, void *memory, size_t count) { FUNCTION_ENTRY; int ret = libnc_reclaim_data(ncid, xtypeid, memory, count); FUNCTION_EXIT; return ret; } int nc_reclaim_data_all(int ncid, nc_type xtypeid, void *memory, size_t count) { FUNCTION_ENTRY; int ret = libnc_reclaim_data_all(ncid, xtypeid, memory, count); FUNCTION_EXIT; return ret; } int nc_copy_data(int ncid, nc_type xtypeid, const void *memory, size_t count, void *copy) { FUNCTION_ENTRY; int ret = libnc_copy_data(ncid, xtypeid, memory, count, copy); FUNCTION_EXIT; return ret; } int nc_copy_data_all(int ncid, nc_type xtypeid, const void *memory, size_t count, void **copyp) { FUNCTION_ENTRY; int ret = libnc_copy_data_all(ncid, xtypeid, memory, count, copyp); FUNCTION_EXIT; return ret; } int nc_dump_data(int ncid, nc_type xtypeid, void *memory, size_t count, char **buf) { FUNCTION_ENTRY; int ret = libnc_dump_data(ncid, xtypeid, memory, count, buf); FUNCTION_EXIT; return ret; } int nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_att_ubyte(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_att_ubyte(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_var1_ubyte(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var1_ubyte(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_vara_ubyte(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vara_ubyte(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_vars_ubyte(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_vars_ubyte(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_varm_ubyte(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_varm_ubyte(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int nc_put_var_ubyte(int ncid, int varid, const unsigned char *op) { FUNCTION_ENTRY; int ret = libnc_put_var_ubyte(ncid, varid, op); FUNCTION_EXIT; return ret; } int nc_get_var_ubyte(int ncid, int varid, unsigned char *ip) { FUNCTION_ENTRY; int ret = libnc_get_var_ubyte(ncid, varid, ip); FUNCTION_EXIT; return ret; } int nc_set_log_level(int new_level) { FUNCTION_ENTRY; int ret = libnc_set_log_level(new_level); FUNCTION_EXIT; return ret; } int nc_show_metadata(int ncid) { FUNCTION_ENTRY; int ret = libnc_show_metadata(ncid); FUNCTION_EXIT; return ret; } int nc_delete(const char *path) { FUNCTION_ENTRY; int ret = libnc_delete(path); FUNCTION_EXIT; return ret; } int nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int *ncidp) { FUNCTION_ENTRY; int ret = libnc__create_mp(path, cmode, initialsz, basepe, chunksizehintp, ncidp); FUNCTION_EXIT; return ret; } int nc__open_mp(const char *path, int mode, int basepe, size_t *chunksizehintp, int *ncidp) { FUNCTION_ENTRY; int ret = libnc__open_mp(path, mode, basepe, chunksizehintp, ncidp); FUNCTION_EXIT; return ret; } int nc_delete_mp(const char *path, int basepe) { FUNCTION_ENTRY; int ret = libnc_delete_mp(path, basepe); FUNCTION_EXIT; return ret; } int nc_set_base_pe(int ncid, int pe) { FUNCTION_ENTRY; int ret = libnc_set_base_pe(ncid, pe); FUNCTION_EXIT; return ret; } int nc_inq_base_pe(int ncid, int *pe) { FUNCTION_ENTRY; int ret = libnc_inq_base_pe(ncid, pe); FUNCTION_EXIT; return ret; } int nctypelen(nc_type datatype) { FUNCTION_ENTRY; int ret = libnctypelen(datatype); FUNCTION_EXIT; return ret; } int nccreate(const char *path, int cmode) { FUNCTION_ENTRY; int ret = libnccreate(path, cmode); FUNCTION_EXIT; return ret; } int ncopen(const char *path, int mode) { FUNCTION_ENTRY; int ret = libncopen(path, mode); FUNCTION_EXIT; return ret; } int ncsetfill(int ncid, int fillmode) { FUNCTION_ENTRY; int ret = libncsetfill(ncid, fillmode); FUNCTION_EXIT; return ret; } int ncredef(int ncid) { FUNCTION_ENTRY; int ret = libncredef(ncid); FUNCTION_EXIT; return ret; } int ncendef(int ncid) { FUNCTION_ENTRY; int ret = libncendef(ncid); FUNCTION_EXIT; return ret; } int ncsync(int ncid) { FUNCTION_ENTRY; int ret = libncsync(ncid); FUNCTION_EXIT; return ret; } int ncabort(int ncid) { FUNCTION_ENTRY; int ret = libncabort(ncid); FUNCTION_EXIT; return ret; } int ncclose(int ncid) { FUNCTION_ENTRY; int ret = libncclose(ncid); FUNCTION_EXIT; return ret; } int ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp) { FUNCTION_ENTRY; int ret = libncinquire(ncid, ndimsp, nvarsp, nattsp, unlimdimp); FUNCTION_EXIT; return ret; } int ncdimdef(int ncid, const char *name, long len) { FUNCTION_ENTRY; int ret = libncdimdef(ncid, name, len); FUNCTION_EXIT; return ret; } int ncdimid(int ncid, const char *name) { FUNCTION_ENTRY; int ret = libncdimid(ncid, name); FUNCTION_EXIT; return ret; } int ncdiminq(int ncid, int dimid, char *name, long *lenp) { FUNCTION_ENTRY; int ret = libncdiminq(ncid, dimid, name, lenp); FUNCTION_EXIT; return ret; } int ncdimrename(int ncid, int dimid, const char *name) { FUNCTION_ENTRY; int ret = libncdimrename(ncid, dimid, name); FUNCTION_EXIT; return ret; } int ncattput(int ncid, int varid, const char *name, nc_type xtype, int len, const void *op) { FUNCTION_ENTRY; int ret = libncattput(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncattinq(int ncid, int varid, const char *name, nc_type * xtypep, int *lenp) { FUNCTION_ENTRY; int ret = libncattinq(ncid, varid, name, xtypep, lenp); FUNCTION_EXIT; return ret; } int ncattget(int ncid, int varid, const char *name, void *ip) { FUNCTION_ENTRY; int ret = libncattget(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out) { FUNCTION_ENTRY; int ret = libncattcopy(ncid_in, varid_in, name, ncid_out, varid_out); FUNCTION_EXIT; return ret; } int ncattname(int ncid, int varid, int attnum, char *name) { FUNCTION_ENTRY; int ret = libncattname(ncid, varid, attnum, name); FUNCTION_EXIT; return ret; } int ncattrename(int ncid, int varid, const char *name, const char *newname) { FUNCTION_ENTRY; int ret = libncattrename(ncid, varid, name, newname); FUNCTION_EXIT; return ret; } int ncattdel(int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libncattdel(ncid, varid, name); FUNCTION_EXIT; return ret; } int ncvardef(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp) { FUNCTION_ENTRY; int ret = libncvardef(ncid, name, xtype, ndims, dimidsp); FUNCTION_EXIT; return ret; } int ncvarid(int ncid, const char *name) { FUNCTION_ENTRY; int ret = libncvarid(ncid, name); FUNCTION_EXIT; return ret; } int ncvarinq(int ncid, int varid, char *name, nc_type * xtypep, int *ndimsp, int *dimidsp, int *nattsp) { FUNCTION_ENTRY; int ret = libncvarinq(ncid, varid, name, xtypep, ndimsp, dimidsp, nattsp); FUNCTION_EXIT; return ret; } int ncvarput1(int ncid, int varid, const long *indexp, const void *op) { FUNCTION_ENTRY; int ret = libncvarput1(ncid, varid, indexp, op); FUNCTION_EXIT; return ret; } int ncvarget1(int ncid, int varid, const long *indexp, void *ip) { FUNCTION_ENTRY; int ret = libncvarget1(ncid, varid, indexp, ip); FUNCTION_EXIT; return ret; } int ncvarput(int ncid, int varid, const long *startp, const long *countp, const void *op) { FUNCTION_ENTRY; int ret = libncvarput(ncid, varid, startp, countp, op); FUNCTION_EXIT; return ret; } int ncvarget(int ncid, int varid, const long *startp, const long *countp, void *ip) { FUNCTION_ENTRY; int ret = libncvarget(ncid, varid, startp, countp, ip); FUNCTION_EXIT; return ret; } int ncvarputs(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const void *op) { FUNCTION_ENTRY; int ret = libncvarputs(ncid, varid, startp, countp, stridep, op); FUNCTION_EXIT; return ret; } int ncvargets(int ncid, int varid, const long *startp, const long *countp, const long *stridep, void *ip) { FUNCTION_ENTRY; int ret = libncvargets(ncid, varid, startp, countp, stridep, ip); FUNCTION_EXIT; return ret; } int ncvarputg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, const void *op) { FUNCTION_ENTRY; int ret = libncvarputg(ncid, varid, startp, countp, stridep, imapp, op); FUNCTION_EXIT; return ret; } int ncvargetg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, void *ip) { FUNCTION_ENTRY; int ret = libncvargetg(ncid, varid, startp, countp, stridep, imapp, ip); FUNCTION_EXIT; return ret; } int ncvarrename(int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libncvarrename(ncid, varid, name); FUNCTION_EXIT; return ret; } int ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp) { FUNCTION_ENTRY; int ret = libncrecinq(ncid, nrecvarsp, recvaridsp, recsizesp); FUNCTION_EXIT; return ret; } int ncrecget(int ncid, long recnum, void **datap) { FUNCTION_ENTRY; int ret = libncrecget(ncid, recnum, datap); FUNCTION_EXIT; return ret; } int ncrecput(int ncid, long recnum, void *const *datap) { FUNCTION_ENTRY; int ret = libncrecput(ncid, recnum, datap); FUNCTION_EXIT; return ret; } int nc_initialize(void) { FUNCTION_ENTRY; int ret = libnc_initialize(); FUNCTION_EXIT; return ret; } int nc_finalize(void) { FUNCTION_ENTRY; int ret = libnc_finalize(); FUNCTION_EXIT; return ret; } int nc_rc_set(const char *key, const char *value) { FUNCTION_ENTRY; int ret = libnc_rc_set(key, value); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(netcdf) INTERCEPT3("nc_def_user_format", libnc_def_user_format) INTERCEPT3("nc_inq_user_format", libnc_inq_user_format) INTERCEPT3("nc_set_alignment", libnc_set_alignment) INTERCEPT3("nc_get_alignment", libnc_get_alignment) INTERCEPT3("nc__create", libnc__create) INTERCEPT3("nc_create", libnc_create) INTERCEPT3("nc__open", libnc__open) INTERCEPT3("nc_open", libnc_open) INTERCEPT3("nc_inq_path", libnc_inq_path) INTERCEPT3("nc_inq_ncid", libnc_inq_ncid) INTERCEPT3("nc_inq_grps", libnc_inq_grps) INTERCEPT3("nc_inq_grpname", libnc_inq_grpname) INTERCEPT3("nc_inq_grpname_full", libnc_inq_grpname_full) INTERCEPT3("nc_inq_grpname_len", libnc_inq_grpname_len) INTERCEPT3("nc_inq_grp_parent", libnc_inq_grp_parent) INTERCEPT3("nc_inq_grp_ncid", libnc_inq_grp_ncid) INTERCEPT3("nc_inq_grp_full_ncid", libnc_inq_grp_full_ncid) INTERCEPT3("nc_inq_varids", libnc_inq_varids) INTERCEPT3("nc_inq_dimids", libnc_inq_dimids) INTERCEPT3("nc_inq_typeids", libnc_inq_typeids) INTERCEPT3("nc_inq_type_equal", libnc_inq_type_equal) INTERCEPT3("nc_def_grp", libnc_def_grp) INTERCEPT3("nc_rename_grp", libnc_rename_grp) INTERCEPT3("nc_def_compound", libnc_def_compound) INTERCEPT3("nc_insert_compound", libnc_insert_compound) INTERCEPT3("nc_insert_array_compound", libnc_insert_array_compound) INTERCEPT3("nc_inq_type", libnc_inq_type) INTERCEPT3("nc_inq_typeid", libnc_inq_typeid) INTERCEPT3("nc_inq_compound", libnc_inq_compound) INTERCEPT3("nc_inq_compound_name", libnc_inq_compound_name) INTERCEPT3("nc_inq_compound_size", libnc_inq_compound_size) INTERCEPT3("nc_inq_compound_nfields", libnc_inq_compound_nfields) INTERCEPT3("nc_inq_compound_field", libnc_inq_compound_field) INTERCEPT3("nc_inq_compound_fieldname", libnc_inq_compound_fieldname) INTERCEPT3("nc_inq_compound_fieldindex", libnc_inq_compound_fieldindex) INTERCEPT3("nc_inq_compound_fieldoffset", libnc_inq_compound_fieldoffset) INTERCEPT3("nc_inq_compound_fieldtype", libnc_inq_compound_fieldtype) INTERCEPT3("nc_inq_compound_fieldndims", libnc_inq_compound_fieldndims) INTERCEPT3("nc_inq_compound_fielddim_sizes", libnc_inq_compound_fielddim_sizes) INTERCEPT3("nc_def_vlen", libnc_def_vlen) INTERCEPT3("nc_inq_vlen", libnc_inq_vlen) INTERCEPT3("nc_free_vlen", libnc_free_vlen) INTERCEPT3("nc_free_vlens", libnc_free_vlens) INTERCEPT3("nc_put_vlen_element", libnc_put_vlen_element) INTERCEPT3("nc_get_vlen_element", libnc_get_vlen_element) INTERCEPT3("nc_free_string", libnc_free_string) INTERCEPT3("nc_inq_user_type", libnc_inq_user_type) INTERCEPT3("nc_put_att", libnc_put_att) INTERCEPT3("nc_get_att", libnc_get_att) INTERCEPT3("nc_def_enum", libnc_def_enum) INTERCEPT3("nc_insert_enum", libnc_insert_enum) INTERCEPT3("nc_inq_enum", libnc_inq_enum) INTERCEPT3("nc_inq_enum_member", libnc_inq_enum_member) INTERCEPT3("nc_inq_enum_ident", libnc_inq_enum_ident) INTERCEPT3("nc_def_opaque", libnc_def_opaque) INTERCEPT3("nc_inq_opaque", libnc_inq_opaque) INTERCEPT3("nc_put_var", libnc_put_var) INTERCEPT3("nc_get_var", libnc_get_var) INTERCEPT3("nc_put_var1", libnc_put_var1) INTERCEPT3("nc_get_var1", libnc_get_var1) INTERCEPT3("nc_put_vara", libnc_put_vara) INTERCEPT3("nc_get_vara", libnc_get_vara) INTERCEPT3("nc_put_vars", libnc_put_vars) INTERCEPT3("nc_get_vars", libnc_get_vars) INTERCEPT3("nc_put_varm", libnc_put_varm) INTERCEPT3("nc_get_varm", libnc_get_varm) INTERCEPT3("nc_def_var_quantize", libnc_def_var_quantize) INTERCEPT3("nc_inq_var_quantize", libnc_inq_var_quantize) INTERCEPT3("nc_def_var_deflate", libnc_def_var_deflate) INTERCEPT3("nc_inq_var_deflate", libnc_inq_var_deflate) INTERCEPT3("nc_def_var_szip", libnc_def_var_szip) INTERCEPT3("nc_inq_var_szip", libnc_inq_var_szip) INTERCEPT3("nc_def_var_fletcher32", libnc_def_var_fletcher32) INTERCEPT3("nc_inq_var_fletcher32", libnc_inq_var_fletcher32) INTERCEPT3("nc_def_var_chunking", libnc_def_var_chunking) INTERCEPT3("nc_inq_var_chunking", libnc_inq_var_chunking) INTERCEPT3("nc_def_var_fill", libnc_def_var_fill) INTERCEPT3("nc_inq_var_fill", libnc_inq_var_fill) INTERCEPT3("nc_def_var_endian", libnc_def_var_endian) INTERCEPT3("nc_inq_var_endian", libnc_inq_var_endian) INTERCEPT3("nc_def_var_filter", libnc_def_var_filter) INTERCEPT3("nc_inq_var_filter", libnc_inq_var_filter) INTERCEPT3("nc_set_fill", libnc_set_fill) INTERCEPT3("nc_set_default_format", libnc_set_default_format) INTERCEPT3("nc_set_chunk_cache", libnc_set_chunk_cache) INTERCEPT3("nc_get_chunk_cache", libnc_get_chunk_cache) INTERCEPT3("nc_set_var_chunk_cache", libnc_set_var_chunk_cache) INTERCEPT3("nc_get_var_chunk_cache", libnc_get_var_chunk_cache) INTERCEPT3("nc_redef", libnc_redef) INTERCEPT3("nc__enddef", libnc__enddef) INTERCEPT3("nc_enddef", libnc_enddef) INTERCEPT3("nc_sync", libnc_sync) INTERCEPT3("nc_abort", libnc_abort) INTERCEPT3("nc_close", libnc_close) INTERCEPT3("nc_inq", libnc_inq) INTERCEPT3("nc_inq_ndims", libnc_inq_ndims) INTERCEPT3("nc_inq_nvars", libnc_inq_nvars) INTERCEPT3("nc_inq_natts", libnc_inq_natts) INTERCEPT3("nc_inq_unlimdim", libnc_inq_unlimdim) INTERCEPT3("nc_inq_unlimdims", libnc_inq_unlimdims) INTERCEPT3("nc_inq_format", libnc_inq_format) INTERCEPT3("nc_inq_format_extended", libnc_inq_format_extended) INTERCEPT3("nc_def_dim", libnc_def_dim) INTERCEPT3("nc_inq_dimid", libnc_inq_dimid) INTERCEPT3("nc_inq_dim", libnc_inq_dim) INTERCEPT3("nc_inq_dimname", libnc_inq_dimname) INTERCEPT3("nc_inq_dimlen", libnc_inq_dimlen) INTERCEPT3("nc_rename_dim", libnc_rename_dim) INTERCEPT3("nc_inq_att", libnc_inq_att) INTERCEPT3("nc_inq_attid", libnc_inq_attid) INTERCEPT3("nc_inq_atttype", libnc_inq_atttype) INTERCEPT3("nc_inq_attlen", libnc_inq_attlen) INTERCEPT3("nc_inq_attname", libnc_inq_attname) INTERCEPT3("nc_copy_att", libnc_copy_att) INTERCEPT3("nc_rename_att", libnc_rename_att) INTERCEPT3("nc_del_att", libnc_del_att) INTERCEPT3("nc_put_att_text", libnc_put_att_text) INTERCEPT3("nc_get_att_text", libnc_get_att_text) INTERCEPT3("nc_put_att_string", libnc_put_att_string) INTERCEPT3("nc_get_att_string", libnc_get_att_string) INTERCEPT3("nc_put_att_uchar", libnc_put_att_uchar) INTERCEPT3("nc_get_att_uchar", libnc_get_att_uchar) INTERCEPT3("nc_put_att_schar", libnc_put_att_schar) INTERCEPT3("nc_get_att_schar", libnc_get_att_schar) INTERCEPT3("nc_put_att_short", libnc_put_att_short) INTERCEPT3("nc_get_att_short", libnc_get_att_short) INTERCEPT3("nc_put_att_int", libnc_put_att_int) INTERCEPT3("nc_get_att_int", libnc_get_att_int) INTERCEPT3("nc_put_att_long", libnc_put_att_long) INTERCEPT3("nc_get_att_long", libnc_get_att_long) INTERCEPT3("nc_put_att_float", libnc_put_att_float) INTERCEPT3("nc_get_att_float", libnc_get_att_float) INTERCEPT3("nc_put_att_double", libnc_put_att_double) INTERCEPT3("nc_get_att_double", libnc_get_att_double) INTERCEPT3("nc_put_att_ushort", libnc_put_att_ushort) INTERCEPT3("nc_get_att_ushort", libnc_get_att_ushort) INTERCEPT3("nc_put_att_uint", libnc_put_att_uint) INTERCEPT3("nc_get_att_uint", libnc_get_att_uint) INTERCEPT3("nc_put_att_longlong", libnc_put_att_longlong) INTERCEPT3("nc_get_att_longlong", libnc_get_att_longlong) INTERCEPT3("nc_put_att_ulonglong", libnc_put_att_ulonglong) INTERCEPT3("nc_get_att_ulonglong", libnc_get_att_ulonglong) INTERCEPT3("nc_def_var", libnc_def_var) INTERCEPT3("nc_inq_var", libnc_inq_var) INTERCEPT3("nc_inq_varid", libnc_inq_varid) INTERCEPT3("nc_inq_varname", libnc_inq_varname) INTERCEPT3("nc_inq_vartype", libnc_inq_vartype) INTERCEPT3("nc_inq_varndims", libnc_inq_varndims) INTERCEPT3("nc_inq_vardimid", libnc_inq_vardimid) INTERCEPT3("nc_inq_varnatts", libnc_inq_varnatts) INTERCEPT3("nc_rename_var", libnc_rename_var) INTERCEPT3("nc_copy_var", libnc_copy_var) INTERCEPT3("nc_put_var1_text", libnc_put_var1_text) INTERCEPT3("nc_get_var1_text", libnc_get_var1_text) INTERCEPT3("nc_put_var1_uchar", libnc_put_var1_uchar) INTERCEPT3("nc_get_var1_uchar", libnc_get_var1_uchar) INTERCEPT3("nc_put_var1_schar", libnc_put_var1_schar) INTERCEPT3("nc_get_var1_schar", libnc_get_var1_schar) INTERCEPT3("nc_put_var1_short", libnc_put_var1_short) INTERCEPT3("nc_get_var1_short", libnc_get_var1_short) INTERCEPT3("nc_put_var1_int", libnc_put_var1_int) INTERCEPT3("nc_get_var1_int", libnc_get_var1_int) INTERCEPT3("nc_put_var1_long", libnc_put_var1_long) INTERCEPT3("nc_get_var1_long", libnc_get_var1_long) INTERCEPT3("nc_put_var1_float", libnc_put_var1_float) INTERCEPT3("nc_get_var1_float", libnc_get_var1_float) INTERCEPT3("nc_put_var1_double", libnc_put_var1_double) INTERCEPT3("nc_get_var1_double", libnc_get_var1_double) INTERCEPT3("nc_put_var1_ushort", libnc_put_var1_ushort) INTERCEPT3("nc_get_var1_ushort", libnc_get_var1_ushort) INTERCEPT3("nc_put_var1_uint", libnc_put_var1_uint) INTERCEPT3("nc_get_var1_uint", libnc_get_var1_uint) INTERCEPT3("nc_put_var1_longlong", libnc_put_var1_longlong) INTERCEPT3("nc_get_var1_longlong", libnc_get_var1_longlong) INTERCEPT3("nc_put_var1_ulonglong", libnc_put_var1_ulonglong) INTERCEPT3("nc_get_var1_ulonglong", libnc_get_var1_ulonglong) INTERCEPT3("nc_put_var1_string", libnc_put_var1_string) INTERCEPT3("nc_get_var1_string", libnc_get_var1_string) INTERCEPT3("nc_put_vara_text", libnc_put_vara_text) INTERCEPT3("nc_get_vara_text", libnc_get_vara_text) INTERCEPT3("nc_put_vara_uchar", libnc_put_vara_uchar) INTERCEPT3("nc_get_vara_uchar", libnc_get_vara_uchar) INTERCEPT3("nc_put_vara_schar", libnc_put_vara_schar) INTERCEPT3("nc_get_vara_schar", libnc_get_vara_schar) INTERCEPT3("nc_put_vara_short", libnc_put_vara_short) INTERCEPT3("nc_get_vara_short", libnc_get_vara_short) INTERCEPT3("nc_put_vara_int", libnc_put_vara_int) INTERCEPT3("nc_get_vara_int", libnc_get_vara_int) INTERCEPT3("nc_put_vara_long", libnc_put_vara_long) INTERCEPT3("nc_get_vara_long", libnc_get_vara_long) INTERCEPT3("nc_put_vara_float", libnc_put_vara_float) INTERCEPT3("nc_get_vara_float", libnc_get_vara_float) INTERCEPT3("nc_put_vara_double", libnc_put_vara_double) INTERCEPT3("nc_get_vara_double", libnc_get_vara_double) INTERCEPT3("nc_put_vara_ushort", libnc_put_vara_ushort) INTERCEPT3("nc_get_vara_ushort", libnc_get_vara_ushort) INTERCEPT3("nc_put_vara_uint", libnc_put_vara_uint) INTERCEPT3("nc_get_vara_uint", libnc_get_vara_uint) INTERCEPT3("nc_put_vara_longlong", libnc_put_vara_longlong) INTERCEPT3("nc_get_vara_longlong", libnc_get_vara_longlong) INTERCEPT3("nc_put_vara_ulonglong", libnc_put_vara_ulonglong) INTERCEPT3("nc_get_vara_ulonglong", libnc_get_vara_ulonglong) INTERCEPT3("nc_put_vara_string", libnc_put_vara_string) INTERCEPT3("nc_get_vara_string", libnc_get_vara_string) INTERCEPT3("nc_put_vars_text", libnc_put_vars_text) INTERCEPT3("nc_get_vars_text", libnc_get_vars_text) INTERCEPT3("nc_put_vars_uchar", libnc_put_vars_uchar) INTERCEPT3("nc_get_vars_uchar", libnc_get_vars_uchar) INTERCEPT3("nc_put_vars_schar", libnc_put_vars_schar) INTERCEPT3("nc_get_vars_schar", libnc_get_vars_schar) INTERCEPT3("nc_put_vars_short", libnc_put_vars_short) INTERCEPT3("nc_get_vars_short", libnc_get_vars_short) INTERCEPT3("nc_put_vars_int", libnc_put_vars_int) INTERCEPT3("nc_get_vars_int", libnc_get_vars_int) INTERCEPT3("nc_put_vars_long", libnc_put_vars_long) INTERCEPT3("nc_get_vars_long", libnc_get_vars_long) INTERCEPT3("nc_put_vars_float", libnc_put_vars_float) INTERCEPT3("nc_get_vars_float", libnc_get_vars_float) INTERCEPT3("nc_put_vars_double", libnc_put_vars_double) INTERCEPT3("nc_get_vars_double", libnc_get_vars_double) INTERCEPT3("nc_put_vars_ushort", libnc_put_vars_ushort) INTERCEPT3("nc_get_vars_ushort", libnc_get_vars_ushort) INTERCEPT3("nc_put_vars_uint", libnc_put_vars_uint) INTERCEPT3("nc_get_vars_uint", libnc_get_vars_uint) INTERCEPT3("nc_put_vars_longlong", libnc_put_vars_longlong) INTERCEPT3("nc_get_vars_longlong", libnc_get_vars_longlong) INTERCEPT3("nc_put_vars_ulonglong", libnc_put_vars_ulonglong) INTERCEPT3("nc_get_vars_ulonglong", libnc_get_vars_ulonglong) INTERCEPT3("nc_put_vars_string", libnc_put_vars_string) INTERCEPT3("nc_get_vars_string", libnc_get_vars_string) INTERCEPT3("nc_put_varm_text", libnc_put_varm_text) INTERCEPT3("nc_get_varm_text", libnc_get_varm_text) INTERCEPT3("nc_put_varm_uchar", libnc_put_varm_uchar) INTERCEPT3("nc_get_varm_uchar", libnc_get_varm_uchar) INTERCEPT3("nc_put_varm_schar", libnc_put_varm_schar) INTERCEPT3("nc_get_varm_schar", libnc_get_varm_schar) INTERCEPT3("nc_put_varm_short", libnc_put_varm_short) INTERCEPT3("nc_get_varm_short", libnc_get_varm_short) INTERCEPT3("nc_put_varm_int", libnc_put_varm_int) INTERCEPT3("nc_get_varm_int", libnc_get_varm_int) INTERCEPT3("nc_put_varm_long", libnc_put_varm_long) INTERCEPT3("nc_get_varm_long", libnc_get_varm_long) INTERCEPT3("nc_put_varm_float", libnc_put_varm_float) INTERCEPT3("nc_get_varm_float", libnc_get_varm_float) INTERCEPT3("nc_put_varm_double", libnc_put_varm_double) INTERCEPT3("nc_get_varm_double", libnc_get_varm_double) INTERCEPT3("nc_put_varm_ushort", libnc_put_varm_ushort) INTERCEPT3("nc_get_varm_ushort", libnc_get_varm_ushort) INTERCEPT3("nc_put_varm_uint", libnc_put_varm_uint) INTERCEPT3("nc_get_varm_uint", libnc_get_varm_uint) INTERCEPT3("nc_put_varm_longlong", libnc_put_varm_longlong) INTERCEPT3("nc_get_varm_longlong", libnc_get_varm_longlong) INTERCEPT3("nc_put_varm_ulonglong", libnc_put_varm_ulonglong) INTERCEPT3("nc_get_varm_ulonglong", libnc_get_varm_ulonglong) INTERCEPT3("nc_put_varm_string", libnc_put_varm_string) INTERCEPT3("nc_get_varm_string", libnc_get_varm_string) INTERCEPT3("nc_put_var_text", libnc_put_var_text) INTERCEPT3("nc_get_var_text", libnc_get_var_text) INTERCEPT3("nc_put_var_uchar", libnc_put_var_uchar) INTERCEPT3("nc_get_var_uchar", libnc_get_var_uchar) INTERCEPT3("nc_put_var_schar", libnc_put_var_schar) INTERCEPT3("nc_get_var_schar", libnc_get_var_schar) INTERCEPT3("nc_put_var_short", libnc_put_var_short) INTERCEPT3("nc_get_var_short", libnc_get_var_short) INTERCEPT3("nc_put_var_int", libnc_put_var_int) INTERCEPT3("nc_get_var_int", libnc_get_var_int) INTERCEPT3("nc_put_var_long", libnc_put_var_long) INTERCEPT3("nc_get_var_long", libnc_get_var_long) INTERCEPT3("nc_put_var_float", libnc_put_var_float) INTERCEPT3("nc_get_var_float", libnc_get_var_float) INTERCEPT3("nc_put_var_double", libnc_put_var_double) INTERCEPT3("nc_get_var_double", libnc_get_var_double) INTERCEPT3("nc_put_var_ushort", libnc_put_var_ushort) INTERCEPT3("nc_get_var_ushort", libnc_get_var_ushort) INTERCEPT3("nc_put_var_uint", libnc_put_var_uint) INTERCEPT3("nc_get_var_uint", libnc_get_var_uint) INTERCEPT3("nc_put_var_longlong", libnc_put_var_longlong) INTERCEPT3("nc_get_var_longlong", libnc_get_var_longlong) INTERCEPT3("nc_put_var_ulonglong", libnc_put_var_ulonglong) INTERCEPT3("nc_get_var_ulonglong", libnc_get_var_ulonglong) INTERCEPT3("nc_put_var_string", libnc_put_var_string) INTERCEPT3("nc_get_var_string", libnc_get_var_string) INTERCEPT3("nc_reclaim_data", libnc_reclaim_data) INTERCEPT3("nc_reclaim_data_all", libnc_reclaim_data_all) INTERCEPT3("nc_copy_data", libnc_copy_data) INTERCEPT3("nc_copy_data_all", libnc_copy_data_all) INTERCEPT3("nc_dump_data", libnc_dump_data) INTERCEPT3("nc_put_att_ubyte", libnc_put_att_ubyte) INTERCEPT3("nc_get_att_ubyte", libnc_get_att_ubyte) INTERCEPT3("nc_put_var1_ubyte", libnc_put_var1_ubyte) INTERCEPT3("nc_get_var1_ubyte", libnc_get_var1_ubyte) INTERCEPT3("nc_put_vara_ubyte", libnc_put_vara_ubyte) INTERCEPT3("nc_get_vara_ubyte", libnc_get_vara_ubyte) INTERCEPT3("nc_put_vars_ubyte", libnc_put_vars_ubyte) INTERCEPT3("nc_get_vars_ubyte", libnc_get_vars_ubyte) INTERCEPT3("nc_put_varm_ubyte", libnc_put_varm_ubyte) INTERCEPT3("nc_get_varm_ubyte", libnc_get_varm_ubyte) INTERCEPT3("nc_put_var_ubyte", libnc_put_var_ubyte) INTERCEPT3("nc_get_var_ubyte", libnc_get_var_ubyte) INTERCEPT3("nc_set_log_level", libnc_set_log_level) INTERCEPT3("nc_show_metadata", libnc_show_metadata) INTERCEPT3("nc_delete", libnc_delete) INTERCEPT3("nc__create_mp", libnc__create_mp) INTERCEPT3("nc__open_mp", libnc__open_mp) INTERCEPT3("nc_delete_mp", libnc_delete_mp) INTERCEPT3("nc_set_base_pe", libnc_set_base_pe) INTERCEPT3("nc_inq_base_pe", libnc_inq_base_pe) INTERCEPT3("nctypelen", libnctypelen) INTERCEPT3("nccreate", libnccreate) INTERCEPT3("ncopen", libncopen) INTERCEPT3("ncsetfill", libncsetfill) INTERCEPT3("ncredef", libncredef) INTERCEPT3("ncendef", libncendef) INTERCEPT3("ncsync", libncsync) INTERCEPT3("ncabort", libncabort) INTERCEPT3("ncclose", libncclose) INTERCEPT3("ncinquire", libncinquire) INTERCEPT3("ncdimdef", libncdimdef) INTERCEPT3("ncdimid", libncdimid) INTERCEPT3("ncdiminq", libncdiminq) INTERCEPT3("ncdimrename", libncdimrename) INTERCEPT3("ncattput", libncattput) INTERCEPT3("ncattinq", libncattinq) INTERCEPT3("ncattget", libncattget) INTERCEPT3("ncattcopy", libncattcopy) INTERCEPT3("ncattname", libncattname) INTERCEPT3("ncattrename", libncattrename) INTERCEPT3("ncattdel", libncattdel) INTERCEPT3("ncvardef", libncvardef) INTERCEPT3("ncvarid", libncvarid) INTERCEPT3("ncvarinq", libncvarinq) INTERCEPT3("ncvarput1", libncvarput1) INTERCEPT3("ncvarget1", libncvarget1) INTERCEPT3("ncvarput", libncvarput) INTERCEPT3("ncvarget", libncvarget) INTERCEPT3("ncvarputs", libncvarputs) INTERCEPT3("ncvargets", libncvargets) INTERCEPT3("ncvarputg", libncvarputg) INTERCEPT3("ncvargetg", libncvargetg) INTERCEPT3("ncvarrename", libncvarrename) INTERCEPT3("ncrecinq", libncrecinq) INTERCEPT3("ncrecget", libncrecget) INTERCEPT3("ncrecput", libncrecput) INTERCEPT3("nc_initialize", libnc_initialize) INTERCEPT3("nc_finalize", libnc_finalize) INTERCEPT3("nc_rc_set", libnc_rc_set) PPTRACE_END_INTERCEPT_FUNCTIONS(netcdf) static void init_netcdf() { INSTRUMENT_FUNCTIONS(netcdf); if (eztrace_autostart_enabled()) eztrace_start(); _netcdf_initialized = 1; } static void finalize_netcdf() { _netcdf_initialized = 0; eztrace_stop(); } static void _netcdf_init(void) __attribute__((constructor)); static void _netcdf_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_netcdf constructor starts\n"); EZT_REGISTER_MODULE(netcdf, "Module for the netcdf library", init_netcdf, finalize_netcdf); eztrace_log(dbg_lvl_debug, "eztrace_netcdf constructor ends\n"); } eztrace-2.1/src/modules/omp/000077500000000000000000000000001447213526500160545ustar00rootroot00000000000000eztrace-2.1/src/modules/omp/CMakeLists.txt000066400000000000000000000024341447213526500206170ustar00rootroot00000000000000 add_library(eztpomp SHARED pomp-lib-dummy/pomp2_fwrapper.c pomp-lib-dummy/pomp2_fwrapper_base.c pomp-lib-dummy/pomp2_fwrapper_base.h pomp-lib-dummy/pomp2_lib.c pomp-lib-dummy/pomp2_lib.h pomp-lib-dummy/pomp2_region_info.c pomp-lib-dummy/pomp2_region_info.h ) target_include_directories(eztpomp PUBLIC pomp-lib-dummy ) target_compile_options(eztpomp PRIVATE -Wall -Wextra -DOPENMP_FOUND ${OpenMP_C_FLAGS} ) target_link_libraries(eztpomp PRIVATE eztrace-core ) target_compile_options(eztpomp PRIVATE -Wall -Wextra -DOPENMP_FOUND ${OpenMP_C_FLAGS} ) #--------------------------------------------- # Create : libeztrace-omp.so add_library(eztrace-openmp SHARED gomp.c ) target_link_libraries(eztrace-openmp PRIVATE atomic dl eztrace-core eztrace-instrumentation eztrace-lib gomp ) target_compile_options(eztrace-openmp PRIVATE -Wall -Wextra -DOPENMP_FOUND ${OpenMP_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments ) set(EZTRACE_CC_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin/eztrace_cc) configure_file (eztrace_cc.in ${EZTRACE_CC_PATH} @ONLY) install(TARGETS eztpomp eztrace-openmp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(PROGRAMS ${EZTRACE_CC_PATH} DESTINATION ${CMAKE_INSTALL_BINDIR}) eztrace-2.1/src/modules/omp/eztrace_cc.in000077500000000000000000000054151447213526500205160ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. # usage: eztrace_cc gcc -o foo foo.c -I/usr/include/bar -L/lib/bar -lbar prefix=@prefix@ exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include bindir=${exec_prefix}/bin OPARI=@OPARI2@ OPARI_CFLAGS=$(@OPARI2_CONFIG@ --cflags) CFLAGS="-I${includedir} $OPARI_CFLAGS" LDFLAGS="-leztpomp -L${libdir} -Wl,-rpath=${libdir}" debug=n usage() { cat << EOF usage: $0 options OPTIONS: -? Show this message -d Enable debug mode EOF } while getopts 'd' OPTION; do case $OPTION in d) echo "[eztrace_cc] Debug mode is ON" debug=y ;; ?) usage exit 2 ;; esac done # remove the options from the command line shift $(($OPTIND - 1)) if [ $# -lt 1 ]; then usage exit 2 fi cc_cmd=$@ tmpdir=`mktemp -d` instrumentFile() { param=$1 new_file_name=$2 # copy the file to tmpdir and instrument it param_base=`basename $param` param_dir=`dirname $param` ${OPARI} --nosrc --omp-task-untied=keep --omp-task-untied=no-warn ${param} $new_file_name res_grep=`echo "$cc_cmd" |grep -- "-c" ` if [ "x$res_grep" != "x" ]; then res_grep=`echo "$cc_cmd" |grep -- "-o" ` if [ "x$res_grep" = "x" ]; then # there is no -o in the compilation line # we need to add -o param.o # otherwise the generated file would be tmp.xxxx.o instead of param.o doto_file=`echo "$param_base" |sed 's/\.[c|f|F]$/\.o/' |sed 's/\.f90$/\.o/'` cc_cmd="$cc_cmd -o $doto_file" fi fi cc_cmd=`echo $cc_cmd -I$param_dir | sed "s@$param\s@$new_file_name @"` } cleanup_cmd="rm -rf opari.rc $tmpdir" for param in $@ ; do case $param in *.c ) #new_file_name=`mktemp --suffix=.c --tmpdir=$tmpdir 2>/dev/null` new_file_name=$tmpdir/$(basename $param) # if [ $? -ne 0 ]; then # new_file_name=`mktemp -p $tmpdir`.c # fi instrumentFile $param $new_file_name ;; *.f ) new_file_name=`mktemp --suffix=.f --tmpdir=$tmpdir 2>/dev/null` if [ $? -ne 0 ]; then new_file_name=`mktemp -p $tmpdir`.f fi instrumentFile $param $new_file_name ;; *.F ) new_file_name=`mktemp --suffix=.F --tmpdir=$tmpdir 2>/dev/null` if [ $? -ne 0 ]; then new_file_name=`mktemp -p $tmpdir`.F fi instrumentFile $param $new_file_name ;; *.f90 ) new_file_name=`mktemp --suffix=.f90 --tmpdir=$PWD 2>/dev/null` if [ $? -ne 0 ]; then new_file_name=`mktemp -p $tmpdir`.f90 fi instrumentFile $param $new_file_name ;; esac done cc_cmd="$cc_cmd $CFLAGS $LDFLAGS" echo "[eztrace_cc] Running: $cc_cmd" $cc_cmd if [ "$debug" != "y" ]; then $cleanup_cmd else echo "[eztrace_cc] Temporary files are kept in ${tmpdir}" fi eztrace-2.1/src/modules/omp/gomp.c000066400000000000000000001124321447213526500171650ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "pomp-lib-dummy/pomp2_lib.h" #include #include #include #include #include #include #include #include #include #include #include #define CURRENT_MODULE openmp DECLARE_CURRENT_MODULE; static int _openmp_initialized = 0; /* if found, the application has been instrumented with opari, so we can record detail events * such as parallel for loops, etc. * if not found, we only instrument calls to the GNU OpenMP API (eg. parallel section) */ static int pomp2_found = 0; //#define GOMP_RECORD if (!pomp2_found) // todo: add hooks for // OMP_Barrier // OMP_critical ? int openmp_parallel_id = -1; int openmp_for_id = -1; int openmp_section_id = -1; int openmp_workshare_id = -1; int openmp_ordered_id = -1; int openmp_implicit_barrier_id = -1; int openmp_barrier_id = -1; int openmp_critical_id = -1; int openmp_task_create_id = -1; int openmp_task_run_id = -1; int openmp_untied_task_create_id = -1; int openmp_untied_task_run_id = -1; int openmp_taskwait_id = -1; int openmp_setlock_id = -1; int openmp_unsetlock_id = -1; int openmp_testlock_id = -1; int openmp_setnestlock_id = -1; int openmp_unsetnestlock_id = -1; int openmp_testnestlock_id = -1; static void openmp_register_functions(); struct ezt_hashtable lock_map; typedef int EZT_Region_handle; typedef struct { int creating_thread; // the thread who created the task int generation_number; // thread-private generation number of task's creating thread } EZT_Task_handle; /* TODO: does it work with nested parallelism ? */ /* each thread has its own counter */ static __thread EZT_Region_handle _next_section_id = -1; static EZT_Region_handle _get_next_section_id() { // /* make sure that the counters of each thread do not collide */ // if (_next_section_id < 0) { // /* EZT_Region_handle is an int, this will work for: // * - ~ 2^11 threads // * - ~ 2^20 parallel region created by a thread // */ // _next_section_id = omp_get_thread_num() << 20; // } // _next_section_id = ezt_otf2_register_thread_team(); return _next_section_id++; } #define OMP_ENTER(event_id) do { \ if(event_id<0) { \ openmp_register_functions(); \ eztrace_assert(event_id >= 0); \ } \ EZTRACE_SHOULD_TRACE(OTF2_EvtWriter_Enter(evt_writer, \ NULL, \ ezt_get_timestamp(), \ event_id)); \ }while(0) #define OMP_LEAVE(event_id) do { \ if(event_id<0) { \ openmp_register_functions(); \ eztrace_assert(event_id >= 0); \ } \ EZTRACE_SHOULD_TRACE(OTF2_EvtWriter_Leave(evt_writer, \ NULL, \ ezt_get_timestamp(), \ event_id)); \ }while(0) /* event issued by the master thread before #pragma omp parallel */ void openmp_parallel_fork_generic(POMP2_Region_handle* pomp2_handle, int num_threads) { EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; *ezt_handle = ezt_otf2_register_thread_team("OpenMP Thread Team", num_threads); if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadFork( evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, num_threads); eztrace_assert(err == OTF2_SUCCESS); } } /* event issued by the master thread after a #pragma omp parallel block */ void openmp_parallel_join_generic() { if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadJoin( evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP); eztrace_assert(err == OTF2_SUCCESS); } } /* event issued by each thread of an OpenMP team at the beginning of a #pragma omp parallel block */ void openmp_parallel_begin_generic(POMP2_Region_handle* pomp2_handle) { if(thread_status == ezt_trace_status_uninitialized) { /* this is a newly created thread */ ezt_init_thread(); } int nb_threads = omp_get_num_threads(); int my_id = omp_get_thread_num(); EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; int thread_team = *ezt_handle; ezt_otf2_register_thread_team_member(thread_team, my_id, nb_threads); if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadTeamBegin(evt_writer, NULL, ezt_get_timestamp(), thread_team); eztrace_assert(err == OTF2_SUCCESS); OMP_ENTER(openmp_parallel_id); } } /* event issued by each thread of an OpenMP team at the end of a #pragma omp parallel block */ void openmp_parallel_end_generic(POMP2_Region_handle* pomp2_handle) { EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; int thread_team = *ezt_handle; if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadTeamEnd(evt_writer, NULL, ezt_get_timestamp(), thread_team); eztrace_assert(err == OTF2_SUCCESS); OMP_LEAVE(openmp_parallel_id); } } void (*libGOMP_parallel_loop_static_start)(void (*)(void*), void*, unsigned, long, long, long, long); void (*libGOMP_parallel_loop_runtime_start)(void (*)(void*), void*, unsigned, long, long, long, long); void (*libGOMP_parallel_loop_dynamic_start)(void (*)(void*), void*, unsigned, long, long, long, long); void (*libGOMP_parallel_loop_guided_start)(void (*)(void*), void*, unsigned, long, long, long, long); void (*libGOMP_parallel_start)(void (*fn)(void*), void* data, unsigned num_threads); void (*libGOMP_parallel_end)(); void (*libGOMP_parallel)(void (*fn)(void*), void* data, unsigned num_threads, unsigned int flags); void (*libGOMP_critical_start)(void); void (*libGOMP_critical_end)(void); /* these function are only available in GOMP 4 */ void (*libGOMP_parallel_loop_static)(void (*)(void*), void*, unsigned, long, long, long, long, unsigned); void (*libGOMP_parallel_loop_dynamic)(void (*)(void*), void*, unsigned, long, long, long, long, unsigned); void (*libGOMP_parallel_loop_guided)(void (*)(void*), void*, unsigned, long, long, long, long, unsigned); void (*libGOMP_parallel_loop_runtime)(void (*)(void*), void*, unsigned, long, long, long, unsigned); struct gomp_arg_t { void (*func)(void*); void* data; EZT_Region_handle id; }; /* Function called by GOMP_parallel_start for each thread */ void gomp_new_thread(void* arg) { // FUNCTION_ENTRY; struct gomp_arg_t* _arg = (struct gomp_arg_t*)arg; void (*func)(void*) = _arg->func; void* data = _arg->data; EZT_Region_handle section_id = _arg->id; POMP2_Region_handle *pomp2_section_id = (POMP2_Region_handle *)§ion_id; if(!pomp2_found) openmp_parallel_begin_generic(pomp2_section_id); func(data); if(!pomp2_found) openmp_parallel_end_generic(pomp2_section_id); return; } /* generic implementation of parallel loop */ #define GOMP_PARALLEL_LOOP_GENERIC(fn, data, varname, gomp_func, section_id) \ { \ EZTRACE_PROTECT_ON(); \ /* Since the runtime functions provide more information, let's use it instead of the compiler functions */ \ /* call unprotected function 'cause the block is protected */ \ struct gomp_arg_t* varname = (struct gomp_arg_t*)malloc(sizeof(struct gomp_arg_t)); \ varname->func = fn; \ varname->data = data; \ varname->id = section_id; \ EZTRACE_PROTECT_OFF(); \ gomp_func; \ } #define GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, varname, gomp_func) \ { \ EZT_Region_handle section_id = -1; \ POMP2_Region_handle *pomp2_section_id = (POMP2_Region_handle *)§ion_id; \ if(!pomp2_found) { \ /* the application was not instrumented, so we need to record events when intercepting the libGOMP API */ \ openmp_parallel_fork_generic(pomp2_section_id, num_threads); \ } \ GOMP_PARALLEL_LOOP_GENERIC(fn, data, varname, gomp_func, section_id); \ } /* generic implementation of parallel loop */ #define GOMP3_PARALLEL_LOOP_GENERIC(fn, data, varname, gomp_func) \ { \ OMP_ENTER(openmp_parallel_id); \ EZT_Region_handle section_id = _get_next_section_id(); \ GOMP_PARALLEL_LOOP_GENERIC(fn, data, varname, gomp_func, section_id); \ return; \ } /* should be called when reaching #pragma omp parallel for schedule(static) * However, this function doesn't seem to be called. Let's implement it just in case. */ void GOMP_parallel_loop_static_start(void (*fn)(void*), void* data, unsigned num_threads, long a1, long a2, long a3, long a4) { GOMP3_PARALLEL_LOOP_GENERIC(fn, data, arg, libGOMP_parallel_loop_static_start(gomp_new_thread, arg, num_threads, a1, a2, a3, a4)); } /* Function called when reaching #pragma omp parallel for schedule(runtime) */ void GOMP_parallel_loop_runtime_start(void (*fn)(void*), void* data, unsigned num_threads, long a1, long a2, long a3, long a4) { GOMP3_PARALLEL_LOOP_GENERIC(fn, data, arg, libGOMP_parallel_loop_runtime_start(gomp_new_thread, arg, num_threads, a1, a2, a3, a4)); } /* Function called when reaching #pragma omp parallel for schedule(dynamic) */ void GOMP_parallel_loop_dynamic_start(void (*fn)(void*), void* data, unsigned num_threads, long a1, long a2, long a3, long a4) { GOMP3_PARALLEL_LOOP_GENERIC(fn, data, arg, libGOMP_parallel_loop_dynamic_start(gomp_new_thread, arg, num_threads, a1, a2, a3, a4)); } /* Function called when reaching #pragma omp parallel for schedule(guided) */ void GOMP_parallel_loop_guided_start(void (*fn)(void*), void* data, unsigned num_threads, long a1, long a2, long a3, long a4) { GOMP3_PARALLEL_LOOP_GENERIC(fn, data, arg, libGOMP_parallel_loop_guided_start(gomp_new_thread, arg, num_threads, a1, a2, a3, a4)); } void GOMP_parallel_loop_static(void (*fn)(void*), void* data, unsigned num_threads, long start, long end, long incr, long chunk_size, unsigned flags) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel_loop_static(gomp_new_thread, arg, num_threads, start, end, incr, chunk_size, flags)); } void GOMP_parallel_loop_dynamic(void (*fn)(void*), void* data, unsigned num_threads, long start, long end, long incr, long chunk_size, unsigned flags) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel_loop_dynamic(gomp_new_thread, arg, num_threads, start, end, incr, chunk_size, flags)); } void GOMP_parallel_loop_guided(void (*fn)(void*), void* data, unsigned num_threads, long start, long end, long incr, long chunk_size, unsigned flags) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel_loop_guided(gomp_new_thread, arg, num_threads, start, end, incr, chunk_size, flags)); } void GOMP_parallel_loop_runtime(void (*fn)(void*), void* data, unsigned num_threads, long start, long end, long incr, unsigned flags) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel_loop_runtime(gomp_new_thread, arg, num_threads, start, end, incr, flags)); } // Called by the main thread (ie. only once) during #pragma omp parallel // (fork) void GOMP_parallel_start(void (*fn)(void*), void* data, unsigned num_threads) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel_start(gomp_new_thread, arg, num_threads)); } /* in recent versions of libgomp, both the beginning and the end of a parallel region are * processed by GOMP_parallel */ void GOMP_parallel (void (*fn) (void *), void *data, unsigned num_threads, unsigned int flags) { GOMP4_PARALLEL_LOOP_GENERIC(fn, data, num_threads, arg, libGOMP_parallel(gomp_new_thread, arg, num_threads, flags)); if(!pomp2_found) openmp_parallel_join_generic(); } // Called at the end of a parallel section (~ join) void GOMP_parallel_end() { /* Since the runtime functions provide more information, let's use it instead of the compiler functions */ libGOMP_parallel_end(); if(!pomp2_found) openmp_parallel_join_generic(); OMP_LEAVE(openmp_parallel_id); \ } void GOMP_critical_start() { OMP_ENTER(openmp_critical_id); libGOMP_critical_start(); } void GOMP_critical_end() { libGOMP_critical_end(); OMP_LEAVE(openmp_critical_id); } /* beginning of pomp2 internals */ void POMP2_Finalize() { } void POMP2_Init() { /* todo: initialize stuff ? */ } void POMP2_Off() { /* todo: stop recording events ? */ } void POMP2_On() { /* todo: initialize stuff ? */ } void POMP2_Begin(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { /** Called at the begin of a user defined POMP2 region. @param pomp2_handle The handle of the started region. */ } void POMP2_End(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Assign_handle( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { /** Registers a POMP2 region and returns a region handle. @param pomp2_handle Returns the handle for the newly registered region. @param ctc_string A string containing the region data. */ } /* end of pomp2 internals */ void POMP2_Atomic_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { /** Called before an atomic statement. @param pomp2_handle The handle of the started region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ } void POMP2_Atomic_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Implicit_barrier_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused))) { /** Called before an implicit barrier. \e OpenMP \e 3.0: Barriers can be used as scheduling points for tasks. When entering a barrier the task id of the currently executing task (\e pomp2_current_task) is saved in \e pomp2_old_task, which is defined inside the instrumented user code. @param pomp2_handle The handle of the started region. @param pomp2_old_task Pointer to a "taskprivate" variable where the current task id is stored. */ OMP_ENTER(openmp_implicit_barrier_id); } extern void POMP2_Implicit_barrier_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { OMP_LEAVE(openmp_implicit_barrier_id); } void POMP2_Barrier_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_barrier_id); } void POMP2_Barrier_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { OMP_LEAVE(openmp_barrier_id); } void POMP2_Flush_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_FLUSH_ENTER); } void POMP2_Flush_exit(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_FLUSH_EXIT); } void POMP2_Critical_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_CRITICAL_BEGIN); } void POMP2_Critical_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_CRITICAL_END); } void POMP2_Critical_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_CRITICAL_ENTER); } void POMP2_Critical_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_CRITICAL_EXIT); } void POMP2_Master_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_MASTER_BEGIN); } void POMP2_Master_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { // FUNCTION_ENTRY; //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_MASTER_END); } /* event issued by the master thread before #pragma omp parallel */ void POMP2_Parallel_fork(POMP2_Region_handle* pomp2_handle, int if_clause __attribute__((unused)), int num_threads, POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { openmp_parallel_fork_generic(pomp2_handle, num_threads); } /* event issued by the master thread after a #pragma omp parallel block */ void POMP2_Parallel_join(POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { openmp_parallel_join_generic(); } /* event issued by each thread of an OpenMP team at the beginning of a #pragma omp parallel block */ void POMP2_Parallel_begin(POMP2_Region_handle* pomp2_handle) { openmp_parallel_begin_generic(pomp2_handle); } /* event issued by each thread of an OpenMP team at the end of a #pragma omp parallel block */ void POMP2_Parallel_end(POMP2_Region_handle* pomp2_handle) { openmp_parallel_end_generic(pomp2_handle); } /* event issued by each thread at the beginnig of a #pragma omp for loop */ void POMP2_For_enter(POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_for_id); } void POMP2_For_exit(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { OMP_LEAVE(openmp_for_id); } void POMP2_Section_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Section_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Sections_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_section_id); } void POMP2_Sections_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { OMP_LEAVE(openmp_section_id); } void POMP2_Single_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Single_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Single_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_section_id); } void POMP2_Single_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { OMP_LEAVE(openmp_section_id); } void POMP2_Workshare_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_workshare_id); } void POMP2_Workshare_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { OMP_LEAVE(openmp_workshare_id); } void POMP2_Ordered_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { /** Called at the start of an ordered region. @param pomp2_handle The handle of the region. */ // FUNCTION_ENTRY; // todo : //EZTRACE_EVENT_PACKED_0(EZTRACE_POMP2_ORDERED_BEGIN); } void POMP2_Ordered_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { /* todo: implement that */ } void POMP2_Ordered_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_ordered_id); } void POMP2_Ordered_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { OMP_LEAVE(openmp_ordered_id); } static _Thread_local EZT_Task_handle task_handle = {.creating_thread = -1, .generation_number = -1}; #define DEFAULT_STACK_SIZE 1024 struct _ezt_task_stack { EZT_Task_handle *stack; int alloc_size; // number of allocated spots int index; // index of the next empty spot in the stack }; static _Thread_local struct _ezt_task_stack _task_stack = { .stack = NULL, .alloc_size = 0, .index = 0}; void task_stack_push(EZT_Task_handle *t) { while(_task_stack.index >= _task_stack.alloc_size) { /* stack is full. Allocate more spots */ int new_size = _task_stack.alloc_size ? _task_stack.alloc_size * 2 : DEFAULT_STACK_SIZE; void* ptr = realloc(_task_stack.stack, new_size * sizeof(EZT_Task_handle)); if(!ptr) { eztrace_error("Cannot allocated memory\n"); } _task_stack.stack = ptr; _task_stack.alloc_size = new_size; } memcpy(&_task_stack.stack[_task_stack.index], t, sizeof(EZT_Task_handle)); _task_stack.index++; } void task_stack_pop() { eztrace_assert(_task_stack.index > 0); //#if DEBUG #if 1 memset(&_task_stack.stack[_task_stack.index-1], -1, sizeof(EZT_Task_handle)); #endif _task_stack.index--; } int task_stack_size() { return _task_stack.index; } EZT_Task_handle * task_stack_top() { if(task_stack_size() > 0) return &_task_stack.stack[_task_stack.index-1]; return NULL; } void _ezt_task_create(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task __attribute__((unused)), int pomp2_if __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { /* we could use pomp2_new_task to store the task id, but this would require a mutex * (or at least an atomic increment primitive) that would kill the performance. * In order to keep the overhead as low as possible, let's only record the event. */ if(EZTRACE_SAFE) { EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; int thread_team = *ezt_handle; EZT_Task_handle *ezt_new_task = (EZT_Task_handle *) pomp2_new_task; if(task_handle.generation_number < 0) { task_handle.creating_thread = otf2_thread_id; task_handle.generation_number = 0; } memcpy(ezt_new_task, &task_handle, sizeof(task_handle)); task_handle.generation_number++; OTF2_ErrorCode err = OTF2_EvtWriter_ThreadTaskCreate(evt_writer, NULL, ezt_get_timestamp(), thread_team, otf2_thread_id, ezt_new_task->generation_number); eztrace_assert(err == OTF2_SUCCESS); } } void _ezt_task_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_task) { EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; int thread_team = *ezt_handle; if(EZTRACE_SAFE) { EZT_Task_handle *task_handle = (EZT_Task_handle *)&pomp2_task; task_stack_push(task_handle); OTF2_ErrorCode err = OTF2_EvtWriter_ThreadTaskSwitch(evt_writer, NULL, ezt_get_timestamp(), thread_team, task_handle->creating_thread, task_handle->generation_number); eztrace_assert(err == OTF2_SUCCESS); } } void ezt_task_end(POMP2_Region_handle* pomp2_handle) { EZT_Region_handle *ezt_handle = (EZT_Region_handle*)pomp2_handle; int thread_team = *ezt_handle; if(EZTRACE_SAFE) { EZT_Task_handle *current_omp_task = task_stack_top(); eztrace_assert(current_omp_task); eztrace_assert(current_omp_task->creating_thread >= 0); eztrace_assert(current_omp_task->generation_number >= 0); OTF2_ErrorCode err = OTF2_EvtWriter_ThreadTaskComplete(evt_writer, NULL, ezt_get_timestamp(), thread_team, current_omp_task->creating_thread, current_omp_task->generation_number); eztrace_assert(err == OTF2_SUCCESS); #if DEBUG current_omp_task->creating_thread = -1; current_omp_task->generation_number = -1; #endif task_stack_pop(); } } /** \e OpenMP \e 3.0: When a task encounters a task construct it creates a new task. The task may be scheduled for later execution or executed immediately. In both cases the pomp-adapter assigns the id of the currently active task to \e pomp2_old_task which is defined in the instrumented user code. @param pomp2_handle The handle of the region. @param pomp2_old_task Pointer to the task id in the instrumented user code @param pomp2_if If an if clause is present on the task directive this variable holds the evaluated result of the argument of the if clause. Else it is 1. @param ctc_string The initialization string. */ void POMP2_Task_create_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task, int pomp2_if, const char ctc_string[]) { _ezt_task_create(pomp2_handle, pomp2_new_task, pomp2_old_task, pomp2_if, ctc_string); OMP_ENTER(openmp_task_create_id); } void POMP2_Task_create_end( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { OMP_LEAVE(openmp_task_create_id); } void POMP2_Task_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_task) { OMP_ENTER(openmp_task_run_id); _ezt_task_begin(pomp2_handle, pomp2_task); } void POMP2_Task_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { ezt_task_end(pomp2_handle); OMP_LEAVE(openmp_task_run_id); } void POMP2_Untied_task_create_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task __attribute__((unused)), int pomp2_if __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { _ezt_task_create(pomp2_handle, pomp2_new_task, pomp2_old_task, pomp2_if, ctc_string); OMP_ENTER(openmp_untied_task_create_id); } void POMP2_Untied_task_create_end(POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { OMP_LEAVE(openmp_untied_task_create_id); } void POMP2_Untied_task_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_task) { OMP_ENTER(openmp_untied_task_run_id); _ezt_task_begin(pomp2_handle, pomp2_task); } void POMP2_Untied_task_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { ezt_task_end(pomp2_handle); OMP_LEAVE(openmp_untied_task_run_id); } void POMP2_Taskwait_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { OMP_ENTER(openmp_taskwait_id); } void POMP2_Taskwait_end( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_task __attribute__((unused))) { OMP_LEAVE(openmp_taskwait_id); } #ifdef OPENMP_FOUND static _Atomic uint32_t next_lock_id=0; struct ezt_omp_lock_info { uint32_t acquisition_order; uint32_t lock_id; uint32_t nested_lock_count; omp_lock_t* addr; }; void POMP2_Init_lock(omp_lock_t* s) { omp_init_lock(s); struct ezt_omp_lock_info* l = malloc(sizeof(struct ezt_omp_lock_info)); l->acquisition_order = 0; l->lock_id = next_lock_id ++; l->nested_lock_count = 0; l->addr = s; ezt_hashtable_insert(&lock_map, hash_function_ptr(s), (void*)l); eztrace_assert(ezt_hashtable_get(&lock_map, hash_function_ptr(s)) == l); } void POMP2_Destroy_lock(omp_lock_t* s) { ezt_hashtable_remove(&lock_map, hash_function_ptr(s)); omp_destroy_lock(s); } void POMP2_Set_lock(omp_lock_t* s) { OMP_ENTER(openmp_setlock_id); omp_set_lock(s); if(EZTRACE_SAFE) { struct ezt_omp_lock_info* l = ezt_hashtable_get(&lock_map, hash_function_ptr(s)); eztrace_assert(l); l->nested_lock_count = 1; l->acquisition_order++; OTF2_ErrorCode err = OTF2_EvtWriter_ThreadAcquireLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->lock_id, l->acquisition_order); eztrace_assert(err == OTF2_SUCCESS); } OMP_LEAVE(openmp_setlock_id); } void POMP2_Unset_lock(omp_lock_t* s) { OMP_ENTER(openmp_unsetlock_id); if(EZTRACE_SAFE) { struct ezt_omp_lock_info* l = ezt_hashtable_get(&lock_map, hash_function_ptr(s)); eztrace_assert(l); l->nested_lock_count = 0; OTF2_ErrorCode err = OTF2_EvtWriter_ThreadReleaseLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->lock_id, l->acquisition_order); eztrace_assert(err == OTF2_SUCCESS); } omp_unset_lock(s); OMP_LEAVE(openmp_unsetlock_id); } int POMP2_Test_lock(omp_lock_t* s) { OMP_ENTER(openmp_testlock_id); int ret = omp_test_lock(s); OMP_LEAVE(openmp_testlock_id); return ret; } void POMP2_Init_nest_lock(omp_nest_lock_t* s) { omp_init_nest_lock(s); struct ezt_omp_lock_info* l = malloc(sizeof(struct ezt_omp_lock_info)); l->acquisition_order = 0; l->nested_lock_count = 0; l->lock_id = next_lock_id ++; l->addr = (omp_lock_t*)s; ezt_hashtable_insert(&lock_map, hash_function_ptr(s), (void*)l); eztrace_assert(ezt_hashtable_get(&lock_map, hash_function_ptr(s)) == l); } void POMP2_Destroy_nest_lock(omp_nest_lock_t* s) { ezt_hashtable_remove(&lock_map, hash_function_ptr(s)); omp_destroy_nest_lock(s); } void POMP2_Set_nest_lock(omp_nest_lock_t* s) { OMP_ENTER(openmp_setnestlock_id); omp_set_nest_lock(s); struct ezt_omp_lock_info* l = ezt_hashtable_get(&lock_map, hash_function_ptr(s)); eztrace_assert(l); l->nested_lock_count ++; if(l->nested_lock_count==1) { l->acquisition_order++; if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadAcquireLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->lock_id, l->acquisition_order); eztrace_assert(err == OTF2_SUCCESS); } } OMP_LEAVE(openmp_setnestlock_id); } void POMP2_Unset_nest_lock(omp_nest_lock_t* s) { OMP_ENTER(openmp_unsetnestlock_id); struct ezt_omp_lock_info* l = ezt_hashtable_get(&lock_map, hash_function_ptr(s)); eztrace_assert(l); l->nested_lock_count --; if(l->nested_lock_count == 0) { if(EZTRACE_SAFE) { OTF2_ErrorCode err = OTF2_EvtWriter_ThreadReleaseLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->lock_id, l->acquisition_order); eztrace_assert(err == OTF2_SUCCESS); } } omp_unset_nest_lock(s); OMP_LEAVE(openmp_unsetnestlock_id); } int POMP2_Test_nest_lock(omp_nest_lock_t* s) { OMP_ENTER(openmp_testnestlock_id); int ret = omp_test_nest_lock(s); OMP_LEAVE(openmp_testnestlock_id); return ret; } #endif /* OPENMP_FOUND */ void (*libPOMP2_Finalize)(); PPTRACE_START_INTERCEPT_FUNCTIONS(openmp) INTERCEPT3("GOMP_parallel_start", libGOMP_parallel_start) INTERCEPT3("GOMP_parallel", libGOMP_parallel) INTERCEPT3("GOMP_parallel_end", libGOMP_parallel_end) INTERCEPT3("GOMP_parallel_loop_static_start", libGOMP_parallel_loop_static_start) INTERCEPT3("GOMP_parallel_loop_runtime_start", libGOMP_parallel_loop_runtime_start) INTERCEPT3("GOMP_parallel_loop_dynamic_start", libGOMP_parallel_loop_dynamic_start) INTERCEPT3("GOMP_parallel_loop_guided_start", libGOMP_parallel_loop_guided_start) INTERCEPT3("GOMP_critical_start", libGOMP_critical_start) INTERCEPT3("GOMP_critical_end", libGOMP_critical_end) INTERCEPT3("GOMP_parallel_loop_static", libGOMP_parallel_loop_static) INTERCEPT3("GOMP_parallel_loop_dynamic", libGOMP_parallel_loop_dynamic) INTERCEPT3("GOMP_parallel_loop_guided", libGOMP_parallel_loop_guided) INTERCEPT3("GOMP_parallel_loop_runtime", libGOMP_parallel_loop_runtime) PPTRACE_END_INTERCEPT_FUNCTIONS(openmp) static void openmp_register_functions() { if(openmp_for_id < 0 ) { openmp_for_id = ezt_otf2_register_function("OpenMP For"); openmp_parallel_id = ezt_otf2_register_function("OpenMP Parallel"); openmp_section_id = ezt_otf2_register_function("OpenMP Section"); openmp_workshare_id = ezt_otf2_register_function("OpenMP Workshare"); openmp_ordered_id = ezt_otf2_register_function("OpenMP Ordered"); openmp_critical_id = ezt_otf2_register_function("OpenMP critical"); openmp_implicit_barrier_id = ezt_otf2_register_function("OpenMP implicit barrier"); openmp_barrier_id = ezt_otf2_register_function("OpenMP barrier"); openmp_task_create_id = ezt_otf2_register_function("OpenMP Task create"); openmp_task_run_id = ezt_otf2_register_function("OpenMP Task run"); openmp_untied_task_create_id = ezt_otf2_register_function("OpenMP Untied Task create"); openmp_untied_task_run_id = ezt_otf2_register_function("OpenMP Untied Task run"); openmp_taskwait_id = ezt_otf2_register_function("OpenMP Task wait"); openmp_setlock_id = ezt_otf2_register_function("OpenMP Set Lock"); openmp_unsetlock_id = ezt_otf2_register_function("OpenMP Unset Lock"); openmp_testlock_id = ezt_otf2_register_function("OpenMP Test Lock"); openmp_setnestlock_id = ezt_otf2_register_function("OpenMP Set Nest Lock"); openmp_unsetnestlock_id = ezt_otf2_register_function("OpenMP Unset Nest Lock"); openmp_testnestlock_id = ezt_otf2_register_function("OpenMP Test Nest Lock"); } } void init_openmp() { INSTRUMENT_FUNCTIONS(openmp); /* This symbol is only available if the program was compiled with eztrace_cc. * Use this information as a test and print a warning message. */ void* has_pomp2_finalize = dlsym(RTLD_NEXT, "POMP2_Finalize"); if (has_pomp2_finalize) { eztrace_log(dbg_lvl_normal, "Intercepting all OpenMP constructs\n"); pomp2_found = 1; } else { eztrace_log(dbg_lvl_normal, "Intercepting GNU OpenMP API calls\n"); eztrace_warn( "Only GNU OpenMP runtime functions will be intercepted. For a more precise trace, please instrument your program with eztrace_cc.\n"); pomp2_found = 0; } ezt_hashtable_init(&lock_map, 1024); openmp_register_functions(); if (eztrace_autostart_enabled()) eztrace_start(); _openmp_initialized = 1; } static void finalize_openmp() { _openmp_initialized = 0; eztrace_stop(); } void _gomp_init(void) __attribute__((constructor)); void _gomp_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_omp constructor starts\n"); EZT_REGISTER_MODULE(openmp, "Module for OpenMP", init_openmp, finalize_openmp); eztrace_log(dbg_lvl_debug, "eztrace_omp constructor ends\n"); } eztrace-2.1/src/modules/omp/pomp-lib-dummy/000077500000000000000000000000001447213526500207245ustar00rootroot00000000000000eztrace-2.1/src/modules/omp/pomp-lib-dummy/foos.c000066400000000000000000000304111447213526500220350ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * * Copyright (c) 2009-2011, * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Dresden, Germany * * Copyright (c) 2009-2011, * University of Oregon, Eugene, USA * * Copyright (c) 2009-2011, 2013 * Forschungszentrum Juelich GmbH, Germany * * Copyright (c) 2009-2011, * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Muenchen, Germany * * This software may be modified and distributed under the terms of * a BSD-style license. See the COPYING file in the package base * directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ /** @internal * * @file foos.c * * @brief This file is used to check the Fotran mangling of the * used compiler. In getfname.f a Function foo_foo is * called. Here functions with mangled names exist * foo_foo, foo_foo_, _foo_foo_, ... , depending on the * function called a file pomp2_fwrapper_def.h is written * with a macro to mangle function names to fortran * function names.*/ #include #include static char* header = "/*\n" " * Fortan subroutine external name setup\n" " */\n" "\n" "#define POMP2_Finalize_U POMP2_FINALIZE\n" "#define POMP2_Init_U POMP2_INIT\n" "#define POMP2_Off_U POMP2_OFF\n" "#define POMP2_On_U POMP2_ON\n" "#define POMP2_Atomic_enter_U POMP2_ATOMIC_ENTER\n" "#define POMP2_Atomic_exit_U POMP2_ATOMIC_EXIT\n" "#define POMP2_Implicit_barrier_enter_U POMP2_IMPLICIT_BARRIER_ENTER\n" "#define POMP2_Implicit_barrier_exit_U POMP2_IMPLICIT_BARRIER_EXIT\n" "#define POMP2_Barrier_enter_U POMP2_BARRIER_ENTER\n" "#define POMP2_Barrier_exit_U POMP2_BARRIER_EXIT\n" "#define POMP2_Flush_enter_U POMP2_FLUSH_ENTER\n" "#define POMP2_Flush_exit_U POMP2_FLUSH_EXIT\n" "#define POMP2_Critical_begin_U POMP2_CRITICAL_BEGIN\n" "#define POMP2_Critical_end_U POMP2_CRITICAL_END\n" "#define POMP2_Critical_enter_U POMP2_CRITICAL_ENTER\n" "#define POMP2_Critical_exit_U POMP2_CRITICAL_EXIT\n" "#define POMP2_Do_enter_U POMP2_DO_ENTER\n" "#define POMP2_Do_exit_U POMP2_DO_EXIT\n" "#define POMP2_Master_begin_U POMP2_MASTER_BEGIN\n" "#define POMP2_Master_end_U POMP2_MASTER_END\n" "#define POMP2_Parallel_begin_U POMP2_PARALLEL_BEGIN\n" "#define POMP2_Parallel_end_U POMP2_PARALLEL_END\n" "#define POMP2_Parallel_enter_U POMP2_PARALLEL_ENTER\n" "#define POMP2_Parallel_exit_U POMP2_PARALLEL_EXIT\n" "#define POMP2_Parallel_fork_U POMP2_PARALLEL_FORK\n" "#define POMP2_Parallel_join_U POMP2_PARALLEL_JOIN\n" "#define POMP2_Section_begin_U POMP2_SECTION_BEGIN\n" "#define POMP2_Section_end_U POMP2_SECTION_END\n" "#define POMP2_Section_enter_U POMP2_SECTION_ENTER\n" "#define POMP2_Section_exit_U POMP2_SECTION_EXIT\n" "#define POMP2_Sections_enter_U POMP2_SECTIONS_ENTER\n" "#define POMP2_Sections_exit_U POMP2_SECTIONS_EXIT\n" "#define POMP2_Single_begin_U POMP2_SINGLE_BEGIN\n" "#define POMP2_Single_end_U POMP2_SINGLE_END\n" "#define POMP2_Single_enter_U POMP2_SINGLE_ENTER\n" "#define POMP2_Single_exit_U POMP2_SINGLE_EXIT\n" "#define POMP2_Ordered_begin_U POMP2_ORDERED_BEGIN\n" "#define POMP2_Ordered_end_U POMP2_ORDERED_END\n" "#define POMP2_Ordered_enter_U POMP2_ORDERED_ENTER\n" "#define POMP2_Ordered_exit_U POMP2_ORDERED_EXIT\n" "#define POMP2_Task_begin_U POMP2_TASK_BEGIN\n" "#define POMP2_Task_end_U POMP2_TASK_END\n" "#define POMP2_Task_create_begin_U POMP2_TASK_CREATE_BEGIN\n" "#define POMP2_Task_create_end_U POMP2_TASK_CREATE_END\n" "#define POMP2_Untied_task_begin_U POMP2_UNTIED_TASK_BEGIN\n" "#define POMP2_Untied_task_end_U POMP2_UNTIED_TASK_END\n" "#define POMP2_Untied_task_create_begin_U POMP2_UNTIED_TASK_CREATE_BEGIN\n" "#define POMP2_Untied_task_create_end_U POMP2_UNTIED_TASK_CREATE_END\n" "#define POMP2_Taskwait_begin_U POMP2_TASKWAIT_BEGIN\n" "#define POMP2_Taskwait_end_U POMP2_TASKWAIT_END\n" "#define POMP2_Workshare_enter_U POMP2_WORKSHARE_ENTER\n" "#define POMP2_Workshare_exit_U POMP2_WORKSHARE_EXIT\n" "#define POMP2_Begin_U POMP2_BEGIN\n" "#define POMP2_End_U POMP2_END\n" "#define POMP2_Lib_get_max_threads_U POMP2_LIB_GET_MAX_THREADS\n" "#define POMP2_Init_lock_U POMP2_INIT_LOCK\n" "#define POMP2_Destroy_lock_U POMP2_DESTROY_LOCK\n" "#define POMP2_Set_lock_U POMP2_SET_LOCK\n" "#define POMP2_Unset_lock_U POMP2_UNSET_LOCK\n" "#define POMP2_Test_lock_U POMP2_TEST_LOCK\n" "#define POMP2_Init_nest_lock_U POMP2_INIT_NEST_LOCK\n" "#define POMP2_Destroy_nest_lock_U POMP2_DESTROY_NEST_LOCK\n" "#define POMP2_Set_nest_lock_U POMP2_SET_NEST_LOCK\n" "#define POMP2_Unset_nest_lock_U POMP2_UNSET_NEST_LOCK\n" "#define POMP2_Test_nest_lock_U POMP2_TEST_NEST_LOCK\n" "#define POMP2_Assign_handle_U POMP2_ASSIGN_HANDLE\n" "#define omp_init_lock_U OMP_INIT_LOCK\n" "#define omp_destroy_lock_U OMP_DESTROY_LOCK\n" "#define omp_set_lock_U OMP_SET_LOCK\n" "#define omp_unset_lock_U OMP_UNSET_LOCK\n" "#define omp_test_lock_U OMP_TEST_LOCK\n" "#define omp_init_nest_lock_U OMP_INIT_NEST_LOCK\n" "#define omp_destroy_nest_lock_U OMP_DESTROY_NEST_LOCK\n" "#define omp_set_nest_lock_U OMP_SET_NEST_LOCK\n" "#define omp_unset_nest_lock_U OMP_UNSET_NEST_LOCK\n" "#define omp_test_nest_lock_U OMP_TEST_NEST_LOCK\n" "\n" "#define POMP2_Finalize_L pomp2_finalize\n" "#define POMP2_Init_L pomp2_init\n" "#define POMP2_Off_L pomp2_off\n" "#define POMP2_On_L pomp2_on\n" "#define POMP2_Atomic_enter_L pomp2_atomic_enter\n" "#define POMP2_Atomic_exit_L pomp2_atomic_exit\n" "#define POMP2_Implicit_barrier_enter_L pomp2_implicit_barrier_enter\n" "#define POMP2_Implicit_barrier_exit_L pomp2_implicit_barrier_exit\n" "#define POMP2_Barrier_enter_L pomp2_barrier_enter\n" "#define POMP2_Barrier_exit_L pomp2_barrier_exit\n" "#define POMP2_Flush_enter_L pomp2_flush_enter\n" "#define POMP2_Flush_exit_L pomp2_flush_exit\n" "#define POMP2_Critical_begin_L pomp2_critical_begin\n" "#define POMP2_Critical_end_L pomp2_critical_end\n" "#define POMP2_Critical_enter_L pomp2_critical_enter\n" "#define POMP2_Critical_exit_L pomp2_critical_exit\n" "#define POMP2_Do_enter_L pomp2_do_enter\n" "#define POMP2_Do_exit_L pomp2_do_exit\n" "#define POMP2_Master_begin_L pomp2_master_begin\n" "#define POMP2_Master_end_L pomp2_master_end\n" "#define POMP2_Parallel_begin_L pomp2_parallel_begin\n" "#define POMP2_Parallel_end_L pomp2_parallel_end\n" "#define POMP2_Parallel_enter_L pomp2_parallel_enter\n" "#define POMP2_Parallel_exit_L pomp2_parallel_exit\n" "#define POMP2_Parallel_fork_L pomp2_parallel_fork\n" "#define POMP2_Parallel_join_L pomp2_parallel_join\n" "#define POMP2_Section_begin_L pomp2_section_begin\n" "#define POMP2_Section_end_L pomp2_section_end\n" "#define POMP2_Section_enter_L pomp2_section_enter\n" "#define POMP2_Section_exit_L pomp2_section_exit\n" "#define POMP2_Sections_enter_L pomp2_sections_enter\n" "#define POMP2_Sections_exit_L pomp2_sections_exit\n" "#define POMP2_Single_begin_L pomp2_single_begin\n" "#define POMP2_Single_end_L pomp2_single_end\n" "#define POMP2_Single_enter_L pomp2_single_enter\n" "#define POMP2_Single_exit_L pomp2_single_exit\n" "#define POMP2_Ordered_begin_L pomp2_ordered_begin\n" "#define POMP2_Ordered_end_L pomp2_ordered_end\n" "#define POMP2_Ordered_enter_L pomp2_ordered_enter\n" "#define POMP2_Ordered_exit_L pomp2_ordered_exit\n" "#define POMP2_Task_begin_L pomp2_task_begin\n" "#define POMP2_Task_end_L pomp2_task_end\n" "#define POMP2_Task_create_begin_L pomp2_task_create_begin\n" "#define POMP2_Task_create_end_L pomp2_task_create_end\n" "#define POMP2_Untied_task_begin_L pomp2_untied_task_begin\n" "#define POMP2_Untied_task_end_L pomp2_untied_task_end\n" "#define POMP2_Untied_task_create_begin_L pomp2_untied_task_create_begin\n" "#define POMP2_Untied_task_create_end_L pomp2_untied_task_create_end\n" "#define POMP2_Taskwait_begin_L pomp2_taskwait_begin\n" "#define POMP2_Taskwait_end_L pomp2_taskwait_end\n" "#define POMP2_Workshare_enter_L pomp2_workshare_enter\n" "#define POMP2_Workshare_exit_L pomp2_workshare_exit\n" "#define POMP2_Begin_L pomp2_begin\n" "#define POMP2_End_L pomp2_end\n" "#define POMP2_Lib_get_max_threads_L pomp2_lib_get_max_threads\n" "#define POMP2_Init_lock_L pomp2_init_lock\n" "#define POMP2_Destroy_lock_L pomp2_destroy_lock\n" "#define POMP2_Set_lock_L pomp2_set_lock\n" "#define POMP2_Unset_lock_L pomp2_unset_lock\n" "#define POMP2_Test_lock_L pomp2_test_lock\n" "#define POMP2_Init_nest_lock_L pomp2_init_nest_lock\n" "#define POMP2_Destroy_nest_lock_L pomp2_destroy_nest_lock\n" "#define POMP2_Set_nest_lock_L pomp2_set_nest_lock\n" "#define POMP2_Unset_nest_lock_L pomp2_unset_nest_lock\n" "#define POMP2_Test_nest_lock_L pomp2_test_nest_lock\n" "#define POMP2_Assign_handle_L pomp2_assign_handle\n" "#define omp_init_lock_L omp_init_lock\n" "#define omp_destroy_lock_L omp_destroy_lock\n" "#define omp_set_lock_L omp_set_lock\n" "#define omp_unset_lock_L omp_unset_lock\n" "#define omp_test_lock_L omp_test_lock\n" "#define omp_init_nest_lock_L omp_init_nest_lock\n" "#define omp_destroy_nest_lock_L omp_destroy_nest_lock\n" "#define omp_set_nest_lock_L omp_set_nest_lock\n" "#define omp_unset_nest_lock_L omp_unset_nest_lock\n" "#define omp_test_nest_lock_L omp_test_nest_lock\n" "\n" "#define XSUFFIX(name) name##_\n" "#define XSUFFIX2(name) name##__\n" "#define XPREFIX(name) _##name\n" "#define XPREFIX2(name) __##name\n" "\n" "#define SUFFIX(name) XSUFFIX(name)\n" "#define SUFFIX2(name) XSUFFIX2(name)\n" "#define PREFIX(name) XPREFIX(name)\n" "#define PREFIX2(name) XPREFIX2(name)\n" "\n" "#define UPCASE(name) name##_U\n" "#define LOWCASE(name) name##_L\n" "\n"; static void generate(char* str) { FILE* f = fopen("pomp2_fwrapper_def.h", "w"); if (f == NULL) { perror("pomp2_fwrapper_def.h"); exit(1); } fputs(header, f); fputs(str, f); fputs("\n", f); fclose(f); } void foo_foo() { generate("#define FSUB(name) LOWCASE(name)"); } void foo_foo_() { generate("#define FSUB(name) SUFFIX(LOWCASE(name))"); } void foo_foo__() { generate("#define FSUB(name) SUFFIX2(LOWCASE(name))"); } void _foo_foo() { generate("#define FSUB(name) PREFIX(LOWCASE(name))"); } void __foo_foo() { generate("#define FSUB(name) PREFIX2(LOWCASE(name))"); } void _foo_foo_() { generate("#define FSUB(name) PREFIX(SUFFIX(LOWCASE(name)))"); } void FOO_FOO() { generate("#define FSUB(name) UPCASE(name)"); } void FOO_FOO_() { generate("#define FSUB(name) SUFFIX(UPCASE(name))"); } void FOO_FOO__() { generate("#define FSUB(name) SUFFIX2(UPCASE(name))"); } void _FOO_FOO() { generate("#define FSUB(name) PREFIX(UPCASE(name))"); } void __FOO_FOO() { generate("#define FSUB(name) PREFIX2(UPCASE(name))"); } void _FOO_FOO_() { generate("#define FSUB(name) PREFIX(SUFFIX(UPCASE(name)))"); } eztrace-2.1/src/modules/omp/pomp-lib-dummy/getfname.f000066400000000000000000000022131447213526500226570ustar00rootroot00000000000000!> !> This file is part of the Score-P software (http://www.score-p.org) !> !> Copyright (c) 2009-2011, !> RWTH Aachen University, Germany !> !> Copyright (c) 2009-2011, !> Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany !> !> Copyright (c) 2009-2011, !> Technische Universitaet Dresden, Germany !> !> Copyright (c) 2009-2011, !> University of Oregon, Eugene, USA !> !> Copyright (c) 2009-2011, 2013 !> Forschungszentrum Juelich GmbH, Germany !> !> Copyright (c) 2009-2011, !> German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany !> !> Copyright (c) 2009-2011, !> Technische Universitaet Muenchen, Germany !> !> This software may be modified and distributed under the terms of !> a BSD-style license. See the COPYING file in the package base !> directory for details. !> @internal !> !> @file getname.f !> !> @brief This file is needed to check the Fortran name mangling of !> the used compiler. foo_foo is called and depending on ! the mangling, this is linked against a c function ! foo_foo_, _foo_foo, ... #include #include #include /* * Fortran wrappers calling the C versions */ /* *INDENT-OFF* */ void FSUB(POMP2_Atomic_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Atomic_enter(regionHandle, ctc_string); } void FSUB(POMP2_Atomic_exit)(POMP2_Region_handle* regionHandle) { POMP2_Atomic_exit(regionHandle); } void FSUB(POMP2_Implicit_barrier_enter)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Implicit_barrier_enter(regionHandle, pomp2_old_task); } void FSUB(POMP2_Implicit_barrier_exit)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Implicit_barrier_exit(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Barrier_enter)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task, char* ctc_string) { POMP2_Barrier_enter(regionHandle, pomp2_old_task, ctc_string); } void FSUB(POMP2_Barrier_exit)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Barrier_exit(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Flush_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Flush_enter(regionHandle, ctc_string); } void FSUB(POMP2_Flush_exit)(POMP2_Region_handle* regionHandle) { POMP2_Flush_exit(regionHandle); } void FSUB(POMP2_Critical_begin)(POMP2_Region_handle* regionHandle) { POMP2_Critical_begin(regionHandle); } void FSUB(POMP2_Critical_end)(POMP2_Region_handle* regionHandle) { POMP2_Critical_end(regionHandle); } void FSUB(POMP2_Critical_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Critical_enter(regionHandle, ctc_string); } void FSUB(POMP2_Critical_exit)(POMP2_Region_handle* regionHandle) { POMP2_Critical_exit(regionHandle); } void FSUB(POMP2_Do_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_For_enter(regionHandle, ctc_string); } void FSUB(POMP2_Do_exit)(POMP2_Region_handle* regionHandle) { POMP2_For_exit(regionHandle); } void FSUB(POMP2_Parallel_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* newTask __attribute__((unused)), char* ctc_string __attribute__((unused))) { POMP2_Parallel_begin(regionHandle); } void FSUB(POMP2_Parallel_end)(POMP2_Region_handle* regionHandle) { POMP2_Parallel_end(regionHandle); } void FSUB(POMP2_Master_begin)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Master_begin(regionHandle, ctc_string); } void FSUB(POMP2_Master_end)(POMP2_Region_handle* regionHandle) { POMP2_Master_end(regionHandle); } void FSUB(POMP2_Parallel_fork)(POMP2_Region_handle* regionHandle, int* if_clause, int* num_threads, POMP2_Task_handle* pomp2_old_task, char* ctc_string __attribute__((unused))) { POMP2_Parallel_fork(regionHandle, *if_clause, *num_threads, pomp2_old_task, "dummy"); } void FSUB(POMP2_Parallel_join)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Parallel_join(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Section_begin)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Section_begin(regionHandle, ctc_string); } void FSUB(POMP2_Section_end)(POMP2_Region_handle* regionHandle) { POMP2_Section_end(regionHandle); } void FSUB(POMP2_Sections_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Sections_enter(regionHandle, ctc_string); } void FSUB(POMP2_Sections_exit)(POMP2_Region_handle* regionHandle) { POMP2_Sections_exit(regionHandle); } void FSUB(POMP2_Single_begin)(POMP2_Region_handle* regionHandle) { POMP2_Single_begin(regionHandle); } void FSUB(POMP2_Single_end)(POMP2_Region_handle* regionHandle) { POMP2_Single_end(regionHandle); } void FSUB(POMP2_Single_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Single_enter(regionHandle, ctc_string); } void FSUB(POMP2_Ordered_exit)(POMP2_Region_handle* regionHandle) { POMP2_Ordered_exit(regionHandle); } void FSUB(POMP2_Ordered_begin)(POMP2_Region_handle* regionHandle) { POMP2_Ordered_begin(regionHandle); } void FSUB(POMP2_Ordered_end)(POMP2_Region_handle* regionHandle) { POMP2_Ordered_end(regionHandle); } void FSUB(POMP2_Ordered_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Ordered_enter(regionHandle, ctc_string); } void FSUB(POMP2_Single_exit)(POMP2_Region_handle* regionHandle) { POMP2_Single_exit(regionHandle); } void FSUB(POMP2_Task_create_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task, int* pomp2_if, char* ctc_string) { POMP2_Task_create_begin(regionHandle, pomp2_new_task, pomp2_old_task, *pomp2_if, ctc_string); } void FSUB(POMP2_Task_create_end)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Task_create_end(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Task_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_new_task) { POMP2_Task_begin(regionHandle, *pomp2_new_task); } void FSUB(POMP2_Task_end)(POMP2_Region_handle* regionHandle) { POMP2_Task_end(regionHandle); } void FSUB(POMP2_Untied_task_create_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task, int* pomp2_if, char* ctc_string) { POMP2_Task_create_begin(regionHandle, pomp2_new_task, pomp2_old_task, *pomp2_if, ctc_string); } void FSUB(POMP2_Untied_task_create_end)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Task_create_end(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Untied_task_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_new_task) { POMP2_Task_begin(regionHandle, *pomp2_new_task); } void FSUB(POMP2_Untied_task_end)(POMP2_Region_handle* regionHandle) { POMP2_Task_end(regionHandle); } void FSUB(POMP2_Taskwait_begin)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task, char* ctc_string) { POMP2_Taskwait_begin(regionHandle, pomp2_old_task, ctc_string); } void FSUB(POMP2_Taskwait_end)(POMP2_Region_handle* regionHandle, POMP2_Task_handle* pomp2_old_task) { POMP2_Taskwait_end(regionHandle, *pomp2_old_task); } void FSUB(POMP2_Workshare_enter)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Workshare_enter(regionHandle, ctc_string); } void FSUB(POMP2_Workshare_exit)(POMP2_Region_handle* regionHandle) { POMP2_Workshare_exit(regionHandle); } void FSUB(POMP2_Assign_handle)(POMP2_Region_handle* regionHandle, char* ctc_string, int ctc_string_len) { char* str; str = (char*)malloc((ctc_string_len + 1) * sizeof(char)); strncpy(str, ctc_string, ctc_string_len); str[ctc_string_len] = '\0'; POMP2_Assign_handle(regionHandle, str); free(str); } /* *---------------------------------------------------------------- * Wrapper for omp_get_max_threads used in instrumentation * * In Fortran a wrapper function * pomp2_get_max_threads() is used, since it is not possible to * ensure, that omp_get_max_threads is not used in the user * program. We would need to parse much more of the Fortran * Syntax to detect these cases. The Wrapper function avoids * double definition of this function and avoids errors. * ******---------------------------------------------------------------- */ int FSUB(POMP2_Lib_get_max_threads)(void) { return omp_get_max_threads(); } eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_fwrapper_base.c000066400000000000000000000071401447213526500250270ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2013, * RWTH Aachen University, Germany * * Copyright (c) 2009-2013, * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * * Copyright (c) 2009-2013, * Technische Universitaet Dresden, Germany * * Copyright (c) 2009-2013, * University of Oregon, Eugene, USA * * Copyright (c) 2009-2013, * Forschungszentrum Juelich GmbH, Germany * * Copyright (c) 2009-2013, * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * * Copyright (c) 2009-2013, * Technische Universitaet Muenchen, Germany * * This software may be modified and distributed under the terms of * a BSD-style license. See the COPYING file in the package base * directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ /** @internal * * @file pomp2_fwrapper_base.c * * * @brief Basic fortan wrappers calling the C versions.*/ #include "pomp2_fwrapper_base.h" #include "pomp2_fwrapper_def.h" #include "pomp2_lib.h" #include #include static int pomp2_tracing = 1; /* *INDENT-OFF* */ void FSUB(POMP2_Finalize)() { POMP2_Finalize(); } void FSUB(POMP2_Init)() { POMP2_Init(); } void FSUB(POMP2_Off)() { pomp2_tracing = 0; } void FSUB(POMP2_On)() { pomp2_tracing = 1; } #if 0 void FSUB(POMP2_Begin)(POMP2_Region_handle* regionHandle, char* ctc_string) { POMP2_Begin(regionHandle, ctc_string); } #else void FSUB(POMP2_Begin)(POMP2_Region_handle* regionHandle, char* ctc_string __attribute__((unused))) { POMP2_Begin(regionHandle); } #endif void FSUB(POMP2_End)(POMP2_Region_handle* regionHandle) { POMP2_End(regionHandle); } /* *INDENT-OFF* */ /* *---------------------------------------------------------------- * Fortran Wrapper for OpenMP API ******---------------------------------------------------------------- */ /* *INDENT-OFF* */ #if defined(__ICC) || defined(__ECC) || defined(_SX) #define CALLFSUB(a) a #else #define CALLFSUB(a) FSUB(a) #endif void FSUB(POMP2_Init_lock)(omp_lock_t* s) { CALLFSUB(omp_init_lock) (s); } void FSUB(POMP2_Destroy_lock)(omp_lock_t* s) { CALLFSUB(omp_destroy_lock) (s); } void FSUB(POMP2_Set_lock)(omp_lock_t* s) { CALLFSUB(omp_set_lock) (s); } void FSUB(POMP2_Unset_lock)(omp_lock_t* s) { CALLFSUB(omp_unset_lock) (s); } int FSUB(POMP2_Test_lock)(omp_lock_t* s) { return CALLFSUB(omp_test_lock)(s); } #ifndef __osf__ void FSUB(POMP2_Init_nest_lock)(omp_nest_lock_t* s) { CALLFSUB(omp_init_nest_lock) (s); } void FSUB(POMP2_Destroy_nest_lock)(omp_nest_lock_t* s) { CALLFSUB(omp_destroy_nest_lock) (s); } void FSUB(POMP2_Set_nest_lock)(omp_nest_lock_t* s) { CALLFSUB(omp_set_nest_lock) (s); } void FSUB(POMP2_Unset_nest_lock)(omp_nest_lock_t* s) { CALLFSUB(omp_unset_nest_lock) (s); } int FSUB(POMP2_Test_nest_lock)(omp_nest_lock_t* s) { return CALLFSUB(omp_test_nest_lock)(s); } #endif eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_fwrapper_base.h000066400000000000000000000027431447213526500250400ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * * Copyright (c) 2009-2011, * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Dresden, Germany * * Copyright (c) 2009-2011, * University of Oregon, Eugene, USA * * Copyright (c) 2009-2011, 2013 * Forschungszentrum Juelich GmbH, Germany * * Copyright (c) 2009-2011, * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Muenchen, Germany * * This software may be modified and distributed under the terms of * a BSD-style license. See the COPYING file in the package base * directory for details. */ #include "pomp2_fwrapper_def.h" #include #ifndef POMP2_FWRAPPER_BASE_H #define POMP2_FWRAPPER_BASE_H extern void FSUB(omp_init_lock)(omp_lock_t* s); extern void FSUB(omp_destroy_lock)(omp_lock_t* s); extern void FSUB(omp_set_lock)(omp_lock_t* s); extern void FSUB(omp_unset_lock)(omp_lock_t* s); extern int FSUB(omp_test_lock)(omp_lock_t* s); extern void FSUB(omp_init_nest_lock)(omp_nest_lock_t* s); extern void FSUB(omp_destroy_nest_lock)(omp_nest_lock_t* s); extern void FSUB(omp_set_nest_lock)(omp_nest_lock_t* s); extern void FSUB(omp_unset_nest_lock)(omp_nest_lock_t* s); extern int FSUB(omp_test_nest_lock)(omp_nest_lock_t* s); #endif eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_fwrapper_def.h000066400000000000000000000175231447213526500246660ustar00rootroot00000000000000/* * Fortan subroutine external name setup */ #define POMP2_Finalize_U POMP2_FINALIZE #define POMP2_Init_U POMP2_INIT #define POMP2_Off_U POMP2_OFF #define POMP2_On_U POMP2_ON #define POMP2_Atomic_enter_U POMP2_ATOMIC_ENTER #define POMP2_Atomic_exit_U POMP2_ATOMIC_EXIT #define POMP2_Implicit_barrier_enter_U POMP2_IMPLICIT_BARRIER_ENTER #define POMP2_Implicit_barrier_exit_U POMP2_IMPLICIT_BARRIER_EXIT #define POMP2_Barrier_enter_U POMP2_BARRIER_ENTER #define POMP2_Barrier_exit_U POMP2_BARRIER_EXIT #define POMP2_Flush_enter_U POMP2_FLUSH_ENTER #define POMP2_Flush_exit_U POMP2_FLUSH_EXIT #define POMP2_Critical_begin_U POMP2_CRITICAL_BEGIN #define POMP2_Critical_end_U POMP2_CRITICAL_END #define POMP2_Critical_enter_U POMP2_CRITICAL_ENTER #define POMP2_Critical_exit_U POMP2_CRITICAL_EXIT #define POMP2_Do_enter_U POMP2_DO_ENTER #define POMP2_Do_exit_U POMP2_DO_EXIT #define POMP2_Master_begin_U POMP2_MASTER_BEGIN #define POMP2_Master_end_U POMP2_MASTER_END #define POMP2_Parallel_begin_U POMP2_PARALLEL_BEGIN #define POMP2_Parallel_end_U POMP2_PARALLEL_END #define POMP2_Parallel_enter_U POMP2_PARALLEL_ENTER #define POMP2_Parallel_exit_U POMP2_PARALLEL_EXIT #define POMP2_Parallel_fork_U POMP2_PARALLEL_FORK #define POMP2_Parallel_join_U POMP2_PARALLEL_JOIN #define POMP2_Section_begin_U POMP2_SECTION_BEGIN #define POMP2_Section_end_U POMP2_SECTION_END #define POMP2_Section_enter_U POMP2_SECTION_ENTER #define POMP2_Section_exit_U POMP2_SECTION_EXIT #define POMP2_Sections_enter_U POMP2_SECTIONS_ENTER #define POMP2_Sections_exit_U POMP2_SECTIONS_EXIT #define POMP2_Single_begin_U POMP2_SINGLE_BEGIN #define POMP2_Single_end_U POMP2_SINGLE_END #define POMP2_Single_enter_U POMP2_SINGLE_ENTER #define POMP2_Single_exit_U POMP2_SINGLE_EXIT #define POMP2_Ordered_begin_U POMP2_ORDERED_BEGIN #define POMP2_Ordered_end_U POMP2_ORDERED_END #define POMP2_Ordered_enter_U POMP2_ORDERED_ENTER #define POMP2_Ordered_exit_U POMP2_ORDERED_EXIT #define POMP2_Task_begin_U POMP2_TASK_BEGIN #define POMP2_Task_end_U POMP2_TASK_END #define POMP2_Task_create_begin_U POMP2_TASK_CREATE_BEGIN #define POMP2_Task_create_end_U POMP2_TASK_CREATE_END #define POMP2_Untied_task_begin_U POMP2_UNTIED_TASK_BEGIN #define POMP2_Untied_task_end_U POMP2_UNTIED_TASK_END #define POMP2_Untied_task_create_begin_U POMP2_UNTIED_TASK_CREATE_BEGIN #define POMP2_Untied_task_create_end_U POMP2_UNTIED_TASK_CREATE_END #define POMP2_Taskwait_begin_U POMP2_TASKWAIT_BEGIN #define POMP2_Taskwait_end_U POMP2_TASKWAIT_END #define POMP2_Workshare_enter_U POMP2_WORKSHARE_ENTER #define POMP2_Workshare_exit_U POMP2_WORKSHARE_EXIT #define POMP2_Begin_U POMP2_BEGIN #define POMP2_End_U POMP2_END #define POMP2_Lib_get_max_threads_U POMP2_LIB_GET_MAX_THREADS #define POMP2_Init_lock_U POMP2_INIT_LOCK #define POMP2_Destroy_lock_U POMP2_DESTROY_LOCK #define POMP2_Set_lock_U POMP2_SET_LOCK #define POMP2_Unset_lock_U POMP2_UNSET_LOCK #define POMP2_Test_lock_U POMP2_TEST_LOCK #define POMP2_Init_nest_lock_U POMP2_INIT_NEST_LOCK #define POMP2_Destroy_nest_lock_U POMP2_DESTROY_NEST_LOCK #define POMP2_Set_nest_lock_U POMP2_SET_NEST_LOCK #define POMP2_Unset_nest_lock_U POMP2_UNSET_NEST_LOCK #define POMP2_Test_nest_lock_U POMP2_TEST_NEST_LOCK #define POMP2_Assign_handle_U POMP2_ASSIGN_HANDLE #define omp_init_lock_U OMP_INIT_LOCK #define omp_destroy_lock_U OMP_DESTROY_LOCK #define omp_set_lock_U OMP_SET_LOCK #define omp_unset_lock_U OMP_UNSET_LOCK #define omp_test_lock_U OMP_TEST_LOCK #define omp_init_nest_lock_U OMP_INIT_NEST_LOCK #define omp_destroy_nest_lock_U OMP_DESTROY_NEST_LOCK #define omp_set_nest_lock_U OMP_SET_NEST_LOCK #define omp_unset_nest_lock_U OMP_UNSET_NEST_LOCK #define omp_test_nest_lock_U OMP_TEST_NEST_LOCK #define POMP2_Finalize_L pomp2_finalize #define POMP2_Init_L pomp2_init #define POMP2_Off_L pomp2_off #define POMP2_On_L pomp2_on #define POMP2_Atomic_enter_L pomp2_atomic_enter #define POMP2_Atomic_exit_L pomp2_atomic_exit #define POMP2_Implicit_barrier_enter_L pomp2_implicit_barrier_enter #define POMP2_Implicit_barrier_exit_L pomp2_implicit_barrier_exit #define POMP2_Barrier_enter_L pomp2_barrier_enter #define POMP2_Barrier_exit_L pomp2_barrier_exit #define POMP2_Flush_enter_L pomp2_flush_enter #define POMP2_Flush_exit_L pomp2_flush_exit #define POMP2_Critical_begin_L pomp2_critical_begin #define POMP2_Critical_end_L pomp2_critical_end #define POMP2_Critical_enter_L pomp2_critical_enter #define POMP2_Critical_exit_L pomp2_critical_exit #define POMP2_Do_enter_L pomp2_do_enter #define POMP2_Do_exit_L pomp2_do_exit #define POMP2_Master_begin_L pomp2_master_begin #define POMP2_Master_end_L pomp2_master_end #define POMP2_Parallel_begin_L pomp2_parallel_begin #define POMP2_Parallel_end_L pomp2_parallel_end #define POMP2_Parallel_enter_L pomp2_parallel_enter #define POMP2_Parallel_exit_L pomp2_parallel_exit #define POMP2_Parallel_fork_L pomp2_parallel_fork #define POMP2_Parallel_join_L pomp2_parallel_join #define POMP2_Section_begin_L pomp2_section_begin #define POMP2_Section_end_L pomp2_section_end #define POMP2_Section_enter_L pomp2_section_enter #define POMP2_Section_exit_L pomp2_section_exit #define POMP2_Sections_enter_L pomp2_sections_enter #define POMP2_Sections_exit_L pomp2_sections_exit #define POMP2_Single_begin_L pomp2_single_begin #define POMP2_Single_end_L pomp2_single_end #define POMP2_Single_enter_L pomp2_single_enter #define POMP2_Single_exit_L pomp2_single_exit #define POMP2_Ordered_begin_L pomp2_ordered_begin #define POMP2_Ordered_end_L pomp2_ordered_end #define POMP2_Ordered_enter_L pomp2_ordered_enter #define POMP2_Ordered_exit_L pomp2_ordered_exit #define POMP2_Task_begin_L pomp2_task_begin #define POMP2_Task_end_L pomp2_task_end #define POMP2_Task_create_begin_L pomp2_task_create_begin #define POMP2_Task_create_end_L pomp2_task_create_end #define POMP2_Untied_task_begin_L pomp2_untied_task_begin #define POMP2_Untied_task_end_L pomp2_untied_task_end #define POMP2_Untied_task_create_begin_L pomp2_untied_task_create_begin #define POMP2_Untied_task_create_end_L pomp2_untied_task_create_end #define POMP2_Taskwait_begin_L pomp2_taskwait_begin #define POMP2_Taskwait_end_L pomp2_taskwait_end #define POMP2_Workshare_enter_L pomp2_workshare_enter #define POMP2_Workshare_exit_L pomp2_workshare_exit #define POMP2_Begin_L pomp2_begin #define POMP2_End_L pomp2_end #define POMP2_Lib_get_max_threads_L pomp2_lib_get_max_threads #define POMP2_Init_lock_L pomp2_init_lock #define POMP2_Destroy_lock_L pomp2_destroy_lock #define POMP2_Set_lock_L pomp2_set_lock #define POMP2_Unset_lock_L pomp2_unset_lock #define POMP2_Test_lock_L pomp2_test_lock #define POMP2_Init_nest_lock_L pomp2_init_nest_lock #define POMP2_Destroy_nest_lock_L pomp2_destroy_nest_lock #define POMP2_Set_nest_lock_L pomp2_set_nest_lock #define POMP2_Unset_nest_lock_L pomp2_unset_nest_lock #define POMP2_Test_nest_lock_L pomp2_test_nest_lock #define POMP2_Assign_handle_L pomp2_assign_handle #define omp_init_lock_L omp_init_lock #define omp_destroy_lock_L omp_destroy_lock #define omp_set_lock_L omp_set_lock #define omp_unset_lock_L omp_unset_lock #define omp_test_lock_L omp_test_lock #define omp_init_nest_lock_L omp_init_nest_lock #define omp_destroy_nest_lock_L omp_destroy_nest_lock #define omp_set_nest_lock_L omp_set_nest_lock #define omp_unset_nest_lock_L omp_unset_nest_lock #define omp_test_nest_lock_L omp_test_nest_lock #define XSUFFIX(name) name##_ #define XSUFFIX2(name) name##__ #define XPREFIX(name) _##name #define XPREFIX2(name) __##name #define SUFFIX(name) XSUFFIX(name) #define SUFFIX2(name) XSUFFIX2(name) #define PREFIX(name) XPREFIX(name) #define PREFIX2(name) XPREFIX2(name) #define UPCASE(name) name##_U #define LOWCASE(name) name##_L #define FSUB(name) SUFFIX(LOWCASE(name)) eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_lib.c000066400000000000000000000217531447213526500227630ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * Technische Universitaet Dresden, Germany * University of Oregon, Eugene, USA * Forschungszentrum Juelich GmbH, Germany * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * Technische Universitaet Muenchen, Germany * * See the COPYING file in the package base directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ /** @internal * * @file pomp2_lib.c * @status alpha * * @maintainer Dirk Schmidl * * @authors Dirk Schmidl * Peter Philippen * * @brief Dummy implementation of all POMP2 Functions. These functions * only print out messages and do not measure anything.*/ #include "pomp2_lib.h" /* * C pomp2 function library */ void POMP2_Finalize() { } void POMP2_Init() { } void POMP2_Off() { } void POMP2_On() { } void POMP2_Begin(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_End(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Assign_handle( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Atomic_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Atomic_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Implicit_barrier_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused))) { } extern void POMP2_Implicit_barrier_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } void POMP2_Barrier_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Barrier_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } void POMP2_Flush_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Flush_exit(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Critical_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Critical_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Critical_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Critical_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_For_enter(POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_For_exit(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Master_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Master_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Parallel_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Parallel_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Parallel_fork( POMP2_Region_handle* pomp2_handle __attribute__((unused)), int if_clause __attribute__((unused)), int num_threads __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Parallel_join( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } void POMP2_Section_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Section_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Sections_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Sections_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Single_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Single_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Single_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Single_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Workshare_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Workshare_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Ordered_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Ordered_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Ordered_enter( POMP2_Region_handle* pomp2_handle __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Ordered_exit( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Task_create_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_new_task __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), int pomp2_if __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Task_create_end( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } void POMP2_Task_begin(POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_task __attribute__((unused))) { } void POMP2_Task_end(POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Untied_task_create_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_new_task __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), int pomp2_if __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Untied_task_create_end( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } void POMP2_Untied_task_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_parent_task __attribute__((unused))) { } void POMP2_Untied_task_end( POMP2_Region_handle* pomp2_handle __attribute__((unused))) { } void POMP2_Taskwait_begin( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle* pomp2_old_task __attribute__((unused)), const char ctc_string[] __attribute__((unused))) { } void POMP2_Taskwait_end( POMP2_Region_handle* pomp2_handle __attribute__((unused)), POMP2_Task_handle pomp2_old_task __attribute__((unused))) { } /* *---------------------------------------------------------------- * C Wrapper for OpenMP API ******---------------------------------------------------------------- */ #ifdef OPENMP_FOUND void POMP2_Init_lock(omp_lock_t* s __attribute__((unused))) { } void POMP2_Destroy_lock(omp_lock_t* s __attribute__((unused))) { } void POMP2_Set_lock(omp_lock_t* s __attribute__((unused))) { } void POMP2_Unset_lock(omp_lock_t* s __attribute__((unused))) { } int POMP2_Test_lock(omp_lock_t* s __attribute__((unused))) { return -1; } void POMP2_Init_nest_lock(omp_nest_lock_t* s __attribute__((unused))) { } void POMP2_Destroy_nest_lock(omp_nest_lock_t* s __attribute__((unused))) { } void POMP2_Set_nest_lock(omp_nest_lock_t* s __attribute__((unused))) { } void POMP2_Unset_nest_lock(omp_nest_lock_t* s __attribute__((unused))) { } int POMP2_Test_nest_lock(omp_nest_lock_t* s __attribute__((unused))) { return -1; } #endif /* OPENMP_FOUND */ eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_lib.h000066400000000000000000000525031447213526500227650ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * Technische Universitaet Dresden, Germany * University of Oregon, Eugene, USA * Forschungszentrum Juelich GmbH, Germany * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * Technische Universitaet Muenchen, Germany * * See the COPYING file in the package base directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ #ifndef POMP2_LIB_H #define POMP2_LIB_H #ifdef OPENMP_FOUND /* todo: check that in autoconf */ #include #endif /* OPENMP_FOUND */ #include #include #ifdef __cplusplus extern "C" { #endif /** @file pomp2_lib.h * @status alpha * * @authors Daniel Lorenz * Dirk Schmidl * Peter Philippen * * @brief This file contains the declarations of all * POMP2 functions. * */ /** Handles to identify OpenMP regions. */ typedef void* POMP2_Region_handle; typedef int64_t POMP2_Task_handle; /** @name Functions generated by the instrumenter */ /*@{*/ /** * Returns the number of instrumented regions.@n * The instrumenter scans all opari-created include files with nm and greps * the POMP2_INIT_uuid_numRegions() function calls. Here we return the sum of * all numRegions. * @return number of instrumented regions */ extern size_t POMP2_Get_num_regions(); /** * Init all opari-created regions.@n * The instrumentor scans all opari-created include files with nm and greps * the POMP2_INIT_uuid_numRegions() function calls. The instrumentor then * defines these functions by calling all grepped functions. */ extern void POMP2_Init_regions(); /** * Returns the opari version. * @return version string */ extern const char* POMP2_Get_opari2_version(); /*@}*/ /** Function that returns a new task handle. * @return new task handle */ extern POMP2_Task_handle POMP2_Get_new_task_handle(); /** Finalizes the POMP2 adapter. It is inserted at the #%pragma pomp inst end. */ extern void POMP2_Finalize(); /** Initializes the POMP2 adapter. It is inserted at the #%pragma pomp inst begin. */ extern void POMP2_Init(); /** Disables the POMP2 adapter. */ extern void POMP2_Off(); /** Enables the POMP2 adapter. */ extern void POMP2_On(); /** Called at the begin of a user defined POMP2 region. @param pomp2_handle The handle of the started region. */ extern void POMP2_Begin(POMP2_Region_handle* pomp2_handle); /** Called at the begin of a user defined POMP2 region. @param pomp2_handle The handle of the started region. */ extern void POMP2_End(POMP2_Region_handle* pomp2_handle); /** Registers a POMP2 region and returns a region handle. @param pomp2_handle Returns the handle for the newly registered region. @param ctc_string A string containing the region data. */ extern void POMP2_Assign_handle(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called before an atomic statement. @param pomp2_handle The handle of the started region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Atomic_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after an atomic statement. @param pomp2_handle The handle of the ended region. */ extern void POMP2_Atomic_exit(POMP2_Region_handle* pomp2_handle); /** Called before a barrier. \n \e OpenMP \e 3.0: Barriers can be used as scheduling points for tasks. When entering a barrier the task id of the currently executing task (\e pomp2_current_task) is saved in \e pomp2_old_task, which is defined inside the instrumented user code. @param pomp2_handle The handle of the started region. @param pomp2_old_task Pointer to a "taskprivate" variable where the current task id is stored. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Barrier_enter(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_old_task, const char ctc_string[]); /** Called after a barrier. \n \e OpenMP \e 3.0: When a task exits a barrier the variable \e pomp2_old_task (defined in the instrumented user code) holds the id of the task that entered the barrier. The value is stored in the adapter (in \e pomp2_current_task) to be made available for the measurement system for the following regions. @param pomp2_handle The handle of the ended region. @param pomp2_old_task "Taskprivate" variable storing the id of the task the barrier is located in. */ extern void POMP2_Barrier_exit(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** Called before an implicit barrier. \e OpenMP \e 3.0: Barriers can be used as scheduling points for tasks. When entering a barrier the task id of the currently executing task (\e pomp2_current_task) is saved in \e pomp2_old_task, which is defined inside the instrumented user code. @param pomp2_handle The handle of the started region. @param pomp2_old_task Pointer to a "taskprivate" variable where the current task id is stored. */ extern void POMP2_Implicit_barrier_enter(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_old_task); /** Called after an implicit barrier. \e OpenMP \e 3.0: When a task exits a barrier the variable \e pomp2_old_task (defined in the instrumented user code) holds the id of the task that entered the barrier. The value is stored in the adapter (in \e pomp2_current_task) to be made available for the measurement system for the following regions. @param pomp2_handle The handle of the started region. @param pomp2_old_task "Taskprivate" variable storing the id the task the implicit barrier is used in. */ extern void POMP2_Implicit_barrier_exit(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** Called before an flush. @param pomp2_handle The handle of the started region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Flush_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after an flush. @param pomp2_handle The handle of the ended region. */ extern void POMP2_Flush_exit(POMP2_Region_handle* pomp2_handle); /** Called at the start of a critical region. @param pomp2_handle The handle of the started region. */ extern void POMP2_Critical_begin(POMP2_Region_handle* pomp2_handle); /** Called at the end of a critical region. @param pomp2_handle The handle of the ended region. */ extern void POMP2_Critical_end(POMP2_Region_handle* pomp2_handle); /** Called before a critical region. @param pomp2_handle The handle of the started region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Critical_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after a critical region. @param pomp2_handle The handle of the region. */ extern void POMP2_Critical_exit(POMP2_Region_handle* pomp2_handle); /** Called before a for loop. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_For_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after a for loop. @param pomp2_handle The handle of the region. */ extern void POMP2_For_exit(POMP2_Region_handle* pomp2_handle); /** Called at the start of a master region. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Master_begin(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called at the end of a master region. @param pomp2_handle The handle of the ended region. */ extern void POMP2_Master_end(POMP2_Region_handle* pomp2_handle); /** Called at the start of a parallel region. \e OpenMP \e 3.0: When a new parallel region is entered, each thread taking part in that region is executed as a task. These tasks are assigned a new unique task id which is stored in \e pomp2_current_task. @param pomp2_handle The handle of the region. */ extern void POMP2_Parallel_begin(POMP2_Region_handle* pomp2_handle); /** Called at the end of a parallel region. @param pomp2_handle The handle of the region. */ extern void POMP2_Parallel_end(POMP2_Region_handle* pomp2_handle); /** Called before a parallel region. \e OpenMP \e 3.0: The task id of the currently executing task (\e pomp2_current_task) is saved in \e pomp2_old_task, which is defined inside the instrumented user code. In each of the threads taking part in the following parallel region a newly defined unique task id is assigned (see \ref POMP2_Parallel_begin) @param pomp2_handle The handle of the region. @param if_clause Value of the argument of an if clause (if present). @param num_threads Upper bound for number of child threads. @param pomp2_old_task The task id of the region from which the parallel region was started. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Parallel_fork(POMP2_Region_handle* pomp2_handle, int if_clause, int num_threads, POMP2_Task_handle* pomp2_old_task, const char ctc_string[]); /** Called after a parallel region. \e OpenMP \e 3.0: When a task exits a parallel region the variable \e pomp2_old_task (defined in the instrumented user code) holds the id of the task that entered the region. The value is stored in the adapter (in \e pomp2_current_task) to be made available for the measurement system for the following regions. @param pomp2_handle The handle of the region. @param pomp2_old_task The task id of the region inside of which the parallel region was executed. */ extern void POMP2_Parallel_join(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** Called at the start of a section. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Section_begin(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called at the end of a section. @param pomp2_handle The handle of the region. */ extern void POMP2_Section_end(POMP2_Region_handle* pomp2_handle); /** Called before a set of sections. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Sections_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after a set of sections. @param pomp2_handle The handle of the region. */ extern void POMP2_Sections_exit(POMP2_Region_handle* pomp2_handle); /** Called at the start of a single region. @param pomp2_handle The handle of the region. */ extern void POMP2_Single_begin(POMP2_Region_handle* pomp2_handle); /** Called at the end of a single region. @param pomp2_handle The handle of the region. */ extern void POMP2_Single_end(POMP2_Region_handle* pomp2_handle); /** Called before a single region. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Single_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after a single region. @param pomp2_handle The handle of the region. */ extern void POMP2_Single_exit(POMP2_Region_handle* pomp2_handle); /** Called before a workshare region. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Workshare_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after a workshare region. @param pomp2_handle The handle of the region. */ extern void POMP2_Workshare_exit(POMP2_Region_handle* pomp2_handle); /** Called at the start of an ordered region. @param pomp2_handle The handle of the region. */ extern void POMP2_Ordered_begin(POMP2_Region_handle* pomp2_handle); /** Called at the end of an ordered region. @param pomp2_handle The handle of the region. */ extern void POMP2_Ordered_end(POMP2_Region_handle* pomp2_handle); /** Called before an ordered region. @param pomp2_handle The handle of the region. @param ctc_string Initialization string. Ignored. */ extern void POMP2_Ordered_enter(POMP2_Region_handle* pomp2_handle, const char ctc_string[]); /** Called after an ordered region. @param pomp2_handle The handle of the region. */ extern void POMP2_Ordered_exit(POMP2_Region_handle* pomp2_handle); /** \e OpenMP \e 3.0: When a task encounters a task construct it creates a new task. The task may be scheduled for later execution or executed immediately. In both cases the pomp-adapter assigns the id of the currently active task to \e pomp2_old_task which is defined in the instrumented user code. @param pomp2_handle The handle of the region. @param pomp2_old_task Pointer to the task id in the instrumented user code @param pomp2_if If an if clause is present on the task directive this variable holds the evaluated result of the argument of the if clause. Else it is 1. @param ctc_string The initialization string. */ extern void POMP2_Task_create_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task, int pomp2_if, const char ctc_string[]); /** \e OpenMP \e 3.0: After the code region which is executed as a separate task, the task id of the creating task is restored from \e pomp2_old_task (defined in the instrumented user code) and stored in \e pomp2_current_task inside the adapter. @param pomp2_handle The region handle. @param pomp2_old_task The task id of the task inside of which the task was created. This is stored inside the instrumented user code. */ extern void POMP2_Task_create_end(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** \e OpenMP \e 3.0: Marks the beginning of the execution of a task. @param pomp2_handle The region handle. @param pomp2_task handle of task. */ extern void POMP2_Task_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_task); /** \e OpenMP \e 3.0: Marks the end of the execution of a task. @param pomp2_handle The region handle. */ extern void POMP2_Task_end(POMP2_Region_handle* pomp2_handle); /** \e OpenMP \e 3.0: When a task encounters a task construct it creates a new task. If the untied clause is specified the task is executed as an untied task. The task may be scheduled for later execution or executed immediately. In both cases the pomp-adapter assigns the id of the currently active task to \e pomp2_old_task which is defined in the instrumented user code. @param pomp2_handle The handle of the region. @param pomp2_old_task Pointer to the task id in the instrumented user code. @param pomp2_if If an if clause is present on the task directive this variable holds the evaluated result of the argument of the if clause. Else it is 1. @param ctc_string The initialization string. */ extern void POMP2_Untied_task_create_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_new_task, POMP2_Task_handle* pomp2_old_task, int pomp2_if, const char ctc_string[]); /** \e OpenMP \e 3.0: After the code region which is executed as a separate untied task, the task id of the creating task is restored from \e pomp2_old_task (defined in the instrumented user code) and stored in \e pomp2_current_task inside the adapter. @param pomp2_handle The region handle. @param pomp2_old_task The id of the task from which the untied task was created. This is stored in the instrumented user code. */ extern void POMP2_Untied_task_create_end(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** \e OpenMp \e 3.0: Marks the beginning of the execution of an untied task. @param pomp2_handle The region handle. @param pomp2_task Handle of this task. */ void POMP2_Untied_task_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_task); /** \e OpenMP \e 3.0: Marks the end of the execution of a task. @param pomp2_handle The region handle. */ extern void POMP2_Untied_task_end(POMP2_Region_handle* pomp2_handle); /** Called before a taskwait. \n \e OpenMP \e 3.0: Taskwait directives can be used as scheduling points for tasks. When entering a taskwait region the task id of the currently executing task (\e pomp2_current_task) is saved in \e pomp2_old_task, which is defined inside the instrumented user code. @param pomp2_handle The handle of the started region. @param pomp2_old_task Pointer to a "taskprivate" variable where the current task id is stored. @param ctc_string Initialization string. May be ignored if \ is already initialized. */ extern void POMP2_Taskwait_begin(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle* pomp2_old_task, const char ctc_string[]); /** Called after a barrier. \n \e OpenMP \e 3.0: When a task exits a taskwait region the variable \e pomp2_old_task (defined in the instrumented user code) holds the id of the task that entered the taskwait. The value is stored in the adapter (in \e pomp2_current_task) to be made available for the measurement system for the following regions. @param pomp2_handle The handle of the ended region. @param pomp2_old_task "Taskprivate" variable storing the id of the task the barrier is located in. */ extern void POMP2_Taskwait_end(POMP2_Region_handle* pomp2_handle, POMP2_Task_handle pomp2_old_task); /** Wraps the omp_get_max_threads function. * * Needed for the instrumentation of parallel regions * where the num_threads clause is used with the return * value of the omp_get_max_threads function. This can't * be used directly because the user may have declared * it himself. Double declarations are not allowed. */ extern int POMP2_Lib_get_max_threads(); #ifdef OPENMP_FOUND /** Wraps the omp_init_lock function. * @param s The OpenMP lock to initialize.*/ extern void POMP2_Init_lock(omp_lock_t* s); /** Wraps the omp_destroy_lock function. * @param s The OpenMP lock to destroy. */ extern void POMP2_Destroy_lock(omp_lock_t* s); /** Wraps the omp_set_lock function. * @param s The OpenMP lock to set. */ extern void POMP2_Set_lock(omp_lock_t* s); /** Wraps the omp_unset_lock function. * @param s the OpenMP lock to unset. */ extern void POMP2_Unset_lock(omp_lock_t* s); /** Wraps the omp_test_lock function * @param s the OpenMP lock to test for. * @return result of omp_test_lock*/ extern int POMP2_Test_lock(omp_lock_t* s); /** Wraps the omp_init_nest_lock function. * @param s The nested OpenMP lock to initialize. */ extern void POMP2_Init_nest_lock(omp_nest_lock_t* s); /** Wraps the omp_destroy_nest_lock function. * @param s The nested OpenMP lock to destroy. */ extern void POMP2_Destroy_nest_lock(omp_nest_lock_t* s); /** Wraps the omp_set_nest_lock function * @param s The nested OpenMP lock to set.*/ extern void POMP2_Set_nest_lock(omp_nest_lock_t* s); /** Wraps the omp_unset_nest_lock function * @param s The nested OpenMP lock to unset.*/ extern void POMP2_Unset_nest_lock(omp_nest_lock_t* s); /** Wraps the omp_test_nest_lock function * @param s The nested OpenMP lock to test for. * @return result of omp_test_nest_lock*/ extern int POMP2_Test_nest_lock(omp_nest_lock_t* s); #endif /* OPENMP_FOUND */ #ifdef __cplusplus } #endif #endif eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_parse_init_regions.awk.in000066400000000000000000000106441447213526500270420ustar00rootroot00000000000000#!@OPARI2_AWK@ -f ## ## This file is part of the Score-P software (http://www.score-p.org) ## ## Copyright (c) 2009-2011, ## RWTH Aachen University, Germany ## ## Copyright (c) 2009-2011, ## Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany ## ## Copyright (c) 2009-2011, ## Technische Universitaet Dresden, Germany ## ## Copyright (c) 2009-2011, ## University of Oregon, Eugene, USA ## ## Copyright (c) 2009-2011, 2013 ## Forschungszentrum Juelich GmbH, Germany ## ## Copyright (c) 2009-2011, ## German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany ## ## Copyright (c) 2009-2011, ## Technische Universitaet Muenchen, Germany ## ## This software may be modified and distributed under the terms of ## a BSD-style license. See the COPYING file in the package base ## directory for details. ## # # pomp2_parse_init_regions.awk # # Expects the output of # $(NM) $ALL_OBJS_AND_LIBS as input. See # for a working example. # # The output is C-code that needs to be linked to your application. It # provides several functions: # # void POMP2_Init_regions(): need to be called from your POMP2 library to # initialize all instrumented POMP2 region by calling the instrumented # functions POMP2_Init_reg_*. # # size_t POMP2_Get_num_regions() returns the number of POMP2 regions found # in $ALL_OBJS_AND_LIBS. # # const char* POMP2_Get_opari2_version() returns a version string. # # Three functions returning int and specifying the library interface version: # int POMP2_Get_required_pomp2_library_version_(current|revision|age)() # # Author: Christian Roessel # / [_]*[Pp][Oo][Mm][Pp]2_[Ii][Nn][Ii][Tt]_[Rr][Ee][Gg]_[0-9a-zA-Z][0-9a-zA-Z]*_[1-9][0-9]*/ { if ($0 ~ / [TDA] /) { for (i = 1; i <= NF; i++) { if (index($i,"POMP2_Init_reg") != 0) { separator = "POMP2_Init_reg"; } else if (index($i,"pomp2_init_reg") != 0) { separator = "pomp2_init_reg"; } else if (index($i,"POMP2_INIT_REG") != 0) { separator = "POMP2_INIT_REG"; } else { continue; } # $i looks like "POMP2_Init_reg_uniqueId_nRegions" or # like "pomp2_init_reg_uniqueId_nRegions" or # like "POMP2_INIT_REG_uniqueId_nRegions" split ($i,splitResult,separator); _uniqueId_nRegions = splitResult[2]; if (!(_uniqueId_nRegions in regions)) { regions[_uniqueId_nRegions] = $i; split(_uniqueId_nRegions, tokens, "_"); nRegions += tokens[3]; } } } } END{ print tmp "\n" print "#ifdef __cplusplus" print "extern \"C\"" print "{" print "#endif" print "#include \n" # cut away leading full-stops for (i in regions) { sub(/^\./, "", regions[i]); } # declare POMP2_Init_reg_* functions extern for (i in regions) { print "extern void " regions[i] "();"; } # define POMP2_Init_regions() and call all POMP2_Init_reg_* functions print "\nvoid POMP2_Init_regions()" print "{" for (i in regions) { print " " regions[i] "();"; } print "}\n" # define function POMP2_Get_num_regions() print "size_t POMP2_Get_num_regions()" print "{" if (nRegions != 0) { print " return " nRegions ";" } else { print " return 0;" } print "}\n" # define function POMP2_Get_opari2_version() print "const char* POMP2_Get_opari2_version()" print "{" print " return \"@PACKAGE_VERSION@\";" print "}\n" print "/* " print " * The following functions define the POMP2 library interface version" print " * the instrumented code conforms with. The library interface version" print " * is modeled after" print " * https://www.gnu.org/software/libtool/manual/libtool.html#Versioning" print " */\n" # define function POMP2_Get_required_pomp2_library_version_current() print "int POMP2_Get_required_pomp2_library_version_current()" print "{" print " return @LIBRARY_CURRENT@;" print "}\n" # define function POMP2_Get_required_pomp2_library_version_revision() print "int POMP2_Get_required_pomp2_library_version_revision()" print "{" print " return @LIBRARY_REVISION@;" print "}\n" # define function POMP2_Get_required_pomp2_library_version_age() print "int POMP2_Get_required_pomp2_library_version_age()" print "{" print " return @LIBRARY_AGE@;" print "}\n" print "#ifdef __cplusplus" print "}" print "#endif" } eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_region_info.c000066400000000000000000000627651447213526500245230ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * * Copyright (c) 2009-2011, * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Dresden, Germany * * Copyright (c) 2009-2011, * University of Oregon, Eugene, USA * * Copyright (c) 2009-2011, 2013 * Forschungszentrum Juelich GmbH, Germany * * Copyright (c) 2009-2011, * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Muenchen, Germany * * This software may be modified and distributed under the terms of * a BSD-style license. See the COPYING file in the package base * directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ /** * @file pomp2_region_info.c * @date Started Fri Mar 20 16:59:41 2009 * * @brief * */ #include "pomp2_region_info.h" #include #include #include #include #include #include #include /*----------------------------------------------------------------------------*/ /** @brief CTCData */ typedef struct { /** structured region information */ POMP2_Region_info* mRegionInfo; /** CTC String representation*/ char* mCTCStringToParse; /** memory string*/ char* mCTCStringMemory; /** error string*/ char* mCTCStringForErrorMsg; } CTCData; /** @brief errors the user is responsibel for, i.e. just errors in * the passed string */ typedef enum /* CTC_ERROR_Type */ { CTC_ERROR_Ended_unexpectedly, CTC_ERROR_No_region_type, CTC_ERROR_No_separator_after_length_field, CTC_ERROR_Num_sections_invalid, CTC_ERROR_SCL_broken, CTC_ERROR_SCL_line_number_error, CTC_ERROR_Unknown_token, CTC_ERROR_Unsigned_expected, CTC_ERROR_User_region_name_missing, CTC_ERROR_Wrong_clause_value, CTC_ERROR_Unknown_region_type, CTC_ERROR_No_key, CTC_ERROR_No_value, CTC_ERROR_Zero_length_key, CTC_ERROR_Zero_length_value, CTC_ERROR_Unknown_schedule_type, CTC_ERROR_SCL_error, CTC_ERROR_Inconsistent_line_numbers } CTC_ERROR_Type; static void freeCTCData(CTCData* obj); /** @brief print error information*/ void ctcError(CTCData* obj, CTC_ERROR_Type errorType, const char* info1) { bool abort = true; printf("Error parsing ctc string:\n\"%s\"\n", obj->mCTCStringForErrorMsg); switch (errorType) { case CTC_ERROR_Ended_unexpectedly: printf("ctc string ended unexpectedly.\n"); break; case CTC_ERROR_No_region_type: printf("ctc string has no region type field or value is empty.\n"); break; case CTC_ERROR_No_separator_after_length_field: printf("The separator \"*\" is missing after the length field.\n"); break; case CTC_ERROR_Num_sections_invalid: printf("The value of numSections must be > 0.\n"); break; case CTC_ERROR_SCL_broken: printf("The required attributes sscl and/or escl contain invalid data " "or are missing.\n"); break; case CTC_ERROR_SCL_line_number_error: printf("sscl or escl field has invalid line number arguments (%s).\n", info1); break; case CTC_ERROR_Unknown_token: printf("Token \"%s\" not known.\n", info1); abort = false; break; case CTC_ERROR_Unsigned_expected: printf("A value >= 0 is expected, \"%s\" is not allowed.\n", info1); break; case CTC_ERROR_User_region_name_missing: printf("The field or value \"userRegionName\" is missing.\n"); break; case CTC_ERROR_Wrong_clause_value: printf("Clause field value must be \"0\" or \"1\", " "\"%s\" is not allowed.\n", info1); break; case CTC_ERROR_Unknown_region_type: printf("Region type \"%s\" not known.\n", info1); break; case CTC_ERROR_No_key: printf("Could not detect key in \"%s\", \"=\" or \"*\" missing.\n", info1); break; case CTC_ERROR_No_value: printf("Could not detect value in \"%s\", \"*\" missing.\n", info1); break; case CTC_ERROR_Zero_length_key: printf("The character sequence \"*=\" is not allowed.\n"); break; case CTC_ERROR_Zero_length_value: printf("The character sequence \"=*\" is not allowed.\n"); break; case CTC_ERROR_Unknown_schedule_type: printf("Schedule type \"%s\" not known.\n", info1); break; case CTC_ERROR_Inconsistent_line_numbers: printf("Line numbers not valid. Expected startLineNo1 <= startLineNo2 <= endLineNo1 <= endLineNo2 \n"); FALLTHROUGH; case CTC_ERROR_SCL_error: printf("Error parsing source code location, " "expecting \"filename:lineNo1:lineNo2\".\n"); break; default: puts("ctc internal error: unknown error type."); } if (abort) { freeCTCData(obj); puts("Aborting"); exit(1); } } /*----------------------------------------------------------------------------*/ static void parseCTCStringAndAssignRegionInfoValues(CTCData* obj); static void checkConsistency(CTCData* obj); static void initCTCData(CTCData* obj, const char string[], POMP2_Region_info* regionInfo); void ctcString2RegionInfo(const char string[], POMP2_Region_info* regionInfo) { assert(regionInfo); CTCData ctcData; initCTCData(&ctcData, string, regionInfo); parseCTCStringAndAssignRegionInfoValues(&ctcData); checkConsistency(&ctcData); freeCTCData(&ctcData); } static void initRegionInfo(CTCData* obj); static void copyCTCStringToInternalMemory(CTCData* obj, const char* source); static void initCTCData(CTCData* obj, const char string[], POMP2_Region_info* regionInfo) { obj->mRegionInfo = regionInfo; initRegionInfo(obj); obj->mCTCStringToParse = 0; obj->mCTCStringMemory = 0; obj->mCTCStringForErrorMsg = 0; copyCTCStringToInternalMemory(obj, string); } static void initRegionInfo(CTCData* obj) { obj->mRegionInfo->mRegionType = POMP2_No_type; obj->mRegionInfo->mStartFileName = 0; obj->mRegionInfo->mStartLine1 = 0; obj->mRegionInfo->mStartLine2 = 0; obj->mRegionInfo->mEndFileName = 0; obj->mRegionInfo->mEndLine1 = 0; obj->mRegionInfo->mEndLine2 = 0; obj->mRegionInfo->mHasCollapse = false; obj->mRegionInfo->mHasCopyIn = false; obj->mRegionInfo->mHasCopyPrivate = false; obj->mRegionInfo->mHasFirstPrivate = false; obj->mRegionInfo->mHasIf = false; obj->mRegionInfo->mHasLastPrivate = false; obj->mRegionInfo->mHasNoWait = false; obj->mRegionInfo->mHasNumThreads = false; obj->mRegionInfo->mHasOrdered = false; obj->mRegionInfo->mHasReduction = false; obj->mRegionInfo->mHasUntied = false; obj->mRegionInfo->mScheduleType = POMP2_No_schedule; obj->mRegionInfo->mNumSections = 0; obj->mRegionInfo->mCriticalName = 0; obj->mRegionInfo->mUserRegionName = 0; obj->mRegionInfo->mUserGroupName = 0; } static void copyCTCStringToInternalMemory(CTCData* obj, const char* source) { assert(obj->mCTCStringToParse == 0); assert(obj->mCTCStringMemory == 0); assert(obj->mCTCStringForErrorMsg == 0); const size_t nBytes = strlen(source) * sizeof(char) + 1; obj->mCTCStringMemory = malloc(nBytes); obj->mCTCStringForErrorMsg = malloc(nBytes); strcpy(obj->mCTCStringMemory, source); strcpy(obj->mCTCStringForErrorMsg, source); obj->mCTCStringToParse = obj->mCTCStringMemory; } static void freeAndReset(char** freeMe); static void freeCTCData(CTCData* obj) { freeAndReset(&(obj->mCTCStringMemory)); freeAndReset(&(obj->mCTCStringForErrorMsg)); obj->mCTCStringToParse = 0; } static void freeAndReset(char** freeMe) { if (*freeMe) { free(*freeMe); *freeMe = 0; } } /** CTC Tokens */ typedef enum { CTC_Region_type, CTC_Start_source_code_location, CTC_End_source_code_location, CTC_Has_copy_in, CTC_Has_copy_private, CTC_Has_first_private, CTC_Has_last_private, CTC_Has_no_wait, CTC_Has_ordered, CTC_Has_reduction, CTC_Schedule_type, CTC_Num_sections, CTC_Critical_name, CTC_User_region_name, CTC_User_group_name, CTC_Has_if, CTC_Has_collapse, CTC_Has_num_threads, CTC_Has_untied, CTC_No_token } CTCToken; static void ignoreLengthField(CTCData* obj); static bool getKeyValuePair(CTCData* obj, char** key, char** value); static CTCToken getCTCTokenFromString(char* token); static void assignRegionType(CTCData* obj, const char* value); static void assignSourceCodeLocation(CTCData* obj, char** fileName, unsigned* line1, unsigned* line2, char* value); static void assignHasClause(CTCData* obj, bool* hasClause, const char* value); static void assignScheduleType(CTCData* obj, char* __restrict__ value); static void assignUnsigned(CTCData* obj, unsigned* anUnsigned, const char* value); static void assignString(char** aString, const char* value); static void parseCTCStringAndAssignRegionInfoValues(CTCData* obj) { char* key; char* value; ignoreLengthField(obj); while (getKeyValuePair(obj, &key, &value)) { switch (getCTCTokenFromString(key)) { case CTC_Region_type: assignRegionType(obj, value); break; case CTC_Start_source_code_location: assignSourceCodeLocation(obj, &obj->mRegionInfo->mStartFileName, &obj->mRegionInfo->mStartLine1, &obj->mRegionInfo->mStartLine2, value); break; case CTC_End_source_code_location: assignSourceCodeLocation(obj, &obj->mRegionInfo->mEndFileName, &obj->mRegionInfo->mEndLine1, &obj->mRegionInfo->mEndLine2, value); break; case CTC_Has_copy_in: assignHasClause(obj, &obj->mRegionInfo->mHasCopyIn, value); break; case CTC_Has_copy_private: assignHasClause(obj, &obj->mRegionInfo->mHasCopyPrivate, value); break; case CTC_Has_first_private: assignHasClause(obj, &obj->mRegionInfo->mHasFirstPrivate, value); break; case CTC_Has_if: assignHasClause(obj, &obj->mRegionInfo->mHasIf, value); break; case CTC_Has_last_private: assignHasClause(obj, &obj->mRegionInfo->mHasLastPrivate, value); break; case CTC_Has_no_wait: assignHasClause(obj, &obj->mRegionInfo->mHasNoWait, value); break; case CTC_Has_num_threads: assignHasClause(obj, &obj->mRegionInfo->mHasNumThreads, value); break; case CTC_Has_ordered: assignHasClause(obj, &obj->mRegionInfo->mHasOrdered, value); break; case CTC_Has_reduction: assignHasClause(obj, &obj->mRegionInfo->mHasReduction, value); break; case CTC_Has_collapse: assignHasClause(obj, &obj->mRegionInfo->mHasCollapse, value); break; case CTC_Has_untied: assignHasClause(obj, &obj->mRegionInfo->mHasUntied, value); break; case CTC_Schedule_type: assignScheduleType(obj, value); break; case CTC_Num_sections: assignUnsigned(obj, &obj->mRegionInfo->mNumSections, value); break; case CTC_Critical_name: assignString(&obj->mRegionInfo->mCriticalName, value); break; case CTC_User_region_name: assignString(&obj->mRegionInfo->mUserRegionName, value); break; case CTC_User_group_name: assignString(&obj->mRegionInfo->mUserGroupName, value); break; default: ctcError(obj, CTC_ERROR_Unknown_token, key); } } } static void ignoreLengthField(CTCData* obj) { /* We expect ctcString to look like "42*key=value*...**" * The length field is redundant and we don't use it in our parsing * implementation. */ while (obj->mCTCStringToParse && isdigit(*obj->mCTCStringToParse)) { ++(obj->mCTCStringToParse); } if (!obj->mCTCStringToParse) { ctcError(obj, CTC_ERROR_Ended_unexpectedly, 0); } if (*obj->mCTCStringToParse != '*') { ctcError(obj, CTC_ERROR_No_separator_after_length_field, 0); } ++(obj->mCTCStringToParse); if (!obj->mCTCStringToParse) { ctcError(obj, CTC_ERROR_Ended_unexpectedly, 0); } } static bool extractNextToken(char** string, const char tokenDelimiter); static bool getKeyValuePair(CTCData* obj, char** key, char** value) { /* We expect ctcString to look like "key=value*...**" or "*". */ if (*(obj->mCTCStringToParse) == '*') { return false; /* end of ctc string */ } if (*(obj->mCTCStringToParse) == '\0') { return false; /* also end of ctc string. we don't force the second "*" */ } *key = obj->mCTCStringToParse; if (!extractNextToken(&obj->mCTCStringToParse, '=')) { ctcError(obj, CTC_ERROR_No_key, *key); } if (strlen(*key) == 0) { ctcError(obj, CTC_ERROR_Zero_length_key, 0); } *value = obj->mCTCStringToParse; if (!extractNextToken(&obj->mCTCStringToParse, '*')) { ctcError(obj, CTC_ERROR_No_value, *value); } if (strlen(*value) == 0) { ctcError(obj, CTC_ERROR_Zero_length_value, 0); } return true; } static bool extractNextToken(char** string, const char tokenDelimiter) { *string = strchr(*string, tokenDelimiter); if (!(*string && **string == tokenDelimiter)) { return false; } **string = '\0'; /* extraction */ ++(*string); return true; } /** @brief matching between string description and CTC token*/ typedef struct { /** string representation*/ char* mTokenString; /** matching CTCToken*/ CTCToken mToken; } CTCTokenMapValueType; /** @brief map with CTC tokens*/ static const CTCTokenMapValueType ctcTokenMap[] = { /* Entries must be sorted to be used in binary search. */ /* If you add/remove items update ctcTokenMapSize */ {"criticalName", CTC_Critical_name}, {"escl", CTC_End_source_code_location}, {"hasCollapse", CTC_Has_collapse}, {"hasCopyIn", CTC_Has_copy_in}, {"hasCopyPrivate", CTC_Has_copy_private}, {"hasFirstPrivate", CTC_Has_first_private}, {"hasIf", CTC_Has_if}, {"hasLastPrivate", CTC_Has_last_private}, {"hasNoWait", CTC_Has_no_wait}, {"hasNumThreads", CTC_Has_num_threads}, {"hasOrdered", CTC_Has_ordered}, {"hasReduction", CTC_Has_reduction}, {"hasUntied", CTC_Has_untied}, {"numSections", CTC_Num_sections}, {"regionType", CTC_Region_type}, {"scheduleType", CTC_Schedule_type}, {"sscl", CTC_Start_source_code_location}, {"userGroupName", CTC_User_group_name}, {"userRegionName", CTC_User_region_name}}; /** @brief number of entries in ctcTokenMap*/ const size_t ctcTokenMapSize = sizeof(ctcTokenMap) / sizeof(CTCTokenMapValueType); static int ctcTokenMapCompare(const void* searchToken, const void* mapElem); static CTCToken getCTCTokenFromString(char* token) { CTCTokenMapValueType* mapElem = (CTCTokenMapValueType*)bsearch( token, &ctcTokenMap, ctcTokenMapSize, sizeof(CTCTokenMapValueType), ctcTokenMapCompare); if (mapElem) { return mapElem->mToken; } else { return CTC_No_token; } } static int ctcTokenMapCompare(const void* searchToken, const void* mapElem) { const char* const token = (const char*)searchToken; CTCTokenMapValueType* elem = (CTCTokenMapValueType*)mapElem; return strcmp(token, elem->mTokenString); } /** @brief maching between region string and region type */ typedef struct { /** string representation*/ char* mRegionTypeString; /** matching region type*/ POMP2_Region_type mRegionType; } RegionTypesMapValueType; /** @brief map with region types*/ static const RegionTypesMapValueType regionTypesMap[] = { /* Entries must be sorted to be used in binary search. */ /* If you add/remove items, regionTypesMap_size */ {"atomic", POMP2_Atomic}, {"barrier", POMP2_Barrier}, {"critical", POMP2_Critical}, {"do", POMP2_Do}, {"flush", POMP2_Flush}, {"for", POMP2_For}, {"master", POMP2_Master}, {"ordered", POMP2_Ordered}, {"parallel", POMP2_Parallel}, {"paralleldo", POMP2_Parallel_do}, {"parallelfor", POMP2_Parallel_for}, {"parallelsections", POMP2_Parallel_sections}, {"parallelworkshare", POMP2_Parallel_workshare}, {"region", POMP2_User_region}, {"sections", POMP2_Sections}, {"single", POMP2_Single}, {"task", POMP2_Task}, {"taskuntied", POMP2_Taskuntied}, {"taskwait", POMP2_Taskwait}, {"workshare", POMP2_Workshare}}; /** @brief number of entries in regionTypesMap*/ const size_t regionTypesMapSize = sizeof(regionTypesMap) / sizeof(RegionTypesMapValueType); static POMP2_Region_type getRegionTypeFromString(const char* regionTypeString); static void assignRegionType(CTCData* obj, const char* value) { obj->mRegionInfo->mRegionType = getRegionTypeFromString(value); if (obj->mRegionInfo->mRegionType == POMP2_No_type) { ctcError(obj, CTC_ERROR_Unknown_region_type, value); } } static int regionTypesMapCompare(const void* searchKey, const void* mapElem); static POMP2_Region_type getRegionTypeFromString(const char* regionTypeString) { RegionTypesMapValueType* mapElem = (RegionTypesMapValueType*)bsearch( regionTypeString, ®ionTypesMap, regionTypesMapSize, sizeof(RegionTypesMapValueType), regionTypesMapCompare); if (mapElem) { return mapElem->mRegionType; } else { return POMP2_No_type; } } static int regionTypesMapCompare(const void* searchKey, const void* mapElem) { const char* const key = (const char*)searchKey; RegionTypesMapValueType* elem = (RegionTypesMapValueType*)mapElem; return strcmp(key, elem->mRegionTypeString); } static void assignSourceCodeLocation(CTCData* obj, char** filename, unsigned* line1, unsigned* line2, char* value) { /* We assume that value looks like "foo.c:42:43" */ char* token = value; int line1Tmp = -1; int line2Tmp = -1; bool continueExtraction; assert(*filename == 0); if ((continueExtraction = extractNextToken(&value, ':'))) { *filename = malloc(strlen(token) * sizeof(char) + 1); strcpy(*filename, token); } token = value; if (continueExtraction && (continueExtraction = extractNextToken(&value, ':'))) { line1Tmp = atoi(token); } token = value; if (continueExtraction && extractNextToken(&value, '\0')) { line2Tmp = atoi(token); } if (*filename != 0 && line1Tmp > -1 && line2Tmp > -1) { *line1 = line1Tmp; *line2 = line2Tmp; if (*line1 > *line2) { ctcError(obj, CTC_ERROR_SCL_line_number_error, "line1 > line2"); } } else { ctcError(obj, CTC_ERROR_SCL_error, 0); } } static void assignHasClause(CTCData* obj, bool* hasClause, const char* value) { if (!isdigit(*value)) { ctcError(obj, CTC_ERROR_Wrong_clause_value, value); } int tmp = atoi(value); if (tmp != 0 && tmp != 1) { ctcError(obj, CTC_ERROR_Wrong_clause_value, value); } *hasClause = tmp; } static POMP2_Schedule_type getScheduleTypeFromString(const char* key); static void assignScheduleType(CTCData* obj, char* __restrict__ value) { char* token = NULL; token = strtok(value, ","); if (token) { obj->mRegionInfo->mScheduleType = getScheduleTypeFromString(token); } else { obj->mRegionInfo->mScheduleType = getScheduleTypeFromString(value); } if (obj->mRegionInfo->mScheduleType == POMP2_No_schedule) { ctcError(obj, CTC_ERROR_Unknown_schedule_type, value); } } static void assignUnsigned(CTCData* obj, unsigned* anUnsigned, const char* value) { int tmp = atoi(value); if (tmp < 0) { ctcError(obj, CTC_ERROR_Unsigned_expected, value); } *anUnsigned = tmp; } static void assignString(char** aString, const char* value) { *aString = malloc(strlen(value) * sizeof(char) + 1); strcpy(*aString, value); } static void checkConsistency(CTCData* obj) { bool requiredAttributesFound; if (obj->mRegionInfo->mRegionType == POMP2_No_type) { ctcError(obj, CTC_ERROR_No_region_type, 0); return; } requiredAttributesFound = (obj->mRegionInfo->mStartFileName && obj->mRegionInfo->mEndFileName); if (!requiredAttributesFound) { ctcError(obj, CTC_ERROR_SCL_broken, 0); return; } if (obj->mRegionInfo->mRegionType == POMP2_Sections && obj->mRegionInfo->mNumSections <= 0) { ctcError(obj, CTC_ERROR_Num_sections_invalid, 0); return; } if (obj->mRegionInfo->mRegionType == POMP2_User_region && obj->mRegionInfo->mUserRegionName == 0) { ctcError(obj, CTC_ERROR_User_region_name_missing, 0); return; } if (obj->mRegionInfo->mStartLine1 > obj->mRegionInfo->mStartLine2) { ctcError(obj, CTC_ERROR_Inconsistent_line_numbers, 0); return; } if (obj->mRegionInfo->mEndLine1 > obj->mRegionInfo->mEndLine2) { ctcError(obj, CTC_ERROR_Inconsistent_line_numbers, 0); return; } /* A barrier, taskwait and flush does not have an end line number, since it * is not associated to a region.*/ if (obj->mRegionInfo->mStartLine2 > obj->mRegionInfo->mEndLine1 && obj->mRegionInfo->mRegionType != POMP2_Barrier && obj->mRegionInfo->mRegionType != POMP2_Taskwait && obj->mRegionInfo->mRegionType != POMP2_Flush) { ctcError(obj, CTC_ERROR_Inconsistent_line_numbers, 0); return; } } /*----------------------------------------------------------------------------*/ void freePOMP2RegionInfoMembers(POMP2_Region_info* regionInfo) { freeAndReset(®ionInfo->mStartFileName); freeAndReset(®ionInfo->mEndFileName); freeAndReset(®ionInfo->mCriticalName); freeAndReset(®ionInfo->mUserRegionName); freeAndReset(®ionInfo->mUserGroupName); } /*----------------------------------------------------------------------------*/ /** @brief returns a region string*/ const char* pomp2RegionType2String(POMP2_Region_type regionType) { unsigned int i; for (i = 0; i < regionTypesMapSize; ++i) { if (regionType == regionTypesMap[i].mRegionType) { return regionTypesMap[i].mRegionTypeString; } } return "no valid region type"; } /*----------------------------------------------------------------------------*/ /** @brief matching between schedule string description and schedule type*/ typedef struct { /** string representation */ char* mScheduleTypeString; /** matching schedule type*/ POMP2_Schedule_type mScheduleType; } ScheduleTypesMapValueType; /** @brief map with schedule types*/ static const ScheduleTypesMapValueType scheduleTypesMap[] = { /* Entries must be sorted to be used in binary search. */ /* If you add/remove items, scheduleTypesMapSize */ {"auto", POMP2_Auto}, {"dynamic", POMP2_Dynamic}, {"guided", POMP2_Guided}, {"runtime", POMP2_Runtime}, {"static", POMP2_Static}}; /** @brief number of entries in scheduleTypesMap*/ const size_t scheduleTypesMapSize = sizeof(scheduleTypesMap) / sizeof(ScheduleTypesMapValueType); static int scheduleTypesMapCompare(const void* searchKey, const void* mapElem); /* @brief Assigns a schedule type according to an entry in the ctc string */ static POMP2_Schedule_type getScheduleTypeFromString(const char* key) { ScheduleTypesMapValueType* mapElem = (ScheduleTypesMapValueType*)bsearch(key, &scheduleTypesMap, scheduleTypesMapSize, sizeof(ScheduleTypesMapValueType), scheduleTypesMapCompare); if (mapElem) { return mapElem->mScheduleType; } else { return POMP2_No_schedule; } } static int scheduleTypesMapCompare(const void* searchKey, const void* mapElem) { const char* const key = (const char*)searchKey; ScheduleTypesMapValueType* elem = (ScheduleTypesMapValueType*)mapElem; return strcmp(key, elem->mScheduleTypeString); } /** @brief returns a string of the schedule type*/ const char* pomp2ScheduleType2String(POMP2_Schedule_type scheduleType) { unsigned int i; for (i = 0; i < scheduleTypesMapSize; ++i) { if (scheduleType == scheduleTypesMap[i].mScheduleType) { return scheduleTypesMap[i].mScheduleTypeString; } } return "no valid schedule type"; } eztrace-2.1/src/modules/omp/pomp-lib-dummy/pomp2_region_info.h000066400000000000000000000161371447213526500245200ustar00rootroot00000000000000/* * This file is part of the Score-P software (http://www.score-p.org) * * Copyright (c) 2009-2011, * RWTH Aachen University, Germany * * Copyright (c) 2009-2011, * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Dresden, Germany * * Copyright (c) 2009-2011, * University of Oregon, Eugene, USA * * Copyright (c) 2009-2011, 2013 * Forschungszentrum Juelich GmbH, Germany * * Copyright (c) 2009-2011, * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany * * Copyright (c) 2009-2011, * Technische Universitaet Muenchen, Germany * * This software may be modified and distributed under the terms of * a BSD-style license. See the COPYING file in the package base * directory for details. * */ /**************************************************************************** ** SCALASCA http://www.scalasca.org/ ** ** KOJAK http://www.fz-juelich.de/jsc/kojak/ ** ***************************************************************************** ** Copyright (c) 1998-2009 ** ** Forschungszentrum Juelich, Juelich Supercomputing Centre ** ** ** ** See the file COPYRIGHT in the package base directory for details ** ****************************************************************************/ #ifndef POMP2_REGION_INFO_H #define POMP2_REGION_INFO_H /** * @file pomp2_region_info.h * @date Started Fri Mar 20 16:30:45 2009 * * @brief This file contains function declarations and structs * which handle informations on OpenMP regions. POMP2_Region_info * is used to store these informations. It can be filled with a * ctcString by ctcString2RegionInfo(). * */ #include /** * POMP2_Region_type * */ typedef enum /* POMP2_Region_type */ { POMP2_No_type, POMP2_Atomic, POMP2_Barrier, POMP2_Critical, POMP2_Do, POMP2_Flush, POMP2_For, POMP2_Master, POMP2_Ordered, POMP2_Parallel, POMP2_Parallel_do, POMP2_Parallel_for, POMP2_Parallel_sections, POMP2_Parallel_workshare, POMP2_Sections, POMP2_Single, POMP2_Task, POMP2_Taskuntied, POMP2_Taskwait, POMP2_User_region, POMP2_Workshare } POMP2_Region_type; /** converts regionType into a string * @param regionType The regionType to be converted. * @return string representation of the region type*/ const char* pomp2RegionType2String(POMP2_Region_type regionType); /** * type to store the scheduling type of a for worksharing constuct * */ typedef enum { POMP2_No_schedule, POMP2_Static, /* needs chunk size */ POMP2_Dynamic, /* needs chunk size */ POMP2_Guided, /* needs chunk size */ POMP2_Runtime, POMP2_Auto } POMP2_Schedule_type; /** converts scheduleType into a string * @param scheduleType The scheduleType to be converted. * @return string representation of the scheduleType*/ const char* pomp2ScheduleType2String(POMP2_Schedule_type scheduleType); /** * @brief This struct stores all information on an OpenMP region, like the * region type or corresponding source lines. The function * ctcString2RegionInfo() can be used to fill this struct with data * from a ctcString. */ typedef struct { /** @name Required attributes */ /*@{*/ /** type of the OpenMP region*/ POMP2_Region_type mRegionType; /** name of the corresponding source file from the opening pragma */ char* mStartFileName; /** line number of the first line from the opening pragma */ unsigned mStartLine1; /** line number of the last line from the opening pragma */ unsigned mStartLine2; /** name of the corresponding source file from the closing pragma */ char* mEndFileName; /** line number of the first line from the closing pragma */ unsigned mEndLine1; /** line number of the last line from the closing pragma */ unsigned mEndLine2; /*@}*/ /** @name Currently not provided by opari */ /*@{*/ /**true if a copyin clause is present*/ bool mHasCopyIn; /**true if a copyprivate clause is present*/ bool mHasCopyPrivate; /**true if an if clause is present*/ bool mHasIf; /**true if a firstprivate clause is present*/ bool mHasFirstPrivate; /**true if a lastprivate clause is present*/ bool mHasLastPrivate; /**true if a nowait clause is present*/ bool mHasNoWait; /**true if a numThreads clause is present*/ bool mHasNumThreads; /**true if an ordered clause is present*/ bool mHasOrdered; /**true if a reduction clause is present*/ bool mHasReduction; /**true if a collapse clause is present*/ bool mHasCollapse; /**true if a untied clause was present, even if the task was changed to tied during instrumentation.*/ bool mHasUntied; /** schedule type in the schedule clause*/ POMP2_Schedule_type mScheduleType; /** user group name*/ char* mUserGroupName; /*@}*/ /** @name Attributes for specific region types */ /*@{*/ /** number of sections*/ unsigned mNumSections; /** name of a named critical region*/ char* mCriticalName; /** name of a user defined region*/ char* mUserRegionName; /*@}*/ } POMP2_Region_info; /** * ctcString2RegionInfo() fills the POMP2_Region_info object with data read * from the ctcString. If the ctcString does not comply with the * specification, the program aborts with exit code 1. @n Rationale: * ctcString2RegionInfo() is used during initialization of the measurement * system. If an error occurs, it is better to abort than to struggle with * undefined behaviour or @e guessing the meaning of the broken string. * * @note Can be called from multiple threads concurrently, assuming malloc is * thread-safe. * * @note ctcString2RegionInfo() will assign memory to the members of @e * regionInfo. You are supposed to to release this memory by calling * freePOMP2RegionInfoMembers(). * * @param ctcString A string in the format * "length*key=value*[key=value]*". The length field is parsed but not used by * this implementation. Possible values for key are listed in * ctcTokenMap. The string must at least contain values for the keys @c * regionType, @c sscl and @c escl. Possible values for the key @c regionType * are listed in regionTypesMap. The format for @c sscl resp. @c escl values * is @c "filename:lineNo1:lineNo2". * * @param regionInfo must be a valid object * * @post At least the required attributes (see POMP2_Region_info) are set. @n * All other members of @e regionInfo are set to 0 resp. false * resp. POMP2_No_schedule. @n If @c regionType=sections than * POMP2_Region_info::mNumSections has a value > 0. @n If @c regionType=region * than POMP2_Region_info::mUserRegionName has a value != 0. @n If @c * regionType=critical than POMP2_Region_info::mCriticalName may have a value * != 0. * */ void ctcString2RegionInfo(const char ctcString[], POMP2_Region_info* regionInfo); /** * Free the memory of the regionInfo members. * @param regionInfo The regioninfo to be freed. */ void freePOMP2RegionInfoMembers(POMP2_Region_info* regionInfo); #endif /* POMP2_REGION_INFO_H */ eztrace-2.1/src/modules/ompt/000077500000000000000000000000001447213526500162405ustar00rootroot00000000000000eztrace-2.1/src/modules/ompt/CMakeLists.txt000066400000000000000000000012261447213526500210010ustar00rootroot00000000000000add_library(eztrace-ompt SHARED openmp.c ) target_link_libraries(eztrace-ompt PRIVATE atomic dl eztrace-core eztrace-lib eztrace-instrumentation ${OMPT_LIBRARY} ) target_include_directories(eztrace-ompt PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ${OMPT_INCLUDE_DIR} ) target_compile_options(eztrace-ompt PUBLIC -fopenmp ) target_link_options(eztrace-ompt PUBLIC -fopenmp ) #--------------------------------------------- install(TARGETS eztrace-ompt LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/ompt/openmp.c000066400000000000000000000407101447213526500177040ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include #include #include #include #include #include #include #include #include #include static volatile int _ompt_initialized = 0; static ompt_get_thread_data_t ompt_get_thread_data; static ompt_get_unique_id_t ompt_get_unique_id; #define CURRENT_MODULE ompt DECLARE_CURRENT_MODULE; static int openmp_parallel_id = -1; static int openmp_implicit_task_id = -1; static int openmp_acquire_mutex_id = -1; static int openmp_task_id = -1; static int openmp_for_id = -1; static int openmp_implicit_barrier_id = -1; static int openmp_barrier_id = -1; static int loop_ptr_id = -1; static struct ezt_hashtable mutex_map; static void _init_ompt_otf2() { /* sometimes, ezt_otf2_register_function returns 1 (because eztrace is being * initialized). Thus, we may have to call this function several times untils its * succeeds. */ static _Atomic int initialized = 0; if(initialized) return; if(openmp_parallel_id < 0) openmp_parallel_id = ezt_otf2_register_function("OpenMP parallel"); if(openmp_implicit_task_id < 0) openmp_implicit_task_id = ezt_otf2_register_function("OpenMP implicit task"); if(openmp_acquire_mutex_id < 0) openmp_acquire_mutex_id = ezt_otf2_register_function("OpenMP acquire mutex"); if(openmp_task_id < 0) openmp_task_id = ezt_otf2_register_function("OpenMP task"); if(openmp_for_id < 0) openmp_for_id = ezt_otf2_register_function("OpenMP loop"); if(openmp_implicit_barrier_id < 0) openmp_implicit_barrier_id = ezt_otf2_register_function("OpenMP implicit barrier"); if(openmp_barrier_id < 0) openmp_barrier_id = ezt_otf2_register_function("OpenMP barrier"); if(loop_ptr_id < 0) loop_ptr_id = ezt_otf2_register_attribute("Loop pointer", OTF2_TYPE_INT64); if( openmp_parallel_id != -1 && openmp_implicit_task_id != -1 && openmp_acquire_mutex_id != -1 && openmp_task_id != -1 && openmp_for_id != -1 && openmp_implicit_barrier_id != -1 && openmp_barrier_id != -1 && loop_ptr_id != -1) initialized = 1; } static void init_ompt() { INSTRUMENT_FUNCTIONS(ompt); ezt_hashtable_init(&mutex_map, 1024); if (eztrace_autostart_enabled()) eztrace_start(); _init_ompt_otf2(); _ompt_initialized = 1; } static void finalize_ompt() { _ompt_initialized = 0; ezt_hashtable_finalize(&mutex_map); eztrace_stop(); } static void on_ompt_callback_work(ompt_work_t wstype, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, uint64_t count, const void *codeptr_ra ) { if (EZTRACE_SAFE) { if(wstype==ompt_work_loop) { _init_ompt_otf2(); /* TODO: get the source code location that corresponds to codeptr_ra */ OTF2_AttributeList* attribute_list = OTF2_AttributeList_New(); OTF2_AttributeList_AddAttribute_uint64(attribute_list, loop_ptr_id, (uint64_t)codeptr_ra); if( endpoint==ompt_scope_begin) { EZT_OTF2_EvtWriter_Enter(evt_writer, attribute_list, ezt_get_timestamp(), openmp_for_id); } else { EZT_OTF2_EvtWriter_Leave(evt_writer, attribute_list, ezt_get_timestamp(), openmp_for_id); } } /* shall we do something for the other types of work ? ompt_work_sections ompt_work_single_executor ompt_work_single_other ompt_work_workshare ompt_work_distribute ompt_work_taskloop ompt_work_scope */ } } static void on_ompt_callback_sync_region( ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) { if (EZTRACE_SAFE) { _init_ompt_otf2(); switch(kind) { case ompt_sync_region_barrier: case ompt_sync_region_barrier_explicit: case ompt_sync_region_barrier_implementation: #if HAVE_OMPT_51 case ompt_sync_region_barrier_teams: #endif if( endpoint==ompt_scope_begin) { EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_barrier_id); } else { EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_barrier_id); } break; case ompt_sync_region_barrier_implicit: #if HAVE_OMPT_51 case ompt_sync_region_barrier_implicit_workshare: case ompt_sync_region_barrier_implicit_parallel: #endif if( endpoint==ompt_scope_begin) { EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_implicit_barrier_id); } else { EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_implicit_barrier_id); } break; case ompt_sync_region_taskwait: case ompt_sync_region_taskgroup: case ompt_sync_region_reduction: /* unsupported */ break; } } } static void on_ompt_callback_parallel_begin(ompt_data_t *encountering_task_data, const ompt_frame_t *encountering_task_frame, ompt_data_t *parallel_data, unsigned int requested_parallelism, int flags, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; if (EZTRACE_SAFE) { _init_ompt_otf2(); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadTeamBegin(evt_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM)); EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_parallel_id); } } static void on_ompt_callback_parallel_end(ompt_data_t *parallel_data, ompt_data_t *encountering_task_data, int flags, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; if (EZTRACE_SAFE) { _init_ompt_otf2(); EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_parallel_id); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadTeamEnd(evt_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM)); } } static void on_ompt_callback_thread_begin(ompt_thread_t thread_type, ompt_data_t *thread_data) { /* OpenMP may spawn thread without calling pthread_create, so we may have to initialize the current thread */ if(thread_status == ezt_trace_status_uninitialized) ezt_init_thread(); thread_data->value = thread_rank; } static void on_ompt_callback_thread_end(ompt_data_t *thread_data) { /* OpenMP may destroy threads without calling pthread_exit, so we have to finalize them here*/ ezt_finalize_thread(); } static void on_ompt_callback_task_create(ompt_data_t *encountering_task_data, const ompt_frame_t *encountering_task_frame, ompt_data_t *new_task_data, int flags, int has_dependences, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; new_task_data->value = ompt_get_unique_id(); if (EZTRACE_SAFE) { _init_ompt_otf2(); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadTaskCreate(evt_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM, tid, new_task_data->value)); } } static void on_ompt_callback_task_schedule(ompt_data_t *prior_task_data, ompt_task_status_t prior_task_status, ompt_data_t *next_task_data) { uint64_t tid = ompt_get_thread_data()->value; uint32_t ptid = prior_task_data->value; uint32_t ntid = next_task_data->value; /* TODO: Add attributes for prior task id and next task id The following section has been commented out because of an assertion error in _register_attribute (eztrace_otf2.c:194) To reproduce the error, uncomment the commented lines and test the module with any application from https://github.com/bsc-pm/bots */ /* OTF2_AttributeList* attr_list = OTF2_AttributeList_New(); // Create attribute for prior task id OTF2_AttributeValue ptid_attr_value; OTF2_AttributeRef ptid_attr_id = ezt_otf2_register_attribute("Prior task id", OTF2_TYPE_UINT32); ptid_attr_value.uint32 = ptid; // Create attribute for next task id OTF2_AttributeValue ntid_attr_value; OTF2_AttributeRef ntid_attr_id = ezt_otf2_register_attribute("Next task id", OTF2_TYPE_UINT32); ntid_attr_value.uint32 = next_task_data->value; */ if (EZTRACE_SAFE) { _init_ompt_otf2(); // Add prior task id to attribute list // OTF2_AttributeList_AddAttribute(attr_list, ptid_attr_id, OTF2_TYPE_UINT32, ptid_attr_value); EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_task_id); // Add prior and next task ids to attribute list // OTF2_AttributeList_AddAttribute(attr_list, ptid_attr_id, OTF2_TYPE_UINT32, ptid_attr_value); // OTF2_AttributeList_AddAttribute(attr_list, ntid_attr_id, OTF2_TYPE_UINT32, ntid_attr_value); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadTaskSwitch(evt_writer, NULL, ezt_get_timestamp(), OTF2_UNDEFINED_COMM, tid, ntid)); // Add next task id to attribute list // OTF2_AttributeList_AddAttribute(attr_list, ntid_attr_id, OTF2_TYPE_UINT32, ntid_attr_value); EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_task_id); } } static void on_ompt_callback_implicit_task(ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, unsigned int actual_parallelism, unsigned int index, int flags) { uint64_t tid = ompt_get_thread_data()->value; /* TODO: in some cases, implicit tasks may end at the thread * destruction (when it's too late for recording an event). * * This leads to "unbalanced" traces where some of the ENTER events * are never matched with a LEAVE event. */ if (EZTRACE_SAFE) { _init_ompt_otf2(); if (endpoint == ompt_scope_begin) { EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_implicit_task_id); } else if (endpoint == ompt_scope_end) { EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_implicit_task_id); } } } static _Atomic uint32_t next_mutex_id = 0; struct ezt_omp_mutex_info { uint32_t acquisition_order; uint32_t mutex_id; void* addr; }; static void on_ompt_callback_lock_init(ompt_mutex_t kind, unsigned int hint, unsigned int impl, ompt_wait_id_t wait_id, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; struct ezt_omp_mutex_info* l = malloc(sizeof(struct ezt_omp_mutex_info)); l->acquisition_order = 0; l->mutex_id = next_mutex_id++; l->addr = (void*)wait_id; ezt_hashtable_insert(&mutex_map, hash_function_int64(wait_id), (void*)l); assert(ezt_hashtable_get(&mutex_map, hash_function_int64(wait_id)) == l); } static void on_ompt_callback_lock_destroy(ompt_mutex_t kind, unsigned int hint, unsigned int impl, ompt_wait_id_t wait_id, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; } static void on_ompt_callback_mutex_acquire(ompt_mutex_t kind, unsigned int hint, unsigned int impl, ompt_wait_id_t wait_id, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; if (EZTRACE_SAFE) { _init_ompt_otf2(); struct ezt_omp_mutex_info* l = ezt_hashtable_get(&mutex_map, hash_function_int64(wait_id)); // Add mutex to mutex map in case it hasn't been added by `ompt_lock_init` (e.g. for omp_mutex_critical) if (l == NULL) { struct ezt_omp_mutex_info* l_new = malloc(sizeof(struct ezt_omp_mutex_info)); l_new->acquisition_order = 0; l_new->mutex_id = next_mutex_id++; l_new->addr = (void*)wait_id; ezt_hashtable_insert(&mutex_map, hash_function_int64(wait_id), (void*)l_new); l = ezt_hashtable_get(&mutex_map, hash_function_int64(wait_id)); } assert(l); l->acquisition_order++; EZT_OTF2_EvtWriter_Enter(evt_writer, NULL, ezt_get_timestamp(), openmp_acquire_mutex_id); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadAcquireLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->mutex_id, l->acquisition_order)); } } static void on_ompt_callback_mutex_acquired(ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; if (EZTRACE_SAFE) { _init_ompt_otf2(); EZT_OTF2_EvtWriter_Leave(evt_writer, NULL, ezt_get_timestamp(), openmp_acquire_mutex_id); } } static void on_ompt_callback_mutex_released(ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; if (EZTRACE_SAFE) { _init_ompt_otf2(); struct ezt_omp_mutex_info* l = ezt_hashtable_get(&mutex_map, hash_function_int64(wait_id)); assert(l); EZT_OTF2_CHECK(OTF2_EvtWriter_ThreadReleaseLock(evt_writer, NULL, ezt_get_timestamp(), OTF2_PARADIGM_OPENMP, l->mutex_id, l->acquisition_order)); } } static void on_ompt_callback_sync_region_wait(ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) { uint64_t tid = ompt_get_thread_data()->value; } /* No function to intercept since we rely on the OMPT interface */ PPTRACE_START_INTERCEPT_FUNCTIONS(ompt) PPTRACE_END_INTERCEPT_FUNCTIONS(ompt) #define register_callback(name, type) \ do{ \ type f_##name = &on_##name; \ if (ompt_set_callback(name, (ompt_callback_t)f_##name) == \ ompt_set_never) \ printf("0: Could not register callback '" #name "'\n"); \ }while(0) int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num, ompt_data_t* data) { *(double*)(data->ptr)=omp_get_wtime(); ompt_set_callback_t ompt_set_callback = (ompt_set_callback_t) lookup("ompt_set_callback"); ompt_get_thread_data = (ompt_get_thread_data_t) lookup("ompt_get_thread_data"); ompt_get_unique_id = (ompt_get_unique_id_t) lookup("ompt_get_unique_id"); register_callback(ompt_callback_parallel_begin, ompt_callback_parallel_begin_t); register_callback(ompt_callback_parallel_end, ompt_callback_parallel_end_t); register_callback(ompt_callback_thread_begin, ompt_callback_thread_begin_t); register_callback(ompt_callback_thread_end, ompt_callback_thread_end_t); register_callback(ompt_callback_task_create, ompt_callback_task_create_t); register_callback(ompt_callback_task_schedule, ompt_callback_task_schedule_t); register_callback(ompt_callback_implicit_task, ompt_callback_implicit_task_t); register_callback(ompt_callback_sync_region_wait, ompt_callback_sync_region_t); register_callback(ompt_callback_mutex_acquire, ompt_callback_mutex_acquire_t); register_callback(ompt_callback_lock_destroy, ompt_callback_mutex_acquire_t); register_callback(ompt_callback_lock_init, ompt_callback_mutex_acquire_t); register_callback(ompt_callback_mutex_acquired, ompt_callback_mutex_t); register_callback(ompt_callback_mutex_released, ompt_callback_mutex_t); register_callback(ompt_callback_work, ompt_callback_work_t); register_callback(ompt_callback_sync_region, ompt_callback_sync_region_t); return 1; //success } void ompt_finalize(ompt_data_t* data) { /* Nothing to do */ } static void _ompt_init(void) __attribute__((constructor)); static double t=0; ompt_start_tool_result_t* ompt_start_tool(unsigned int omp_version, const char *runtime_version) { _ompt_init(); t = omp_get_wtime(); static ompt_start_tool_result_t ompt_start_tool_result = {&ompt_initialize, &ompt_finalize, {.ptr=&t}}; return &ompt_start_tool_result; } static void _ompt_init(void) { static int init_called=0; if(init_called) return; init_called=1; eztrace_log(dbg_lvl_debug, "eztrace_ompt constructor starts\n"); EZT_REGISTER_MODULE(ompt, "Module for OpenMP directives, using OMPT", init_ompt, finalize_ompt); eztrace_log(dbg_lvl_debug, "eztrace_ompt constructor ends\n"); } static void _ompt_destructor() __attribute__((destructor)); static void _ompt_destructor() { /* The ompt module may be loaded by libompt directly instead of using LD_PRELOAD * In this case, the ompt module may be destroyed before eztrace terminaison. This * result in eztrace accessing memory regions that were free (eg the "ompt" structure) * * To avoid that, we add a destructor to make sure eztrace terminates before ompt */ eztrace_stop(); } eztrace-2.1/src/modules/papi/000077500000000000000000000000001447213526500162125ustar00rootroot00000000000000eztrace-2.1/src/modules/papi/CMakeLists.txt000066400000000000000000000007141447213526500207540ustar00rootroot00000000000000# Target : libeztrace-papi.so add_library(eztrace-papi SHARED papi.c papi_ev_codes.h ) target_include_directories(eztrace-papi PUBLIC ${LIBPAPI_INCLUDE_DIRS} ) target_compile_options(eztrace-papi PRIVATE -Wall -Wextra -Wpedantic -Werror ) target_link_libraries(eztrace-papi PUBLIC eztrace-core papi PRIVATE eztrace-lib Threads::Threads ${INTERCEPT_LIB} ) install(TARGETS eztrace-papi LIBRARY DESTINATION lib ) eztrace-2.1/src/modules/papi/papi.c000066400000000000000000000225651447213526500173210ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include #include #include #include #include #include #include #include #include #error PAPI plugin not yet ported to eztrace 2.0 API /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls */ static int _papi_initialized = 0; //#define VERBOSE 1 /* We don't use the FUNCTION_NAME macro (defined in src/core/eztrace.h) * to avoid infinite loops (since it calls record_counters). */ #ifdef FUNCTION_NAME #undef FUNCTION_NAME #endif #ifdef VERBOSE #define FUNCTION_NAME fprintf(stderr, "Calling [%s]\n", __func__) #else #define FUNCTION_NAME (void)0 #endif #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) static pthread_key_t papi_thread_info_key; struct _papi_thread_info { int Events; long_long* values; struct timeval last_tick; }; static int nb_events; static int Events; static int* Event_codes; static char** Event_names; static char** units_names; struct _papi_thread_info* papi_init_hw_counter(); #define handle_error(n) \ fprintf(stderr, "%s: PAPI error %d: %s\n", __func__, n, PAPI_strerror(n)) int papi_record(struct ezt_sampling_callback_instance* instance) { if (!_papi_initialized || !nb_events) return 0; struct _papi_thread_info* ptr = NULL; struct timeval cur_tick; gettimeofday(&cur_tick, NULL); /* retrieve the thread-specific structure */ if (!instance->plugin_data) { ptr = papi_init_hw_counter(instance); if (!ptr) { return -1; } } ptr = instance->plugin_data; /* read hardware counter */ // this region needs to be protected in order to disable infinite recursion due to the intercepting of functions. // Because, PAPI functions can possibly be intercepted too. EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); int ret; /* get the values of counters */ if ((ret = PAPI_stop(ptr->Events, ptr->values)) != PAPI_OK) { handle_error(ret); eztrace_abort(); } /* restart counters */ ret = PAPI_start(ptr->Events); if (ret != PAPI_OK) { handle_error(ret); eztrace_abort(); } int duration = TIME_DIFF(instance->last_call, cur_tick); /* duration in usec */ int i; for (i = 0; i < nb_events; i++) { // As this region is protected, the unprotected function is called EZTRACE_EVENT3_PACKED_UNPROTECTED(EZTRACE_PAPI_MEASUREMENT, i, ptr->values[i], duration); } /* reset the timer */ instance->last_call.tv_usec = cur_tick.tv_usec; instance->last_call.tv_sec = cur_tick.tv_sec; EZTRACE_PROTECT_OFF(); return 0; } return 1; } /* Initialize the PAPI counter interface for a thread */ struct _papi_thread_info* papi_init_hw_counter(struct ezt_sampling_callback_instance* instance) { if (!nb_events) /* no counter were selected. We don't need to do anything */ return NULL; struct _papi_thread_info* ptr = NULL; // this region needs to be protected in order to disable infinite recursion due to the intercepting of functions. // Because, PAPI functions can possibly be intercepted too. EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); int ret; /* initialize the thread-specific structure */ if (instance->plugin_data == NULL) { /* This thread has not been initialized yet */ PAPI_register_thread(); ptr = malloc(sizeof(struct _papi_thread_info)); ptr->values = malloc(sizeof(long_long) * nb_events); int i; /* Create a new EventSet */ ptr->Events = PAPI_NULL; ret = PAPI_create_eventset(&ptr->Events); if (ret != PAPI_OK) { handle_error(ret); eztrace_abort(); } /* copy Events to the EventSet */ for (i = 0; i < nb_events; i++) { ret = PAPI_add_event(ptr->Events, Event_codes[i]); if (ret != PAPI_OK) { handle_error(ret); eztrace_abort(); } } /* Start the counter */ if ((ret = PAPI_start(ptr->Events)) != PAPI_OK) { if (ret == PAPI_ECNFLCT) { fprintf(stderr, "PAPI error %d (%s): It is likely that you selected too many counters to monitor\n", ret, PAPI_strerror(ret)); exit(-1); } } /* set the structure Thread-specific */ instance->plugin_data = ptr; /* first measurement */ gettimeofday(&instance->last_call, NULL); int retval = PAPI_stop(ptr->Events, ptr->values); if (retval != PAPI_OK) { fprintf(stderr, "PAPI_stop() failed\n"); } retval = PAPI_start(ptr->Events); if (retval != PAPI_OK) { fprintf(stderr, "PAPI_start() failed\n"); exit(1); } } EZTRACE_PROTECT_OFF(); } return ptr; } static int _papi_add_counter(char* counter_name) { nb_events++; Event_codes = realloc(Event_codes, sizeof(int) * nb_events); Event_names = realloc(Event_names, sizeof(char*) * nb_events); units_names = realloc(units_names, sizeof(char*) * nb_events); int code; int retval; if ((retval = PAPI_event_name_to_code(counter_name, &code)) == PAPI_OK) { retval = PAPI_add_event(Events, code); if (retval != PAPI_OK) { handle_error(retval); nb_events--; return retval; } else { #if PAPI_VERSION > PAPI_VERSION_NUMBER(5, 0, 0, 0) PAPI_event_info_t info; retval = PAPI_get_event_info(code, &info); if (retval != PAPI_OK) { /* PAPI_get_event_info failed. Let's assume there is no unit */ handle_error(retval); asprintf(&units_names[nb_events - 1], " "); } else { asprintf(&units_names[nb_events - 1], "%s", info.units); } #else asprintf(&units_names[nb_events - 1], " "); #endif Event_codes[nb_events - 1] = code; asprintf(&Event_names[nb_events - 1], "%s", counter_name); return PAPI_OK; } } handle_error(retval); nb_events--; return retval; } /* select the counters to monitor */ static void _papi_select_counters() { int invalid_counters = 0; char* env1 = getenv("EZTRACE_PAPI_COUNTERS"); nb_events = 0; Events = PAPI_NULL; if (PAPI_create_eventset(&Events) != PAPI_OK) { eztrace_abort(); } if (env1) { /* EZTRACE_PAPI_COUNTERS is defined */ /* strtok may modify env, so let's make a copy of it */ char* env; asprintf(&env, "%s", env1); char* token = strtok(env, " "); /* for each token, get the code id and fill the Events array */ while (token) { if (_papi_add_counter(token) != PAPI_OK) { invalid_counters = 1; } token = strtok(NULL, " "); } } else { /* EZTRACE_PAPI_COUNTERS is not defined, use the default values */ _papi_add_counter("PAPI_TOT_INS"); } if (invalid_counters) { fprintf(stderr, "Available counters:\n"); _papi_print_available_counters(); } } /* In some cases (eg. using -O3 with gcc), the compiler may optimize too agressively and remove the function array symbol. * This results in pptrace being unable to load the module (since the symbol is not found). * This can be "solved" by declaring 2 callbacks to avoid the compiler optimization */ void (*libfoo)(void*); void (*libfoo2)(void*); START_INTERCEPT_MODULE(papi) INTERCEPT2("foo", libfoo) INTERCEPT2("foo2", libfoo2) END_INTERCEPT_MODULE(papi) static void _papi_init(void) __attribute__((constructor)); static void _papi_init(void) { DYNAMIC_INTERCEPT_ALL_MODULE(papi); int ret; pthread_key_create(&papi_thread_info_key, NULL); /* initialize PAPI */ ret = PAPI_library_init(PAPI_VER_CURRENT); if (ret != PAPI_VER_CURRENT && ret > 0) { fprintf(stderr, "PAPI library version mismatch!\n"); exit(1); } /* There may be several threads, so let's tell this to PAPI */ if ((ret = PAPI_thread_init(pthread_self)) != PAPI_OK) handle_error(ret); _papi_init_counter_ids(); _papi_select_counters(); char* env = getenv("EZTRACE_PAPI_SAMPLE_INTERVAL"); int sample_interval = 100; /* by default, check counter every 100 µs */ if (env) { sample_interval = atoi(env); if (sample_interval <= 0) { fprintf(stderr, "[EZTrace] please enter a value > 0 when setting EZTRACE_PAPI_SAMPLE_INTERVAL\n"); sample_interval = 100; } } if (eztrace_autostart_enabled()) eztrace_start(); _papi_initialized = 1; /* Tell how many counters (and which counters) are monitored */ EZTRACE_EVENT_PACKED_1(EZTRACE_PAPI_INIT, nb_events); int i; for (i = 0; i < nb_events; i++) { EZTRACE_EVENT_PACKED_2(EZTRACE_PAPI_INIT_COUNTERS, i, Event_codes[i]); litl_write_probe_raw(_ezt_trace.litl_trace, EZTRACE_PAPI_INIT_COUNTERS, strlen(Event_names[i]), (litl_data_t*)Event_names[i]); litl_write_probe_raw(_ezt_trace.litl_trace, EZTRACE_PAPI_INIT_COUNTERS, strlen(units_names[i]), (litl_data_t*)units_names[i]); /* todo: add event description */ } ezt_sampling_register_callback(papi_record, sample_interval); } static void _papi_conclude(void) __attribute__((destructor)); static void _papi_conclude(void) { _papi_initialized = 0; eztrace_stop(); } eztrace-2.1/src/modules/pnetcdf/000077500000000000000000000000001447213526500167045ustar00rootroot00000000000000eztrace-2.1/src/modules/pnetcdf/CMakeLists.txt000066400000000000000000000011661447213526500214500ustar00rootroot00000000000000# Compile this module with mpicc set(CMAKE_C_COMPILER ${MPICC}) add_library(eztrace-pnetcdf SHARED pnetcdf.c ) target_link_libraries(eztrace-pnetcdf PRIVATE dl eztrace-core eztrace-lib eztrace-instrumentation ${pnetcdf_LINK_LIBRARIES} ) target_include_directories(eztrace-pnetcdf PUBLIC ${pnetcdf_INCLUDE_DIRS} PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) #--------------------------------------------- install(TARGETS eztrace-pnetcdf LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/pnetcdf/pnetcdf.c000066400000000000000000014625121447213526500205060ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Universite Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include #include #include #include #include #include #include #include #include #include /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls to functions for example */ static volatile int _pnetcdf_initialized = 0; #define CURRENT_MODULE pnetcdf DECLARE_CURRENT_MODULE; /* pointers to actual functions */ int (*libncmpi_create)(MPI_Comm comm, const char *path, int cmode, MPI_Info info, int *ncidp); int (*libncmpi_open)(MPI_Comm comm, const char *path, int omode, MPI_Info info, int *ncidp); int (*libncmpi_inq_file_info)(int ncid, MPI_Info *info_used); int (*libncmpi_get_file_info)(int ncid, MPI_Info *info_used); /* deprecated */ int (*libncmpi_delete)(const char *filename, MPI_Info info); int (*libncmpi_enddef)(int ncid); int (*libncmpi__enddef)(int ncid, MPI_Offset h_minfree, MPI_Offset v_align, MPI_Offset v_minfree, MPI_Offset r_align); int (*libncmpi_redef)(int ncid); int (*libncmpi_set_default_format)(int format, int *old_formatp); int (*libncmpi_inq_default_format)(int *formatp); int (*libncmpi_sync)(int ncid); int (*libncmpi_flush)(int ncid); int (*libncmpi_sync_numrecs)(int ncid); int (*libncmpi_abort)(int ncid); int (*libncmpi_begin_indep_data)(int ncid); int (*libncmpi_end_indep_data)(int ncid); int (*libncmpi_close)(int ncid); int (*libncmpi_set_fill)(int ncid, int fillmode, int *old_modep); int (*libncmpi_def_var_fill)(int ncid, int varid, int no_fill, const void *fill_value); int (*libncmpi_fill_var_rec)(int ncid, int varid, MPI_Offset recno); /* End File Functions */ /* Begin Define Mode Functions */ int (*libncmpi_def_dim)(int ncid, const char *name, MPI_Offset len, int *idp); int (*libncmpi_def_var)(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp); int (*libncmpi_rename_dim)(int ncid, int dimid, const char *name); int (*libncmpi_rename_var)(int ncid, int varid, const char *name); int (*libncmpi_inq)(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp); int (*libncmpi_inq_format)(int ncid, int *formatp); int (*libncmpi_inq_file_format)(const char *filename, int *formatp); int (*libncmpi_inq_version)(int ncid, int *NC_mode); int (*libncmpi_inq_striping)(int ncid, int *striping_size, int *striping_count); int (*libncmpi_inq_ndims)(int ncid, int *ndimsp); int (*libncmpi_inq_nvars)(int ncid, int *nvarsp); int (*libncmpi_inq_num_rec_vars)(int ncid, int *nvarsp); int (*libncmpi_inq_num_fix_vars)(int ncid, int *nvarsp); int (*libncmpi_inq_natts)(int ncid, int *ngattsp); int (*libncmpi_inq_unlimdim)(int ncid, int *unlimdimidp); int (*libncmpi_inq_dimid)(int ncid, const char *name, int *idp); int (*libncmpi_inq_dim)(int ncid, int dimid, char *name, MPI_Offset *lenp); int (*libncmpi_inq_dimname)(int ncid, int dimid, char *name); int (*libncmpi_inq_dimlen)(int ncid, int dimid, MPI_Offset *lenp); int (*libncmpi_inq_var)(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp); int (*libncmpi_inq_varid)(int ncid, const char *name, int *varidp); int (*libncmpi_inq_varname)(int ncid, int varid, char *name); int (*libncmpi_inq_vartype)(int ncid, int varid, nc_type *xtypep); int (*libncmpi_inq_varndims)(int ncid, int varid, int *ndimsp); int (*libncmpi_inq_vardimid)(int ncid, int varid, int *dimidsp); int (*libncmpi_inq_varnatts)(int ncid, int varid, int *nattsp); int (*libncmpi_inq_varoffset)(int ncid, int varid, MPI_Offset *offset); int (*libncmpi_inq_put_size)(int ncid, MPI_Offset *size); int (*libncmpi_inq_get_size)(int ncid, MPI_Offset *size); int (*libncmpi_inq_header_size)(int ncid, MPI_Offset *size); int (*libncmpi_inq_header_extent)(int ncid, MPI_Offset *extent); int (*libncmpi_inq_malloc_size)(MPI_Offset *size); int (*libncmpi_inq_malloc_max_size)(MPI_Offset *size); int (*libncmpi_inq_malloc_list)(void); int (*libncmpi_inq_files_opened)(int *num, int *ncids); int (*libncmpi_inq_recsize)(int ncid, MPI_Offset *recsize); int (*libncmpi_inq_var_fill)(int ncid, int varid, int *no_fill, void *fill_value); int (*libncmpi_inq_path)(int ncid, int *pathlen, char *path); int (*libncmpi_inq_att)(int ncid, int varid, const char *name, nc_type *xtypep, MPI_Offset *lenp); int (*libncmpi_inq_attid)(int ncid, int varid, const char *name, int *idp); int (*libncmpi_inq_atttype)(int ncid, int varid, const char *name, nc_type *xtypep); int (*libncmpi_inq_attlen)(int ncid, int varid, const char *name, MPI_Offset *lenp); int (*libncmpi_inq_attname)(int ncid, int varid, int attnum, char *name); int (*libncmpi_copy_att)(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out); int (*libncmpi_rename_att)(int ncid, int varid, const char *name, const char *newname); int (*libncmpi_del_att)(int ncid, int varid, const char *name); int (*libncmpi_put_att)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset nelems, const void *value); int (*libncmpi_put_att_text)(int ncid, int varid, const char *name, MPI_Offset len, const char *op); int (*libncmpi_put_att_schar)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const signed char *op); int (*libncmpi_put_att_short)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const short *op); int (*libncmpi_put_att_int)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const int *op); int (*libncmpi_put_att_float)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const float *op); int (*libncmpi_put_att_double)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const double *op); int (*libncmpi_put_att_longlong)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const long long *op); int (*libncmpi_get_att)(int ncid, int varid, const char *name, void *value); int (*libncmpi_get_att_text)(int ncid, int varid, const char *name, char *ip); int (*libncmpi_get_att_schar)(int ncid, int varid, const char *name, signed char *ip); int (*libncmpi_get_att_short)(int ncid, int varid, const char *name, short *ip); int (*libncmpi_get_att_int)(int ncid, int varid, const char *name, int *ip); int (*libncmpi_get_att_float)(int ncid, int varid, const char *name, float *ip); int (*libncmpi_get_att_double)(int ncid, int varid, const char *name, double *ip); int (*libncmpi_get_att_longlong)(int ncid, int varid, const char *name, long long *ip); int (*libncmpi_put_att_uchar)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned char *op); int (*libncmpi_put_att_ubyte)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned char *op); int (*libncmpi_put_att_ushort)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned short *op); int (*libncmpi_put_att_uint)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned int *op); int (*libncmpi_put_att_long)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const long *op); int (*libncmpi_put_att_ulonglong)(int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned long long *op); int (*libncmpi_get_att_uchar)(int ncid, int varid, const char *name, unsigned char *ip); int (*libncmpi_get_att_ubyte)(int ncid, int varid, const char *name, unsigned char *ip); int (*libncmpi_get_att_ushort)(int ncid, int varid, const char *name, unsigned short *ip); int (*libncmpi_get_att_uint)(int ncid, int varid, const char *name, unsigned int *ip); int (*libncmpi_get_att_long)(int ncid, int varid, const char *name, long *ip); int (*libncmpi_get_att_ulonglong)(int ncid, int varid, const char *name, unsigned long long *ip); int (*libncmpi_put_var1)(int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_var1_all)(int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_var1_text)(int ncid, int varid, const MPI_Offset *start, const char *op); int (*libncmpi_put_var1_text_all)(int ncid, int varid, const MPI_Offset *start, const char *op); int (*libncmpi_put_var1_schar)(int ncid, int varid, const MPI_Offset *start, const signed char *op); int (*libncmpi_put_var1_schar_all)(int ncid, int varid, const MPI_Offset *start, const signed char *op); int (*libncmpi_put_var1_short)(int ncid, int varid, const MPI_Offset *start, const short *op); int (*libncmpi_put_var1_short_all)(int ncid, int varid, const MPI_Offset *start, const short *op); int (*libncmpi_put_var1_int)(int ncid, int varid, const MPI_Offset *start, const int *op); int (*libncmpi_put_var1_int_all)(int ncid, int varid, const MPI_Offset *start, const int *op); int (*libncmpi_put_var1_float)(int ncid, int varid, const MPI_Offset *start, const float *op); int (*libncmpi_put_var1_float_all)(int ncid, int varid, const MPI_Offset *start, const float *op); int (*libncmpi_put_var1_double)(int ncid, int varid, const MPI_Offset *start, const double *op); int (*libncmpi_put_var1_double_all)(int ncid, int varid, const MPI_Offset *start, const double *op); int (*libncmpi_put_var1_longlong)(int ncid, int varid, const MPI_Offset *start, const long long *op); int (*libncmpi_put_var1_longlong_all)(int ncid, int varid, const MPI_Offset *start, const long long *op); int (*libncmpi_get_var1)(int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_var1_all)(int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_var1_text)(int ncid, int varid, const MPI_Offset *start, char *ip); int (*libncmpi_get_var1_text_all)(int ncid, int varid, const MPI_Offset *start, char *ip); int (*libncmpi_get_var1_schar)(int ncid, int varid, const MPI_Offset *start, signed char *ip); int (*libncmpi_get_var1_schar_all)(int ncid, int varid, const MPI_Offset *start, signed char *ip); int (*libncmpi_get_var1_short)(int ncid, int varid, const MPI_Offset *start, short *ip); int (*libncmpi_get_var1_short_all)(int ncid, int varid, const MPI_Offset *start, short *ip); int (*libncmpi_get_var1_int)(int ncid, int varid, const MPI_Offset *start, int *ip); int (*libncmpi_get_var1_int_all)(int ncid, int varid, const MPI_Offset *start, int *ip); int (*libncmpi_get_var1_float)(int ncid, int varid, const MPI_Offset *start, float *ip); int (*libncmpi_get_var1_float_all)(int ncid, int varid, const MPI_Offset *start, float *ip); int (*libncmpi_get_var1_double)(int ncid, int varid, const MPI_Offset *start, double *ip); int (*libncmpi_get_var1_double_all)(int ncid, int varid, const MPI_Offset *start, double *ip); int (*libncmpi_get_var1_longlong)(int ncid, int varid, const MPI_Offset *start, long long *ip); int (*libncmpi_get_var1_longlong_all)(int ncid, int varid, const MPI_Offset *start, long long *ip); int (*libncmpi_put_var1_uchar)(int ncid, int varid, const MPI_Offset *start, const unsigned char *op); int (*libncmpi_put_var1_uchar_all)(int ncid, int varid, const MPI_Offset *start, const unsigned char *op); int (*libncmpi_put_var1_ushort)(int ncid, int varid, const MPI_Offset *start, const unsigned short *op); int (*libncmpi_put_var1_ushort_all)(int ncid, int varid, const MPI_Offset *start, const unsigned short *op); int (*libncmpi_put_var1_uint)(int ncid, int varid, const MPI_Offset *start, const unsigned int *op); int (*libncmpi_put_var1_uint_all)(int ncid, int varid, const MPI_Offset *start, const unsigned int *op); int (*libncmpi_put_var1_long)(int ncid, int varid, const MPI_Offset *start, const long *ip); int (*libncmpi_put_var1_long_all)(int ncid, int varid, const MPI_Offset *start, const long *ip); int (*libncmpi_put_var1_ulonglong)(int ncid, int varid, const MPI_Offset *start, const unsigned long long *ip); int (*libncmpi_put_var1_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const unsigned long long *ip); int (*libncmpi_get_var1_uchar)(int ncid, int varid, const MPI_Offset *start, unsigned char *ip); int (*libncmpi_get_var1_uchar_all)(int ncid, int varid, const MPI_Offset *start, unsigned char *ip); int (*libncmpi_get_var1_ushort)(int ncid, int varid, const MPI_Offset *start, unsigned short *ip); int (*libncmpi_get_var1_ushort_all)(int ncid, int varid, const MPI_Offset *start, unsigned short *ip); int (*libncmpi_get_var1_uint)(int ncid, int varid, const MPI_Offset *start, unsigned int *ip); int (*libncmpi_get_var1_uint_all)(int ncid, int varid, const MPI_Offset *start, unsigned int *ip); int (*libncmpi_get_var1_long)(int ncid, int varid, const MPI_Offset *start, long *ip); int (*libncmpi_get_var1_long_all)(int ncid, int varid, const MPI_Offset *start, long *ip); int (*libncmpi_get_var1_ulonglong)(int ncid, int varid, const MPI_Offset *start, unsigned long long *ip); int (*libncmpi_get_var1_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, unsigned long long *ip); int (*libncmpi_put_var)(int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_var_all)(int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_var_text)(int ncid, int varid, const char *op); int (*libncmpi_put_var_text_all)(int ncid, int varid, const char *op); int (*libncmpi_put_var_schar)(int ncid, int varid, const signed char *op); int (*libncmpi_put_var_schar_all)(int ncid, int varid, const signed char *op); int (*libncmpi_put_var_short)(int ncid, int varid, const short *op); int (*libncmpi_put_var_short_all)(int ncid, int varid, const short *op); int (*libncmpi_put_var_int)(int ncid, int varid, const int *op); int (*libncmpi_put_var_int_all)(int ncid, int varid, const int *op); int (*libncmpi_put_var_float)(int ncid, int varid, const float *op); int (*libncmpi_put_var_float_all)(int ncid, int varid, const float *op); int (*libncmpi_put_var_double)(int ncid, int varid, const double *op); int (*libncmpi_put_var_double_all)(int ncid, int varid, const double *op); int (*libncmpi_put_var_longlong)(int ncid, int varid, const long long *op); int (*libncmpi_put_var_longlong_all)(int ncid, int varid, const long long *op); int (*libncmpi_get_var)(int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_var_all)(int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_var_text)(int ncid, int varid, char *ip); int (*libncmpi_get_var_text_all)(int ncid, int varid, char *ip); int (*libncmpi_get_var_schar)(int ncid, int varid, signed char *ip); int (*libncmpi_get_var_schar_all)(int ncid, int varid, signed char *ip); int (*libncmpi_get_var_short)(int ncid, int varid, short *ip); int (*libncmpi_get_var_short_all)(int ncid, int varid, short *ip); int (*libncmpi_get_var_int)(int ncid, int varid, int *ip); int (*libncmpi_get_var_int_all)(int ncid, int varid, int *ip); int (*libncmpi_get_var_float)(int ncid, int varid, float *ip); int (*libncmpi_get_var_float_all)(int ncid, int varid, float *ip); int (*libncmpi_get_var_double)(int ncid, int varid, double *ip); int (*libncmpi_get_var_double_all)(int ncid, int varid, double *ip); int (*libncmpi_get_var_longlong)(int ncid, int varid, long long *ip); int (*libncmpi_get_var_longlong_all)(int ncid, int varid, long long *ip); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_put_var_uchar)(int ncid, int varid, const unsigned char *op); int (*libncmpi_put_var_uchar_all)(int ncid, int varid, const unsigned char *op); int (*libncmpi_put_var_ushort)(int ncid, int varid, const unsigned short *op); int (*libncmpi_put_var_ushort_all)(int ncid, int varid, const unsigned short *op); int (*libncmpi_put_var_uint)(int ncid, int varid, const unsigned int *op); int (*libncmpi_put_var_uint_all)(int ncid, int varid, const unsigned int *op); int (*libncmpi_put_var_long)(int ncid, int varid, const long *op); int (*libncmpi_put_var_long_all)(int ncid, int varid, const long *op); int (*libncmpi_put_var_ulonglong)(int ncid, int varid, const unsigned long long *op); int (*libncmpi_put_var_ulonglong_all)(int ncid, int varid, const unsigned long long *op); int (*libncmpi_get_var_uchar)(int ncid, int varid, unsigned char *ip); int (*libncmpi_get_var_uchar_all)(int ncid, int varid, unsigned char *ip); int (*libncmpi_get_var_ushort)(int ncid, int varid, unsigned short *ip); int (*libncmpi_get_var_ushort_all)(int ncid, int varid, unsigned short *ip); int (*libncmpi_get_var_uint)(int ncid, int varid, unsigned int *ip); int (*libncmpi_get_var_uint_all)(int ncid, int varid, unsigned int *ip); int (*libncmpi_get_var_long)(int ncid, int varid, long *ip); int (*libncmpi_get_var_long_all)(int ncid, int varid, long *ip); int (*libncmpi_get_var_ulonglong)(int ncid, int varid, unsigned long long *ip); int (*libncmpi_get_var_ulonglong_all)(int ncid, int varid, unsigned long long *ip); /* End Skip Prototypes for Fortran binding */ /* End {put,get}_var */ /* Begin {put,get}_vara */ int (*libncmpi_put_vara)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vara_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vara_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op); int (*libncmpi_put_vara_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op); int (*libncmpi_put_vara_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op); int (*libncmpi_put_vara_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op); int (*libncmpi_put_vara_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op); int (*libncmpi_put_vara_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op); int (*libncmpi_put_vara_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op); int (*libncmpi_put_vara_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op); int (*libncmpi_put_vara_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op); int (*libncmpi_put_vara_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op); int (*libncmpi_put_vara_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op); int (*libncmpi_put_vara_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op); int (*libncmpi_put_vara_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op); int (*libncmpi_put_vara_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op); int (*libncmpi_get_vara)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_vara_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_vara_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip); int (*libncmpi_get_vara_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip); int (*libncmpi_get_vara_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip); int (*libncmpi_get_vara_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip); int (*libncmpi_get_vara_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip); int (*libncmpi_get_vara_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip); int (*libncmpi_get_vara_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip); int (*libncmpi_get_vara_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip); int (*libncmpi_get_vara_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip); int (*libncmpi_get_vara_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip); int (*libncmpi_get_vara_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip); int (*libncmpi_get_vara_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip); int (*libncmpi_get_vara_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip); int (*libncmpi_get_vara_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_put_vara_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op); int (*libncmpi_put_vara_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op); int (*libncmpi_put_vara_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op); int (*libncmpi_put_vara_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op); int (*libncmpi_put_vara_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op); int (*libncmpi_put_vara_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op); int (*libncmpi_put_vara_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op); int (*libncmpi_put_vara_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op); int (*libncmpi_put_vara_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op); int (*libncmpi_put_vara_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op); int (*libncmpi_get_vara_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip); int (*libncmpi_get_vara_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip); int (*libncmpi_get_vara_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip); int (*libncmpi_get_vara_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip); int (*libncmpi_get_vara_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip); int (*libncmpi_get_vara_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip); int (*libncmpi_get_vara_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip); int (*libncmpi_get_vara_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip); int (*libncmpi_get_vara_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip); int (*libncmpi_get_vara_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip); /* End Skip Prototypes for Fortran binding */ /* End {put,get}_vara */ /* Begin {put,get}_vars */ int (*libncmpi_put_vars)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vars_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vars_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op); int (*libncmpi_put_vars_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op); int (*libncmpi_put_vars_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op); int (*libncmpi_put_vars_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op); int (*libncmpi_put_vars_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op); int (*libncmpi_put_vars_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op); int (*libncmpi_put_vars_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op); int (*libncmpi_put_vars_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op); int (*libncmpi_put_vars_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op); int (*libncmpi_put_vars_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op); int (*libncmpi_put_vars_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op); int (*libncmpi_put_vars_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op); int (*libncmpi_put_vars_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op); int (*libncmpi_put_vars_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op); int (*libncmpi_get_vars)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_vars_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_vars_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip); int (*libncmpi_get_vars_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip); int (*libncmpi_get_vars_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip); int (*libncmpi_get_vars_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip); int (*libncmpi_get_vars_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip); int (*libncmpi_get_vars_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip); int (*libncmpi_get_vars_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip); int (*libncmpi_get_vars_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip); int (*libncmpi_get_vars_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip); int (*libncmpi_get_vars_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip); int (*libncmpi_get_vars_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip); int (*libncmpi_get_vars_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip); int (*libncmpi_get_vars_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip); int (*libncmpi_get_vars_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_put_vars_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op); int (*libncmpi_put_vars_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op); int (*libncmpi_put_vars_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op); int (*libncmpi_put_vars_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op); int (*libncmpi_put_vars_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op); int (*libncmpi_put_vars_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op); int (*libncmpi_put_vars_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op); int (*libncmpi_put_vars_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op); int (*libncmpi_put_vars_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op); int (*libncmpi_put_vars_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op); int (*libncmpi_get_vars_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip); int (*libncmpi_get_vars_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip); int (*libncmpi_get_vars_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip); int (*libncmpi_get_vars_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip); int (*libncmpi_get_vars_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip); int (*libncmpi_get_vars_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip); int (*libncmpi_get_vars_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip); int (*libncmpi_get_vars_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip); int (*libncmpi_get_vars_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip); int (*libncmpi_get_vars_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip); /* End Skip Prototypes for Fortran binding */ /* End {put,get}_vars */ /* Begin {put,get}_varm */ int (*libncmpi_put_varm)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_varm_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_varm_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op); int (*libncmpi_put_varm_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op); int (*libncmpi_put_varm_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op); int (*libncmpi_put_varm_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op); int (*libncmpi_put_varm_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op); int (*libncmpi_put_varm_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op); int (*libncmpi_put_varm_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op); int (*libncmpi_put_varm_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op); int (*libncmpi_put_varm_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op); int (*libncmpi_put_varm_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op); int (*libncmpi_put_varm_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op); int (*libncmpi_put_varm_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op); int (*libncmpi_put_varm_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op); int (*libncmpi_put_varm_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op); int (*libncmpi_get_varm)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_varm_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_varm_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip); int (*libncmpi_get_varm_schar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip); int (*libncmpi_get_varm_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip); int (*libncmpi_get_varm_text_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip); int (*libncmpi_get_varm_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip); int (*libncmpi_get_varm_short_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip); int (*libncmpi_get_varm_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip); int (*libncmpi_get_varm_int_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip); int (*libncmpi_get_varm_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip); int (*libncmpi_get_varm_float_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip); int (*libncmpi_get_varm_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip); int (*libncmpi_get_varm_double_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip); int (*libncmpi_get_varm_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip); int (*libncmpi_get_varm_longlong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_put_varm_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op); int (*libncmpi_put_varm_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op); int (*libncmpi_put_varm_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op); int (*libncmpi_put_varm_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op); int (*libncmpi_put_varm_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op); int (*libncmpi_put_varm_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op); int (*libncmpi_put_varm_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op); int (*libncmpi_put_varm_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op); int (*libncmpi_put_varm_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op); int (*libncmpi_put_varm_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op); int (*libncmpi_get_varm_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip); int (*libncmpi_get_varm_uchar_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip); int (*libncmpi_get_varm_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip); int (*libncmpi_get_varm_ushort_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip); int (*libncmpi_get_varm_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip); int (*libncmpi_get_varm_uint_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip); int (*libncmpi_get_varm_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip); int (*libncmpi_get_varm_long_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip); int (*libncmpi_get_varm_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip); int (*libncmpi_get_varm_ulonglong_all)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip); /* End Skip Prototypes for Fortran binding */ /* End {put,get}_varm */ /* Begin of {put,get}_varn{kind} */ int (*libncmpi_put_varn)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_varn_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_varn)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_varn_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_varn_text)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const char *op); int (*libncmpi_put_varn_text_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const char *op); int (*libncmpi_put_varn_schar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const signed char *op); int (*libncmpi_put_varn_schar_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const signed char *op); int (*libncmpi_put_varn_short)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const short *op); int (*libncmpi_put_varn_short_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const short *op); int (*libncmpi_put_varn_int)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const int *op); int (*libncmpi_put_varn_int_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const int *op); int (*libncmpi_put_varn_float)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const float *op); int (*libncmpi_put_varn_float_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const float *op); int (*libncmpi_put_varn_double)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const double *op); int (*libncmpi_put_varn_double_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const double *op); int (*libncmpi_put_varn_longlong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long long *op); int (*libncmpi_put_varn_longlong_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long long *op); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_put_varn_uchar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned char *op); int (*libncmpi_put_varn_uchar_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned char *op); int (*libncmpi_put_varn_ushort)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned short *op); int (*libncmpi_put_varn_ushort_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned short *op); int (*libncmpi_put_varn_uint)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned int *op); int (*libncmpi_put_varn_uint_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned int *op); int (*libncmpi_put_varn_long)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long *op); int (*libncmpi_put_varn_long_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long *op); int (*libncmpi_put_varn_ulonglong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned long long *op); int (*libncmpi_put_varn_ulonglong_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned long long *op); /* End Skip Prototypes for Fortran binding */ int (*libncmpi_get_varn_text)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, char *ip); int (*libncmpi_get_varn_text_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, char *ip); int (*libncmpi_get_varn_schar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char *ip); int (*libncmpi_get_varn_schar_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char *ip); int (*libncmpi_get_varn_short)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, short *ip); int (*libncmpi_get_varn_short_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, short *ip); int (*libncmpi_get_varn_int)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, int *ip); int (*libncmpi_get_varn_int_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, int *ip); int (*libncmpi_get_varn_float)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, float *ip); int (*libncmpi_get_varn_float_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, float *ip); int (*libncmpi_get_varn_double)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, double *ip); int (*libncmpi_get_varn_double_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, double *ip); int (*libncmpi_get_varn_longlong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long long *ip); int (*libncmpi_get_varn_longlong_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long long *ip); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_get_varn_uchar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char *ip); int (*libncmpi_get_varn_uchar_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char *ip); int (*libncmpi_get_varn_ushort)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short *ip); int (*libncmpi_get_varn_ushort_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short *ip); int (*libncmpi_get_varn_uint)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int *ip); int (*libncmpi_get_varn_uint_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int *ip); int (*libncmpi_get_varn_long)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long *ip); int (*libncmpi_get_varn_long_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long *ip); int (*libncmpi_get_varn_ulonglong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long *ip); int (*libncmpi_get_varn_ulonglong_all)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long *ip); /* End Skip Prototypes for Fortran binding */ /* End of {put,get}_varn{kind} */ /* Begin {put,get}_vard */ int (*libncmpi_get_vard)(int ncid, int varid, MPI_Datatype filetype, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_get_vard_all)(int ncid, int varid, MPI_Datatype filetype, void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vard)(int ncid, int varid, MPI_Datatype filetype, const void *ip, MPI_Offset bufcount, MPI_Datatype buftype); int (*libncmpi_put_vard_all)(int ncid, int varid, MPI_Datatype filetype, const void *ip, MPI_Offset bufcount, MPI_Datatype buftype); /* End of {put,get}_vard */ /* Begin {mput,mget}_var */ /* #################################################################### */ /* Begin: more prototypes to be included for Fortran binding conversion */ /* Begin non-blocking data access functions */ int (*libncmpi_wait)(int ncid, int count, int array_of_requests[], int array_of_statuses[]); int (*libncmpi_wait_all)(int ncid, int count, int array_of_requests[], int array_of_statuses[]); int (*libncmpi_cancel)(int ncid, int num, int *reqs, int *statuses); int (*libncmpi_buffer_attach)(int ncid, MPI_Offset bufsize); int (*libncmpi_buffer_detach)(int ncid); int (*libncmpi_inq_buffer_usage)(int ncid, MPI_Offset *usage); int (*libncmpi_inq_buffer_size)(int ncid, MPI_Offset *buf_size); int (*libncmpi_inq_nreqs)(int ncid, int *nreqs); /* Begin {iput,iget,bput}_var1 */ int (*libncmpi_iput_var1)(int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_var1_text)(int ncid, int varid, const MPI_Offset *start, const char *op, int *req); int (*libncmpi_iput_var1_schar)(int ncid, int varid, const MPI_Offset *start, const signed char *op, int *req); int (*libncmpi_iput_var1_short)(int ncid, int varid, const MPI_Offset *start, const short *op, int *req); int (*libncmpi_iput_var1_int)(int ncid, int varid, const MPI_Offset *start, const int *op, int *req); int (*libncmpi_iput_var1_float)(int ncid, int varid, const MPI_Offset *start, const float *op, int *req); int (*libncmpi_iput_var1_double)(int ncid, int varid, const MPI_Offset *start, const double *op, int *req); int (*libncmpi_iput_var1_longlong)(int ncid, int varid, const MPI_Offset *start, const long long *op, int *req); int (*libncmpi_iget_var1)(int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_var1_schar)(int ncid, int varid, const MPI_Offset *start, signed char *ip, int *req); int (*libncmpi_iget_var1_text)(int ncid, int varid, const MPI_Offset *start, char *ip, int *req); int (*libncmpi_iget_var1_short)(int ncid, int varid, const MPI_Offset *start, short *ip, int *req); int (*libncmpi_iget_var1_int)(int ncid, int varid, const MPI_Offset *start, int *ip, int *req); int (*libncmpi_iget_var1_float)(int ncid, int varid, const MPI_Offset *start, float *ip, int *req); int (*libncmpi_iget_var1_double)(int ncid, int varid, const MPI_Offset *start, double *ip, int *req); int (*libncmpi_iget_var1_longlong)(int ncid, int varid, const MPI_Offset *start, long long *ip, int *req); int (*libncmpi_bput_var1)(int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_var1_text)(int ncid, int varid, const MPI_Offset *start, const char *op, int *req); int (*libncmpi_bput_var1_schar)(int ncid, int varid, const MPI_Offset *start, const signed char *op, int *req); int (*libncmpi_bput_var1_short)(int ncid, int varid, const MPI_Offset *start, const short *op, int *req); int (*libncmpi_bput_var1_int)(int ncid, int varid, const MPI_Offset *start, const int *op, int *req); int (*libncmpi_bput_var1_float)(int ncid, int varid, const MPI_Offset *start, const float *op, int *req); int (*libncmpi_bput_var1_double)(int ncid, int varid, const MPI_Offset *start, const double *op, int *req); int (*libncmpi_bput_var1_longlong)(int ncid, int varid, const MPI_Offset *start, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_var1_uchar)(int ncid, int varid, const MPI_Offset *start, const unsigned char *op, int *req); int (*libncmpi_iput_var1_ushort)(int ncid, int varid, const MPI_Offset *start, const unsigned short *op, int *req); int (*libncmpi_iput_var1_uint)(int ncid, int varid, const MPI_Offset *start, const unsigned int *op, int *req); int (*libncmpi_iput_var1_long)(int ncid, int varid, const MPI_Offset *start, const long *ip, int *req); int (*libncmpi_iput_var1_ulonglong)(int ncid, int varid, const MPI_Offset *start, const unsigned long long *op, int *req); int (*libncmpi_iget_var1_uchar)(int ncid, int varid, const MPI_Offset *start, unsigned char *ip, int *req); int (*libncmpi_iget_var1_ushort)(int ncid, int varid, const MPI_Offset *start, unsigned short *ip, int *req); int (*libncmpi_iget_var1_uint)(int ncid, int varid, const MPI_Offset *start, unsigned int *ip, int *req); int (*libncmpi_iget_var1_long)(int ncid, int varid, const MPI_Offset *start, long *ip, int *req); int (*libncmpi_iget_var1_ulonglong)(int ncid, int varid, const MPI_Offset *start, unsigned long long *ip, int *req); int (*libncmpi_bput_var1_uchar)(int ncid, int varid, const MPI_Offset *start, const unsigned char *op, int *req); int (*libncmpi_bput_var1_ushort)(int ncid, int varid, const MPI_Offset *start, const unsigned short *op, int *req); int (*libncmpi_bput_var1_uint)(int ncid, int varid, const MPI_Offset *start, const unsigned int *op, int *req); int (*libncmpi_bput_var1_long)(int ncid, int varid, const MPI_Offset *start, const long *ip, int *req); int (*libncmpi_bput_var1_ulonglong)(int ncid, int varid, const MPI_Offset *start, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End {iput,iget,bput}_var1 */ /* Begin {iput,iget,bput}_var */ int (*libncmpi_iput_var)(int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_var_schar)(int ncid, int varid, const signed char *op, int *req); int (*libncmpi_iput_var_text)(int ncid, int varid, const char *op, int *req); int (*libncmpi_iput_var_short)(int ncid, int varid, const short *op, int *req); int (*libncmpi_iput_var_int)(int ncid, int varid, const int *op, int *req); int (*libncmpi_iput_var_float)(int ncid, int varid, const float *op, int *req); int (*libncmpi_iput_var_double)(int ncid, int varid, const double *op, int *req); int (*libncmpi_iput_var_longlong)(int ncid, int varid, const long long *op, int *req); int (*libncmpi_iget_var)(int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_var_schar)(int ncid, int varid, signed char *ip, int *req); int (*libncmpi_iget_var_text)(int ncid, int varid, char *ip, int *req); int (*libncmpi_iget_var_short)(int ncid, int varid, short *ip, int *req); int (*libncmpi_iget_var_int)(int ncid, int varid, int *ip, int *req); int (*libncmpi_iget_var_float)(int ncid, int varid, float *ip, int *req); int (*libncmpi_iget_var_double)(int ncid, int varid, double *ip, int *req); int (*libncmpi_iget_var_longlong)(int ncid, int varid, long long *ip, int *req); int (*libncmpi_bput_var)(int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_var_schar)(int ncid, int varid, const signed char *op, int *req); int (*libncmpi_bput_var_text)(int ncid, int varid, const char *op, int *req); int (*libncmpi_bput_var_short)(int ncid, int varid, const short *op, int *req); int (*libncmpi_bput_var_int)(int ncid, int varid, const int *op, int *req); int (*libncmpi_bput_var_float)(int ncid, int varid, const float *op, int *req); int (*libncmpi_bput_var_double)(int ncid, int varid, const double *op, int *req); int (*libncmpi_bput_var_longlong)(int ncid, int varid, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_var_uchar)(int ncid, int varid, const unsigned char *op, int *req); int (*libncmpi_iput_var_ushort)(int ncid, int varid, const unsigned short *op, int *req); int (*libncmpi_iput_var_uint)(int ncid, int varid, const unsigned int *op, int *req); int (*libncmpi_iput_var_long)(int ncid, int varid, const long *op, int *req); int (*libncmpi_iput_var_ulonglong)(int ncid, int varid, const unsigned long long *op, int *req); int (*libncmpi_iget_var_uchar)(int ncid, int varid, unsigned char *ip, int *req); int (*libncmpi_iget_var_ushort)(int ncid, int varid, unsigned short *ip, int *req); int (*libncmpi_iget_var_uint)(int ncid, int varid, unsigned int *ip, int *req); int (*libncmpi_iget_var_long)(int ncid, int varid, long *ip, int *req); int (*libncmpi_iget_var_ulonglong)(int ncid, int varid, unsigned long long *ip, int *req); int (*libncmpi_bput_var_uchar)(int ncid, int varid, const unsigned char *op, int *req); int (*libncmpi_bput_var_ushort)(int ncid, int varid, const unsigned short *op, int *req); int (*libncmpi_bput_var_uint)(int ncid, int varid, const unsigned int *op, int *req); int (*libncmpi_bput_var_long)(int ncid, int varid, const long *op, int *req); int (*libncmpi_bput_var_ulonglong)(int ncid, int varid, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End {iput,iget,bput}_var */ /* Begin {iput,iget,bput}_vara */ int (*libncmpi_iput_vara)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_vara_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op, int *req); int (*libncmpi_iput_vara_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op, int *req); int (*libncmpi_iput_vara_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op, int *req); int (*libncmpi_iput_vara_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op, int *req); int (*libncmpi_iput_vara_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op, int *req); int (*libncmpi_iput_vara_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op, int *req); int (*libncmpi_iput_vara_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op, int *req); int (*libncmpi_iget_vara)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_vara_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip, int *req); int (*libncmpi_iget_vara_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip, int *req); int (*libncmpi_iget_vara_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip, int *req); int (*libncmpi_iget_vara_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip, int *req); int (*libncmpi_iget_vara_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip, int *req); int (*libncmpi_iget_vara_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip, int *req); int (*libncmpi_iget_vara_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip, int *req); int (*libncmpi_bput_vara)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_vara_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op, int *req); int (*libncmpi_bput_vara_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op, int *req); int (*libncmpi_bput_vara_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op, int *req); int (*libncmpi_bput_vara_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op, int *req); int (*libncmpi_bput_vara_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op, int *req); int (*libncmpi_bput_vara_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op, int *req); int (*libncmpi_bput_vara_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_vara_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op, int *req); int (*libncmpi_iput_vara_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op, int *req); int (*libncmpi_iput_vara_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op, int *req); int (*libncmpi_iput_vara_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op, int *req); int (*libncmpi_iput_vara_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op, int *req); int (*libncmpi_iget_vara_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip, int *req); int (*libncmpi_iget_vara_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip, int *req); int (*libncmpi_iget_vara_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip, int *req); int (*libncmpi_iget_vara_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip, int *req); int (*libncmpi_iget_vara_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip, int *req); int (*libncmpi_bput_vara_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op, int *req); int (*libncmpi_bput_vara_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op, int *req); int (*libncmpi_bput_vara_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op, int *req); int (*libncmpi_bput_vara_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op, int *req); int (*libncmpi_bput_vara_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End {iput,iget,bput}_vara */ /* Begin {iput,iget,bput}_vars */ int (*libncmpi_iput_vars)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_vars_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op, int *req); int (*libncmpi_iput_vars_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op, int *req); int (*libncmpi_iput_vars_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op, int *req); int (*libncmpi_iput_vars_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op, int *req); int (*libncmpi_iput_vars_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op, int *req); int (*libncmpi_iput_vars_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op, int *req); int (*libncmpi_iput_vars_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op, int *req); int (*libncmpi_iget_vars)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_vars_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip, int *req); int (*libncmpi_iget_vars_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip, int *req); int (*libncmpi_iget_vars_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip, int *req); int (*libncmpi_iget_vars_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip, int *req); int (*libncmpi_iget_vars_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip, int *req); int (*libncmpi_iget_vars_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip, int *req); int (*libncmpi_iget_vars_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip, int *req); int (*libncmpi_bput_vars)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_vars_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op, int *req); int (*libncmpi_bput_vars_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op, int *req); int (*libncmpi_bput_vars_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op, int *req); int (*libncmpi_bput_vars_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op, int *req); int (*libncmpi_bput_vars_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op, int *req); int (*libncmpi_bput_vars_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op, int *req); int (*libncmpi_bput_vars_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_vars_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op, int *req); int (*libncmpi_iput_vars_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op, int *req); int (*libncmpi_iput_vars_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op, int *req); int (*libncmpi_iput_vars_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op, int *req); int (*libncmpi_iput_vars_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op, int *req); int (*libncmpi_iget_vars_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip, int *req); int (*libncmpi_iget_vars_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip, int *req); int (*libncmpi_iget_vars_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip, int *req); int (*libncmpi_iget_vars_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip, int *req); int (*libncmpi_iget_vars_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip, int *req); int (*libncmpi_bput_vars_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op, int *req); int (*libncmpi_bput_vars_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op, int *req); int (*libncmpi_bput_vars_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op, int *req); int (*libncmpi_bput_vars_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op, int *req); int (*libncmpi_bput_vars_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End {iput,iget,bput}_vars */ /* Begin {iput,iget,bput}_varm */ int (*libncmpi_iput_varm)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_varm_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op, int *req); int (*libncmpi_iput_varm_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op, int *req); int (*libncmpi_iput_varm_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op, int *req); int (*libncmpi_iput_varm_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op, int *req); int (*libncmpi_iput_varm_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op, int *req); int (*libncmpi_iput_varm_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op, int *req); int (*libncmpi_iput_varm_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op, int *req); int (*libncmpi_iget_varm)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_varm_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip, int *req); int (*libncmpi_iget_varm_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip, int *req); int (*libncmpi_iget_varm_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip, int *req); int (*libncmpi_iget_varm_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip, int *req); int (*libncmpi_iget_varm_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip, int *req); int (*libncmpi_iget_varm_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip, int *req); int (*libncmpi_iget_varm_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip, int *req); int (*libncmpi_bput_varm)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_varm_schar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op, int *req); int (*libncmpi_bput_varm_text)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op, int *req); int (*libncmpi_bput_varm_short)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op, int *req); int (*libncmpi_bput_varm_int)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op, int *req); int (*libncmpi_bput_varm_float)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op, int *req); int (*libncmpi_bput_varm_double)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op, int *req); int (*libncmpi_bput_varm_longlong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_varm_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op, int *req); int (*libncmpi_iput_varm_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op, int *req); int (*libncmpi_iput_varm_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op, int *req); int (*libncmpi_iput_varm_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op, int *req); int (*libncmpi_iput_varm_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op, int *req); int (*libncmpi_iget_varm_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip, int *req); int (*libncmpi_iget_varm_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip, int *req); int (*libncmpi_iget_varm_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip, int *req); int (*libncmpi_iget_varm_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip, int *req); int (*libncmpi_iget_varm_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip, int *req); int (*libncmpi_bput_varm_uchar)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op, int *req); int (*libncmpi_bput_varm_ushort)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op, int *req); int (*libncmpi_bput_varm_uint)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op, int *req); int (*libncmpi_bput_varm_long)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op, int *req); int (*libncmpi_bput_varm_ulonglong)(int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End {iput,iget,bput}_varm */ /* Begin of nonblocking {iput,iget}_varn{kind} */ int (*libncmpi_iput_varn)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iget_varn)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_iput_varn_text)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const char *op, int *req); int (*libncmpi_iput_varn_schar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const signed char *op, int *req); int (*libncmpi_iput_varn_short)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const short *op, int *req); int (*libncmpi_iput_varn_int)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const int *op, int *req); int (*libncmpi_iput_varn_float)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const float *op, int *req); int (*libncmpi_iput_varn_double)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const double *op, int *req); int (*libncmpi_iput_varn_longlong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iput_varn_uchar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned char *op, int *req); int (*libncmpi_iput_varn_ushort)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned short *op, int *req); int (*libncmpi_iput_varn_uint)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned int *op, int *req); int (*libncmpi_iput_varn_long)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long *op, int *req); int (*libncmpi_iput_varn_ulonglong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ int (*libncmpi_iget_varn_text)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, char *ip, int *req); int (*libncmpi_iget_varn_schar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char *ip, int *req); int (*libncmpi_iget_varn_short)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, short *ip, int *req); int (*libncmpi_iget_varn_int)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, int *ip, int *req); int (*libncmpi_iget_varn_float)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, float *ip, int *req); int (*libncmpi_iget_varn_double)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, double *ip, int *req); int (*libncmpi_iget_varn_longlong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long long *ip, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_iget_varn_uchar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char *ip, int *req); int (*libncmpi_iget_varn_ushort)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short *ip, int *req); int (*libncmpi_iget_varn_uint)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int *ip, int *req); int (*libncmpi_iget_varn_long)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, long *ip, int *req); int (*libncmpi_iget_varn_ulonglong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long *ip, int *req); /* End Skip Prototypes for Fortran binding */ /* End of {iput,iget}_varn{kind} */ /* Begin of nonblocking bput_varn{kind} */ int (*libncmpi_bput_varn)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req); int (*libncmpi_bput_varn_text)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const char *op, int *req); int (*libncmpi_bput_varn_schar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const signed char *op, int *req); int (*libncmpi_bput_varn_short)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const short *op, int *req); int (*libncmpi_bput_varn_int)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const int *op, int *req); int (*libncmpi_bput_varn_float)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const float *op, int *req); int (*libncmpi_bput_varn_double)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const double *op, int *req); int (*libncmpi_bput_varn_longlong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long long *op, int *req); /* Begin Skip Prototypes for Fortran binding */ /* skip types: uchar, ubyte, ushort, uint, long, ulonglong string */ int (*libncmpi_bput_varn_uchar)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned char *op, int *req); int (*libncmpi_bput_varn_ushort)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned short *op, int *req); int (*libncmpi_bput_varn_uint)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned int *op, int *req); int (*libncmpi_bput_varn_long)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const long *op, int *req); int (*libncmpi_bput_varn_ulonglong)(int ncid, int varid, int num, MPI_Offset* const *starts, MPI_Offset* const *counts, const unsigned long long *op, int *req); /* End Skip Prototypes for Fortran binding */ /* End of bput_varn{kind} */ /* End non-blocking data access functions */ /* Begin Skip Prototypes for Fortran binding */ /* skip all mput/mget APIs as Fortran cannot handle array of buffers */ int (*libncmpi_mput_var)(int ncid, int num, int *varids, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_var_all)(int ncid, int num, int *varids, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_var_text)(int ncid, int num, int *varids, char* const *buf); int (*libncmpi_mput_var_text_all)(int ncid, int num, int *varids, char* const *buf); int (*libncmpi_mput_var_schar)(int ncid, int num, int *varids, signed char* const *buf); int (*libncmpi_mput_var_schar_all)(int ncid, int num, int *varids, signed char* const *buf); int (*libncmpi_mput_var_uchar)(int ncid, int num, int *varids, unsigned char* const *buf); int (*libncmpi_mput_var_uchar_all)(int ncid, int num, int *varids, unsigned char* const *buf); int (*libncmpi_mput_var_short)(int ncid, int num, int *varids, short* const *buf); int (*libncmpi_mput_var_short_all)(int ncid, int num, int *varids, short* const *buf); int (*libncmpi_mput_var_ushort)(int ncid, int num, int *varids, unsigned short* const *buf); int (*libncmpi_mput_var_ushort_all)(int ncid, int num, int *varids, unsigned short* const *buf); int (*libncmpi_mput_var_int)(int ncid, int num, int *varids, int* const *buf); int (*libncmpi_mput_var_int_all)(int ncid, int num, int *varids, int* const *buf); int (*libncmpi_mput_var_uint)(int ncid, int num, int *varids, unsigned int* const *buf); int (*libncmpi_mput_var_uint_all)(int ncid, int num, int *varids, unsigned int* const *buf); int (*libncmpi_mput_var_long)(int ncid, int num, int *varids, long* const *buf); int (*libncmpi_mput_var_long_all)(int ncid, int num, int *varids, long* const *buf); int (*libncmpi_mput_var_float)(int ncid, int num, int *varids, float* const *buf); int (*libncmpi_mput_var_float_all)(int ncid, int num, int *varids, float* const *buf); int (*libncmpi_mput_var_double)(int ncid, int num, int *varids, double* const *buf); int (*libncmpi_mput_var_double_all)(int ncid, int num, int *varids, double* const *buf); int (*libncmpi_mput_var_longlong)(int ncid, int num, int *varids, long long* const *buf); int (*libncmpi_mput_var_longlong_all)(int ncid, int num, int *varids, long long* const *buf); int (*libncmpi_mput_var_ulonglong)(int ncid, int num, int *varids, unsigned long long* const *buf); int (*libncmpi_mput_var_ulonglong_all)(int ncid, int num, int *varids, unsigned long long* const *buf); int (*libncmpi_mput_var1)(int ncid, int num, int *varids, MPI_Offset* const *starts, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_var1_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_var1_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, char* const *buf); int (*libncmpi_mput_var1_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, char* const *buf); int (*libncmpi_mput_var1_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, signed char* const *buf); int (*libncmpi_mput_var1_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, signed char* const *buf); int (*libncmpi_mput_var1_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned char* const *buf); int (*libncmpi_mput_var1_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned char* const *buf); int (*libncmpi_mput_var1_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, short* const *buf); int (*libncmpi_mput_var1_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, short* const *buf); int (*libncmpi_mput_var1_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned short* const *buf); int (*libncmpi_mput_var1_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned short* const *buf); int (*libncmpi_mput_var1_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, int* const *buf); int (*libncmpi_mput_var1_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, int* const *buf); int (*libncmpi_mput_var1_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned int* const *buf); int (*libncmpi_mput_var1_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned int* const *buf); int (*libncmpi_mput_var1_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, long* const *buf); int (*libncmpi_mput_var1_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, long* const *buf); int (*libncmpi_mput_var1_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, float* const *buf); int (*libncmpi_mput_var1_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, float* const *buf); int (*libncmpi_mput_var1_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, double* const *buf); int (*libncmpi_mput_var1_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, double* const *buf); int (*libncmpi_mput_var1_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, long long* const *buf); int (*libncmpi_mput_var1_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, long long* const *buf); int (*libncmpi_mput_var1_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned long long* const *buf); int (*libncmpi_mput_var1_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned long long* const *buf); int (*libncmpi_mput_vara)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_vara_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_vara_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, char* const *buf); int (*libncmpi_mput_vara_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, char* const *buf); int (*libncmpi_mput_vara_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char* const *buf); int (*libncmpi_mput_vara_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char* const *buf); int (*libncmpi_mput_vara_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char* const *buf); int (*libncmpi_mput_vara_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char* const *buf); int (*libncmpi_mput_vara_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, short* const *buf); int (*libncmpi_mput_vara_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, short* const *buf); int (*libncmpi_mput_vara_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short* const *buf); int (*libncmpi_mput_vara_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short* const *buf); int (*libncmpi_mput_vara_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, int* const *buf); int (*libncmpi_mput_vara_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, int* const *buf); int (*libncmpi_mput_vara_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int* const *buf); int (*libncmpi_mput_vara_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int* const *buf); int (*libncmpi_mput_vara_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long* const *buf); int (*libncmpi_mput_vara_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long* const *buf); int (*libncmpi_mput_vara_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, float* const *buf); int (*libncmpi_mput_vara_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, float* const *buf); int (*libncmpi_mput_vara_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, double* const *buf); int (*libncmpi_mput_vara_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, double* const *buf); int (*libncmpi_mput_vara_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long long* const *buf); int (*libncmpi_mput_vara_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long long* const *buf); int (*libncmpi_mput_vara_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long* const *buf); int (*libncmpi_mput_vara_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long* const *buf); int (*libncmpi_mput_vars)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_vars_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_vars_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, char* const *buf); int (*libncmpi_mput_vars_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, char* const *buf); int (*libncmpi_mput_vars_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, signed char* const *buf); int (*libncmpi_mput_vars_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, signed char* const *buf); int (*libncmpi_mput_vars_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned char* const *buf); int (*libncmpi_mput_vars_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned char* const *buf); int (*libncmpi_mput_vars_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, short* const *buf); int (*libncmpi_mput_vars_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, short* const *buf); int (*libncmpi_mput_vars_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned short* const *buf); int (*libncmpi_mput_vars_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned short* const *buf); int (*libncmpi_mput_vars_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, int* const *buf); int (*libncmpi_mput_vars_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, int* const *buf); int (*libncmpi_mput_vars_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned int* const *buf); int (*libncmpi_mput_vars_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned int* const *buf); int (*libncmpi_mput_vars_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long* const *buf); int (*libncmpi_mput_vars_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long* const *buf); int (*libncmpi_mput_vars_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, float* const *buf); int (*libncmpi_mput_vars_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, float* const *buf); int (*libncmpi_mput_vars_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, double* const *buf); int (*libncmpi_mput_vars_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, double* const *buf); int (*libncmpi_mput_vars_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long long* const *buf); int (*libncmpi_mput_vars_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long long* const *buf); int (*libncmpi_mput_vars_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned long long* const *buf); int (*libncmpi_mput_vars_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned long long* const *buf); int (*libncmpi_mput_varm)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_varm_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, void* const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]); int (*libncmpi_mput_varm_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, char* const *buf); int (*libncmpi_mput_varm_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, char* const *buf); int (*libncmpi_mput_varm_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, signed char* const *buf); int (*libncmpi_mput_varm_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, signed char* const *buf); int (*libncmpi_mput_varm_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned char* const *buf); int (*libncmpi_mput_varm_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned char* const *buf); int (*libncmpi_mput_varm_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, short* const *buf); int (*libncmpi_mput_varm_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, short* const *buf); int (*libncmpi_mput_varm_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned short* const *buf); int (*libncmpi_mput_varm_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned short* const *buf); int (*libncmpi_mput_varm_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, int* const *buf); int (*libncmpi_mput_varm_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, int* const *buf); int (*libncmpi_mput_varm_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned int* const *buf); int (*libncmpi_mput_varm_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned int* const *buf); int (*libncmpi_mput_varm_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long* const *buf); int (*libncmpi_mput_varm_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long* const *buf); int (*libncmpi_mput_varm_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, float* const *buf); int (*libncmpi_mput_varm_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, float* const *buf); int (*libncmpi_mput_varm_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, double* const *buf); int (*libncmpi_mput_varm_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, double* const *buf); int (*libncmpi_mput_varm_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long long* const *buf); int (*libncmpi_mput_varm_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long long* const *buf); int (*libncmpi_mput_varm_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned long long* const *buf); int (*libncmpi_mput_varm_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned long long* const *buf); int (*libncmpi_mget_var)(int ncid, int num, int *varids, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_var_all)(int ncid, int num, int *varids, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_var_text)(int ncid, int num, int *varids, char *bufs[]); int (*libncmpi_mget_var_text_all)(int ncid, int num, int *varids, char *bufs[]); int (*libncmpi_mget_var_schar)(int ncid, int num, int *varids, signed char *bufs[]); int (*libncmpi_mget_var_schar_all)(int ncid, int num, int *varids, signed char *bufs[]); int (*libncmpi_mget_var_uchar)(int ncid, int num, int *varids, unsigned char *bufs[]); int (*libncmpi_mget_var_uchar_all)(int ncid, int num, int *varids, unsigned char *bufs[]); int (*libncmpi_mget_var_short)(int ncid, int num, int *varids, short *bufs[]); int (*libncmpi_mget_var_short_all)(int ncid, int num, int *varids, short *bufs[]); int (*libncmpi_mget_var_ushort)(int ncid, int num, int *varids, unsigned short *bufs[]); int (*libncmpi_mget_var_ushort_all)(int ncid, int num, int *varids, unsigned short *bufs[]); int (*libncmpi_mget_var_int)(int ncid, int num, int *varids, int *bufs[]); int (*libncmpi_mget_var_int_all)(int ncid, int num, int *varids, int *bufs[]); int (*libncmpi_mget_var_uint)(int ncid, int num, int *varids, unsigned int *bufs[]); int (*libncmpi_mget_var_uint_all)(int ncid, int num, int *varids, unsigned int *bufs[]); int (*libncmpi_mget_var_long)(int ncid, int num, int *varids, long *bufs[]); int (*libncmpi_mget_var_long_all)(int ncid, int num, int *varids, long *bufs[]); int (*libncmpi_mget_var_float)(int ncid, int num, int *varids, float *bufs[]); int (*libncmpi_mget_var_float_all)(int ncid, int num, int *varids, float *bufs[]); int (*libncmpi_mget_var_double)(int ncid, int num, int *varids, double *bufs[]); int (*libncmpi_mget_var_double_all)(int ncid, int num, int *varids, double *bufs[]); int (*libncmpi_mget_var_longlong)(int ncid, int num, int *varids, long long *bufs[]); int (*libncmpi_mget_var_longlong_all)(int ncid, int num, int *varids, long long *bufs[]); int (*libncmpi_mget_var_ulonglong)(int ncid, int num, int *varids, unsigned long long *bufs[]); int (*libncmpi_mget_var_ulonglong_all)(int ncid, int num, int *varids, unsigned long long *bufs[]); int (*libncmpi_mget_var1)(int ncid, int num, int *varids, MPI_Offset* const *starts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_var1_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_var1_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, char *bufs[]); int (*libncmpi_mget_var1_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, char *bufs[]); int (*libncmpi_mget_var1_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, signed char *bufs[]); int (*libncmpi_mget_var1_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, signed char *bufs[]); int (*libncmpi_mget_var1_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned char *bufs[]); int (*libncmpi_mget_var1_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned char *bufs[]); int (*libncmpi_mget_var1_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, short *bufs[]); int (*libncmpi_mget_var1_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, short *bufs[]); int (*libncmpi_mget_var1_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned short *bufs[]); int (*libncmpi_mget_var1_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned short *bufs[]); int (*libncmpi_mget_var1_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, int *bufs[]); int (*libncmpi_mget_var1_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, int *bufs[]); int (*libncmpi_mget_var1_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned int *bufs[]); int (*libncmpi_mget_var1_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned int *bufs[]); int (*libncmpi_mget_var1_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, long *bufs[]); int (*libncmpi_mget_var1_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, long *bufs[]); int (*libncmpi_mget_var1_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, float *bufs[]); int (*libncmpi_mget_var1_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, float *bufs[]); int (*libncmpi_mget_var1_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, double *bufs[]); int (*libncmpi_mget_var1_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, double *bufs[]); int (*libncmpi_mget_var1_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, long long *bufs[]); int (*libncmpi_mget_var1_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, long long *bufs[]); int (*libncmpi_mget_var1_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned long long *bufs[]); int (*libncmpi_mget_var1_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, unsigned long long *bufs[]); int (*libncmpi_mget_vara)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_vara_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_vara_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, char *bufs[]); int (*libncmpi_mget_vara_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, char *bufs[]); int (*libncmpi_mget_vara_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char *bufs[]); int (*libncmpi_mget_vara_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, signed char *bufs[]); int (*libncmpi_mget_vara_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char *bufs[]); int (*libncmpi_mget_vara_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned char *bufs[]); int (*libncmpi_mget_vara_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, short *bufs[]); int (*libncmpi_mget_vara_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, short *bufs[]); int (*libncmpi_mget_vara_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short *bufs[]); int (*libncmpi_mget_vara_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned short *bufs[]); int (*libncmpi_mget_vara_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, int *bufs[]); int (*libncmpi_mget_vara_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, int *bufs[]); int (*libncmpi_mget_vara_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int *bufs[]); int (*libncmpi_mget_vara_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned int *bufs[]); int (*libncmpi_mget_vara_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long *bufs[]); int (*libncmpi_mget_vara_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long *bufs[]); int (*libncmpi_mget_vara_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, float *bufs[]); int (*libncmpi_mget_vara_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, float *bufs[]); int (*libncmpi_mget_vara_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, double *bufs[]); int (*libncmpi_mget_vara_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, double *bufs[]); int (*libncmpi_mget_vara_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long long *bufs[]); int (*libncmpi_mget_vara_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, long long *bufs[]); int (*libncmpi_mget_vara_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long *bufs[]); int (*libncmpi_mget_vara_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, unsigned long long *bufs[]); int (*libncmpi_mget_vars)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_vars_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_vars_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, char *bufs[]); int (*libncmpi_mget_vars_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, char *bufs[]); int (*libncmpi_mget_vars_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, signed char *bufs[]); int (*libncmpi_mget_vars_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, signed char *bufs[]); int (*libncmpi_mget_vars_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned char *bufs[]); int (*libncmpi_mget_vars_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned char *bufs[]); int (*libncmpi_mget_vars_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, short *bufs[]); int (*libncmpi_mget_vars_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, short *bufs[]); int (*libncmpi_mget_vars_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned short *bufs[]); int (*libncmpi_mget_vars_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned short *bufs[]); int (*libncmpi_mget_vars_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, int *bufs[]); int (*libncmpi_mget_vars_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, int *bufs[]); int (*libncmpi_mget_vars_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned int *bufs[]); int (*libncmpi_mget_vars_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned int *bufs[]); int (*libncmpi_mget_vars_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long *bufs[]); int (*libncmpi_mget_vars_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long *bufs[]); int (*libncmpi_mget_vars_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, float *bufs[]); int (*libncmpi_mget_vars_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, float *bufs[]); int (*libncmpi_mget_vars_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, double *bufs[]); int (*libncmpi_mget_vars_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, double *bufs[]); int (*libncmpi_mget_vars_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long long *bufs[]); int (*libncmpi_mget_vars_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, long long *bufs[]); int (*libncmpi_mget_vars_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned long long *bufs[]); int (*libncmpi_mget_vars_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, unsigned long long *bufs[]); int (*libncmpi_mget_varm)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_varm_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes); int (*libncmpi_mget_varm_text)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, char *bufs[]); int (*libncmpi_mget_varm_text_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, char *bufs[]); int (*libncmpi_mget_varm_schar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, signed char *bufs[]); int (*libncmpi_mget_varm_schar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, signed char *bufs[]); int (*libncmpi_mget_varm_uchar)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned char *bufs[]); int (*libncmpi_mget_varm_uchar_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned char *bufs[]); int (*libncmpi_mget_varm_short)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, short *bufs[]); int (*libncmpi_mget_varm_short_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, short *bufs[]); int (*libncmpi_mget_varm_ushort)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned short *bufs[]); int (*libncmpi_mget_varm_ushort_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned short *bufs[]); int (*libncmpi_mget_varm_int)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, int *bufs[]); int (*libncmpi_mget_varm_int_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, int *bufs[]); int (*libncmpi_mget_varm_uint)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned int *bufs[]); int (*libncmpi_mget_varm_uint_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned int *bufs[]); int (*libncmpi_mget_varm_long)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long *bufs[]); int (*libncmpi_mget_varm_long_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long *bufs[]); int (*libncmpi_mget_varm_float)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, float *bufs[]); int (*libncmpi_mget_varm_float_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, float *bufs[]); int (*libncmpi_mget_varm_double)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, double *bufs[]); int (*libncmpi_mget_varm_double_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, double *bufs[]); int (*libncmpi_mget_varm_longlong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long long *bufs[]); int (*libncmpi_mget_varm_longlong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, long long *bufs[]); int (*libncmpi_mget_varm_ulonglong)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned long long *bufs[]); int (*libncmpi_mget_varm_ulonglong_all)(int ncid, int num, int *varids, MPI_Offset* const *starts, MPI_Offset* const *counts, MPI_Offset* const *strides, MPI_Offset* const *imaps, unsigned long long *bufs[]); int ncmpi_create (MPI_Comm comm, const char *path, int cmode, MPI_Info info, int *ncidp) { FUNCTION_ENTRY; int ret = libncmpi_create(comm, path, cmode, info, ncidp); FUNCTION_EXIT; return ret; } int ncmpi_open (MPI_Comm comm, const char *path, int omode, MPI_Info info, int *ncidp) { FUNCTION_ENTRY; int ret = libncmpi_open(comm, path, omode, info, ncidp); FUNCTION_EXIT; return ret; } int ncmpi_inq_file_info (int ncid, MPI_Info *info_used) { FUNCTION_ENTRY; int ret = libncmpi_inq_file_info(ncid, info_used); FUNCTION_EXIT; return ret; } int ncmpi_get_file_info (int ncid, MPI_Info *info_used) { FUNCTION_ENTRY; int ret = libncmpi_get_file_info(ncid, info_used); FUNCTION_EXIT; return ret; } int ncmpi_delete (const char *filename, MPI_Info info) { FUNCTION_ENTRY; int ret = libncmpi_delete(filename, info); FUNCTION_EXIT; return ret; } int ncmpi_enddef (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_enddef(ncid); FUNCTION_EXIT; return ret; } int ncmpi__enddef (int ncid, MPI_Offset h_minfree, MPI_Offset v_align, MPI_Offset v_minfree, MPI_Offset r_align) { FUNCTION_ENTRY; int ret = libncmpi__enddef(ncid, h_minfree, v_align, v_minfree, r_align); FUNCTION_EXIT; return ret; } int ncmpi_redef (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_redef(ncid); FUNCTION_EXIT; return ret; } int ncmpi_set_default_format (int format, int *old_formatp) { FUNCTION_ENTRY; int ret = libncmpi_set_default_format(format, old_formatp); FUNCTION_EXIT; return ret; } int ncmpi_inq_default_format (int *formatp) { FUNCTION_ENTRY; int ret = libncmpi_inq_default_format(formatp); FUNCTION_EXIT; return ret; } int ncmpi_sync (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_sync(ncid); FUNCTION_EXIT; return ret; } int ncmpi_flush (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_flush(ncid); FUNCTION_EXIT; return ret; } int ncmpi_sync_numrecs (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_sync_numrecs(ncid); FUNCTION_EXIT; return ret; } int ncmpi_abort (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_abort(ncid); FUNCTION_EXIT; return ret; } int ncmpi_begin_indep_data (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_begin_indep_data(ncid); FUNCTION_EXIT; return ret; } int ncmpi_end_indep_data (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_end_indep_data(ncid); FUNCTION_EXIT; return ret; } int ncmpi_close (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_close(ncid); FUNCTION_EXIT; return ret; } int ncmpi_set_fill (int ncid, int fillmode, int *old_modep) { FUNCTION_ENTRY; int ret = libncmpi_set_fill(ncid, fillmode, old_modep); FUNCTION_EXIT; return ret; } int ncmpi_def_var_fill (int ncid, int varid, int no_fill, const void *fill_value) { FUNCTION_ENTRY; int ret = libncmpi_def_var_fill(ncid, varid, no_fill, fill_value); FUNCTION_EXIT; return ret; } int ncmpi_fill_var_rec (int ncid, int varid, MPI_Offset recno) { FUNCTION_ENTRY; int ret = libncmpi_fill_var_rec(ncid, varid, recno); FUNCTION_EXIT; return ret; } int ncmpi_def_dim (int ncid, const char *name, MPI_Offset len, int *idp) { FUNCTION_ENTRY; int ret = libncmpi_def_dim(ncid, name, len, idp); FUNCTION_EXIT; return ret; } int ncmpi_def_var (int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp) { FUNCTION_ENTRY; int ret = libncmpi_def_var(ncid, name, xtype, ndims, dimidsp, varidp); FUNCTION_EXIT; return ret; } int ncmpi_rename_dim (int ncid, int dimid, const char *name) { FUNCTION_ENTRY; int ret = libncmpi_rename_dim(ncid, dimid, name); FUNCTION_EXIT; return ret; } int ncmpi_rename_var (int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libncmpi_rename_var(ncid, varid, name); FUNCTION_EXIT; return ret; } int ncmpi_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp) { FUNCTION_ENTRY; int ret = libncmpi_inq(ncid, ndimsp, nvarsp, ngattsp, unlimdimidp); FUNCTION_EXIT; return ret; } int ncmpi_inq_format (int ncid, int *formatp) { FUNCTION_ENTRY; int ret = libncmpi_inq_format(ncid, formatp); FUNCTION_EXIT; return ret; } int ncmpi_inq_file_format (const char *filename, int *formatp) { FUNCTION_ENTRY; int ret = libncmpi_inq_file_format(filename, formatp); FUNCTION_EXIT; return ret; } int ncmpi_inq_version (int ncid, int *NC_mode) { FUNCTION_ENTRY; int ret = libncmpi_inq_version(ncid, NC_mode); FUNCTION_EXIT; return ret; } int ncmpi_inq_striping (int ncid, int *striping_size, int *striping_count) { FUNCTION_ENTRY; int ret = libncmpi_inq_striping(ncid, striping_size, striping_count); FUNCTION_EXIT; return ret; } int ncmpi_inq_ndims (int ncid, int *ndimsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_ndims(ncid, ndimsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_nvars (int ncid, int *nvarsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_nvars(ncid, nvarsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_num_rec_vars (int ncid, int *nvarsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_num_rec_vars(ncid, nvarsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_num_fix_vars (int ncid, int *nvarsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_num_fix_vars(ncid, nvarsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_natts (int ncid, int *ngattsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_natts(ncid, ngattsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_unlimdim (int ncid, int *unlimdimidp) { FUNCTION_ENTRY; int ret = libncmpi_inq_unlimdim(ncid, unlimdimidp); FUNCTION_EXIT; return ret; } int ncmpi_inq_dimid (int ncid, const char *name, int *idp) { FUNCTION_ENTRY; int ret = libncmpi_inq_dimid(ncid, name, idp); FUNCTION_EXIT; return ret; } int ncmpi_inq_dim (int ncid, int dimid, char *name, MPI_Offset *lenp) { FUNCTION_ENTRY; int ret = libncmpi_inq_dim(ncid, dimid, name, lenp); FUNCTION_EXIT; return ret; } int ncmpi_inq_dimname (int ncid, int dimid, char *name) { FUNCTION_ENTRY; int ret = libncmpi_inq_dimname(ncid, dimid, name); FUNCTION_EXIT; return ret; } int ncmpi_inq_dimlen (int ncid, int dimid, MPI_Offset *lenp) { FUNCTION_ENTRY; int ret = libncmpi_inq_dimlen(ncid, dimid, lenp); FUNCTION_EXIT; return ret; } int ncmpi_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_var(ncid, varid, name, xtypep, ndimsp, dimidsp, nattsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_varid (int ncid, const char *name, int *varidp) { FUNCTION_ENTRY; int ret = libncmpi_inq_varid(ncid, name, varidp); FUNCTION_EXIT; return ret; } int ncmpi_inq_varname (int ncid, int varid, char *name) { FUNCTION_ENTRY; int ret = libncmpi_inq_varname(ncid, varid, name); FUNCTION_EXIT; return ret; } int ncmpi_inq_vartype (int ncid, int varid, nc_type *xtypep) { FUNCTION_ENTRY; int ret = libncmpi_inq_vartype(ncid, varid, xtypep); FUNCTION_EXIT; return ret; } int ncmpi_inq_varndims (int ncid, int varid, int *ndimsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_varndims(ncid, varid, ndimsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_vardimid (int ncid, int varid, int *dimidsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_vardimid(ncid, varid, dimidsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_varnatts (int ncid, int varid, int *nattsp) { FUNCTION_ENTRY; int ret = libncmpi_inq_varnatts(ncid, varid, nattsp); FUNCTION_EXIT; return ret; } int ncmpi_inq_varoffset (int ncid, int varid, MPI_Offset *offset) { FUNCTION_ENTRY; int ret = libncmpi_inq_varoffset(ncid, varid, offset); FUNCTION_EXIT; return ret; } int ncmpi_inq_put_size (int ncid, MPI_Offset *size) { FUNCTION_ENTRY; int ret = libncmpi_inq_put_size(ncid, size); FUNCTION_EXIT; return ret; } int ncmpi_inq_get_size (int ncid, MPI_Offset *size) { FUNCTION_ENTRY; int ret = libncmpi_inq_get_size(ncid, size); FUNCTION_EXIT; return ret; } int ncmpi_inq_header_size (int ncid, MPI_Offset *size) { FUNCTION_ENTRY; int ret = libncmpi_inq_header_size(ncid, size); FUNCTION_EXIT; return ret; } int ncmpi_inq_header_extent (int ncid, MPI_Offset *extent) { FUNCTION_ENTRY; int ret = libncmpi_inq_header_extent(ncid, extent); FUNCTION_EXIT; return ret; } int ncmpi_inq_malloc_size (MPI_Offset *size) { FUNCTION_ENTRY; int ret = libncmpi_inq_malloc_size(size); FUNCTION_EXIT; return ret; } int ncmpi_inq_malloc_max_size (MPI_Offset *size) { FUNCTION_ENTRY; int ret = libncmpi_inq_malloc_max_size(size); FUNCTION_EXIT; return ret; } int ncmpi_inq_malloc_list (void) { FUNCTION_ENTRY; int ret = libncmpi_inq_malloc_list(); FUNCTION_EXIT; return ret; } int ncmpi_inq_files_opened (int *num, int *ncids) { FUNCTION_ENTRY; int ret = libncmpi_inq_files_opened(num, ncids); FUNCTION_EXIT; return ret; } int ncmpi_inq_recsize (int ncid, MPI_Offset *recsize) { FUNCTION_ENTRY; int ret = libncmpi_inq_recsize(ncid, recsize); FUNCTION_EXIT; return ret; } int ncmpi_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_value) { FUNCTION_ENTRY; int ret = libncmpi_inq_var_fill(ncid, varid, no_fill, fill_value); FUNCTION_EXIT; return ret; } int ncmpi_inq_path (int ncid, int *pathlen, char *path) { FUNCTION_ENTRY; int ret = libncmpi_inq_path(ncid, pathlen, path); FUNCTION_EXIT; return ret; } int ncmpi_inq_att (int ncid, int varid, const char *name, nc_type *xtypep, MPI_Offset *lenp) { FUNCTION_ENTRY; int ret = libncmpi_inq_att(ncid, varid, name, xtypep, lenp); FUNCTION_EXIT; return ret; } int ncmpi_inq_attid (int ncid, int varid, const char *name, int *idp) { FUNCTION_ENTRY; int ret = libncmpi_inq_attid(ncid, varid, name, idp); FUNCTION_EXIT; return ret; } int ncmpi_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep) { FUNCTION_ENTRY; int ret = libncmpi_inq_atttype(ncid, varid, name, xtypep); FUNCTION_EXIT; return ret; } int ncmpi_inq_attlen (int ncid, int varid, const char *name, MPI_Offset *lenp) { FUNCTION_ENTRY; int ret = libncmpi_inq_attlen(ncid, varid, name, lenp); FUNCTION_EXIT; return ret; } int ncmpi_inq_attname (int ncid, int varid, int attnum, char *name) { FUNCTION_ENTRY; int ret = libncmpi_inq_attname(ncid, varid, attnum, name); FUNCTION_EXIT; return ret; } int ncmpi_copy_att (int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out) { FUNCTION_ENTRY; int ret = libncmpi_copy_att(ncid_in, varid_in, name, ncid_out, varid_out); FUNCTION_EXIT; return ret; } int ncmpi_rename_att (int ncid, int varid, const char *name, const char *newname) { FUNCTION_ENTRY; int ret = libncmpi_rename_att(ncid, varid, name, newname); FUNCTION_EXIT; return ret; } int ncmpi_del_att (int ncid, int varid, const char *name) { FUNCTION_ENTRY; int ret = libncmpi_del_att(ncid, varid, name); FUNCTION_EXIT; return ret; } int ncmpi_put_att (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset nelems, const void *value) { FUNCTION_ENTRY; int ret = libncmpi_put_att(ncid, varid, name, xtype, nelems, value); FUNCTION_EXIT; return ret; } int ncmpi_put_att_text (int ncid, int varid, const char *name, MPI_Offset len, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_text(ncid, varid, name, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_schar (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_schar(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_short (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_short(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_int (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_int(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_float (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_float(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_double (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_double(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_longlong (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_longlong(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_get_att (int ncid, int varid, const char *name, void *value) { FUNCTION_ENTRY; int ret = libncmpi_get_att(ncid, varid, name, value); FUNCTION_EXIT; return ret; } int ncmpi_get_att_text (int ncid, int varid, const char *name, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_text(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_schar (int ncid, int varid, const char *name, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_schar(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_short (int ncid, int varid, const char *name, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_short(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_int (int ncid, int varid, const char *name, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_int(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_float (int ncid, int varid, const char *name, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_float(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_double (int ncid, int varid, const char *name, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_double(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_longlong (int ncid, int varid, const char *name, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_longlong(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_att_uchar (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_uchar(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_ubyte (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_ubyte(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_ushort (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_ushort(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_uint (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_uint(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_long (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_long(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_put_att_ulonglong (int ncid, int varid, const char *name, nc_type xtype, MPI_Offset len, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_att_ulonglong(ncid, varid, name, xtype, len, op); FUNCTION_EXIT; return ret; } int ncmpi_get_att_uchar (int ncid, int varid, const char *name, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_uchar(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_ubyte (int ncid, int varid, const char *name, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_ubyte(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_ushort (int ncid, int varid, const char *name, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_ushort(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_uint (int ncid, int varid, const char *name, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_uint(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_long (int ncid, int varid, const char *name, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_long(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_att_ulonglong (int ncid, int varid, const char *name, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_att_ulonglong(ncid, varid, name, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var1 (int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_var1(ncid, varid, start, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_all (int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_all(ncid, varid, start, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_text (int ncid, int varid, const MPI_Offset *start, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_text(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_text_all (int ncid, int varid, const MPI_Offset *start, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_text_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_schar (int ncid, int varid, const MPI_Offset *start, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_schar(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_schar_all (int ncid, int varid, const MPI_Offset *start, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_schar_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_short (int ncid, int varid, const MPI_Offset *start, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_short(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_short_all (int ncid, int varid, const MPI_Offset *start, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_short_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_int (int ncid, int varid, const MPI_Offset *start, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_int(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_int_all (int ncid, int varid, const MPI_Offset *start, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_int_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_float (int ncid, int varid, const MPI_Offset *start, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_float(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_float_all (int ncid, int varid, const MPI_Offset *start, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_float_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_double (int ncid, int varid, const MPI_Offset *start, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_double(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_double_all (int ncid, int varid, const MPI_Offset *start, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_double_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_longlong (int ncid, int varid, const MPI_Offset *start, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_longlong(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_longlong_all (int ncid, int varid, const MPI_Offset *start, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_longlong_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_get_var1 (int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_var1(ncid, varid, start, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_all (int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_all(ncid, varid, start, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_text (int ncid, int varid, const MPI_Offset *start, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_text(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_text_all (int ncid, int varid, const MPI_Offset *start, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_text_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_schar (int ncid, int varid, const MPI_Offset *start, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_schar(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_schar_all (int ncid, int varid, const MPI_Offset *start, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_schar_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_short (int ncid, int varid, const MPI_Offset *start, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_short(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_short_all (int ncid, int varid, const MPI_Offset *start, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_short_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_int (int ncid, int varid, const MPI_Offset *start, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_int(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_int_all (int ncid, int varid, const MPI_Offset *start, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_int_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_float (int ncid, int varid, const MPI_Offset *start, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_float(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_float_all (int ncid, int varid, const MPI_Offset *start, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_float_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_double (int ncid, int varid, const MPI_Offset *start, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_double(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_double_all (int ncid, int varid, const MPI_Offset *start, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_double_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_longlong (int ncid, int varid, const MPI_Offset *start, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_longlong(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_longlong_all (int ncid, int varid, const MPI_Offset *start, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_longlong_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_uchar (int ncid, int varid, const MPI_Offset *start, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_uchar(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_uchar_all (int ncid, int varid, const MPI_Offset *start, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_uchar_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_ushort (int ncid, int varid, const MPI_Offset *start, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_ushort(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_ushort_all (int ncid, int varid, const MPI_Offset *start, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_ushort_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_uint (int ncid, int varid, const MPI_Offset *start, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_uint(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_uint_all (int ncid, int varid, const MPI_Offset *start, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_uint_all(ncid, varid, start, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_long (int ncid, int varid, const MPI_Offset *start, const long *ip) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_long(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_long_all (int ncid, int varid, const MPI_Offset *start, const long *ip) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_long_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_ulonglong (int ncid, int varid, const MPI_Offset *start, const unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_ulonglong(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var1_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_put_var1_ulonglong_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_uchar (int ncid, int varid, const MPI_Offset *start, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_uchar(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_uchar_all (int ncid, int varid, const MPI_Offset *start, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_uchar_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_ushort (int ncid, int varid, const MPI_Offset *start, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_ushort(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_ushort_all (int ncid, int varid, const MPI_Offset *start, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_ushort_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_uint (int ncid, int varid, const MPI_Offset *start, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_uint(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_uint_all (int ncid, int varid, const MPI_Offset *start, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_uint_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_long (int ncid, int varid, const MPI_Offset *start, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_long(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_long_all (int ncid, int varid, const MPI_Offset *start, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_long_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_ulonglong (int ncid, int varid, const MPI_Offset *start, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_ulonglong(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var1_ulonglong_all (int ncid, int varid, const MPI_Offset *start, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var1_ulonglong_all(ncid, varid, start, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var (int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_var(ncid, varid, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_var_all (int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_var_all(ncid, varid, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_var_text (int ncid, int varid, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_text(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_text_all (int ncid, int varid, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_text_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_schar (int ncid, int varid, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_schar(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_schar_all (int ncid, int varid, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_schar_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_short (int ncid, int varid, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_short(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_short_all (int ncid, int varid, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_short_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_int (int ncid, int varid, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_int(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_int_all (int ncid, int varid, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_int_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_float (int ncid, int varid, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_float(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_float_all (int ncid, int varid, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_float_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_double (int ncid, int varid, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_double(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_double_all (int ncid, int varid, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_double_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_longlong (int ncid, int varid, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_longlong(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_longlong_all (int ncid, int varid, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_longlong_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_get_var (int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_var(ncid, varid, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_var_all (int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_var_all(ncid, varid, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_var_text (int ncid, int varid, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_text(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_text_all (int ncid, int varid, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_text_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_schar (int ncid, int varid, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_schar(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_schar_all (int ncid, int varid, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_schar_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_short (int ncid, int varid, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_short(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_short_all (int ncid, int varid, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_short_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_int (int ncid, int varid, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_int(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_int_all (int ncid, int varid, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_int_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_float (int ncid, int varid, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_float(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_float_all (int ncid, int varid, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_float_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_double (int ncid, int varid, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_double(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_double_all (int ncid, int varid, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_double_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_longlong (int ncid, int varid, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_longlong(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_longlong_all (int ncid, int varid, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_longlong_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_var_uchar (int ncid, int varid, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_uchar(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_uchar_all (int ncid, int varid, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_uchar_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_ushort (int ncid, int varid, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_ushort(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_ushort_all (int ncid, int varid, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_ushort_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_uint (int ncid, int varid, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_uint(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_uint_all (int ncid, int varid, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_uint_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_long (int ncid, int varid, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_long(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_long_all (int ncid, int varid, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_long_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_ulonglong (int ncid, int varid, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_ulonglong(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_put_var_ulonglong_all (int ncid, int varid, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_var_ulonglong_all(ncid, varid, op); FUNCTION_EXIT; return ret; } int ncmpi_get_var_uchar (int ncid, int varid, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_uchar(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_uchar_all (int ncid, int varid, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_uchar_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_ushort (int ncid, int varid, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_ushort(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_ushort_all (int ncid, int varid, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_ushort_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_uint (int ncid, int varid, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_uint(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_uint_all (int ncid, int varid, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_uint_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_long (int ncid, int varid, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_long(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_long_all (int ncid, int varid, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_long_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_ulonglong (int ncid, int varid, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_ulonglong(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_var_ulonglong_all (int ncid, int varid, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_var_ulonglong_all(ncid, varid, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_vara (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vara(ncid, varid, start, count, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_all(ncid, varid, start, count, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_text(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_text_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_schar(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_schar_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_short(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_short_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_int(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_int_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_float(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_float_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_double(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_double_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_longlong(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_longlong_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_get_vara (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vara(ncid, varid, start, count, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_all(ncid, varid, start, count, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_text(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_text_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_schar(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_schar_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_short(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_short_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_int(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_int_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_float(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_float_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_double(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_double_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_longlong(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_longlong_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_uchar(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_uchar_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_ushort(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_ushort_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_uint(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_uint_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_long(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_long_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_ulonglong(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vara_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vara_ulonglong_all(ncid, varid, start, count, op); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_uchar(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_uchar_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_ushort(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_ushort_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_uint(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_uint_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_long(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_long_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_ulonglong(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vara_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vara_ulonglong_all(ncid, varid, start, count, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_vars (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vars(ncid, varid, start, count, stride, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_all(ncid, varid, start, count, stride, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_text(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_text_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_schar(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_schar_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_short(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_short_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_int(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_int_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_float(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_float_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_double(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_double_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_longlong(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_longlong_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_get_vars (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vars(ncid, varid, start, count, stride, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_all(ncid, varid, start, count, stride, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_schar(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_schar_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_text(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_text_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_short(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_short_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_int(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_int_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_float(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_float_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_double(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_double_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_longlong(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_longlong_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_uchar(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_uchar_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_ushort(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_ushort_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_uint(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_uint_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_long(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_long_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_ulonglong(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_put_vars_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_vars_ulonglong_all(ncid, varid, start, count, stride, op); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_uchar(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_uchar_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_ushort(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_ushort_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_uint(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_uint_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_long(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_long_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_ulonglong(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vars_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_vars_ulonglong_all(ncid, varid, start, count, stride, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_varm (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_varm(ncid, varid, start, count, stride, imap, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_all(ncid, varid, start, count, stride, imap, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_text(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_text_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_schar(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_schar_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_short(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_short_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_int(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_int_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_float(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_float_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_double(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_double_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_longlong(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_longlong_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_get_varm (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_varm(ncid, varid, start, count, stride, imap, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_all(ncid, varid, start, count, stride, imap, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_schar(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_schar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_schar_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_text(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_text_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_text_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_short(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_short_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_short_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_int(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_int_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_int_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_float(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_float_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_float_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_double(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_double_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_double_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_longlong(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_longlong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_longlong_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_uchar(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_uchar_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_ushort(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_ushort_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_uint(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_uint_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_long(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_long_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_ulonglong(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varm_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varm_ulonglong_all(ncid, varid, start, count, stride, imap, op); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_uchar(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_uchar_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_uchar_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_ushort(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_ushort_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_ushort_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_uint(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_uint_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_uint_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_long(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_long_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_long_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_ulonglong(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varm_ulonglong_all (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varm_ulonglong_all(ncid, varid, start, count, stride, imap, ip); FUNCTION_EXIT; return ret; } int ncmpi_put_varn (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_varn(ncid, varid, num, starts, counts, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_all(ncid, varid, num, starts, counts, op, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_varn (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_varn(ncid, varid, num, starts, counts, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_all(ncid, varid, num, starts, counts, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_text (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_text(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_text_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_text_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_schar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_schar(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_schar_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const signed char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_schar_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_short (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_short(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_short_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_short_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_int (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_int(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_int_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_int_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_float (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_float(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_float_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const float *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_float_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_double (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_double(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_double_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const double *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_double_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_longlong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_longlong(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_longlong_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_longlong_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_uchar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_uchar(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_uchar_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned char *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_uchar_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_ushort (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_ushort(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_ushort_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned short *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_ushort_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_uint (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_uint(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_uint_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned int *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_uint_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_long (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_long(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_long_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_long_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_ulonglong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_ulonglong(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_put_varn_ulonglong_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned long long *op) { FUNCTION_ENTRY; int ret = libncmpi_put_varn_ulonglong_all(ncid, varid, num, starts, counts, op); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_text (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_text(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_text_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_text_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_schar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_schar(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_schar_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_schar_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_short (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_short(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_short_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_short_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_int (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_int(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_int_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_int_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_float (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_float(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_float_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, float *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_float_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_double (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_double(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_double_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, double *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_double_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_longlong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_longlong(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_longlong_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_longlong_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_uchar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_uchar(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_uchar_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_uchar_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_ushort (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_ushort(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_ushort_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_ushort_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_uint (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_uint(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_uint_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_uint_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_long (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_long(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_long_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_long_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_ulonglong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_ulonglong(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_varn_ulonglong_all (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *ip) { FUNCTION_ENTRY; int ret = libncmpi_get_varn_ulonglong_all(ncid, varid, num, starts, counts, ip); FUNCTION_EXIT; return ret; } int ncmpi_get_vard (int ncid, int varid, MPI_Datatype filetype, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vard(ncid, varid, filetype, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_get_vard_all (int ncid, int varid, MPI_Datatype filetype, void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_get_vard_all(ncid, varid, filetype, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vard (int ncid, int varid, MPI_Datatype filetype, const void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vard(ncid, varid, filetype, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_put_vard_all (int ncid, int varid, MPI_Datatype filetype, const void *ip, MPI_Offset bufcount, MPI_Datatype buftype) { FUNCTION_ENTRY; int ret = libncmpi_put_vard_all(ncid, varid, filetype, ip, bufcount, buftype); FUNCTION_EXIT; return ret; } int ncmpi_wait (int ncid, int count, int array_of_requests[], int array_of_statuses[]) { FUNCTION_ENTRY; int ret = libncmpi_wait(ncid, count, array_of_requests, array_of_statuses); FUNCTION_EXIT; return ret; } int ncmpi_wait_all (int ncid, int count, int array_of_requests[], int array_of_statuses[]) { FUNCTION_ENTRY; int ret = libncmpi_wait_all(ncid, count, array_of_requests, array_of_statuses); FUNCTION_EXIT; return ret; } int ncmpi_cancel (int ncid, int num, int *reqs, int *statuses) { FUNCTION_ENTRY; int ret = libncmpi_cancel(ncid, num, reqs, statuses); FUNCTION_EXIT; return ret; } int ncmpi_buffer_attach (int ncid, MPI_Offset bufsize) { FUNCTION_ENTRY; int ret = libncmpi_buffer_attach(ncid, bufsize); FUNCTION_EXIT; return ret; } int ncmpi_buffer_detach (int ncid) { FUNCTION_ENTRY; int ret = libncmpi_buffer_detach(ncid); FUNCTION_EXIT; return ret; } int ncmpi_inq_buffer_usage (int ncid, MPI_Offset *usage) { FUNCTION_ENTRY; int ret = libncmpi_inq_buffer_usage(ncid, usage); FUNCTION_EXIT; return ret; } int ncmpi_inq_buffer_size (int ncid, MPI_Offset *buf_size) { FUNCTION_ENTRY; int ret = libncmpi_inq_buffer_size(ncid, buf_size); FUNCTION_EXIT; return ret; } int ncmpi_inq_nreqs (int ncid, int *nreqs) { FUNCTION_ENTRY; int ret = libncmpi_inq_nreqs(ncid, nreqs); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1 (int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1(ncid, varid, start, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_text (int ncid, int varid, const MPI_Offset *start, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_text(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_schar (int ncid, int varid, const MPI_Offset *start, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_schar(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_short (int ncid, int varid, const MPI_Offset *start, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_short(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_int (int ncid, int varid, const MPI_Offset *start, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_int(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_float (int ncid, int varid, const MPI_Offset *start, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_float(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_double (int ncid, int varid, const MPI_Offset *start, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_double(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_longlong (int ncid, int varid, const MPI_Offset *start, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_longlong(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1 (int ncid, int varid, const MPI_Offset *start, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1(ncid, varid, start, ip, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_schar (int ncid, int varid, const MPI_Offset *start, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_schar(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_text (int ncid, int varid, const MPI_Offset *start, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_text(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_short (int ncid, int varid, const MPI_Offset *start, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_short(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_int (int ncid, int varid, const MPI_Offset *start, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_int(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_float (int ncid, int varid, const MPI_Offset *start, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_float(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_double (int ncid, int varid, const MPI_Offset *start, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_double(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_longlong (int ncid, int varid, const MPI_Offset *start, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_longlong(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1 (int ncid, int varid, const MPI_Offset *start, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1(ncid, varid, start, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_text (int ncid, int varid, const MPI_Offset *start, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_text(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_schar (int ncid, int varid, const MPI_Offset *start, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_schar(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_short (int ncid, int varid, const MPI_Offset *start, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_short(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_int (int ncid, int varid, const MPI_Offset *start, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_int(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_float (int ncid, int varid, const MPI_Offset *start, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_float(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_double (int ncid, int varid, const MPI_Offset *start, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_double(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_longlong (int ncid, int varid, const MPI_Offset *start, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_longlong(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_uchar (int ncid, int varid, const MPI_Offset *start, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_uchar(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_ushort (int ncid, int varid, const MPI_Offset *start, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_ushort(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_uint (int ncid, int varid, const MPI_Offset *start, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_uint(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_long (int ncid, int varid, const MPI_Offset *start, const long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_long(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var1_ulonglong (int ncid, int varid, const MPI_Offset *start, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var1_ulonglong(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_uchar (int ncid, int varid, const MPI_Offset *start, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_uchar(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_ushort (int ncid, int varid, const MPI_Offset *start, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_ushort(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_uint (int ncid, int varid, const MPI_Offset *start, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_uint(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_long (int ncid, int varid, const MPI_Offset *start, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_long(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var1_ulonglong (int ncid, int varid, const MPI_Offset *start, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var1_ulonglong(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_uchar (int ncid, int varid, const MPI_Offset *start, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_uchar(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_ushort (int ncid, int varid, const MPI_Offset *start, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_ushort(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_uint (int ncid, int varid, const MPI_Offset *start, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_uint(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_long (int ncid, int varid, const MPI_Offset *start, const long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_long(ncid, varid, start, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var1_ulonglong (int ncid, int varid, const MPI_Offset *start, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var1_ulonglong(ncid, varid, start, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var (int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var(ncid, varid, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_schar (int ncid, int varid, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_schar(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_text (int ncid, int varid, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_text(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_short (int ncid, int varid, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_short(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_int (int ncid, int varid, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_int(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_float (int ncid, int varid, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_float(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_double (int ncid, int varid, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_double(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_longlong (int ncid, int varid, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_longlong(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var (int ncid, int varid, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var(ncid, varid, ip, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_schar (int ncid, int varid, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_schar(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_text (int ncid, int varid, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_text(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_short (int ncid, int varid, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_short(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_int (int ncid, int varid, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_int(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_float (int ncid, int varid, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_float(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_double (int ncid, int varid, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_double(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_longlong (int ncid, int varid, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_longlong(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var (int ncid, int varid, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var(ncid, varid, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_schar (int ncid, int varid, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_schar(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_text (int ncid, int varid, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_text(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_short (int ncid, int varid, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_short(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_int (int ncid, int varid, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_int(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_float (int ncid, int varid, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_float(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_double (int ncid, int varid, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_double(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_longlong (int ncid, int varid, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_longlong(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_uchar (int ncid, int varid, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_uchar(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_ushort (int ncid, int varid, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_ushort(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_uint (int ncid, int varid, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_uint(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_long (int ncid, int varid, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_long(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_var_ulonglong (int ncid, int varid, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_var_ulonglong(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_uchar (int ncid, int varid, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_uchar(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_ushort (int ncid, int varid, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_ushort(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_uint (int ncid, int varid, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_uint(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_long (int ncid, int varid, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_long(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_var_ulonglong (int ncid, int varid, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_var_ulonglong(ncid, varid, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_uchar (int ncid, int varid, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_uchar(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_ushort (int ncid, int varid, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_ushort(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_uint (int ncid, int varid, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_uint(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_long (int ncid, int varid, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_long(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_var_ulonglong (int ncid, int varid, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_var_ulonglong(ncid, varid, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara(ncid, varid, start, count, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_schar(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_text(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_short(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_int(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_float(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_double(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_longlong(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara(ncid, varid, start, count, ip, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_schar(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_text(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_short(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_int(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_float(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_double(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_longlong(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara(ncid, varid, start, count, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_schar(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_text(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_short(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_int(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_float(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_double(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_longlong(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_uchar(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_ushort(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_uint(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_long(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vara_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vara_ulonglong(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_uchar(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_ushort(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_uint(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_long(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vara_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vara_ulonglong(ncid, varid, start, count, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_uchar(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_ushort(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_uint(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_long(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vara_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vara_ulonglong(ncid, varid, start, count, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars(ncid, varid, start, count, stride, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_schar(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_text(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_short(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_int(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_float(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_double(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_longlong(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars(ncid, varid, start, count, stride, ip, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_schar(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_text(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_short(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_int(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_float(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_double(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_longlong(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars(ncid, varid, start, count, stride, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_schar(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_text(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_short(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_int(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_float(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_double(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_longlong(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_uchar(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_ushort(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_uint(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_long(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_vars_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_vars_ulonglong(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_uchar(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_ushort(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_uint(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_long(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_vars_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_vars_ulonglong(ncid, varid, start, count, stride, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_uchar(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_ushort(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_uint(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_long(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_vars_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_vars_ulonglong(ncid, varid, start, count, stride, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm(ncid, varid, start, count, stride, imap, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_schar(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_text(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_short(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_int(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_float(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_double(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_longlong(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, void *ip, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm(ncid, varid, start, count, stride, imap, ip, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_schar(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_text(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_short(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_int(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_float(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_double(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_longlong(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm(ncid, varid, start, count, stride, imap, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_schar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_schar(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_text (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_text(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_short (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_short(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_int (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_int(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_float (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_float(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_double (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_double(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_longlong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_longlong(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_uchar(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_ushort(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_uint(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_long(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varm_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varm_ulonglong(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_uchar(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_ushort(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_uint(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_long(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varm_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varm_ulonglong(ncid, varid, start, count, stride, imap, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_uchar (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_uchar(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_ushort (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_ushort(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_uint (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_uint(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_long (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_long(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varm_ulonglong (int ncid, int varid, const MPI_Offset *start, const MPI_Offset *count, const MPI_Offset *stride, const MPI_Offset *imap, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varm_ulonglong(ncid, varid, start, count, stride, imap, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn(ncid, varid, num, starts, counts, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn(ncid, varid, num, starts, counts, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_text (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_text(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_schar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_schar(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_short (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_short(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_int (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_int(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_float (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_float(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_double (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_double(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_longlong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_longlong(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_uchar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_uchar(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_ushort (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_ushort(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_uint (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_uint(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_long (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_long(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iput_varn_ulonglong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iput_varn_ulonglong(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_text (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_text(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_schar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_schar(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_short (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_short(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_int (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_int(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_float (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, float *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_float(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_double (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, double *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_double(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_longlong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_longlong(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_uchar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_uchar(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_ushort (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_ushort(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_uint (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_uint(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_long (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_long(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_iget_varn_ulonglong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *ip, int *req) { FUNCTION_ENTRY; int ret = libncmpi_iget_varn_ulonglong(ncid, varid, num, starts, counts, ip, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const void *op, MPI_Offset bufcount, MPI_Datatype buftype, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn(ncid, varid, num, starts, counts, op, bufcount, buftype, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_text (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_text(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_schar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const signed char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_schar(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_short (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_short(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_int (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_int(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_float (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const float *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_float(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_double (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const double *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_double(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_longlong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_longlong(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_uchar (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned char *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_uchar(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_ushort (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned short *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_ushort(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_uint (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned int *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_uint(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_long (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_long(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_bput_varn_ulonglong (int ncid, int varid, int num, MPI_Offset *const *starts, MPI_Offset *const *counts, const unsigned long long *op, int *req) { FUNCTION_ENTRY; int ret = libncmpi_bput_varn_ulonglong(ncid, varid, num, starts, counts, op, req); FUNCTION_EXIT; return ret; } int ncmpi_mput_var (int ncid, int num, int *varids, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_var(ncid, num, varids, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_all (int ncid, int num, int *varids, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_all(ncid, num, varids, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_text (int ncid, int num, int *varids, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_text(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_text_all (int ncid, int num, int *varids, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_text_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_schar (int ncid, int num, int *varids, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_schar(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_schar_all (int ncid, int num, int *varids, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_schar_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_uchar (int ncid, int num, int *varids, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_uchar(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_uchar_all (int ncid, int num, int *varids, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_uchar_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_short (int ncid, int num, int *varids, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_short(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_short_all (int ncid, int num, int *varids, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_short_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_ushort (int ncid, int num, int *varids, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_ushort(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_ushort_all (int ncid, int num, int *varids, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_ushort_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_int (int ncid, int num, int *varids, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_int(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_int_all (int ncid, int num, int *varids, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_int_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_uint (int ncid, int num, int *varids, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_uint(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_uint_all (int ncid, int num, int *varids, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_uint_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_long (int ncid, int num, int *varids, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_long(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_long_all (int ncid, int num, int *varids, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_long_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_float (int ncid, int num, int *varids, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_float(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_float_all (int ncid, int num, int *varids, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_float_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_double (int ncid, int num, int *varids, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_double(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_double_all (int ncid, int num, int *varids, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_double_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_longlong (int ncid, int num, int *varids, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_longlong(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_longlong_all (int ncid, int num, int *varids, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_longlong_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_ulonglong (int ncid, int num, int *varids, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_ulonglong(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var_ulonglong_all (int ncid, int num, int *varids, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var_ulonglong_all(ncid, num, varids, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1 (int ncid, int num, int *varids, MPI_Offset *const *starts, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1(ncid, num, varids, starts, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_all (int ncid, int num, int *varids, MPI_Offset *const *starts, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_all(ncid, num, varids, starts, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_text (int ncid, int num, int *varids, MPI_Offset *const *starts, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_text(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_text_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_schar(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_schar_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_uchar(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_uchar_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_short (int ncid, int num, int *varids, MPI_Offset *const *starts, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_short(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_short_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_ushort(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_ushort_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_int (int ncid, int num, int *varids, MPI_Offset *const *starts, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_int(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_int_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_uint(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_uint_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_long (int ncid, int num, int *varids, MPI_Offset *const *starts, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_long(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_long_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_float (int ncid, int num, int *varids, MPI_Offset *const *starts, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_float(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_float_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_double (int ncid, int num, int *varids, MPI_Offset *const *starts, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_double(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_double_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_longlong(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_longlong_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_ulonglong(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_var1_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_var1_ulonglong_all(ncid, num, varids, starts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara(ncid, num, varids, starts, counts, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_all(ncid, num, varids, starts, counts, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_text(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_text_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_schar(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_schar_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_uchar(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_uchar_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_short(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_short_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_ushort(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_ushort_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_int(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_int_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_uint(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_uint_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_long(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_long_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_float(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_float_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_double(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_double_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_longlong(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_longlong_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_ulonglong(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vara_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vara_ulonglong_all(ncid, num, varids, starts, counts, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars(ncid, num, varids, starts, counts, strides, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_all(ncid, num, varids, starts, counts, strides, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_text(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_text_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_schar(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_schar_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_uchar(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_uchar_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_short(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_short_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_ushort(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_ushort_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_int(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_int_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_uint(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_uint_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_long(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_long_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_float(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_float_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_double(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_double_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_longlong(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_longlong_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_ulonglong(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_vars_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_vars_ulonglong_all(ncid, num, varids, starts, counts, strides, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm(ncid, num, varids, starts, counts, strides, imaps, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, void *const *buf, const MPI_Offset *bufcounts, const MPI_Datatype datatypes[]) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_all(ncid, num, varids, starts, counts, strides, imaps, buf, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_text(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_text_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_schar(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, signed char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_schar_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_uchar(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned char *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_uchar_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_short(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_short_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_ushort(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned short *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_ushort_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_int(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_int_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_uint(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned int *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_uint_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_long(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_long_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_float(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, float *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_float_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_double(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, double *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_double_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_longlong(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_longlong_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_ulonglong(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mput_varm_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned long long *const *buf) { FUNCTION_ENTRY; int ret = libncmpi_mput_varm_ulonglong_all(ncid, num, varids, starts, counts, strides, imaps, buf); FUNCTION_EXIT; return ret; } int ncmpi_mget_var (int ncid, int num, int *varids, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_var(ncid, num, varids, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_all (int ncid, int num, int *varids, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_all(ncid, num, varids, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_text (int ncid, int num, int *varids, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_text(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_text_all (int ncid, int num, int *varids, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_text_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_schar (int ncid, int num, int *varids, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_schar(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_schar_all (int ncid, int num, int *varids, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_schar_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_uchar (int ncid, int num, int *varids, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_uchar(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_uchar_all (int ncid, int num, int *varids, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_uchar_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_short (int ncid, int num, int *varids, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_short(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_short_all (int ncid, int num, int *varids, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_short_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_ushort (int ncid, int num, int *varids, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_ushort(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_ushort_all (int ncid, int num, int *varids, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_ushort_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_int (int ncid, int num, int *varids, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_int(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_int_all (int ncid, int num, int *varids, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_int_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_uint (int ncid, int num, int *varids, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_uint(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_uint_all (int ncid, int num, int *varids, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_uint_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_long (int ncid, int num, int *varids, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_long(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_long_all (int ncid, int num, int *varids, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_long_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_float (int ncid, int num, int *varids, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_float(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_float_all (int ncid, int num, int *varids, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_float_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_double (int ncid, int num, int *varids, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_double(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_double_all (int ncid, int num, int *varids, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_double_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_longlong (int ncid, int num, int *varids, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_longlong(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_longlong_all (int ncid, int num, int *varids, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_longlong_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_ulonglong (int ncid, int num, int *varids, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_ulonglong(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var_ulonglong_all (int ncid, int num, int *varids, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var_ulonglong_all(ncid, num, varids, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1 (int ncid, int num, int *varids, MPI_Offset *const *starts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1(ncid, num, varids, starts, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_all (int ncid, int num, int *varids, MPI_Offset *const *starts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_all(ncid, num, varids, starts, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_text (int ncid, int num, int *varids, MPI_Offset *const *starts, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_text(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_text_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_schar(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_schar_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_uchar(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_uchar_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_short (int ncid, int num, int *varids, MPI_Offset *const *starts, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_short(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_short_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_ushort(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_ushort_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_int (int ncid, int num, int *varids, MPI_Offset *const *starts, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_int(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_int_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_uint(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_uint_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_long (int ncid, int num, int *varids, MPI_Offset *const *starts, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_long(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_long_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_float (int ncid, int num, int *varids, MPI_Offset *const *starts, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_float(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_float_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_double (int ncid, int num, int *varids, MPI_Offset *const *starts, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_double(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_double_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_longlong(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_longlong_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_ulonglong(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_var1_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_var1_ulonglong_all(ncid, num, varids, starts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara(ncid, num, varids, starts, counts, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_all(ncid, num, varids, starts, counts, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_text(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_text_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_schar(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_schar_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_uchar(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_uchar_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_short(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_short_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_ushort(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_ushort_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_int(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_int_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_uint(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_uint_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_long(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_long_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_float(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_float_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_double(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_double_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_longlong(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_longlong_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_ulonglong(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vara_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vara_ulonglong_all(ncid, num, varids, starts, counts, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars(ncid, num, varids, starts, counts, strides, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_all(ncid, num, varids, starts, counts, strides, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_text(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_text_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_schar(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_schar_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_uchar(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_uchar_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_short(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_short_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_ushort(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_ushort_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_int(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_int_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_uint(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_uint_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_long(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_long_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_float(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_float_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_double(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_double_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_longlong(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_longlong_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_ulonglong(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_vars_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_vars_ulonglong_all(ncid, num, varids, starts, counts, strides, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm(ncid, num, varids, starts, counts, strides, imaps, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, void *bufs[], const MPI_Offset *bufcounts, const MPI_Datatype *datatypes) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_all(ncid, num, varids, starts, counts, strides, imaps, bufs, bufcounts, datatypes); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_text (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_text(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_text_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_text_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_schar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_schar(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_schar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, signed char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_schar_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_uchar (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_uchar(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_uchar_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned char *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_uchar_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_short (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_short(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_short_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_short_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_ushort (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_ushort(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_ushort_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned short *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_ushort_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_int (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_int(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_int_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_int_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_uint (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_uint(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_uint_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned int *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_uint_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_long (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_long(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_long_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_long_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_float (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_float(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_float_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, float *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_float_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_double (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_double(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_double_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, double *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_double_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_longlong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_longlong(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_longlong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_longlong_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_ulonglong (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_ulonglong(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } int ncmpi_mget_varm_ulonglong_all (int ncid, int num, int *varids, MPI_Offset *const *starts, MPI_Offset *const *counts, MPI_Offset *const *strides, MPI_Offset *const *imaps, unsigned long long *bufs[]) { FUNCTION_ENTRY; int ret = libncmpi_mget_varm_ulonglong_all(ncid, num, varids, starts, counts, strides, imaps, bufs); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(pnetcdf) INTERCEPT3("ncmpi_create", libncmpi_create) INTERCEPT3("ncmpi_open", libncmpi_open) INTERCEPT3("ncmpi_inq_file_info", libncmpi_inq_file_info) INTERCEPT3("ncmpi_get_file_info", libncmpi_get_file_info) INTERCEPT3("ncmpi_delete", libncmpi_delete) INTERCEPT3("ncmpi_enddef", libncmpi_enddef) INTERCEPT3("ncmpi__enddef", libncmpi__enddef) INTERCEPT3("ncmpi_redef", libncmpi_redef) INTERCEPT3("ncmpi_set_default_format", libncmpi_set_default_format) INTERCEPT3("ncmpi_inq_default_format", libncmpi_inq_default_format) INTERCEPT3("ncmpi_sync", libncmpi_sync) INTERCEPT3("ncmpi_flush", libncmpi_flush) INTERCEPT3("ncmpi_sync_numrecs", libncmpi_sync_numrecs) INTERCEPT3("ncmpi_abort", libncmpi_abort) INTERCEPT3("ncmpi_begin_indep_data", libncmpi_begin_indep_data) INTERCEPT3("ncmpi_end_indep_data", libncmpi_end_indep_data) INTERCEPT3("ncmpi_close", libncmpi_close) INTERCEPT3("ncmpi_set_fill", libncmpi_set_fill) INTERCEPT3("ncmpi_def_var_fill", libncmpi_def_var_fill) INTERCEPT3("ncmpi_fill_var_rec", libncmpi_fill_var_rec) INTERCEPT3("ncmpi_def_dim", libncmpi_def_dim) INTERCEPT3("ncmpi_def_var", libncmpi_def_var) INTERCEPT3("ncmpi_rename_dim", libncmpi_rename_dim) INTERCEPT3("ncmpi_rename_var", libncmpi_rename_var) INTERCEPT3("ncmpi_inq", libncmpi_inq) INTERCEPT3("ncmpi_inq_format", libncmpi_inq_format) INTERCEPT3("ncmpi_inq_file_format", libncmpi_inq_file_format) INTERCEPT3("ncmpi_inq_version", libncmpi_inq_version) INTERCEPT3("ncmpi_inq_striping", libncmpi_inq_striping) INTERCEPT3("ncmpi_inq_ndims", libncmpi_inq_ndims) INTERCEPT3("ncmpi_inq_nvars", libncmpi_inq_nvars) INTERCEPT3("ncmpi_inq_num_rec_vars", libncmpi_inq_num_rec_vars) INTERCEPT3("ncmpi_inq_num_fix_vars", libncmpi_inq_num_fix_vars) INTERCEPT3("ncmpi_inq_natts", libncmpi_inq_natts) INTERCEPT3("ncmpi_inq_unlimdim", libncmpi_inq_unlimdim) INTERCEPT3("ncmpi_inq_dimid", libncmpi_inq_dimid) INTERCEPT3("ncmpi_inq_dim", libncmpi_inq_dim) INTERCEPT3("ncmpi_inq_dimname", libncmpi_inq_dimname) INTERCEPT3("ncmpi_inq_dimlen", libncmpi_inq_dimlen) INTERCEPT3("ncmpi_inq_var", libncmpi_inq_var) INTERCEPT3("ncmpi_inq_varid", libncmpi_inq_varid) INTERCEPT3("ncmpi_inq_varname", libncmpi_inq_varname) INTERCEPT3("ncmpi_inq_vartype", libncmpi_inq_vartype) INTERCEPT3("ncmpi_inq_varndims", libncmpi_inq_varndims) INTERCEPT3("ncmpi_inq_vardimid", libncmpi_inq_vardimid) INTERCEPT3("ncmpi_inq_varnatts", libncmpi_inq_varnatts) INTERCEPT3("ncmpi_inq_varoffset", libncmpi_inq_varoffset) INTERCEPT3("ncmpi_inq_put_size", libncmpi_inq_put_size) INTERCEPT3("ncmpi_inq_get_size", libncmpi_inq_get_size) INTERCEPT3("ncmpi_inq_header_size", libncmpi_inq_header_size) INTERCEPT3("ncmpi_inq_header_extent", libncmpi_inq_header_extent) INTERCEPT3("ncmpi_inq_malloc_size", libncmpi_inq_malloc_size) INTERCEPT3("ncmpi_inq_malloc_max_size", libncmpi_inq_malloc_max_size) INTERCEPT3("ncmpi_inq_malloc_list", libncmpi_inq_malloc_list) INTERCEPT3("ncmpi_inq_files_opened", libncmpi_inq_files_opened) INTERCEPT3("ncmpi_inq_recsize", libncmpi_inq_recsize) INTERCEPT3("ncmpi_inq_var_fill", libncmpi_inq_var_fill) INTERCEPT3("ncmpi_inq_path", libncmpi_inq_path) INTERCEPT3("ncmpi_inq_att", libncmpi_inq_att) INTERCEPT3("ncmpi_inq_attid", libncmpi_inq_attid) INTERCEPT3("ncmpi_inq_atttype", libncmpi_inq_atttype) INTERCEPT3("ncmpi_inq_attlen", libncmpi_inq_attlen) INTERCEPT3("ncmpi_inq_attname", libncmpi_inq_attname) INTERCEPT3("ncmpi_copy_att", libncmpi_copy_att) INTERCEPT3("ncmpi_rename_att", libncmpi_rename_att) INTERCEPT3("ncmpi_del_att", libncmpi_del_att) INTERCEPT3("ncmpi_put_att", libncmpi_put_att) INTERCEPT3("ncmpi_put_att_text", libncmpi_put_att_text) INTERCEPT3("ncmpi_put_att_schar", libncmpi_put_att_schar) INTERCEPT3("ncmpi_put_att_short", libncmpi_put_att_short) INTERCEPT3("ncmpi_put_att_int", libncmpi_put_att_int) INTERCEPT3("ncmpi_put_att_float", libncmpi_put_att_float) INTERCEPT3("ncmpi_put_att_double", libncmpi_put_att_double) INTERCEPT3("ncmpi_put_att_longlong", libncmpi_put_att_longlong) INTERCEPT3("ncmpi_get_att", libncmpi_get_att) INTERCEPT3("ncmpi_get_att_text", libncmpi_get_att_text) INTERCEPT3("ncmpi_get_att_schar", libncmpi_get_att_schar) INTERCEPT3("ncmpi_get_att_short", libncmpi_get_att_short) INTERCEPT3("ncmpi_get_att_int", libncmpi_get_att_int) INTERCEPT3("ncmpi_get_att_float", libncmpi_get_att_float) INTERCEPT3("ncmpi_get_att_double", libncmpi_get_att_double) INTERCEPT3("ncmpi_get_att_longlong", libncmpi_get_att_longlong) INTERCEPT3("ncmpi_put_att_uchar", libncmpi_put_att_uchar) INTERCEPT3("ncmpi_put_att_ubyte", libncmpi_put_att_ubyte) INTERCEPT3("ncmpi_put_att_ushort", libncmpi_put_att_ushort) INTERCEPT3("ncmpi_put_att_uint", libncmpi_put_att_uint) INTERCEPT3("ncmpi_put_att_long", libncmpi_put_att_long) INTERCEPT3("ncmpi_put_att_ulonglong", libncmpi_put_att_ulonglong) INTERCEPT3("ncmpi_get_att_uchar", libncmpi_get_att_uchar) INTERCEPT3("ncmpi_get_att_ubyte", libncmpi_get_att_ubyte) INTERCEPT3("ncmpi_get_att_ushort", libncmpi_get_att_ushort) INTERCEPT3("ncmpi_get_att_uint", libncmpi_get_att_uint) INTERCEPT3("ncmpi_get_att_long", libncmpi_get_att_long) INTERCEPT3("ncmpi_get_att_ulonglong", libncmpi_get_att_ulonglong) INTERCEPT3("ncmpi_put_var1", libncmpi_put_var1) INTERCEPT3("ncmpi_put_var1_all", libncmpi_put_var1_all) INTERCEPT3("ncmpi_put_var1_text", libncmpi_put_var1_text) INTERCEPT3("ncmpi_put_var1_text_all", libncmpi_put_var1_text_all) INTERCEPT3("ncmpi_put_var1_schar", libncmpi_put_var1_schar) INTERCEPT3("ncmpi_put_var1_schar_all", libncmpi_put_var1_schar_all) INTERCEPT3("ncmpi_put_var1_short", libncmpi_put_var1_short) INTERCEPT3("ncmpi_put_var1_short_all", libncmpi_put_var1_short_all) INTERCEPT3("ncmpi_put_var1_int", libncmpi_put_var1_int) INTERCEPT3("ncmpi_put_var1_int_all", libncmpi_put_var1_int_all) INTERCEPT3("ncmpi_put_var1_float", libncmpi_put_var1_float) INTERCEPT3("ncmpi_put_var1_float_all", libncmpi_put_var1_float_all) INTERCEPT3("ncmpi_put_var1_double", libncmpi_put_var1_double) INTERCEPT3("ncmpi_put_var1_double_all", libncmpi_put_var1_double_all) INTERCEPT3("ncmpi_put_var1_longlong", libncmpi_put_var1_longlong) INTERCEPT3("ncmpi_put_var1_longlong_all", libncmpi_put_var1_longlong_all) INTERCEPT3("ncmpi_get_var1", libncmpi_get_var1) INTERCEPT3("ncmpi_get_var1_all", libncmpi_get_var1_all) INTERCEPT3("ncmpi_get_var1_text", libncmpi_get_var1_text) INTERCEPT3("ncmpi_get_var1_text_all", libncmpi_get_var1_text_all) INTERCEPT3("ncmpi_get_var1_schar", libncmpi_get_var1_schar) INTERCEPT3("ncmpi_get_var1_schar_all", libncmpi_get_var1_schar_all) INTERCEPT3("ncmpi_get_var1_short", libncmpi_get_var1_short) INTERCEPT3("ncmpi_get_var1_short_all", libncmpi_get_var1_short_all) INTERCEPT3("ncmpi_get_var1_int", libncmpi_get_var1_int) INTERCEPT3("ncmpi_get_var1_int_all", libncmpi_get_var1_int_all) INTERCEPT3("ncmpi_get_var1_float", libncmpi_get_var1_float) INTERCEPT3("ncmpi_get_var1_float_all", libncmpi_get_var1_float_all) INTERCEPT3("ncmpi_get_var1_double", libncmpi_get_var1_double) INTERCEPT3("ncmpi_get_var1_double_all", libncmpi_get_var1_double_all) INTERCEPT3("ncmpi_get_var1_longlong", libncmpi_get_var1_longlong) INTERCEPT3("ncmpi_get_var1_longlong_all", libncmpi_get_var1_longlong_all) INTERCEPT3("ncmpi_put_var1_uchar", libncmpi_put_var1_uchar) INTERCEPT3("ncmpi_put_var1_uchar_all", libncmpi_put_var1_uchar_all) INTERCEPT3("ncmpi_put_var1_ushort", libncmpi_put_var1_ushort) INTERCEPT3("ncmpi_put_var1_ushort_all", libncmpi_put_var1_ushort_all) INTERCEPT3("ncmpi_put_var1_uint", libncmpi_put_var1_uint) INTERCEPT3("ncmpi_put_var1_uint_all", libncmpi_put_var1_uint_all) INTERCEPT3("ncmpi_put_var1_long", libncmpi_put_var1_long) INTERCEPT3("ncmpi_put_var1_long_all", libncmpi_put_var1_long_all) INTERCEPT3("ncmpi_put_var1_ulonglong", libncmpi_put_var1_ulonglong) INTERCEPT3("ncmpi_put_var1_ulonglong_all", libncmpi_put_var1_ulonglong_all) INTERCEPT3("ncmpi_get_var1_uchar", libncmpi_get_var1_uchar) INTERCEPT3("ncmpi_get_var1_uchar_all", libncmpi_get_var1_uchar_all) INTERCEPT3("ncmpi_get_var1_ushort", libncmpi_get_var1_ushort) INTERCEPT3("ncmpi_get_var1_ushort_all", libncmpi_get_var1_ushort_all) INTERCEPT3("ncmpi_get_var1_uint", libncmpi_get_var1_uint) INTERCEPT3("ncmpi_get_var1_uint_all", libncmpi_get_var1_uint_all) INTERCEPT3("ncmpi_get_var1_long", libncmpi_get_var1_long) INTERCEPT3("ncmpi_get_var1_long_all", libncmpi_get_var1_long_all) INTERCEPT3("ncmpi_get_var1_ulonglong", libncmpi_get_var1_ulonglong) INTERCEPT3("ncmpi_get_var1_ulonglong_all", libncmpi_get_var1_ulonglong_all) INTERCEPT3("ncmpi_put_var", libncmpi_put_var) INTERCEPT3("ncmpi_put_var_all", libncmpi_put_var_all) INTERCEPT3("ncmpi_put_var_text", libncmpi_put_var_text) INTERCEPT3("ncmpi_put_var_text_all", libncmpi_put_var_text_all) INTERCEPT3("ncmpi_put_var_schar", libncmpi_put_var_schar) INTERCEPT3("ncmpi_put_var_schar_all", libncmpi_put_var_schar_all) INTERCEPT3("ncmpi_put_var_short", libncmpi_put_var_short) INTERCEPT3("ncmpi_put_var_short_all", libncmpi_put_var_short_all) INTERCEPT3("ncmpi_put_var_int", libncmpi_put_var_int) INTERCEPT3("ncmpi_put_var_int_all", libncmpi_put_var_int_all) INTERCEPT3("ncmpi_put_var_float", libncmpi_put_var_float) INTERCEPT3("ncmpi_put_var_float_all", libncmpi_put_var_float_all) INTERCEPT3("ncmpi_put_var_double", libncmpi_put_var_double) INTERCEPT3("ncmpi_put_var_double_all", libncmpi_put_var_double_all) INTERCEPT3("ncmpi_put_var_longlong", libncmpi_put_var_longlong) INTERCEPT3("ncmpi_put_var_longlong_all", libncmpi_put_var_longlong_all) INTERCEPT3("ncmpi_get_var", libncmpi_get_var) INTERCEPT3("ncmpi_get_var_all", libncmpi_get_var_all) INTERCEPT3("ncmpi_get_var_text", libncmpi_get_var_text) INTERCEPT3("ncmpi_get_var_text_all", libncmpi_get_var_text_all) INTERCEPT3("ncmpi_get_var_schar", libncmpi_get_var_schar) INTERCEPT3("ncmpi_get_var_schar_all", libncmpi_get_var_schar_all) INTERCEPT3("ncmpi_get_var_short", libncmpi_get_var_short) INTERCEPT3("ncmpi_get_var_short_all", libncmpi_get_var_short_all) INTERCEPT3("ncmpi_get_var_int", libncmpi_get_var_int) INTERCEPT3("ncmpi_get_var_int_all", libncmpi_get_var_int_all) INTERCEPT3("ncmpi_get_var_float", libncmpi_get_var_float) INTERCEPT3("ncmpi_get_var_float_all", libncmpi_get_var_float_all) INTERCEPT3("ncmpi_get_var_double", libncmpi_get_var_double) INTERCEPT3("ncmpi_get_var_double_all", libncmpi_get_var_double_all) INTERCEPT3("ncmpi_get_var_longlong", libncmpi_get_var_longlong) INTERCEPT3("ncmpi_get_var_longlong_all", libncmpi_get_var_longlong_all) INTERCEPT3("ncmpi_put_var_uchar", libncmpi_put_var_uchar) INTERCEPT3("ncmpi_put_var_uchar_all", libncmpi_put_var_uchar_all) INTERCEPT3("ncmpi_put_var_ushort", libncmpi_put_var_ushort) INTERCEPT3("ncmpi_put_var_ushort_all", libncmpi_put_var_ushort_all) INTERCEPT3("ncmpi_put_var_uint", libncmpi_put_var_uint) INTERCEPT3("ncmpi_put_var_uint_all", libncmpi_put_var_uint_all) INTERCEPT3("ncmpi_put_var_long", libncmpi_put_var_long) INTERCEPT3("ncmpi_put_var_long_all", libncmpi_put_var_long_all) INTERCEPT3("ncmpi_put_var_ulonglong", libncmpi_put_var_ulonglong) INTERCEPT3("ncmpi_put_var_ulonglong_all", libncmpi_put_var_ulonglong_all) INTERCEPT3("ncmpi_get_var_uchar", libncmpi_get_var_uchar) INTERCEPT3("ncmpi_get_var_uchar_all", libncmpi_get_var_uchar_all) INTERCEPT3("ncmpi_get_var_ushort", libncmpi_get_var_ushort) INTERCEPT3("ncmpi_get_var_ushort_all", libncmpi_get_var_ushort_all) INTERCEPT3("ncmpi_get_var_uint", libncmpi_get_var_uint) INTERCEPT3("ncmpi_get_var_uint_all", libncmpi_get_var_uint_all) INTERCEPT3("ncmpi_get_var_long", libncmpi_get_var_long) INTERCEPT3("ncmpi_get_var_long_all", libncmpi_get_var_long_all) INTERCEPT3("ncmpi_get_var_ulonglong", libncmpi_get_var_ulonglong) INTERCEPT3("ncmpi_get_var_ulonglong_all", libncmpi_get_var_ulonglong_all) INTERCEPT3("ncmpi_put_vara", libncmpi_put_vara) INTERCEPT3("ncmpi_put_vara_all", libncmpi_put_vara_all) INTERCEPT3("ncmpi_put_vara_text", libncmpi_put_vara_text) INTERCEPT3("ncmpi_put_vara_text_all", libncmpi_put_vara_text_all) INTERCEPT3("ncmpi_put_vara_schar", libncmpi_put_vara_schar) INTERCEPT3("ncmpi_put_vara_schar_all", libncmpi_put_vara_schar_all) INTERCEPT3("ncmpi_put_vara_short", libncmpi_put_vara_short) INTERCEPT3("ncmpi_put_vara_short_all", libncmpi_put_vara_short_all) INTERCEPT3("ncmpi_put_vara_int", libncmpi_put_vara_int) INTERCEPT3("ncmpi_put_vara_int_all", libncmpi_put_vara_int_all) INTERCEPT3("ncmpi_put_vara_float", libncmpi_put_vara_float) INTERCEPT3("ncmpi_put_vara_float_all", libncmpi_put_vara_float_all) INTERCEPT3("ncmpi_put_vara_double", libncmpi_put_vara_double) INTERCEPT3("ncmpi_put_vara_double_all", libncmpi_put_vara_double_all) INTERCEPT3("ncmpi_put_vara_longlong", libncmpi_put_vara_longlong) INTERCEPT3("ncmpi_put_vara_longlong_all", libncmpi_put_vara_longlong_all) INTERCEPT3("ncmpi_get_vara", libncmpi_get_vara) INTERCEPT3("ncmpi_get_vara_all", libncmpi_get_vara_all) INTERCEPT3("ncmpi_get_vara_text", libncmpi_get_vara_text) INTERCEPT3("ncmpi_get_vara_text_all", libncmpi_get_vara_text_all) INTERCEPT3("ncmpi_get_vara_schar", libncmpi_get_vara_schar) INTERCEPT3("ncmpi_get_vara_schar_all", libncmpi_get_vara_schar_all) INTERCEPT3("ncmpi_get_vara_short", libncmpi_get_vara_short) INTERCEPT3("ncmpi_get_vara_short_all", libncmpi_get_vara_short_all) INTERCEPT3("ncmpi_get_vara_int", libncmpi_get_vara_int) INTERCEPT3("ncmpi_get_vara_int_all", libncmpi_get_vara_int_all) INTERCEPT3("ncmpi_get_vara_float", libncmpi_get_vara_float) INTERCEPT3("ncmpi_get_vara_float_all", libncmpi_get_vara_float_all) INTERCEPT3("ncmpi_get_vara_double", libncmpi_get_vara_double) INTERCEPT3("ncmpi_get_vara_double_all", libncmpi_get_vara_double_all) INTERCEPT3("ncmpi_get_vara_longlong", libncmpi_get_vara_longlong) INTERCEPT3("ncmpi_get_vara_longlong_all", libncmpi_get_vara_longlong_all) INTERCEPT3("ncmpi_put_vara_uchar", libncmpi_put_vara_uchar) INTERCEPT3("ncmpi_put_vara_uchar_all", libncmpi_put_vara_uchar_all) INTERCEPT3("ncmpi_put_vara_ushort", libncmpi_put_vara_ushort) INTERCEPT3("ncmpi_put_vara_ushort_all", libncmpi_put_vara_ushort_all) INTERCEPT3("ncmpi_put_vara_uint", libncmpi_put_vara_uint) INTERCEPT3("ncmpi_put_vara_uint_all", libncmpi_put_vara_uint_all) INTERCEPT3("ncmpi_put_vara_long", libncmpi_put_vara_long) INTERCEPT3("ncmpi_put_vara_long_all", libncmpi_put_vara_long_all) INTERCEPT3("ncmpi_put_vara_ulonglong", libncmpi_put_vara_ulonglong) INTERCEPT3("ncmpi_put_vara_ulonglong_all", libncmpi_put_vara_ulonglong_all) INTERCEPT3("ncmpi_get_vara_uchar", libncmpi_get_vara_uchar) INTERCEPT3("ncmpi_get_vara_uchar_all", libncmpi_get_vara_uchar_all) INTERCEPT3("ncmpi_get_vara_ushort", libncmpi_get_vara_ushort) INTERCEPT3("ncmpi_get_vara_ushort_all", libncmpi_get_vara_ushort_all) INTERCEPT3("ncmpi_get_vara_uint", libncmpi_get_vara_uint) INTERCEPT3("ncmpi_get_vara_uint_all", libncmpi_get_vara_uint_all) INTERCEPT3("ncmpi_get_vara_long", libncmpi_get_vara_long) INTERCEPT3("ncmpi_get_vara_long_all", libncmpi_get_vara_long_all) INTERCEPT3("ncmpi_get_vara_ulonglong", libncmpi_get_vara_ulonglong) INTERCEPT3("ncmpi_get_vara_ulonglong_all", libncmpi_get_vara_ulonglong_all) INTERCEPT3("ncmpi_put_vars", libncmpi_put_vars) INTERCEPT3("ncmpi_put_vars_all", libncmpi_put_vars_all) INTERCEPT3("ncmpi_put_vars_text", libncmpi_put_vars_text) INTERCEPT3("ncmpi_put_vars_text_all", libncmpi_put_vars_text_all) INTERCEPT3("ncmpi_put_vars_schar", libncmpi_put_vars_schar) INTERCEPT3("ncmpi_put_vars_schar_all", libncmpi_put_vars_schar_all) INTERCEPT3("ncmpi_put_vars_short", libncmpi_put_vars_short) INTERCEPT3("ncmpi_put_vars_short_all", libncmpi_put_vars_short_all) INTERCEPT3("ncmpi_put_vars_int", libncmpi_put_vars_int) INTERCEPT3("ncmpi_put_vars_int_all", libncmpi_put_vars_int_all) INTERCEPT3("ncmpi_put_vars_float", libncmpi_put_vars_float) INTERCEPT3("ncmpi_put_vars_float_all", libncmpi_put_vars_float_all) INTERCEPT3("ncmpi_put_vars_double", libncmpi_put_vars_double) INTERCEPT3("ncmpi_put_vars_double_all", libncmpi_put_vars_double_all) INTERCEPT3("ncmpi_put_vars_longlong", libncmpi_put_vars_longlong) INTERCEPT3("ncmpi_put_vars_longlong_all", libncmpi_put_vars_longlong_all) INTERCEPT3("ncmpi_get_vars", libncmpi_get_vars) INTERCEPT3("ncmpi_get_vars_all", libncmpi_get_vars_all) INTERCEPT3("ncmpi_get_vars_schar", libncmpi_get_vars_schar) INTERCEPT3("ncmpi_get_vars_schar_all", libncmpi_get_vars_schar_all) INTERCEPT3("ncmpi_get_vars_text", libncmpi_get_vars_text) INTERCEPT3("ncmpi_get_vars_text_all", libncmpi_get_vars_text_all) INTERCEPT3("ncmpi_get_vars_short", libncmpi_get_vars_short) INTERCEPT3("ncmpi_get_vars_short_all", libncmpi_get_vars_short_all) INTERCEPT3("ncmpi_get_vars_int", libncmpi_get_vars_int) INTERCEPT3("ncmpi_get_vars_int_all", libncmpi_get_vars_int_all) INTERCEPT3("ncmpi_get_vars_float", libncmpi_get_vars_float) INTERCEPT3("ncmpi_get_vars_float_all", libncmpi_get_vars_float_all) INTERCEPT3("ncmpi_get_vars_double", libncmpi_get_vars_double) INTERCEPT3("ncmpi_get_vars_double_all", libncmpi_get_vars_double_all) INTERCEPT3("ncmpi_get_vars_longlong", libncmpi_get_vars_longlong) INTERCEPT3("ncmpi_get_vars_longlong_all", libncmpi_get_vars_longlong_all) INTERCEPT3("ncmpi_put_vars_uchar", libncmpi_put_vars_uchar) INTERCEPT3("ncmpi_put_vars_uchar_all", libncmpi_put_vars_uchar_all) INTERCEPT3("ncmpi_put_vars_ushort", libncmpi_put_vars_ushort) INTERCEPT3("ncmpi_put_vars_ushort_all", libncmpi_put_vars_ushort_all) INTERCEPT3("ncmpi_put_vars_uint", libncmpi_put_vars_uint) INTERCEPT3("ncmpi_put_vars_uint_all", libncmpi_put_vars_uint_all) INTERCEPT3("ncmpi_put_vars_long", libncmpi_put_vars_long) INTERCEPT3("ncmpi_put_vars_long_all", libncmpi_put_vars_long_all) INTERCEPT3("ncmpi_put_vars_ulonglong", libncmpi_put_vars_ulonglong) INTERCEPT3("ncmpi_put_vars_ulonglong_all", libncmpi_put_vars_ulonglong_all) INTERCEPT3("ncmpi_get_vars_uchar", libncmpi_get_vars_uchar) INTERCEPT3("ncmpi_get_vars_uchar_all", libncmpi_get_vars_uchar_all) INTERCEPT3("ncmpi_get_vars_ushort", libncmpi_get_vars_ushort) INTERCEPT3("ncmpi_get_vars_ushort_all", libncmpi_get_vars_ushort_all) INTERCEPT3("ncmpi_get_vars_uint", libncmpi_get_vars_uint) INTERCEPT3("ncmpi_get_vars_uint_all", libncmpi_get_vars_uint_all) INTERCEPT3("ncmpi_get_vars_long", libncmpi_get_vars_long) INTERCEPT3("ncmpi_get_vars_long_all", libncmpi_get_vars_long_all) INTERCEPT3("ncmpi_get_vars_ulonglong", libncmpi_get_vars_ulonglong) INTERCEPT3("ncmpi_get_vars_ulonglong_all", libncmpi_get_vars_ulonglong_all) INTERCEPT3("ncmpi_put_varm", libncmpi_put_varm) INTERCEPT3("ncmpi_put_varm_all", libncmpi_put_varm_all) INTERCEPT3("ncmpi_put_varm_text", libncmpi_put_varm_text) INTERCEPT3("ncmpi_put_varm_text_all", libncmpi_put_varm_text_all) INTERCEPT3("ncmpi_put_varm_schar", libncmpi_put_varm_schar) INTERCEPT3("ncmpi_put_varm_schar_all", libncmpi_put_varm_schar_all) INTERCEPT3("ncmpi_put_varm_short", libncmpi_put_varm_short) INTERCEPT3("ncmpi_put_varm_short_all", libncmpi_put_varm_short_all) INTERCEPT3("ncmpi_put_varm_int", libncmpi_put_varm_int) INTERCEPT3("ncmpi_put_varm_int_all", libncmpi_put_varm_int_all) INTERCEPT3("ncmpi_put_varm_float", libncmpi_put_varm_float) INTERCEPT3("ncmpi_put_varm_float_all", libncmpi_put_varm_float_all) INTERCEPT3("ncmpi_put_varm_double", libncmpi_put_varm_double) INTERCEPT3("ncmpi_put_varm_double_all", libncmpi_put_varm_double_all) INTERCEPT3("ncmpi_put_varm_longlong", libncmpi_put_varm_longlong) INTERCEPT3("ncmpi_put_varm_longlong_all", libncmpi_put_varm_longlong_all) INTERCEPT3("ncmpi_get_varm", libncmpi_get_varm) INTERCEPT3("ncmpi_get_varm_all", libncmpi_get_varm_all) INTERCEPT3("ncmpi_get_varm_schar", libncmpi_get_varm_schar) INTERCEPT3("ncmpi_get_varm_schar_all", libncmpi_get_varm_schar_all) INTERCEPT3("ncmpi_get_varm_text", libncmpi_get_varm_text) INTERCEPT3("ncmpi_get_varm_text_all", libncmpi_get_varm_text_all) INTERCEPT3("ncmpi_get_varm_short", libncmpi_get_varm_short) INTERCEPT3("ncmpi_get_varm_short_all", libncmpi_get_varm_short_all) INTERCEPT3("ncmpi_get_varm_int", libncmpi_get_varm_int) INTERCEPT3("ncmpi_get_varm_int_all", libncmpi_get_varm_int_all) INTERCEPT3("ncmpi_get_varm_float", libncmpi_get_varm_float) INTERCEPT3("ncmpi_get_varm_float_all", libncmpi_get_varm_float_all) INTERCEPT3("ncmpi_get_varm_double", libncmpi_get_varm_double) INTERCEPT3("ncmpi_get_varm_double_all", libncmpi_get_varm_double_all) INTERCEPT3("ncmpi_get_varm_longlong", libncmpi_get_varm_longlong) INTERCEPT3("ncmpi_get_varm_longlong_all", libncmpi_get_varm_longlong_all) INTERCEPT3("ncmpi_put_varm_uchar", libncmpi_put_varm_uchar) INTERCEPT3("ncmpi_put_varm_uchar_all", libncmpi_put_varm_uchar_all) INTERCEPT3("ncmpi_put_varm_ushort", libncmpi_put_varm_ushort) INTERCEPT3("ncmpi_put_varm_ushort_all", libncmpi_put_varm_ushort_all) INTERCEPT3("ncmpi_put_varm_uint", libncmpi_put_varm_uint) INTERCEPT3("ncmpi_put_varm_uint_all", libncmpi_put_varm_uint_all) INTERCEPT3("ncmpi_put_varm_long", libncmpi_put_varm_long) INTERCEPT3("ncmpi_put_varm_long_all", libncmpi_put_varm_long_all) INTERCEPT3("ncmpi_put_varm_ulonglong", libncmpi_put_varm_ulonglong) INTERCEPT3("ncmpi_put_varm_ulonglong_all", libncmpi_put_varm_ulonglong_all) INTERCEPT3("ncmpi_get_varm_uchar", libncmpi_get_varm_uchar) INTERCEPT3("ncmpi_get_varm_uchar_all", libncmpi_get_varm_uchar_all) INTERCEPT3("ncmpi_get_varm_ushort", libncmpi_get_varm_ushort) INTERCEPT3("ncmpi_get_varm_ushort_all", libncmpi_get_varm_ushort_all) INTERCEPT3("ncmpi_get_varm_uint", libncmpi_get_varm_uint) INTERCEPT3("ncmpi_get_varm_uint_all", libncmpi_get_varm_uint_all) INTERCEPT3("ncmpi_get_varm_long", libncmpi_get_varm_long) INTERCEPT3("ncmpi_get_varm_long_all", libncmpi_get_varm_long_all) INTERCEPT3("ncmpi_get_varm_ulonglong", libncmpi_get_varm_ulonglong) INTERCEPT3("ncmpi_get_varm_ulonglong_all", libncmpi_get_varm_ulonglong_all) INTERCEPT3("ncmpi_put_varn", libncmpi_put_varn) INTERCEPT3("ncmpi_put_varn_all", libncmpi_put_varn_all) INTERCEPT3("ncmpi_get_varn", libncmpi_get_varn) INTERCEPT3("ncmpi_get_varn_all", libncmpi_get_varn_all) INTERCEPT3("ncmpi_put_varn_text", libncmpi_put_varn_text) INTERCEPT3("ncmpi_put_varn_text_all", libncmpi_put_varn_text_all) INTERCEPT3("ncmpi_put_varn_schar", libncmpi_put_varn_schar) INTERCEPT3("ncmpi_put_varn_schar_all", libncmpi_put_varn_schar_all) INTERCEPT3("ncmpi_put_varn_short", libncmpi_put_varn_short) INTERCEPT3("ncmpi_put_varn_short_all", libncmpi_put_varn_short_all) INTERCEPT3("ncmpi_put_varn_int", libncmpi_put_varn_int) INTERCEPT3("ncmpi_put_varn_int_all", libncmpi_put_varn_int_all) INTERCEPT3("ncmpi_put_varn_float", libncmpi_put_varn_float) INTERCEPT3("ncmpi_put_varn_float_all", libncmpi_put_varn_float_all) INTERCEPT3("ncmpi_put_varn_double", libncmpi_put_varn_double) INTERCEPT3("ncmpi_put_varn_double_all", libncmpi_put_varn_double_all) INTERCEPT3("ncmpi_put_varn_longlong", libncmpi_put_varn_longlong) INTERCEPT3("ncmpi_put_varn_longlong_all", libncmpi_put_varn_longlong_all) INTERCEPT3("ncmpi_put_varn_uchar", libncmpi_put_varn_uchar) INTERCEPT3("ncmpi_put_varn_uchar_all", libncmpi_put_varn_uchar_all) INTERCEPT3("ncmpi_put_varn_ushort", libncmpi_put_varn_ushort) INTERCEPT3("ncmpi_put_varn_ushort_all", libncmpi_put_varn_ushort_all) INTERCEPT3("ncmpi_put_varn_uint", libncmpi_put_varn_uint) INTERCEPT3("ncmpi_put_varn_uint_all", libncmpi_put_varn_uint_all) INTERCEPT3("ncmpi_put_varn_long", libncmpi_put_varn_long) INTERCEPT3("ncmpi_put_varn_long_all", libncmpi_put_varn_long_all) INTERCEPT3("ncmpi_put_varn_ulonglong", libncmpi_put_varn_ulonglong) INTERCEPT3("ncmpi_put_varn_ulonglong_all", libncmpi_put_varn_ulonglong_all) INTERCEPT3("ncmpi_get_varn_text", libncmpi_get_varn_text) INTERCEPT3("ncmpi_get_varn_text_all", libncmpi_get_varn_text_all) INTERCEPT3("ncmpi_get_varn_schar", libncmpi_get_varn_schar) INTERCEPT3("ncmpi_get_varn_schar_all", libncmpi_get_varn_schar_all) INTERCEPT3("ncmpi_get_varn_short", libncmpi_get_varn_short) INTERCEPT3("ncmpi_get_varn_short_all", libncmpi_get_varn_short_all) INTERCEPT3("ncmpi_get_varn_int", libncmpi_get_varn_int) INTERCEPT3("ncmpi_get_varn_int_all", libncmpi_get_varn_int_all) INTERCEPT3("ncmpi_get_varn_float", libncmpi_get_varn_float) INTERCEPT3("ncmpi_get_varn_float_all", libncmpi_get_varn_float_all) INTERCEPT3("ncmpi_get_varn_double", libncmpi_get_varn_double) INTERCEPT3("ncmpi_get_varn_double_all", libncmpi_get_varn_double_all) INTERCEPT3("ncmpi_get_varn_longlong", libncmpi_get_varn_longlong) INTERCEPT3("ncmpi_get_varn_longlong_all", libncmpi_get_varn_longlong_all) INTERCEPT3("ncmpi_get_varn_uchar", libncmpi_get_varn_uchar) INTERCEPT3("ncmpi_get_varn_uchar_all", libncmpi_get_varn_uchar_all) INTERCEPT3("ncmpi_get_varn_ushort", libncmpi_get_varn_ushort) INTERCEPT3("ncmpi_get_varn_ushort_all", libncmpi_get_varn_ushort_all) INTERCEPT3("ncmpi_get_varn_uint", libncmpi_get_varn_uint) INTERCEPT3("ncmpi_get_varn_uint_all", libncmpi_get_varn_uint_all) INTERCEPT3("ncmpi_get_varn_long", libncmpi_get_varn_long) INTERCEPT3("ncmpi_get_varn_long_all", libncmpi_get_varn_long_all) INTERCEPT3("ncmpi_get_varn_ulonglong", libncmpi_get_varn_ulonglong) INTERCEPT3("ncmpi_get_varn_ulonglong_all", libncmpi_get_varn_ulonglong_all) INTERCEPT3("ncmpi_get_vard", libncmpi_get_vard) INTERCEPT3("ncmpi_get_vard_all", libncmpi_get_vard_all) INTERCEPT3("ncmpi_put_vard", libncmpi_put_vard) INTERCEPT3("ncmpi_put_vard_all", libncmpi_put_vard_all) INTERCEPT3("ncmpi_wait", libncmpi_wait) INTERCEPT3("ncmpi_wait_all", libncmpi_wait_all) INTERCEPT3("ncmpi_cancel", libncmpi_cancel) INTERCEPT3("ncmpi_buffer_attach", libncmpi_buffer_attach) INTERCEPT3("ncmpi_buffer_detach", libncmpi_buffer_detach) INTERCEPT3("ncmpi_inq_buffer_usage", libncmpi_inq_buffer_usage) INTERCEPT3("ncmpi_inq_buffer_size", libncmpi_inq_buffer_size) INTERCEPT3("ncmpi_inq_nreqs", libncmpi_inq_nreqs) INTERCEPT3("ncmpi_iput_var1", libncmpi_iput_var1) INTERCEPT3("ncmpi_iput_var1_text", libncmpi_iput_var1_text) INTERCEPT3("ncmpi_iput_var1_schar", libncmpi_iput_var1_schar) INTERCEPT3("ncmpi_iput_var1_short", libncmpi_iput_var1_short) INTERCEPT3("ncmpi_iput_var1_int", libncmpi_iput_var1_int) INTERCEPT3("ncmpi_iput_var1_float", libncmpi_iput_var1_float) INTERCEPT3("ncmpi_iput_var1_double", libncmpi_iput_var1_double) INTERCEPT3("ncmpi_iput_var1_longlong", libncmpi_iput_var1_longlong) INTERCEPT3("ncmpi_iget_var1", libncmpi_iget_var1) INTERCEPT3("ncmpi_iget_var1_schar", libncmpi_iget_var1_schar) INTERCEPT3("ncmpi_iget_var1_text", libncmpi_iget_var1_text) INTERCEPT3("ncmpi_iget_var1_short", libncmpi_iget_var1_short) INTERCEPT3("ncmpi_iget_var1_int", libncmpi_iget_var1_int) INTERCEPT3("ncmpi_iget_var1_float", libncmpi_iget_var1_float) INTERCEPT3("ncmpi_iget_var1_double", libncmpi_iget_var1_double) INTERCEPT3("ncmpi_iget_var1_longlong", libncmpi_iget_var1_longlong) INTERCEPT3("ncmpi_bput_var1", libncmpi_bput_var1) INTERCEPT3("ncmpi_bput_var1_text", libncmpi_bput_var1_text) INTERCEPT3("ncmpi_bput_var1_schar", libncmpi_bput_var1_schar) INTERCEPT3("ncmpi_bput_var1_short", libncmpi_bput_var1_short) INTERCEPT3("ncmpi_bput_var1_int", libncmpi_bput_var1_int) INTERCEPT3("ncmpi_bput_var1_float", libncmpi_bput_var1_float) INTERCEPT3("ncmpi_bput_var1_double", libncmpi_bput_var1_double) INTERCEPT3("ncmpi_bput_var1_longlong", libncmpi_bput_var1_longlong) INTERCEPT3("ncmpi_iput_var1_uchar", libncmpi_iput_var1_uchar) INTERCEPT3("ncmpi_iput_var1_ushort", libncmpi_iput_var1_ushort) INTERCEPT3("ncmpi_iput_var1_uint", libncmpi_iput_var1_uint) INTERCEPT3("ncmpi_iput_var1_long", libncmpi_iput_var1_long) INTERCEPT3("ncmpi_iput_var1_ulonglong", libncmpi_iput_var1_ulonglong) INTERCEPT3("ncmpi_iget_var1_uchar", libncmpi_iget_var1_uchar) INTERCEPT3("ncmpi_iget_var1_ushort", libncmpi_iget_var1_ushort) INTERCEPT3("ncmpi_iget_var1_uint", libncmpi_iget_var1_uint) INTERCEPT3("ncmpi_iget_var1_long", libncmpi_iget_var1_long) INTERCEPT3("ncmpi_iget_var1_ulonglong", libncmpi_iget_var1_ulonglong) INTERCEPT3("ncmpi_bput_var1_uchar", libncmpi_bput_var1_uchar) INTERCEPT3("ncmpi_bput_var1_ushort", libncmpi_bput_var1_ushort) INTERCEPT3("ncmpi_bput_var1_uint", libncmpi_bput_var1_uint) INTERCEPT3("ncmpi_bput_var1_long", libncmpi_bput_var1_long) INTERCEPT3("ncmpi_bput_var1_ulonglong", libncmpi_bput_var1_ulonglong) INTERCEPT3("ncmpi_iput_var", libncmpi_iput_var) INTERCEPT3("ncmpi_iput_var_schar", libncmpi_iput_var_schar) INTERCEPT3("ncmpi_iput_var_text", libncmpi_iput_var_text) INTERCEPT3("ncmpi_iput_var_short", libncmpi_iput_var_short) INTERCEPT3("ncmpi_iput_var_int", libncmpi_iput_var_int) INTERCEPT3("ncmpi_iput_var_float", libncmpi_iput_var_float) INTERCEPT3("ncmpi_iput_var_double", libncmpi_iput_var_double) INTERCEPT3("ncmpi_iput_var_longlong", libncmpi_iput_var_longlong) INTERCEPT3("ncmpi_iget_var", libncmpi_iget_var) INTERCEPT3("ncmpi_iget_var_schar", libncmpi_iget_var_schar) INTERCEPT3("ncmpi_iget_var_text", libncmpi_iget_var_text) INTERCEPT3("ncmpi_iget_var_short", libncmpi_iget_var_short) INTERCEPT3("ncmpi_iget_var_int", libncmpi_iget_var_int) INTERCEPT3("ncmpi_iget_var_float", libncmpi_iget_var_float) INTERCEPT3("ncmpi_iget_var_double", libncmpi_iget_var_double) INTERCEPT3("ncmpi_iget_var_longlong", libncmpi_iget_var_longlong) INTERCEPT3("ncmpi_bput_var", libncmpi_bput_var) INTERCEPT3("ncmpi_bput_var_schar", libncmpi_bput_var_schar) INTERCEPT3("ncmpi_bput_var_text", libncmpi_bput_var_text) INTERCEPT3("ncmpi_bput_var_short", libncmpi_bput_var_short) INTERCEPT3("ncmpi_bput_var_int", libncmpi_bput_var_int) INTERCEPT3("ncmpi_bput_var_float", libncmpi_bput_var_float) INTERCEPT3("ncmpi_bput_var_double", libncmpi_bput_var_double) INTERCEPT3("ncmpi_bput_var_longlong", libncmpi_bput_var_longlong) INTERCEPT3("ncmpi_iput_var_uchar", libncmpi_iput_var_uchar) INTERCEPT3("ncmpi_iput_var_ushort", libncmpi_iput_var_ushort) INTERCEPT3("ncmpi_iput_var_uint", libncmpi_iput_var_uint) INTERCEPT3("ncmpi_iput_var_long", libncmpi_iput_var_long) INTERCEPT3("ncmpi_iput_var_ulonglong", libncmpi_iput_var_ulonglong) INTERCEPT3("ncmpi_iget_var_uchar", libncmpi_iget_var_uchar) INTERCEPT3("ncmpi_iget_var_ushort", libncmpi_iget_var_ushort) INTERCEPT3("ncmpi_iget_var_uint", libncmpi_iget_var_uint) INTERCEPT3("ncmpi_iget_var_long", libncmpi_iget_var_long) INTERCEPT3("ncmpi_iget_var_ulonglong", libncmpi_iget_var_ulonglong) INTERCEPT3("ncmpi_bput_var_uchar", libncmpi_bput_var_uchar) INTERCEPT3("ncmpi_bput_var_ushort", libncmpi_bput_var_ushort) INTERCEPT3("ncmpi_bput_var_uint", libncmpi_bput_var_uint) INTERCEPT3("ncmpi_bput_var_long", libncmpi_bput_var_long) INTERCEPT3("ncmpi_bput_var_ulonglong", libncmpi_bput_var_ulonglong) INTERCEPT3("ncmpi_iput_vara", libncmpi_iput_vara) INTERCEPT3("ncmpi_iput_vara_schar", libncmpi_iput_vara_schar) INTERCEPT3("ncmpi_iput_vara_text", libncmpi_iput_vara_text) INTERCEPT3("ncmpi_iput_vara_short", libncmpi_iput_vara_short) INTERCEPT3("ncmpi_iput_vara_int", libncmpi_iput_vara_int) INTERCEPT3("ncmpi_iput_vara_float", libncmpi_iput_vara_float) INTERCEPT3("ncmpi_iput_vara_double", libncmpi_iput_vara_double) INTERCEPT3("ncmpi_iput_vara_longlong", libncmpi_iput_vara_longlong) INTERCEPT3("ncmpi_iget_vara", libncmpi_iget_vara) INTERCEPT3("ncmpi_iget_vara_schar", libncmpi_iget_vara_schar) INTERCEPT3("ncmpi_iget_vara_text", libncmpi_iget_vara_text) INTERCEPT3("ncmpi_iget_vara_short", libncmpi_iget_vara_short) INTERCEPT3("ncmpi_iget_vara_int", libncmpi_iget_vara_int) INTERCEPT3("ncmpi_iget_vara_float", libncmpi_iget_vara_float) INTERCEPT3("ncmpi_iget_vara_double", libncmpi_iget_vara_double) INTERCEPT3("ncmpi_iget_vara_longlong", libncmpi_iget_vara_longlong) INTERCEPT3("ncmpi_bput_vara", libncmpi_bput_vara) INTERCEPT3("ncmpi_bput_vara_schar", libncmpi_bput_vara_schar) INTERCEPT3("ncmpi_bput_vara_text", libncmpi_bput_vara_text) INTERCEPT3("ncmpi_bput_vara_short", libncmpi_bput_vara_short) INTERCEPT3("ncmpi_bput_vara_int", libncmpi_bput_vara_int) INTERCEPT3("ncmpi_bput_vara_float", libncmpi_bput_vara_float) INTERCEPT3("ncmpi_bput_vara_double", libncmpi_bput_vara_double) INTERCEPT3("ncmpi_bput_vara_longlong", libncmpi_bput_vara_longlong) INTERCEPT3("ncmpi_iput_vara_uchar", libncmpi_iput_vara_uchar) INTERCEPT3("ncmpi_iput_vara_ushort", libncmpi_iput_vara_ushort) INTERCEPT3("ncmpi_iput_vara_uint", libncmpi_iput_vara_uint) INTERCEPT3("ncmpi_iput_vara_long", libncmpi_iput_vara_long) INTERCEPT3("ncmpi_iput_vara_ulonglong", libncmpi_iput_vara_ulonglong) INTERCEPT3("ncmpi_iget_vara_uchar", libncmpi_iget_vara_uchar) INTERCEPT3("ncmpi_iget_vara_ushort", libncmpi_iget_vara_ushort) INTERCEPT3("ncmpi_iget_vara_uint", libncmpi_iget_vara_uint) INTERCEPT3("ncmpi_iget_vara_long", libncmpi_iget_vara_long) INTERCEPT3("ncmpi_iget_vara_ulonglong", libncmpi_iget_vara_ulonglong) INTERCEPT3("ncmpi_bput_vara_uchar", libncmpi_bput_vara_uchar) INTERCEPT3("ncmpi_bput_vara_ushort", libncmpi_bput_vara_ushort) INTERCEPT3("ncmpi_bput_vara_uint", libncmpi_bput_vara_uint) INTERCEPT3("ncmpi_bput_vara_long", libncmpi_bput_vara_long) INTERCEPT3("ncmpi_bput_vara_ulonglong", libncmpi_bput_vara_ulonglong) INTERCEPT3("ncmpi_iput_vars", libncmpi_iput_vars) INTERCEPT3("ncmpi_iput_vars_schar", libncmpi_iput_vars_schar) INTERCEPT3("ncmpi_iput_vars_text", libncmpi_iput_vars_text) INTERCEPT3("ncmpi_iput_vars_short", libncmpi_iput_vars_short) INTERCEPT3("ncmpi_iput_vars_int", libncmpi_iput_vars_int) INTERCEPT3("ncmpi_iput_vars_float", libncmpi_iput_vars_float) INTERCEPT3("ncmpi_iput_vars_double", libncmpi_iput_vars_double) INTERCEPT3("ncmpi_iput_vars_longlong", libncmpi_iput_vars_longlong) INTERCEPT3("ncmpi_iget_vars", libncmpi_iget_vars) INTERCEPT3("ncmpi_iget_vars_schar", libncmpi_iget_vars_schar) INTERCEPT3("ncmpi_iget_vars_text", libncmpi_iget_vars_text) INTERCEPT3("ncmpi_iget_vars_short", libncmpi_iget_vars_short) INTERCEPT3("ncmpi_iget_vars_int", libncmpi_iget_vars_int) INTERCEPT3("ncmpi_iget_vars_float", libncmpi_iget_vars_float) INTERCEPT3("ncmpi_iget_vars_double", libncmpi_iget_vars_double) INTERCEPT3("ncmpi_iget_vars_longlong", libncmpi_iget_vars_longlong) INTERCEPT3("ncmpi_bput_vars", libncmpi_bput_vars) INTERCEPT3("ncmpi_bput_vars_schar", libncmpi_bput_vars_schar) INTERCEPT3("ncmpi_bput_vars_text", libncmpi_bput_vars_text) INTERCEPT3("ncmpi_bput_vars_short", libncmpi_bput_vars_short) INTERCEPT3("ncmpi_bput_vars_int", libncmpi_bput_vars_int) INTERCEPT3("ncmpi_bput_vars_float", libncmpi_bput_vars_float) INTERCEPT3("ncmpi_bput_vars_double", libncmpi_bput_vars_double) INTERCEPT3("ncmpi_bput_vars_longlong", libncmpi_bput_vars_longlong) INTERCEPT3("ncmpi_iput_vars_uchar", libncmpi_iput_vars_uchar) INTERCEPT3("ncmpi_iput_vars_ushort", libncmpi_iput_vars_ushort) INTERCEPT3("ncmpi_iput_vars_uint", libncmpi_iput_vars_uint) INTERCEPT3("ncmpi_iput_vars_long", libncmpi_iput_vars_long) INTERCEPT3("ncmpi_iput_vars_ulonglong", libncmpi_iput_vars_ulonglong) INTERCEPT3("ncmpi_iget_vars_uchar", libncmpi_iget_vars_uchar) INTERCEPT3("ncmpi_iget_vars_ushort", libncmpi_iget_vars_ushort) INTERCEPT3("ncmpi_iget_vars_uint", libncmpi_iget_vars_uint) INTERCEPT3("ncmpi_iget_vars_long", libncmpi_iget_vars_long) INTERCEPT3("ncmpi_iget_vars_ulonglong", libncmpi_iget_vars_ulonglong) INTERCEPT3("ncmpi_bput_vars_uchar", libncmpi_bput_vars_uchar) INTERCEPT3("ncmpi_bput_vars_ushort", libncmpi_bput_vars_ushort) INTERCEPT3("ncmpi_bput_vars_uint", libncmpi_bput_vars_uint) INTERCEPT3("ncmpi_bput_vars_long", libncmpi_bput_vars_long) INTERCEPT3("ncmpi_bput_vars_ulonglong", libncmpi_bput_vars_ulonglong) INTERCEPT3("ncmpi_iput_varm", libncmpi_iput_varm) INTERCEPT3("ncmpi_iput_varm_schar", libncmpi_iput_varm_schar) INTERCEPT3("ncmpi_iput_varm_text", libncmpi_iput_varm_text) INTERCEPT3("ncmpi_iput_varm_short", libncmpi_iput_varm_short) INTERCEPT3("ncmpi_iput_varm_int", libncmpi_iput_varm_int) INTERCEPT3("ncmpi_iput_varm_float", libncmpi_iput_varm_float) INTERCEPT3("ncmpi_iput_varm_double", libncmpi_iput_varm_double) INTERCEPT3("ncmpi_iput_varm_longlong", libncmpi_iput_varm_longlong) INTERCEPT3("ncmpi_iget_varm", libncmpi_iget_varm) INTERCEPT3("ncmpi_iget_varm_schar", libncmpi_iget_varm_schar) INTERCEPT3("ncmpi_iget_varm_text", libncmpi_iget_varm_text) INTERCEPT3("ncmpi_iget_varm_short", libncmpi_iget_varm_short) INTERCEPT3("ncmpi_iget_varm_int", libncmpi_iget_varm_int) INTERCEPT3("ncmpi_iget_varm_float", libncmpi_iget_varm_float) INTERCEPT3("ncmpi_iget_varm_double", libncmpi_iget_varm_double) INTERCEPT3("ncmpi_iget_varm_longlong", libncmpi_iget_varm_longlong) INTERCEPT3("ncmpi_bput_varm", libncmpi_bput_varm) INTERCEPT3("ncmpi_bput_varm_schar", libncmpi_bput_varm_schar) INTERCEPT3("ncmpi_bput_varm_text", libncmpi_bput_varm_text) INTERCEPT3("ncmpi_bput_varm_short", libncmpi_bput_varm_short) INTERCEPT3("ncmpi_bput_varm_int", libncmpi_bput_varm_int) INTERCEPT3("ncmpi_bput_varm_float", libncmpi_bput_varm_float) INTERCEPT3("ncmpi_bput_varm_double", libncmpi_bput_varm_double) INTERCEPT3("ncmpi_bput_varm_longlong", libncmpi_bput_varm_longlong) INTERCEPT3("ncmpi_iput_varm_uchar", libncmpi_iput_varm_uchar) INTERCEPT3("ncmpi_iput_varm_ushort", libncmpi_iput_varm_ushort) INTERCEPT3("ncmpi_iput_varm_uint", libncmpi_iput_varm_uint) INTERCEPT3("ncmpi_iput_varm_long", libncmpi_iput_varm_long) INTERCEPT3("ncmpi_iput_varm_ulonglong", libncmpi_iput_varm_ulonglong) INTERCEPT3("ncmpi_iget_varm_uchar", libncmpi_iget_varm_uchar) INTERCEPT3("ncmpi_iget_varm_ushort", libncmpi_iget_varm_ushort) INTERCEPT3("ncmpi_iget_varm_uint", libncmpi_iget_varm_uint) INTERCEPT3("ncmpi_iget_varm_long", libncmpi_iget_varm_long) INTERCEPT3("ncmpi_iget_varm_ulonglong", libncmpi_iget_varm_ulonglong) INTERCEPT3("ncmpi_bput_varm_uchar", libncmpi_bput_varm_uchar) INTERCEPT3("ncmpi_bput_varm_ushort", libncmpi_bput_varm_ushort) INTERCEPT3("ncmpi_bput_varm_uint", libncmpi_bput_varm_uint) INTERCEPT3("ncmpi_bput_varm_long", libncmpi_bput_varm_long) INTERCEPT3("ncmpi_bput_varm_ulonglong", libncmpi_bput_varm_ulonglong) INTERCEPT3("ncmpi_iput_varn", libncmpi_iput_varn) INTERCEPT3("ncmpi_iget_varn", libncmpi_iget_varn) INTERCEPT3("ncmpi_iput_varn_text", libncmpi_iput_varn_text) INTERCEPT3("ncmpi_iput_varn_schar", libncmpi_iput_varn_schar) INTERCEPT3("ncmpi_iput_varn_short", libncmpi_iput_varn_short) INTERCEPT3("ncmpi_iput_varn_int", libncmpi_iput_varn_int) INTERCEPT3("ncmpi_iput_varn_float", libncmpi_iput_varn_float) INTERCEPT3("ncmpi_iput_varn_double", libncmpi_iput_varn_double) INTERCEPT3("ncmpi_iput_varn_longlong", libncmpi_iput_varn_longlong) INTERCEPT3("ncmpi_iput_varn_uchar", libncmpi_iput_varn_uchar) INTERCEPT3("ncmpi_iput_varn_ushort", libncmpi_iput_varn_ushort) INTERCEPT3("ncmpi_iput_varn_uint", libncmpi_iput_varn_uint) INTERCEPT3("ncmpi_iput_varn_long", libncmpi_iput_varn_long) INTERCEPT3("ncmpi_iput_varn_ulonglong", libncmpi_iput_varn_ulonglong) INTERCEPT3("ncmpi_iget_varn_text", libncmpi_iget_varn_text) INTERCEPT3("ncmpi_iget_varn_schar", libncmpi_iget_varn_schar) INTERCEPT3("ncmpi_iget_varn_short", libncmpi_iget_varn_short) INTERCEPT3("ncmpi_iget_varn_int", libncmpi_iget_varn_int) INTERCEPT3("ncmpi_iget_varn_float", libncmpi_iget_varn_float) INTERCEPT3("ncmpi_iget_varn_double", libncmpi_iget_varn_double) INTERCEPT3("ncmpi_iget_varn_longlong", libncmpi_iget_varn_longlong) INTERCEPT3("ncmpi_iget_varn_uchar", libncmpi_iget_varn_uchar) INTERCEPT3("ncmpi_iget_varn_ushort", libncmpi_iget_varn_ushort) INTERCEPT3("ncmpi_iget_varn_uint", libncmpi_iget_varn_uint) INTERCEPT3("ncmpi_iget_varn_long", libncmpi_iget_varn_long) INTERCEPT3("ncmpi_iget_varn_ulonglong", libncmpi_iget_varn_ulonglong) INTERCEPT3("ncmpi_bput_varn", libncmpi_bput_varn) INTERCEPT3("ncmpi_bput_varn_text", libncmpi_bput_varn_text) INTERCEPT3("ncmpi_bput_varn_schar", libncmpi_bput_varn_schar) INTERCEPT3("ncmpi_bput_varn_short", libncmpi_bput_varn_short) INTERCEPT3("ncmpi_bput_varn_int", libncmpi_bput_varn_int) INTERCEPT3("ncmpi_bput_varn_float", libncmpi_bput_varn_float) INTERCEPT3("ncmpi_bput_varn_double", libncmpi_bput_varn_double) INTERCEPT3("ncmpi_bput_varn_longlong", libncmpi_bput_varn_longlong) INTERCEPT3("ncmpi_bput_varn_uchar", libncmpi_bput_varn_uchar) INTERCEPT3("ncmpi_bput_varn_ushort", libncmpi_bput_varn_ushort) INTERCEPT3("ncmpi_bput_varn_uint", libncmpi_bput_varn_uint) INTERCEPT3("ncmpi_bput_varn_long", libncmpi_bput_varn_long) INTERCEPT3("ncmpi_bput_varn_ulonglong", libncmpi_bput_varn_ulonglong) INTERCEPT3("ncmpi_mput_var", libncmpi_mput_var) INTERCEPT3("ncmpi_mput_var_all", libncmpi_mput_var_all) INTERCEPT3("ncmpi_mput_var_text", libncmpi_mput_var_text) INTERCEPT3("ncmpi_mput_var_text_all", libncmpi_mput_var_text_all) INTERCEPT3("ncmpi_mput_var_schar", libncmpi_mput_var_schar) INTERCEPT3("ncmpi_mput_var_schar_all", libncmpi_mput_var_schar_all) INTERCEPT3("ncmpi_mput_var_uchar", libncmpi_mput_var_uchar) INTERCEPT3("ncmpi_mput_var_uchar_all", libncmpi_mput_var_uchar_all) INTERCEPT3("ncmpi_mput_var_short", libncmpi_mput_var_short) INTERCEPT3("ncmpi_mput_var_short_all", libncmpi_mput_var_short_all) INTERCEPT3("ncmpi_mput_var_ushort", libncmpi_mput_var_ushort) INTERCEPT3("ncmpi_mput_var_ushort_all", libncmpi_mput_var_ushort_all) INTERCEPT3("ncmpi_mput_var_int", libncmpi_mput_var_int) INTERCEPT3("ncmpi_mput_var_int_all", libncmpi_mput_var_int_all) INTERCEPT3("ncmpi_mput_var_uint", libncmpi_mput_var_uint) INTERCEPT3("ncmpi_mput_var_uint_all", libncmpi_mput_var_uint_all) INTERCEPT3("ncmpi_mput_var_long", libncmpi_mput_var_long) INTERCEPT3("ncmpi_mput_var_long_all", libncmpi_mput_var_long_all) INTERCEPT3("ncmpi_mput_var_float", libncmpi_mput_var_float) INTERCEPT3("ncmpi_mput_var_float_all", libncmpi_mput_var_float_all) INTERCEPT3("ncmpi_mput_var_double", libncmpi_mput_var_double) INTERCEPT3("ncmpi_mput_var_double_all", libncmpi_mput_var_double_all) INTERCEPT3("ncmpi_mput_var_longlong", libncmpi_mput_var_longlong) INTERCEPT3("ncmpi_mput_var_longlong_all", libncmpi_mput_var_longlong_all) INTERCEPT3("ncmpi_mput_var_ulonglong", libncmpi_mput_var_ulonglong) INTERCEPT3("ncmpi_mput_var_ulonglong_all", libncmpi_mput_var_ulonglong_all) INTERCEPT3("ncmpi_mput_var1", libncmpi_mput_var1) INTERCEPT3("ncmpi_mput_var1_all", libncmpi_mput_var1_all) INTERCEPT3("ncmpi_mput_var1_text", libncmpi_mput_var1_text) INTERCEPT3("ncmpi_mput_var1_text_all", libncmpi_mput_var1_text_all) INTERCEPT3("ncmpi_mput_var1_schar", libncmpi_mput_var1_schar) INTERCEPT3("ncmpi_mput_var1_schar_all", libncmpi_mput_var1_schar_all) INTERCEPT3("ncmpi_mput_var1_uchar", libncmpi_mput_var1_uchar) INTERCEPT3("ncmpi_mput_var1_uchar_all", libncmpi_mput_var1_uchar_all) INTERCEPT3("ncmpi_mput_var1_short", libncmpi_mput_var1_short) INTERCEPT3("ncmpi_mput_var1_short_all", libncmpi_mput_var1_short_all) INTERCEPT3("ncmpi_mput_var1_ushort", libncmpi_mput_var1_ushort) INTERCEPT3("ncmpi_mput_var1_ushort_all", libncmpi_mput_var1_ushort_all) INTERCEPT3("ncmpi_mput_var1_int", libncmpi_mput_var1_int) INTERCEPT3("ncmpi_mput_var1_int_all", libncmpi_mput_var1_int_all) INTERCEPT3("ncmpi_mput_var1_uint", libncmpi_mput_var1_uint) INTERCEPT3("ncmpi_mput_var1_uint_all", libncmpi_mput_var1_uint_all) INTERCEPT3("ncmpi_mput_var1_long", libncmpi_mput_var1_long) INTERCEPT3("ncmpi_mput_var1_long_all", libncmpi_mput_var1_long_all) INTERCEPT3("ncmpi_mput_var1_float", libncmpi_mput_var1_float) INTERCEPT3("ncmpi_mput_var1_float_all", libncmpi_mput_var1_float_all) INTERCEPT3("ncmpi_mput_var1_double", libncmpi_mput_var1_double) INTERCEPT3("ncmpi_mput_var1_double_all", libncmpi_mput_var1_double_all) INTERCEPT3("ncmpi_mput_var1_longlong", libncmpi_mput_var1_longlong) INTERCEPT3("ncmpi_mput_var1_longlong_all", libncmpi_mput_var1_longlong_all) INTERCEPT3("ncmpi_mput_var1_ulonglong", libncmpi_mput_var1_ulonglong) INTERCEPT3("ncmpi_mput_var1_ulonglong_all", libncmpi_mput_var1_ulonglong_all) INTERCEPT3("ncmpi_mput_vara", libncmpi_mput_vara) INTERCEPT3("ncmpi_mput_vara_all", libncmpi_mput_vara_all) INTERCEPT3("ncmpi_mput_vara_text", libncmpi_mput_vara_text) INTERCEPT3("ncmpi_mput_vara_text_all", libncmpi_mput_vara_text_all) INTERCEPT3("ncmpi_mput_vara_schar", libncmpi_mput_vara_schar) INTERCEPT3("ncmpi_mput_vara_schar_all", libncmpi_mput_vara_schar_all) INTERCEPT3("ncmpi_mput_vara_uchar", libncmpi_mput_vara_uchar) INTERCEPT3("ncmpi_mput_vara_uchar_all", libncmpi_mput_vara_uchar_all) INTERCEPT3("ncmpi_mput_vara_short", libncmpi_mput_vara_short) INTERCEPT3("ncmpi_mput_vara_short_all", libncmpi_mput_vara_short_all) INTERCEPT3("ncmpi_mput_vara_ushort", libncmpi_mput_vara_ushort) INTERCEPT3("ncmpi_mput_vara_ushort_all", libncmpi_mput_vara_ushort_all) INTERCEPT3("ncmpi_mput_vara_int", libncmpi_mput_vara_int) INTERCEPT3("ncmpi_mput_vara_int_all", libncmpi_mput_vara_int_all) INTERCEPT3("ncmpi_mput_vara_uint", libncmpi_mput_vara_uint) INTERCEPT3("ncmpi_mput_vara_uint_all", libncmpi_mput_vara_uint_all) INTERCEPT3("ncmpi_mput_vara_long", libncmpi_mput_vara_long) INTERCEPT3("ncmpi_mput_vara_long_all", libncmpi_mput_vara_long_all) INTERCEPT3("ncmpi_mput_vara_float", libncmpi_mput_vara_float) INTERCEPT3("ncmpi_mput_vara_float_all", libncmpi_mput_vara_float_all) INTERCEPT3("ncmpi_mput_vara_double", libncmpi_mput_vara_double) INTERCEPT3("ncmpi_mput_vara_double_all", libncmpi_mput_vara_double_all) INTERCEPT3("ncmpi_mput_vara_longlong", libncmpi_mput_vara_longlong) INTERCEPT3("ncmpi_mput_vara_longlong_all", libncmpi_mput_vara_longlong_all) INTERCEPT3("ncmpi_mput_vara_ulonglong", libncmpi_mput_vara_ulonglong) INTERCEPT3("ncmpi_mput_vara_ulonglong_all", libncmpi_mput_vara_ulonglong_all) INTERCEPT3("ncmpi_mput_vars", libncmpi_mput_vars) INTERCEPT3("ncmpi_mput_vars_all", libncmpi_mput_vars_all) INTERCEPT3("ncmpi_mput_vars_text", libncmpi_mput_vars_text) INTERCEPT3("ncmpi_mput_vars_text_all", libncmpi_mput_vars_text_all) INTERCEPT3("ncmpi_mput_vars_schar", libncmpi_mput_vars_schar) INTERCEPT3("ncmpi_mput_vars_schar_all", libncmpi_mput_vars_schar_all) INTERCEPT3("ncmpi_mput_vars_uchar", libncmpi_mput_vars_uchar) INTERCEPT3("ncmpi_mput_vars_uchar_all", libncmpi_mput_vars_uchar_all) INTERCEPT3("ncmpi_mput_vars_short", libncmpi_mput_vars_short) INTERCEPT3("ncmpi_mput_vars_short_all", libncmpi_mput_vars_short_all) INTERCEPT3("ncmpi_mput_vars_ushort", libncmpi_mput_vars_ushort) INTERCEPT3("ncmpi_mput_vars_ushort_all", libncmpi_mput_vars_ushort_all) INTERCEPT3("ncmpi_mput_vars_int", libncmpi_mput_vars_int) INTERCEPT3("ncmpi_mput_vars_int_all", libncmpi_mput_vars_int_all) INTERCEPT3("ncmpi_mput_vars_uint", libncmpi_mput_vars_uint) INTERCEPT3("ncmpi_mput_vars_uint_all", libncmpi_mput_vars_uint_all) INTERCEPT3("ncmpi_mput_vars_long", libncmpi_mput_vars_long) INTERCEPT3("ncmpi_mput_vars_long_all", libncmpi_mput_vars_long_all) INTERCEPT3("ncmpi_mput_vars_float", libncmpi_mput_vars_float) INTERCEPT3("ncmpi_mput_vars_float_all", libncmpi_mput_vars_float_all) INTERCEPT3("ncmpi_mput_vars_double", libncmpi_mput_vars_double) INTERCEPT3("ncmpi_mput_vars_double_all", libncmpi_mput_vars_double_all) INTERCEPT3("ncmpi_mput_vars_longlong", libncmpi_mput_vars_longlong) INTERCEPT3("ncmpi_mput_vars_longlong_all", libncmpi_mput_vars_longlong_all) INTERCEPT3("ncmpi_mput_vars_ulonglong", libncmpi_mput_vars_ulonglong) INTERCEPT3("ncmpi_mput_vars_ulonglong_all", libncmpi_mput_vars_ulonglong_all) INTERCEPT3("ncmpi_mput_varm", libncmpi_mput_varm) INTERCEPT3("ncmpi_mput_varm_all", libncmpi_mput_varm_all) INTERCEPT3("ncmpi_mput_varm_text", libncmpi_mput_varm_text) INTERCEPT3("ncmpi_mput_varm_text_all", libncmpi_mput_varm_text_all) INTERCEPT3("ncmpi_mput_varm_schar", libncmpi_mput_varm_schar) INTERCEPT3("ncmpi_mput_varm_schar_all", libncmpi_mput_varm_schar_all) INTERCEPT3("ncmpi_mput_varm_uchar", libncmpi_mput_varm_uchar) INTERCEPT3("ncmpi_mput_varm_uchar_all", libncmpi_mput_varm_uchar_all) INTERCEPT3("ncmpi_mput_varm_short", libncmpi_mput_varm_short) INTERCEPT3("ncmpi_mput_varm_short_all", libncmpi_mput_varm_short_all) INTERCEPT3("ncmpi_mput_varm_ushort", libncmpi_mput_varm_ushort) INTERCEPT3("ncmpi_mput_varm_ushort_all", libncmpi_mput_varm_ushort_all) INTERCEPT3("ncmpi_mput_varm_int", libncmpi_mput_varm_int) INTERCEPT3("ncmpi_mput_varm_int_all", libncmpi_mput_varm_int_all) INTERCEPT3("ncmpi_mput_varm_uint", libncmpi_mput_varm_uint) INTERCEPT3("ncmpi_mput_varm_uint_all", libncmpi_mput_varm_uint_all) INTERCEPT3("ncmpi_mput_varm_long", libncmpi_mput_varm_long) INTERCEPT3("ncmpi_mput_varm_long_all", libncmpi_mput_varm_long_all) INTERCEPT3("ncmpi_mput_varm_float", libncmpi_mput_varm_float) INTERCEPT3("ncmpi_mput_varm_float_all", libncmpi_mput_varm_float_all) INTERCEPT3("ncmpi_mput_varm_double", libncmpi_mput_varm_double) INTERCEPT3("ncmpi_mput_varm_double_all", libncmpi_mput_varm_double_all) INTERCEPT3("ncmpi_mput_varm_longlong", libncmpi_mput_varm_longlong) INTERCEPT3("ncmpi_mput_varm_longlong_all", libncmpi_mput_varm_longlong_all) INTERCEPT3("ncmpi_mput_varm_ulonglong", libncmpi_mput_varm_ulonglong) INTERCEPT3("ncmpi_mput_varm_ulonglong_all", libncmpi_mput_varm_ulonglong_all) INTERCEPT3("ncmpi_mget_var", libncmpi_mget_var) INTERCEPT3("ncmpi_mget_var_all", libncmpi_mget_var_all) INTERCEPT3("ncmpi_mget_var_text", libncmpi_mget_var_text) INTERCEPT3("ncmpi_mget_var_text_all", libncmpi_mget_var_text_all) INTERCEPT3("ncmpi_mget_var_schar", libncmpi_mget_var_schar) INTERCEPT3("ncmpi_mget_var_schar_all", libncmpi_mget_var_schar_all) INTERCEPT3("ncmpi_mget_var_uchar", libncmpi_mget_var_uchar) INTERCEPT3("ncmpi_mget_var_uchar_all", libncmpi_mget_var_uchar_all) INTERCEPT3("ncmpi_mget_var_short", libncmpi_mget_var_short) INTERCEPT3("ncmpi_mget_var_short_all", libncmpi_mget_var_short_all) INTERCEPT3("ncmpi_mget_var_ushort", libncmpi_mget_var_ushort) INTERCEPT3("ncmpi_mget_var_ushort_all", libncmpi_mget_var_ushort_all) INTERCEPT3("ncmpi_mget_var_int", libncmpi_mget_var_int) INTERCEPT3("ncmpi_mget_var_int_all", libncmpi_mget_var_int_all) INTERCEPT3("ncmpi_mget_var_uint", libncmpi_mget_var_uint) INTERCEPT3("ncmpi_mget_var_uint_all", libncmpi_mget_var_uint_all) INTERCEPT3("ncmpi_mget_var_long", libncmpi_mget_var_long) INTERCEPT3("ncmpi_mget_var_long_all", libncmpi_mget_var_long_all) INTERCEPT3("ncmpi_mget_var_float", libncmpi_mget_var_float) INTERCEPT3("ncmpi_mget_var_float_all", libncmpi_mget_var_float_all) INTERCEPT3("ncmpi_mget_var_double", libncmpi_mget_var_double) INTERCEPT3("ncmpi_mget_var_double_all", libncmpi_mget_var_double_all) INTERCEPT3("ncmpi_mget_var_longlong", libncmpi_mget_var_longlong) INTERCEPT3("ncmpi_mget_var_longlong_all", libncmpi_mget_var_longlong_all) INTERCEPT3("ncmpi_mget_var_ulonglong", libncmpi_mget_var_ulonglong) INTERCEPT3("ncmpi_mget_var_ulonglong_all", libncmpi_mget_var_ulonglong_all) INTERCEPT3("ncmpi_mget_var1", libncmpi_mget_var1) INTERCEPT3("ncmpi_mget_var1_all", libncmpi_mget_var1_all) INTERCEPT3("ncmpi_mget_var1_text", libncmpi_mget_var1_text) INTERCEPT3("ncmpi_mget_var1_text_all", libncmpi_mget_var1_text_all) INTERCEPT3("ncmpi_mget_var1_schar", libncmpi_mget_var1_schar) INTERCEPT3("ncmpi_mget_var1_schar_all", libncmpi_mget_var1_schar_all) INTERCEPT3("ncmpi_mget_var1_uchar", libncmpi_mget_var1_uchar) INTERCEPT3("ncmpi_mget_var1_uchar_all", libncmpi_mget_var1_uchar_all) INTERCEPT3("ncmpi_mget_var1_short", libncmpi_mget_var1_short) INTERCEPT3("ncmpi_mget_var1_short_all", libncmpi_mget_var1_short_all) INTERCEPT3("ncmpi_mget_var1_ushort", libncmpi_mget_var1_ushort) INTERCEPT3("ncmpi_mget_var1_ushort_all", libncmpi_mget_var1_ushort_all) INTERCEPT3("ncmpi_mget_var1_int", libncmpi_mget_var1_int) INTERCEPT3("ncmpi_mget_var1_int_all", libncmpi_mget_var1_int_all) INTERCEPT3("ncmpi_mget_var1_uint", libncmpi_mget_var1_uint) INTERCEPT3("ncmpi_mget_var1_uint_all", libncmpi_mget_var1_uint_all) INTERCEPT3("ncmpi_mget_var1_long", libncmpi_mget_var1_long) INTERCEPT3("ncmpi_mget_var1_long_all", libncmpi_mget_var1_long_all) INTERCEPT3("ncmpi_mget_var1_float", libncmpi_mget_var1_float) INTERCEPT3("ncmpi_mget_var1_float_all", libncmpi_mget_var1_float_all) INTERCEPT3("ncmpi_mget_var1_double", libncmpi_mget_var1_double) INTERCEPT3("ncmpi_mget_var1_double_all", libncmpi_mget_var1_double_all) INTERCEPT3("ncmpi_mget_var1_longlong", libncmpi_mget_var1_longlong) INTERCEPT3("ncmpi_mget_var1_longlong_all", libncmpi_mget_var1_longlong_all) INTERCEPT3("ncmpi_mget_var1_ulonglong", libncmpi_mget_var1_ulonglong) INTERCEPT3("ncmpi_mget_var1_ulonglong_all", libncmpi_mget_var1_ulonglong_all) INTERCEPT3("ncmpi_mget_vara", libncmpi_mget_vara) INTERCEPT3("ncmpi_mget_vara_all", libncmpi_mget_vara_all) INTERCEPT3("ncmpi_mget_vara_text", libncmpi_mget_vara_text) INTERCEPT3("ncmpi_mget_vara_text_all", libncmpi_mget_vara_text_all) INTERCEPT3("ncmpi_mget_vara_schar", libncmpi_mget_vara_schar) INTERCEPT3("ncmpi_mget_vara_schar_all", libncmpi_mget_vara_schar_all) INTERCEPT3("ncmpi_mget_vara_uchar", libncmpi_mget_vara_uchar) INTERCEPT3("ncmpi_mget_vara_uchar_all", libncmpi_mget_vara_uchar_all) INTERCEPT3("ncmpi_mget_vara_short", libncmpi_mget_vara_short) INTERCEPT3("ncmpi_mget_vara_short_all", libncmpi_mget_vara_short_all) INTERCEPT3("ncmpi_mget_vara_ushort", libncmpi_mget_vara_ushort) INTERCEPT3("ncmpi_mget_vara_ushort_all", libncmpi_mget_vara_ushort_all) INTERCEPT3("ncmpi_mget_vara_int", libncmpi_mget_vara_int) INTERCEPT3("ncmpi_mget_vara_int_all", libncmpi_mget_vara_int_all) INTERCEPT3("ncmpi_mget_vara_uint", libncmpi_mget_vara_uint) INTERCEPT3("ncmpi_mget_vara_uint_all", libncmpi_mget_vara_uint_all) INTERCEPT3("ncmpi_mget_vara_long", libncmpi_mget_vara_long) INTERCEPT3("ncmpi_mget_vara_long_all", libncmpi_mget_vara_long_all) INTERCEPT3("ncmpi_mget_vara_float", libncmpi_mget_vara_float) INTERCEPT3("ncmpi_mget_vara_float_all", libncmpi_mget_vara_float_all) INTERCEPT3("ncmpi_mget_vara_double", libncmpi_mget_vara_double) INTERCEPT3("ncmpi_mget_vara_double_all", libncmpi_mget_vara_double_all) INTERCEPT3("ncmpi_mget_vara_longlong", libncmpi_mget_vara_longlong) INTERCEPT3("ncmpi_mget_vara_longlong_all", libncmpi_mget_vara_longlong_all) INTERCEPT3("ncmpi_mget_vara_ulonglong", libncmpi_mget_vara_ulonglong) INTERCEPT3("ncmpi_mget_vara_ulonglong_all", libncmpi_mget_vara_ulonglong_all) INTERCEPT3("ncmpi_mget_vars", libncmpi_mget_vars) INTERCEPT3("ncmpi_mget_vars_all", libncmpi_mget_vars_all) INTERCEPT3("ncmpi_mget_vars_text", libncmpi_mget_vars_text) INTERCEPT3("ncmpi_mget_vars_text_all", libncmpi_mget_vars_text_all) INTERCEPT3("ncmpi_mget_vars_schar", libncmpi_mget_vars_schar) INTERCEPT3("ncmpi_mget_vars_schar_all", libncmpi_mget_vars_schar_all) INTERCEPT3("ncmpi_mget_vars_uchar", libncmpi_mget_vars_uchar) INTERCEPT3("ncmpi_mget_vars_uchar_all", libncmpi_mget_vars_uchar_all) INTERCEPT3("ncmpi_mget_vars_short", libncmpi_mget_vars_short) INTERCEPT3("ncmpi_mget_vars_short_all", libncmpi_mget_vars_short_all) INTERCEPT3("ncmpi_mget_vars_ushort", libncmpi_mget_vars_ushort) INTERCEPT3("ncmpi_mget_vars_ushort_all", libncmpi_mget_vars_ushort_all) INTERCEPT3("ncmpi_mget_vars_int", libncmpi_mget_vars_int) INTERCEPT3("ncmpi_mget_vars_int_all", libncmpi_mget_vars_int_all) INTERCEPT3("ncmpi_mget_vars_uint", libncmpi_mget_vars_uint) INTERCEPT3("ncmpi_mget_vars_uint_all", libncmpi_mget_vars_uint_all) INTERCEPT3("ncmpi_mget_vars_long", libncmpi_mget_vars_long) INTERCEPT3("ncmpi_mget_vars_long_all", libncmpi_mget_vars_long_all) INTERCEPT3("ncmpi_mget_vars_float", libncmpi_mget_vars_float) INTERCEPT3("ncmpi_mget_vars_float_all", libncmpi_mget_vars_float_all) INTERCEPT3("ncmpi_mget_vars_double", libncmpi_mget_vars_double) INTERCEPT3("ncmpi_mget_vars_double_all", libncmpi_mget_vars_double_all) INTERCEPT3("ncmpi_mget_vars_longlong", libncmpi_mget_vars_longlong) INTERCEPT3("ncmpi_mget_vars_longlong_all", libncmpi_mget_vars_longlong_all) INTERCEPT3("ncmpi_mget_vars_ulonglong", libncmpi_mget_vars_ulonglong) INTERCEPT3("ncmpi_mget_vars_ulonglong_all", libncmpi_mget_vars_ulonglong_all) INTERCEPT3("ncmpi_mget_varm", libncmpi_mget_varm) INTERCEPT3("ncmpi_mget_varm_all", libncmpi_mget_varm_all) INTERCEPT3("ncmpi_mget_varm_text", libncmpi_mget_varm_text) INTERCEPT3("ncmpi_mget_varm_text_all", libncmpi_mget_varm_text_all) INTERCEPT3("ncmpi_mget_varm_schar", libncmpi_mget_varm_schar) INTERCEPT3("ncmpi_mget_varm_schar_all", libncmpi_mget_varm_schar_all) INTERCEPT3("ncmpi_mget_varm_uchar", libncmpi_mget_varm_uchar) INTERCEPT3("ncmpi_mget_varm_uchar_all", libncmpi_mget_varm_uchar_all) INTERCEPT3("ncmpi_mget_varm_short", libncmpi_mget_varm_short) INTERCEPT3("ncmpi_mget_varm_short_all", libncmpi_mget_varm_short_all) INTERCEPT3("ncmpi_mget_varm_ushort", libncmpi_mget_varm_ushort) INTERCEPT3("ncmpi_mget_varm_ushort_all", libncmpi_mget_varm_ushort_all) INTERCEPT3("ncmpi_mget_varm_int", libncmpi_mget_varm_int) INTERCEPT3("ncmpi_mget_varm_int_all", libncmpi_mget_varm_int_all) INTERCEPT3("ncmpi_mget_varm_uint", libncmpi_mget_varm_uint) INTERCEPT3("ncmpi_mget_varm_uint_all", libncmpi_mget_varm_uint_all) INTERCEPT3("ncmpi_mget_varm_long", libncmpi_mget_varm_long) INTERCEPT3("ncmpi_mget_varm_long_all", libncmpi_mget_varm_long_all) INTERCEPT3("ncmpi_mget_varm_float", libncmpi_mget_varm_float) INTERCEPT3("ncmpi_mget_varm_float_all", libncmpi_mget_varm_float_all) INTERCEPT3("ncmpi_mget_varm_double", libncmpi_mget_varm_double) INTERCEPT3("ncmpi_mget_varm_double_all", libncmpi_mget_varm_double_all) INTERCEPT3("ncmpi_mget_varm_longlong", libncmpi_mget_varm_longlong) INTERCEPT3("ncmpi_mget_varm_longlong_all", libncmpi_mget_varm_longlong_all) INTERCEPT3("ncmpi_mget_varm_ulonglong", libncmpi_mget_varm_ulonglong) INTERCEPT3("ncmpi_mget_varm_ulonglong_all", libncmpi_mget_varm_ulonglong_all) PPTRACE_END_INTERCEPT_FUNCTIONS(pnetcdf) static void init_pnetcdf() { INSTRUMENT_FUNCTIONS(pnetcdf); if (eztrace_autostart_enabled()) eztrace_start(); _pnetcdf_initialized = 1; } static void finalize_pnetcdf() { _pnetcdf_initialized = 0; eztrace_stop(); } static void _pnetcdf_init(void) __attribute__((constructor)); static void _pnetcdf_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_pnetcdf constructor starts\n"); EZT_REGISTER_MODULE(pnetcdf, "Module for PNetCDF functions", init_pnetcdf, finalize_pnetcdf); eztrace_log(dbg_lvl_debug, "eztrace_pnetcdf constructor ends\n"); } eztrace-2.1/src/modules/posixio/000077500000000000000000000000001447213526500167535ustar00rootroot00000000000000eztrace-2.1/src/modules/posixio/CMakeLists.txt000066400000000000000000000010261447213526500215120ustar00rootroot00000000000000add_library(eztrace-posixio SHARED posixio.c posix_io_otf2.c ) target_link_libraries(eztrace-posixio PRIVATE atomic dl eztrace-core eztrace-instrumentation eztrace-lib ) target_include_directories(eztrace-posixio PRIVATE ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) #-------------------------------------------- install( TARGETS eztrace-posixio LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) eztrace-2.1/src/modules/posixio/posix_io_otf2.c000066400000000000000000000333421447213526500217070ustar00rootroot00000000000000 #include #include #include #include "posix_io_otf2.h" static int io_paradigm_ref_posix = 0; static int comm_self_ref = 0; pthread_rwlock_t open_files_lock; struct ezt_file_handle* open_files = NULL; static OTF2_IoAccessMode char_to_mode(const char*mode) { if(strcmp(mode, "r") == 0) return OTF2_IO_ACCESS_MODE_READ_ONLY; if(strcmp(mode, "w") == 0 || strcmp(mode, "a") == 0 ) return OTF2_IO_ACCESS_MODE_WRITE_ONLY; if(strcmp(mode, "r+") == 0 || strcmp(mode, "w+") == 0 || strcmp(mode, "a+") == 0) return OTF2_IO_ACCESS_MODE_READ_WRITE; return OTF2_IO_ACCESS_MODE_READ_WRITE; } static OTF2_IoCreationFlag char_to_cflag(const char* mode) { OTF2_IoCreationFlag ret = OTF2_IO_CREATION_FLAG_NONE; if(strcmp(mode, "r+") == 0 || strcmp(mode, "w+") == 0 || strcmp(mode, "a+") == 0) ret |= OTF2_IO_CREATION_FLAG_CREATE; if(strcmp(mode, "w") == 0 || strcmp(mode, "w+") == 0) ret |= OTF2_IO_CREATION_FLAG_TRUNCATE; if(strcmp(mode, "x") == 0) ret |= OTF2_IO_CREATION_FLAG_EXCLUSIVE; return ret; } static OTF2_IoStatusFlag char_to_sflag(const char* mode) { OTF2_IoStatusFlag ret = OTF2_IO_STATUS_FLAG_NONE; if(strcmp(mode, "e") == 0) ret |= OTF2_IO_STATUS_FLAG_CLOSE_ON_EXEC; if(strcmp(mode, "a") == 0 || strcmp(mode, "a+") == 0) ret |= OTF2_IO_STATUS_FLAG_APPEND; return ret; } static OTF2_IoAccessMode int_to_mode(const int flags) { if(flags & O_RDONLY) return OTF2_IO_ACCESS_MODE_READ_ONLY; if(flags & O_WRONLY) return OTF2_IO_ACCESS_MODE_WRITE_ONLY; if(flags & O_RDWR) return OTF2_IO_ACCESS_MODE_READ_WRITE; return OTF2_IO_ACCESS_MODE_READ_WRITE; } static OTF2_IoCreationFlag int_to_cflag(const int flags) { OTF2_IoCreationFlag ret = OTF2_IO_CREATION_FLAG_NONE; if(flags & O_CREAT) ret |= OTF2_IO_CREATION_FLAG_CREATE; if(flags & O_TRUNC) ret |= OTF2_IO_CREATION_FLAG_TRUNCATE; if(flags & O_EXCL) ret |= OTF2_IO_CREATION_FLAG_EXCLUSIVE; return ret; } static OTF2_IoStatusFlag int_to_sflag(const int flags) { OTF2_IoStatusFlag ret = OTF2_IO_STATUS_FLAG_NONE; if(flags & O_CLOEXEC) ret |= OTF2_IO_STATUS_FLAG_CLOSE_ON_EXEC; if(flags & O_APPEND) ret |= OTF2_IO_STATUS_FLAG_APPEND; return ret; } struct ezt_file_handle* new_file_stream(const char* filename, FILE*stream); struct ezt_file_handle* new_file_fd(const char* filename, int fd); struct ezt_file_handle* get_file_handle_stream(FILE*stream) { pthread_rwlock_rdlock(&open_files_lock); struct ezt_file_handle* f = open_files; while(f) { if(f->stream == stream) { pthread_rwlock_unlock(&open_files_lock); return f; } f = f->next; } pthread_rwlock_unlock(&open_files_lock); eztrace_warn("Cannot find a handle that matches %p (fd: %d)\n",stream, fileno(stream)); char buffer[128]; snprintf(buffer, 128, "unknown_file_stream_%p", stream); return new_file_stream(buffer, stream); } struct ezt_file_handle* get_file_handle_fd(int fd) { pthread_rwlock_rdlock(&open_files_lock); struct ezt_file_handle* f = open_files; while(f) { if(f->fd == fd) { pthread_rwlock_unlock(&open_files_lock); return f; } f = f->next; } pthread_rwlock_unlock(&open_files_lock); if(fd == 0) return new_file_fd("stdin", 0); if(fd == 1) return new_file_fd("stdout", 1); if(fd == 2) return new_file_fd("stderr", 1); eztrace_warn("Cannot find a handle that matches %d\n",fd); char buffer[128]; snprintf(buffer, 128, "unknown_file_fd_%d", fd); return new_file_fd(buffer, fd); } /* eztrace initialization function (in eztrace-lib/eztrace_core.c). This is quite an internal function, so it is not declared in eztrace.h. We still need it here though. */ void _eztrace_init(); void init_otf2_posixio() { _eztrace_init(); if( ezt_mpi_rank == 0) { static int next_io_paradigm_ref=0; io_paradigm_ref_posix=next_io_paradigm_ref++; /* TODO: atomic inc */ int string_ref = ezt_otf2_register_string("posix io"); /* In case MPI is use, all process assume they have the same io_paradigm_ref_posix Only MPI rank 0 is allowed to register this paradigm */ OTF2_GlobalDefWriter_WriteIoParadigm(_ezt_trace.global_def_writer, io_paradigm_ref_posix, string_ref, string_ref, OTF2_IO_PARADIGM_CLASS_SERIAL, OTF2_IO_PARADIGM_FLAG_OS, 0, NULL, NULL, NULL); static int next_group_ref = 0; int group_ref = next_group_ref++; /* TODO: atomic inc */ int group_string_ref = ezt_otf2_register_string(""); uint64_t comm_locations[]={0}; /* TODO: each MPI rank should register this group */ OTF2_GlobalDefWriter_WriteGroup( _ezt_trace.global_def_writer, group_ref, group_string_ref, OTF2_GROUP_TYPE_COMM_GROUP, OTF2_PARADIGM_MPI, OTF2_GROUP_FLAG_NONE, 1, comm_locations ); static int next_comm_ref = 0; /* TODO: each MPI rank should register this communicator */ /* TODO: make mpi_comm_self be register by the MPI module ? */ int comm_ref = next_comm_ref++; /* TODO: atomic inc */ int comm_string_ref = ezt_otf2_register_string("MPI_Comm_Self"); comm_self_ref = comm_ref; OTF2_GlobalDefWriter_WriteComm( _ezt_trace.global_def_writer, comm_ref, comm_string_ref, group_ref, OTF2_UNDEFINED_COMM #if OTF2_MAJOR_VERSION >= 3 , OTF2_COMM_FLAG_NONE #endif ); } } static int get_new_matching_id() { static _Atomic int next_id = 0; return next_id++; } struct ezt_file_handle* close_file(FILE*stream) { pthread_rwlock_wrlock(&open_files_lock); struct ezt_file_handle* f = open_files; struct ezt_file_handle* to_remove = NULL; if(f && f->stream == stream) { to_remove = f; open_files = f->next; to_remove->next = NULL; pthread_rwlock_unlock(&open_files_lock); return to_remove; } while(f && f->next) { if(f->next->stream == stream) { /* remove f->next from the list */ /* TODO: make this thread-safe */ to_remove = f->next; f->next = f->next->next; break; } f = f->next; } if(!to_remove) { eztrace_warn("Warning: when closing stream %p: could not find a matching file\n", stream); } else { to_remove->next = NULL; } pthread_rwlock_unlock(&open_files_lock); return to_remove; } struct ezt_file_handle* close_file_fd(int fd) { pthread_rwlock_wrlock(&open_files_lock); struct ezt_file_handle* f = open_files; struct ezt_file_handle* to_remove = NULL; if(f && f->fd == fd) { to_remove = f; open_files = f->next; to_remove->next = NULL; pthread_rwlock_unlock(&open_files_lock); return to_remove; } while(f && f->next) { if(f->next->fd == fd) { /* remove f->next from the list */ /* TODO: make this thread-safe */ to_remove = f->next; f->next = f->next->next; break; } f = f->next; } if(!to_remove) { eztrace_warn("Warning: when closing fd %d: could not find a matching file\n", fd); } else { to_remove->next = NULL; } pthread_rwlock_unlock(&open_files_lock); return to_remove; } struct ezt_file_handle* new_file(const char* filename) { /* todo: make sure the compiler is C11 compliant and knows _Atomic */ static _Atomic int next_file_ref=0; static _Atomic int next_io_handle_ref = 0; int file_ref = next_file_ref++; int string_ref = 0; int io_handle_ref = next_io_handle_ref++; eztrace_log(dbg_lvl_debug, "New file: %s. io handle=%d\n", filename, io_handle_ref); if(EZTRACE_SAFE) { string_ref = ezt_otf2_register_string(filename); OTF2_GlobalDefWriter_WriteIoHandle( _ezt_trace.global_def_writer, io_handle_ref, string_ref, file_ref, io_paradigm_ref_posix, OTF2_IO_HANDLE_FLAG_NONE, comm_self_ref, OTF2_UNDEFINED_IO_HANDLE); } struct ezt_file_handle* f = malloc(sizeof(struct ezt_file_handle)); f->io_handle_ref = io_handle_ref; f->stream=NULL; f->fd = -1; f->filename = strdup(filename); pthread_rwlock_wrlock(&open_files_lock); f->next = open_files; open_files = f; pthread_rwlock_unlock(&open_files_lock); return f; } struct ezt_file_handle* new_file_stream(const char* filename, FILE*stream) { struct ezt_file_handle* ret = new_file(filename); ret->stream = stream; return ret; } struct ezt_file_handle* new_file_fd(const char* filename, int fd) { struct ezt_file_handle* ret = new_file(filename); ret->fd = fd; return ret; } void otf2_fopen_file(const char* pathname, const char*mode, FILE*stream) { struct ezt_file_handle* handle = new_file_stream(pathname, stream); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { OTF2_EvtWriter_IoCreateHandle( evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref, char_to_mode(mode), char_to_cflag(mode), char_to_sflag(mode)); } EZTRACE_PROTECT_OFF(); } } void otf2_fclose_file(FILE* stream) { struct ezt_file_handle* handle = close_file(stream); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { if(handle) { OTF2_EvtWriter_IoDestroyHandle(evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref); free(handle); } } EZTRACE_PROTECT_OFF(); } } void otf2_open_file(const char*pathname, int flags, int fd) { struct ezt_file_handle* handle = new_file_fd(pathname, fd); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { OTF2_EvtWriter_IoCreateHandle( evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref, int_to_mode(flags), int_to_cflag(flags), int_to_sflag(flags)); } EZTRACE_PROTECT_OFF(); } } void otf2_dup_fd(int oldfd, int new_fd) { struct ezt_file_handle* old_handle = get_file_handle_fd(oldfd); struct ezt_file_handle* new_handle = NULL; if(old_handle) new_handle = new_file_fd(old_handle->filename, new_fd); else new_handle = new_file_fd("unknown_filename", new_fd); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { /* TODO: we should copy the flags from oldfd (except that flags are not stored by eztrace. */ OTF2_EvtWriter_IoCreateHandle( evt_writer, NULL, ezt_get_timestamp(), new_handle->io_handle_ref, OTF2_IO_ACCESS_MODE_READ_WRITE, OTF2_IO_CREATION_FLAG_NONE, OTF2_IO_STATUS_FLAG_NONE); } EZTRACE_PROTECT_OFF(); } } void otf2_close_file(int fd) { struct ezt_file_handle* handle = close_file_fd(fd); EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { if(handle) { OTF2_EvtWriter_IoDestroyHandle(evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref); free(handle); } } EZTRACE_PROTECT_OFF(); } } static int otf2_begin_operation(struct ezt_file_handle *handle, OTF2_IoOperationMode mode, size_t count) { int matching_id = -1; EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { if(handle && handle->io_handle_ref >= 0) { matching_id = get_new_matching_id(); OTF2_EvtWriter_IoOperationBegin(evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref, mode, OTF2_IO_OPERATION_FLAG_NONE, count, matching_id ); } } EZTRACE_PROTECT_OFF(); } return matching_id; } void otf2_begin_fd_operation(int fd, OTF2_IoOperationMode mode, size_t count, struct context*context) { context->handle = get_file_handle_fd(fd); if(context->handle) context->matching_id = otf2_begin_operation(context->handle, mode, count); else { if(mode==OTF2_IO_OPERATION_MODE_READ) eztrace_warn("read unknown fd %d\n", fd); else eztrace_warn("write unknown fd %d\n", fd); } } void otf2_begin_stream_operation(FILE* stream, OTF2_IoOperationMode mode, size_t count, struct context*context) { context->handle = get_file_handle_stream(stream); if(context->handle) context->matching_id = otf2_begin_operation(context->handle, mode, count); else { if(mode==OTF2_IO_OPERATION_MODE_READ) eztrace_warn("read unknown stream %p\n", stream); else eztrace_warn("write unknown stream %p\n", stream); } } void otf2_end_operation(struct context* context, size_t nbytes) { EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { if(context->handle && context->handle->io_handle_ref >= 0) { OTF2_EvtWriter_IoOperationComplete(evt_writer, NULL, ezt_get_timestamp(), context->handle->io_handle_ref, nbytes, context->matching_id); } } EZTRACE_PROTECT_OFF(); } } void otf2_end_fd_operation(struct context* context, size_t nbytes) { if(context->handle) otf2_end_operation(context, nbytes); } void otf2_end_stream_operation(struct context* context, size_t nbytes) { if(context->handle) otf2_end_operation(context, nbytes); } void otf2_seek_operation(struct ezt_file_handle *handle, off_t offset, int whence, off_t result) { EZTRACE_PROTECT { EZTRACE_PROTECT_ON(); if(EZTRACE_SAFE) { if(handle && handle->io_handle_ref >= 0) { OTF2_EvtWriter_IoSeek(evt_writer, NULL, ezt_get_timestamp(), handle->io_handle_ref, offset, whence, result); } } EZTRACE_PROTECT_OFF(); } } void otf2_fd_seek_operation(int fd, off_t offset, int whence, off_t result) { struct ezt_file_handle *handle = get_file_handle_fd(fd); otf2_seek_operation(handle, offset, whence, result); } void otf2_stream_seek_operation(FILE* stream, off_t offset, int whence, off_t result) { struct ezt_file_handle *handle = get_file_handle_stream(stream); otf2_seek_operation(handle, offset, whence, result); } eztrace-2.1/src/modules/posixio/posix_io_otf2.h000066400000000000000000000025221447213526500217100ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef POSIX_IO_OTF2_H #define POSIX_IO_OTF2_H #include #include struct ezt_file_handle { FILE* stream; int fd; int io_handle_ref; char *filename; struct ezt_file_handle*next; }; extern struct ezt_file_handle* open_files; struct context{ struct ezt_file_handle *handle; int matching_id; }; void init_otf2_posixio(); void otf2_fopen_file(const char* pathname, const char*mode, FILE*stream); void otf2_fclose_file(FILE* stream); void otf2_dup_fd(int oldfd, int new_fd); void otf2_open_file(const char*pathname, int flags, int fd); void otf2_close_file(int fd); void otf2_begin_fd_operation(int fd, OTF2_IoOperationMode mode, size_t count, struct context*context); void otf2_begin_stream_operation(FILE* stream, OTF2_IoOperationMode mode, size_t count, struct context*context); void otf2_end_fd_operation(struct context* context, size_t nbytes) ; void otf2_end_stream_operation(struct context* context, size_t nbytes); void otf2_fd_seek_operation(int fd, off_t offset, int whence, off_t result); void otf2_stream_seek_operation(FILE* stream, off_t offset, int whence, off_t result); #endif /* POSIX_IO_OTF2_H */ eztrace-2.1/src/modules/posixio/posixio.c000066400000000000000000000250431447213526500206150ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Telecom SudParis * See COPYING in top-level directory. */ #ifndef _REENTRANT #define _REENTRANT #endif #include "posix_io_otf2.h" #include #include /* crappy hack here: * we need to include fcntl.h so that O_* flags are defined * * but if we do so, the compiler complains about the prototype of open* functions * that should be variadic. * Since we can't wrap a variadic function, we need to include only the part of fcntl.h * that defines the O_* flags. * This part is in bits/fcntl.h but it is protected by #ifndef _FCNTL_H * So, let's define _FCNTL_H and hope everything is fine. */ #define _FCNTL_H #include #define CURRENT_MODULE posixio DECLARE_CURRENT_MODULE; /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls */ static int _posixio_initialized = 0; FILE *(*libfopen)(const char *pathname, const char *mode); FILE *fopen(const char *pathname, const char *mode) { INTERCEPT_FUNCTION("fopen", libfopen); FUNCTION_ENTRY; FILE* ret = libfopen(pathname, mode); if(ret) otf2_fopen_file(pathname, mode, ret); FUNCTION_EXIT; return ret; } FILE *(*libfdopen)(int fd, const char *mode); FILE *fdopen(int fd, const char *mode) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("fdopen", libfdopen); FILE* ret = libfdopen(fd, mode); /* TODO */ // struct ezt_file_handle*handle = get_file_handle_fd(fd); // if(handle) // handle->stream = ret; FUNCTION_EXIT; return ret; } FILE *(*libfreopen)(const char *pathname, const char *mode, FILE *stream); FILE *freopen(const char *pathname, const char *mode, FILE *stream) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("freopen", libfreopen); FILE* ret = libfreopen(pathname, mode, stream); if(ret) otf2_fopen_file(pathname, mode, ret); FUNCTION_EXIT; return ret; } int (*libfclose)(FILE *stream); int fclose(FILE *stream) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("fclose", libfclose); otf2_fclose_file(stream); int ret = libfclose(stream); FUNCTION_EXIT; return ret; } int (*libdup)(int oldfd); int dup(int oldfd) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("dup", libdup); int ret = libdup(oldfd); if(ret >=0) otf2_dup_fd(oldfd, ret); FUNCTION_EXIT; return ret; } int (*libdup2)(int oldfd, int newfd); int dup2(int oldfd, int newfd) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("dup2", libdup2); int ret = libdup2(oldfd, newfd); if(ret >=0) otf2_dup_fd(oldfd, newfd); FUNCTION_EXIT; return ret; } int (*libdup3)(int oldfd, int newfd, int flags); int dup3(int oldfd, int newfd, int flags) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("dup3", libdup3); int ret = libdup3(oldfd, newfd, flags); if(ret >=0) otf2_dup_fd(oldfd, newfd); FUNCTION_EXIT; return ret; } int (*libopen)(const char *pathname, int flags, mode_t mode); int open(const char *pathname, int flags, mode_t mode){ FUNCTION_ENTRY; INTERCEPT_FUNCTION("open", libopen); int ret = libopen(pathname, flags, mode); if(ret >=0) otf2_open_file(pathname, flags, ret); FUNCTION_EXIT; return ret; } int (*libopen64)(const char *pathname, int flags, mode_t mode); int open64(const char *pathname, int flags, mode_t mode){ FUNCTION_ENTRY; INTERCEPT_FUNCTION("open64", libopen64); int ret = libopen64(pathname, flags, mode); if(ret >=0) otf2_open_file(pathname, flags, ret); FUNCTION_EXIT; return ret; } int (*libcreat)(const char *pathname, mode_t mode); int creat(const char *pathname, mode_t mode) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("creat", libcreat); int ret = libcreat(pathname, mode); if(ret >=0) otf2_open_file(pathname, O_CREAT|O_WRONLY|O_TRUNC, ret); FUNCTION_EXIT; return ret; } int (*libopenat)(int dirfd, const char *pathname, int flags, mode_t mode); int openat(int dirfd, const char *pathname, int flags, mode_t mode) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("openat", libopenat); int ret = libopenat(dirfd, pathname, flags, mode); if(ret >=0) otf2_open_file(pathname, flags, ret); FUNCTION_EXIT; return ret; } int __openat64_(int dirfd, const char *pathname, int flags, mode_t mode) __attribute__((alias ("openat64"))); int (*libopenat64)(int dirfd, const char *pathname, int flags, mode_t mode); int openat64(int dirfd, const char *pathname, int flags, mode_t mode) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("openat64", libopenat64); int ret = libopenat64(dirfd, pathname, flags, mode); if(ret >=0) otf2_open_file(pathname, flags, ret); FUNCTION_EXIT; return ret; } int (*libclose)(int fd); int close(int fd) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("close", libclose); int ret =0; if(fd>2) { otf2_close_file(fd); ret = libclose(fd); } FUNCTION_EXIT; return ret; } ssize_t (*libread)(int fd, void* buf, size_t count); ssize_t read(int fd, void* buf, size_t count) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("read", libread); struct context context; otf2_begin_fd_operation(fd, OTF2_IO_OPERATION_MODE_READ, count, &context); ssize_t ret = libread(fd, buf, count); otf2_end_fd_operation(&context, ret); FUNCTION_EXIT; return ret; } ssize_t (*libwrite)(int fd, const void* buf, size_t count); ssize_t write(int fd, const void* buf, size_t count) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("write", libwrite); struct context context; otf2_begin_fd_operation(fd, OTF2_IO_OPERATION_MODE_WRITE, count, &context); ssize_t ret = libwrite(fd, buf, count); otf2_end_fd_operation(&context, ret); FUNCTION_EXIT; return ret; } /* pointers to actual posixio functions */ ssize_t (*libpread)(int fd, void* buf, size_t count, off_t offset); ssize_t (*libpwrite)(int fd, const void* buf, size_t count, off_t offset); ssize_t (*libreadv)(int fd, const struct iovec* iov, int iovcnt); ssize_t (*libwritev)(int fd, const struct iovec* iov, int iovcnt); size_t (*libfread)(void* ptr, size_t size, size_t nmemb, FILE* stream); size_t (*libfwrite)(const void* ptr, size_t size, size_t nmemb, FILE* stream); off_t (*liblseek)(int fd, off_t offset, int whence); ssize_t pread(int fd, void* buf, size_t count, off_t offset) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("pread", libpread); struct context context; otf2_fd_seek_operation(fd, offset, SEEK_SET, offset); otf2_begin_fd_operation(fd, OTF2_IO_OPERATION_MODE_READ, count, &context); ssize_t ret = libpread(fd, buf, count, offset); otf2_end_fd_operation(&context, ret); FUNCTION_EXIT; return ret; } ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("pwrite", libpwrite); struct context context; otf2_fd_seek_operation(fd, offset, SEEK_SET, offset); otf2_begin_fd_operation(fd, OTF2_IO_OPERATION_MODE_WRITE, count, &context); ssize_t ret = libpwrite(fd, buf, count, offset); otf2_end_fd_operation(&context, ret); FUNCTION_EXIT; return ret; } ssize_t readv(int fd, const struct iovec* iov, int iovcnt) { FUNCTION_ENTRY; INTERCEPT_FUNCTION("readv", libreadv); size_t count =0; for(int i=0; i #include #include #include #include #include #include #include #include #include /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls to mutex_lock for example */ static volatile int _pthread_initialized = 0; #define CURRENT_MODULE pthread DECLARE_CURRENT_MODULE; /* pointers to actual pthread functions */ int (*libpthread_mutex_lock)(pthread_mutex_t* mutex) = NULL; int (*libpthread_mutex_trylock)(pthread_mutex_t* mutex); int (*libpthread_mutex_unlock)(pthread_mutex_t* mutex); int (*libpthread_spin_lock)(pthread_spinlock_t* lock); int (*libpthread_spin_unlock)(pthread_spinlock_t* lock); int (*libpthread_spin_trylock)(pthread_spinlock_t* lock); int (*libpthread_barrier_wait)(pthread_barrier_t* barrier); int (*libpthread_sem_wait)(sem_t* sem); int (*libpthread_sem_post)(sem_t* sem); int (*libpthread_cond_init)(pthread_cond_t* __restrict _cond, __const pthread_condattr_t* __restrict _cond_attr); int (*libpthread_cond_wait)(pthread_cond_t* __restrict cond, pthread_mutex_t* __restrict mutex); int (*libpthread_cond_broadcast)(pthread_cond_t* cond); int (*libpthread_cond_signal)(pthread_cond_t* cond); int (*libpthread_cond_destroy)(pthread_cond_t* _cond); int (*libpthread_cond_timedwait)(pthread_cond_t* __restrict _cond, pthread_mutex_t* __restrict _mutex, __const struct timespec* __restrict _abstime); int (*libpthread_rwlock_rdlock)(pthread_rwlock_t* rwlock); int (*libpthread_rwlock_wrlock)(pthread_rwlock_t* rwlock); int (*libpthread_rwlock_unlock)(pthread_rwlock_t* rwlock); /* Mutex-related callbacks */ int pthread_mutex_lock(pthread_mutex_t* mutex) { FUNCTION_ENTRY_WITH_ARGS(mutex); /* If the current file's constructor has not been called yet, this means that the application is being initialized and that there's only one thread. Thus, we do not to call mutex_lock for real. If you try to call mutex_lock in that case, you'll get a SIGSEVG since dlsym was not called yet for mutex_lock */ int ret = 0; if (_pthread_initialized) { ret = libpthread_mutex_lock(mutex); } /* _pthread_initialized is set to 0. The application is initializing, so don't do anything */ FUNCTION_EXIT; return ret; } int pthread_mutex_trylock(pthread_mutex_t* mutex) { FUNCTION_ENTRY_WITH_ARGS(mutex); int ret =0; if (_pthread_initialized) { ret = libpthread_mutex_trylock(mutex); } FUNCTION_EXIT_WITH_ARGS(ret); return ret; } int pthread_mutex_unlock(pthread_mutex_t* mutex) { int ret = 0; if (_pthread_initialized) { FUNCTION_ENTRY_WITH_ARGS(mutex); ret = libpthread_mutex_unlock(mutex); FUNCTION_EXIT; } return ret; } /* Spinlock-related callbacks */ int pthread_spin_lock(pthread_spinlock_t* lock) { FUNCTION_ENTRY_WITH_ARGS(lock); INTERCEPT_FUNCTION("pthread_spin_lock", libpthread_spin_lock); int ret = libpthread_spin_lock(lock); FUNCTION_EXIT; return ret; } int pthread_spin_unlock(pthread_spinlock_t* lock) { FUNCTION_ENTRY_WITH_ARGS(lock); INTERCEPT_FUNCTION("pthread_spin_unlock", libpthread_spin_unlock); int ret = libpthread_spin_unlock(lock); FUNCTION_EXIT; return ret; } int pthread_spin_trylock(pthread_spinlock_t* lock) { FUNCTION_ENTRY_WITH_ARGS(lock); INTERCEPT_FUNCTION("pthread_spin_trylock", libpthread_spin_trylock); int ret = libpthread_spin_trylock(lock); FUNCTION_EXIT_WITH_ARGS(ret); return ret; } /* Barrier-related callbacks */ int pthread_barrier_wait(pthread_barrier_t* barrier) { FUNCTION_ENTRY_WITH_ARGS(barrier); INTERCEPT_FUNCTION("pthread_barrier_wait", libpthread_barrier_wait); int ret = libpthread_barrier_wait(barrier); FUNCTION_EXIT; return ret; } /* Semaphore-related callbacks */ int sem_wait(sem_t* sem) { FUNCTION_ENTRY_WITH_ARGS(sem); INTERCEPT_FUNCTION("sem_wait", libpthread_sem_wait); int ret = libpthread_sem_wait(sem); FUNCTION_EXIT; return ret; } int sem_post(sem_t* sem) { FUNCTION_ENTRY_WITH_ARGS(sem); INTERCEPT_FUNCTION("sem_post", libpthread_sem_post); int ret = libpthread_sem_post(sem); FUNCTION_EXIT; return ret; } /* Condition-related callbacks */ /* We don't actually need these (init, destroy) functions, but if we don't * catch these functions, it will lead to using somehow different implementations * (ie. cond_init from one implementation and cond_wait from another) that are * not compatible, resulting in data corruption :( */ int pthread_cond_init(pthread_cond_t* __restrict cond, __const pthread_condattr_t* __restrict _cond_attr) { FUNCTION_ENTRY_WITH_ARGS(cond); INTERCEPT_FUNCTION("pthread_cond_init", libpthread_cond_init); int ret = libpthread_cond_init(cond, _cond_attr); FUNCTION_EXIT; return ret; } int pthread_cond_destroy(pthread_cond_t* cond) { FUNCTION_ENTRY_WITH_ARGS(cond); INTERCEPT_FUNCTION("pthread_cond_destroy", libpthread_cond_destroy); int ret = libpthread_cond_destroy(cond); FUNCTION_EXIT; return ret; } int pthread_cond_wait(pthread_cond_t* __restrict cond, pthread_mutex_t* __restrict mutex) { FUNCTION_ENTRY_WITH_ARGS(cond, mutex); INTERCEPT_FUNCTION("pthread_cond_wait", libpthread_cond_wait); int ret = libpthread_cond_wait(cond, mutex); FUNCTION_EXIT; return ret; } int pthread_cond_timedwait(pthread_cond_t* __restrict cond, pthread_mutex_t* __restrict mutex, __const struct timespec* __restrict _abstime) { FUNCTION_ENTRY_WITH_ARGS(cond, mutex); INTERCEPT_FUNCTION("pthread_cond_timedwait", libpthread_cond_timedwait); int ret = libpthread_cond_timedwait(cond, mutex, _abstime); /* todo: what if the timer expires ? */ FUNCTION_EXIT; return ret; } int pthread_cond_broadcast(pthread_cond_t* cond) { FUNCTION_ENTRY_WITH_ARGS(cond); INTERCEPT_FUNCTION("pthread_cond_broadcast", libpthread_cond_broadcast); int ret = libpthread_cond_broadcast(cond); FUNCTION_EXIT; return ret; } int pthread_cond_signal(pthread_cond_t* cond) { FUNCTION_ENTRY_WITH_ARGS(cond); INTERCEPT_FUNCTION("pthread_cond_signal", libpthread_cond_signal); int ret = libpthread_cond_signal(cond); FUNCTION_EXIT; return ret; } /* RWLock-related callbacks */ int pthread_rwlock_rdlock(pthread_rwlock_t* rwlock) { FUNCTION_ENTRY_WITH_ARGS(rwlock); INTERCEPT_FUNCTION("pthread_rwlock_rdlock", libpthread_rwlock_rdlock); int ret = libpthread_rwlock_rdlock(rwlock); FUNCTION_EXIT; return ret; } int pthread_rwlock_wrlock(pthread_rwlock_t* rwlock) { FUNCTION_ENTRY_WITH_ARGS(rwlock); INTERCEPT_FUNCTION("pthread_rwlock_wrlock", libpthread_rwlock_wrlock); int ret = libpthread_rwlock_wrlock(rwlock); FUNCTION_EXIT; return ret; } int pthread_rwlock_unlock(pthread_rwlock_t* rwlock) { FUNCTION_ENTRY_WITH_ARGS(rwlock); INTERCEPT_FUNCTION("pthread_rwlock_unlock", libpthread_rwlock_unlock); int ret = libpthread_rwlock_unlock(rwlock); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(pthread) INTERCEPT3("pthread_mutex_lock", libpthread_mutex_lock) INTERCEPT3("pthread_mutex_trylock", libpthread_mutex_trylock) INTERCEPT3("pthread_mutex_unlock", libpthread_mutex_unlock) INTERCEPT3("pthread_spin_lock", libpthread_spin_lock) INTERCEPT3("pthread_spin_unlock", libpthread_spin_unlock) INTERCEPT3("pthread_spin_trylock", libpthread_spin_trylock) INTERCEPT3("pthread_barrier_wait", libpthread_barrier_wait) INTERCEPT3("sem_wait", libpthread_sem_wait) INTERCEPT3("sem_post", libpthread_sem_post) INTERCEPT3("pthread_cond_wait", libpthread_cond_wait) INTERCEPT3("pthread_cond_timedwait", libpthread_cond_timedwait) INTERCEPT3("pthread_cond_broadcast", libpthread_cond_broadcast) INTERCEPT3("pthread_cond_signal", libpthread_cond_signal) INTERCEPT3("pthread_cond_init", libpthread_cond_init) INTERCEPT3("pthread_cond_destroy", libpthread_cond_destroy) INTERCEPT3("pthread_rwlock_rdlock", libpthread_rwlock_rdlock) INTERCEPT3("pthread_rwlock_wrlock", libpthread_rwlock_wrlock) INTERCEPT3("pthread_rwlock_unlock", libpthread_rwlock_unlock) PPTRACE_END_INTERCEPT_FUNCTIONS(pthread) static void init_pthread() { INSTRUMENT_FUNCTIONS(pthread); if (eztrace_autostart_enabled()) eztrace_start(); _pthread_initialized = 1; } static void finalize_pthread() { _pthread_initialized = 0; eztrace_stop(); } static void _pthread_init(void) __attribute__((constructor)); static void _pthread_init(void) { eztrace_log(dbg_lvl_debug, "eztrace_pthread constructor starts\n"); EZT_REGISTER_MODULE(pthread, "Module for pthread synchronization functions (mutex, spinlock, etc.)", init_pthread, finalize_pthread); eztrace_log(dbg_lvl_debug, "eztrace_pthread constructor ends\n"); } eztrace-2.1/src/modules/starpu/000077500000000000000000000000001447213526500165775ustar00rootroot00000000000000eztrace-2.1/src/modules/starpu/CMakeLists.txt000066400000000000000000000016631447213526500213450ustar00rootroot00000000000000# set(CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS}") # foreach(libdir ${STARPU_LIBRARY_DIRS}) # list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}") # endforeach() # string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES}") check_function_exists(starpu_mpi_data_register_comm STARPU_MPI_DATA_REGISTER_COMM_FOUND) if ( STARPU_MPI_DATA_REGISTER_COMM_FOUND ) add_definitions(-DHAVE_STARPU_MPI_DATA_REGISTER_COMM) endif() # Include directories #include_directories( # ${MPI_INCLUDE_PATH} # ) # Libraries diretory # ${STARPU_LIBRARY_DIRS} # Create : libeztrace-starpu.so add_library(eztrace-starpu SHARED starpu.c ) target_include_directories(eztrace-starpu PRIVATE ${STARPU_INCLUDE_DIRS} ) target_link_libraries(eztrace-starpu PRIVATE dl eztrace-core eztrace-lib ${STARPU_LIBRARIES} ) install(TARGETS eztrace-starpu LIBRARY DESTINATION lib ) eztrace-2.1/src/modules/starpu/starpu.c000066400000000000000000001043101447213526500202600ustar00rootroot00000000000000/* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #ifdef USE_MPI #include #endif #define CURRENT_MODULE starpu DECLARE_CURRENT_MODULE; /* set to 1 when all the hooks are set. * This is usefull in order to avoid recursive calls */ static int _starpu_initialized = 0; // Internals void (*lib_starpu_driver_start_job) (void *args, void *j, void *codelet_start, int rank, int profiling); void (*lib_starpu_driver_end_job) (void * args, void *j, void *perf_arch, void *codelet_end, int rank, int profiling); // API void (*libstarpu_cublas_init) (); void (*libstarpu_cublas_shutdown) (); int (*libstarpu_init) (struct starpu_conf* conf); void (*libstarpu_pause) (); void (*libstarpu_resume) (); void (*libstarpu_shutdown) (); void (*libstarpu_data_unregister) (starpu_data_handle_t handle); void (*libstarpu_data_unregister_no_coherency) (starpu_data_handle_t handle); void (*libstarpu_data_unregister_submit) (starpu_data_handle_t handle); void (*libstarpu_data_invalidate) (starpu_data_handle_t handle); void (*libstarpu_data_invalidate_submit) (starpu_data_handle_t handle); int (*libstarpu_data_acquire) (starpu_data_handle_t handle, enum starpu_data_access_mode mode); int (*libstarpu_data_acquire_on_node) (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode); int (*libstarpu_data_acquire_cb) (starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (* callback), void *arg); int (*libstarpu_data_acquire_on_node_cb) (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (* callback), void *arg); void (*libstarpu_data_release) (starpu_data_handle_t handle); void (*libstarpu_data_release_on_node) (starpu_data_handle_t handle, int node); int (*libstarpu_data_request_allocation) (starpu_data_handle_t handle, unsigned node); uintptr_t (*libstarpu_malloc_on_node) (unsigned dst_node, size_t size); void (*libstarpu_free_on_node) (unsigned dst_node, uintptr_t addr, size_t size); #ifdef USE_MPI int (*libstarpu_mpi_isend) (starpu_data_handle_t data_handle, starpu_mpi_req* req, int dest, int mpi_tag, MPI_Comm comm); int (*libstarpu_mpi_irecv) (starpu_data_handle_t data_handle, starpu_mpi_req* req, int source, int mpi_tag, MPI_Comm comm); int (*libstarpu_mpi_send) (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm); int (*libstarpu_mpi_recv) (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, MPI_Status* status); int (*libstarpu_mpi_isend_detached) (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm, void (* callback)(void *arg), void *arg); int (*libstarpu_mpi_irecv_detached) (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, void (* callback)(void *arg), void *arg); int (*libstarpu_mpi_wait) (starpu_mpi_req* req, MPI_Status* status); int (*libstarpu_mpi_test) (starpu_mpi_req* req, int* flag, MPI_Status* status); int (*libstarpu_mpi_barrier) (MPI_Comm comm); int (*libstarpu_mpi_init) (int* argc, char*** argv, int initialize_mpi); int (*libstarpu_mpi_initialize) (); int (*libstarpu_mpi_initialize_extended) (int* rank, int* world_size); int (*libstarpu_mpi_shutdown) (); void (*libstarpu_mpi_get_data_on_node) (MPI_Comm comm, starpu_data_handle_t data_handle, int node); void (*libstarpu_mpi_get_data_on_node_detached) (MPI_Comm comm, starpu_data_handle_t data_handle, int node, void (* callback)(void *arg), void *arg); void (*libstarpu_mpi_redux_data) (MPI_Comm comm, starpu_data_handle_t data_handle); int (*libstarpu_mpi_scatter_detached) (starpu_data_handle_t* data_handles, int count, int root, MPI_Comm comm, void (* scallback)(void *arg), void *arg,void (*rcallback)(void *), void *rarg); int (*libstarpu_mpi_gather_detached) (starpu_data_handle_t* data_handles, int count, int root, MPI_Comm comm, void (* scallback)(void *arg), void *arg, void (*rcallback)(void *), void *rarg); int (*libstarpu_mpi_isend_detached_unlock_tag) (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm, starpu_tag_t tag); int (*libstarpu_mpi_irecv_detached_unlock_tag) (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, starpu_tag_t tag); int (*libstarpu_mpi_isend_array_detached_unlock_tag) (unsigned array_size, starpu_data_handle_t* data_handle, int* dest, int* mpi_tag, MPI_Comm* comm, starpu_tag_t tag); int (*libstarpu_mpi_irecv_array_detached_unlock_tag) (unsigned array_size, starpu_data_handle_t* data_handle, int* source, int* mpi_tag, MPI_Comm* comm, starpu_tag_t tag); void (*libstarpu_mpi_comm_amounts_retrieve) (size_t* comm_amounts); void (*libstarpu_mpi_cache_flush) (MPI_Comm comm, starpu_data_handle_t data_handle); void (*libstarpu_mpi_cache_flush_all_data) (MPI_Comm comm); #ifndef HAVE_STARPU_MPI_DATA_REGISTER_COMM void (*libstarpu_mpi_data_register) (starpu_data_handle_t data_handle, int tag, int rank); #else void (*libstarpu_mpi_data_register_comm) (starpu_data_handle_t data_handle, int tag, int rank, MPI_Comm comm); #endif #endif // USE_MPI void (*libstarpu_sched_ctx_add_workers) (int* workerids_ctx, unsigned nworkers_ctx, unsigned sched_ctx_id); void (*libstarpu_sched_ctx_remove_workers) (int* workerids_ctx, unsigned nworkers_ctx, unsigned sched_ctx_id); void (*libstarpu_sched_ctx_delete) (unsigned sched_ctx_id); void (*libstarpu_sched_ctx_set_inheritor) (unsigned sched_ctx_id, unsigned inheritor); void (*libstarpu_sched_ctx_set_context) (unsigned* sched_ctx_id); unsigned (*libstarpu_sched_ctx_get_context) (); void (*libstarpu_sched_ctx_stop_task_submission) (); void (*libstarpu_sched_ctx_finished_submit) (unsigned sched_ctx_id); struct starpu_worker_collection * (*libstarpu_sched_ctx_create_worker_collection) (unsigned sched_ctx_id, enum starpu_worker_collection_type type); void (*libstarpu_sched_ctx_delete_worker_collection) (unsigned sched_ctx_id); struct starpu_worker_collection * (*libstarpu_sched_ctx_get_worker_collection) (unsigned sched_ctx_id); int (*libstarpu_prefetch_task_input_on_node) (struct starpu_task* task, unsigned node); int (*libstarpu_malloc) (void** A, size_t dim); int (*libstarpu_free) (void* A); int (*libstarpu_malloc_flags) (void** A, size_t dim, int flags); int (*libstarpu_free_flags) (void* A, size_t dim, int flags); int (*libstarpu_tag_wait) (starpu_tag_t id); int (*libstarpu_tag_wait_array) (unsigned ntags, starpu_tag_t* id); void (*libstarpu_tag_notify_from_apps) (starpu_tag_t id); void (*libstarpu_task_init) (struct starpu_task* task); void (*libstarpu_task_clean) (struct starpu_task* task); struct starpu_task * (*libstarpu_task_create) (); void (*libstarpu_task_destroy) (struct starpu_task* task); int (*libstarpu_task_submit) (struct starpu_task* task); int (*libstarpu_task_submit_to_ctx) (struct starpu_task* task, unsigned sched_ctx_id); int (*libstarpu_task_wait) (struct starpu_task* task); int (*libstarpu_task_wait_for_all) (); int (*libstarpu_task_wait_for_all_in_ctx) (unsigned sched_ctx_id); int (*libstarpu_task_wait_for_no_ready) (); int (*libstarpu_task_nready) (); int (*libstarpu_task_nsubmitted) (); struct starpu_task * (*libstarpu_task_dup) (struct starpu_task* task); void (*libstarpu_task_bundle_create) (starpu_task_bundle_t* bundle); int (*libstarpu_task_bundle_insert) (starpu_task_bundle_t bundle, struct starpu_task* task); int (*libstarpu_task_bundle_remove) (starpu_task_bundle_t bundle, struct starpu_task* task); void (*libstarpu_task_bundle_close) (starpu_task_bundle_t bundle); void (*libstarpu_create_sync_task) (starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t* deps, void (* callback)(void *), void *callback_arg); void (*libstarpu_execute_on_each_worker) (void (* func)(void *), void *arg, uint32_t where); void (*libstarpu_execute_on_each_worker_ex) (void (* func)(void *), void *arg, uint32_t where, const char * name); void (*libstarpu_execute_on_specific_workers) (void (* func)(void*), void * arg, unsigned num_workers, unsigned * workers, const char * name); int (*libstarpu_data_cpy) (starpu_data_handle_t dst_handle, starpu_data_handle_t src_handle, int asynchronous, void (* callback_func)(void*), void *callback_arg); int starpu_run_job_id = -1; static void starpu_register_functions() { if(starpu_run_job_id < 0 ) { starpu_run_job_id = ezt_otf2_register_function("StarPU job"); } } #define STARPU_ENTER(event_id) do { \ if(event_id<0) { \ starpu_register_functions(); \ eztrace_assert(event_id >= 0); \ } \ EZTRACE_SHOULD_TRACE(OTF2_EvtWriter_Enter(evt_writer, \ NULL, \ ezt_get_timestamp(), \ event_id)); \ }while(0) #define STARPU_LEAVE(event_id) do { \ if(event_id<0) { \ starpu_register_functions(); \ eztrace_assert(event_id >= 0); \ } \ EZTRACE_SHOULD_TRACE(OTF2_EvtWriter_Leave(evt_writer, \ NULL, \ ezt_get_timestamp(), \ event_id)); \ }while(0) void _starpu_driver_start_job (void *args, void *j, void *codelet_start, int rank, int profiling) { FUNCTION_ENTRY_WITH_ARGS (args, j, codelet_start, rank, profiling); lib_starpu_driver_start_job (args, j, codelet_start, rank, profiling); FUNCTION_EXIT; STARPU_ENTER(starpu_run_job_id); } void _starpu_driver_end_job (void* args, void* j, void* perf_arch, void *codelet_end, int rank, int profiling) { STARPU_LEAVE(starpu_run_job_id); FUNCTION_ENTRY_WITH_ARGS (args, j, perf_arch, codelet_end, rank, profiling) lib_starpu_driver_end_job (args, j, perf_arch, codelet_end, rank, profiling); FUNCTION_EXIT; } void starpu_cublas_init () { FUNCTION_ENTRY; libstarpu_cublas_init (); FUNCTION_EXIT; } void starpu_cublas_shutdown () { FUNCTION_ENTRY; libstarpu_cublas_shutdown (); FUNCTION_EXIT; } int starpu_init (struct starpu_conf* conf) { FUNCTION_ENTRY; int ret = libstarpu_init (conf); FUNCTION_EXIT; return ret; } void starpu_pause () { FUNCTION_ENTRY; libstarpu_pause (); FUNCTION_EXIT; } void starpu_resume () { FUNCTION_ENTRY; libstarpu_resume (); FUNCTION_EXIT; } void starpu_shutdown () { FUNCTION_ENTRY; libstarpu_shutdown (); FUNCTION_EXIT; } void starpu_data_unregister (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_unregister (handle); FUNCTION_EXIT; } void starpu_data_unregister_no_coherency (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_unregister_no_coherency (handle); FUNCTION_EXIT; } void starpu_data_unregister_submit (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_unregister_submit (handle); FUNCTION_EXIT; } void starpu_data_invalidate (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_invalidate (handle); FUNCTION_EXIT; } void starpu_data_invalidate_submit (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_invalidate_submit (handle); FUNCTION_EXIT; } int starpu_data_acquire (starpu_data_handle_t handle, enum starpu_data_access_mode mode) { FUNCTION_ENTRY_WITH_ARGS(handle, mode); int ret = libstarpu_data_acquire (handle, mode); FUNCTION_EXIT; return ret; } int starpu_data_acquire_on_node (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode) { FUNCTION_ENTRY_WITH_ARGS(handle, node, mode); int ret = libstarpu_data_acquire_on_node (handle, node, mode); FUNCTION_EXIT; return ret; } int starpu_data_acquire_cb (starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (* callback)(void *), void *arg) { FUNCTION_ENTRY_WITH_ARGS(handle, mode, callback, arg); int ret = libstarpu_data_acquire_cb (handle, mode, callback, arg); FUNCTION_EXIT; return ret; } int starpu_data_acquire_on_node_cb (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (* callback)(void *), void *arg) { FUNCTION_ENTRY_WITH_ARGS(handle, node, mode, callback, arg); int ret = libstarpu_data_acquire_on_node_cb (handle, node, mode, callback, arg); FUNCTION_EXIT; return ret; } void starpu_data_release (starpu_data_handle_t handle) { FUNCTION_ENTRY_WITH_ARGS(handle); libstarpu_data_release (handle); FUNCTION_EXIT; } void starpu_data_release_on_node (starpu_data_handle_t handle, int node) { FUNCTION_ENTRY_WITH_ARGS(handle, node); libstarpu_data_release_on_node (handle, node); FUNCTION_EXIT; } int starpu_data_request_allocation (starpu_data_handle_t handle, unsigned node) { FUNCTION_ENTRY_WITH_ARGS(handle, node); int ret = libstarpu_data_request_allocation (handle, node); FUNCTION_EXIT; return ret; } uintptr_t starpu_malloc_on_node (unsigned dst_node, size_t size) { FUNCTION_ENTRY_WITH_ARGS(dst_node, size); uintptr_t ret = libstarpu_malloc_on_node (dst_node, size); FUNCTION_EXIT; return ret; } void starpu_free_on_node (unsigned dst_node, uintptr_t addr, size_t size) { FUNCTION_ENTRY_WITH_ARGS(dst_node, addr, size); libstarpu_free_on_node (dst_node, addr, size); FUNCTION_EXIT; } #ifdef USE_MPI int starpu_mpi_isend (starpu_data_handle_t data_handle, starpu_mpi_req* req, int dest, int mpi_tag, MPI_Comm comm) { FUNCTION_ENTRY_WITH_ARGS(data_handle, req, dest, mpi_tag, comm); int ret = libstarpu_mpi_isend (data_handle, req, dest, mpi_tag, comm); FUNCTION_EXIT; return ret; } int starpu_mpi_irecv (starpu_data_handle_t data_handle, starpu_mpi_req* req, int source, int mpi_tag, MPI_Comm comm) { FUNCTION_ENTRY_WITH_ARGS(data_handle, req, source, mpi_tag); int ret = libstarpu_mpi_irecv (data_handle, req, source, mpi_tag, comm); FUNCTION_EXIT; return ret; } int starpu_mpi_send (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm) { FUNCTION_ENTRY_WITH_ARGS(data_handle, dest, mpi_tag, comm); int ret = libstarpu_mpi_send (data_handle, dest, mpi_tag, comm); FUNCTION_EXIT; return ret; } int starpu_mpi_recv (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, MPI_Status* status) { FUNCTION_ENTRY_WITH_ARGS(data_handle, source, mpi_tag, comm); int ret = libstarpu_mpi_recv (data_handle, source, mpi_tag, comm, status); FUNCTION_EXIT; return ret; } int starpu_mpi_isend_detached (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm, void (* callback)(void *arg), void *arg) { FUNCTION_ENTRY_WITH_ARGS(data_handle, dest, mpi_tag, comm); int ret = libstarpu_mpi_isend_detached (data_handle, dest, mpi_tag, comm, callback, arg); FUNCTION_EXIT; return ret; } int starpu_mpi_irecv_detached (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, void (* callback)(void *arg), void *arg) { FUNCTION_ENTRY_WITH_ARGS(data_handle, source, mpi_tag, comm); int ret = libstarpu_mpi_irecv_detached (data_handle, source, mpi_tag, comm, callback, arg); FUNCTION_EXIT; return ret; } int starpu_mpi_wait (starpu_mpi_req* req, MPI_Status* status) { FUNCTION_ENTRY_WITH_ARGS(req, status); int ret = libstarpu_mpi_wait (req, status); FUNCTION_EXIT; return ret; } int starpu_mpi_test (starpu_mpi_req* req, int* flag, MPI_Status* status) { FUNCTION_ENTRY_WITH_ARGS(req, flag, status); int ret = libstarpu_mpi_test (req, flag, status); FUNCTION_EXIT; return ret; } int starpu_mpi_barrier (MPI_Comm comm) { FUNCTION_ENTRY_WITH_ARGS(comm); int ret = libstarpu_mpi_barrier (comm); FUNCTION_EXIT; return ret; } int starpu_mpi_init (int* argc, char*** argv, int initialize_mpi) { FUNCTION_ENTRY_WITH_ARGS(argc, argv, initialize_mpi); int ret = libstarpu_mpi_init (argc, argv, initialize_mpi); FUNCTION_EXIT; return ret; } int starpu_mpi_initialize () { FUNCTION_ENTRY; int ret = libstarpu_mpi_initialize (); FUNCTION_EXIT; return ret; } int starpu_mpi_initialize_extended (int* rank, int* world_size) { FUNCTION_ENTRY_WITH_ARGS(rank, world_size); int ret = libstarpu_mpi_initialize_extended (rank, world_size); FUNCTION_EXIT; return ret; } int starpu_mpi_shutdown () { FUNCTION_ENTRY; int ret = libstarpu_mpi_shutdown (); FUNCTION_EXIT; return ret; } void starpu_mpi_get_data_on_node (MPI_Comm comm, starpu_data_handle_t data_handle, int node) { FUNCTION_ENTRY_WITH_ARGS(comm, data_handle, node); libstarpu_mpi_get_data_on_node (comm, data_handle, node); FUNCTION_EXIT; } void starpu_mpi_get_data_on_node_detached (MPI_Comm comm, starpu_data_handle_t data_handle, int node, void (* callback)(void *arg), void *arg) { FUNCTION_ENTRY_WITH_ARGS(comm, data_handle, node); libstarpu_mpi_get_data_on_node_detached (comm, data_handle, node, callback, arg); FUNCTION_EXIT; } void starpu_mpi_redux_data (MPI_Comm comm, starpu_data_handle_t data_handle) { FUNCTION_ENTRY_WITH_ARGS(comm, data_handle); libstarpu_mpi_redux_data (comm, data_handle); FUNCTION_EXIT; } int starpu_mpi_scatter_detached (starpu_data_handle_t* data_handles, int count, int root, MPI_Comm comm, void (* scallback)(void *arg), void *arg, void (*rcallback)(void *), void *rarg) { FUNCTION_ENTRY_WITH_ARGS(data_handles, count, root, comm); int ret = libstarpu_mpi_scatter_detached (data_handles, count, root, comm, scallback, arg, rcallback, rarg); FUNCTION_EXIT; return ret; } int starpu_mpi_gather_detached (starpu_data_handle_t* data_handles, int count, int root, MPI_Comm comm, void (* scallback)(void *arg), void *arg, void (*rcallback)(void *), void *rarg) { FUNCTION_ENTRY_WITH_ARGS(data_handles, count, root, comm); int ret = libstarpu_mpi_gather_detached (data_handles, count, root, comm, scallback, arg, rcallback, rarg); FUNCTION_EXIT; return ret; } int starpu_mpi_isend_detached_unlock_tag (starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm, starpu_tag_t tag) { FUNCTION_ENTRY_WITH_ARGS(data_handle, dest, mpi_tag, comm); int ret = libstarpu_mpi_isend_detached_unlock_tag (data_handle, dest, mpi_tag, comm, tag); FUNCTION_EXIT; return ret; } int starpu_mpi_irecv_detached_unlock_tag (starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, starpu_tag_t tag) { FUNCTION_ENTRY_WITH_ARGS(data_handle, source, mpi_tag, comm); int ret = libstarpu_mpi_irecv_detached_unlock_tag (data_handle, source, mpi_tag, comm, tag); FUNCTION_EXIT; return ret; } int starpu_mpi_isend_array_detached_unlock_tag (unsigned array_size, starpu_data_handle_t* data_handle, int* dest, int* mpi_tag, MPI_Comm* comm, starpu_tag_t tag) { FUNCTION_ENTRY_WITH_ARGS(array_size, data_handle, dest, mpi_tag); int ret = libstarpu_mpi_isend_array_detached_unlock_tag (array_size, data_handle, dest, mpi_tag, comm, tag); FUNCTION_EXIT; return ret; } int starpu_mpi_irecv_array_detached_unlock_tag (unsigned array_size, starpu_data_handle_t* data_handle, int* source, int* mpi_tag, MPI_Comm* comm, starpu_tag_t tag) { FUNCTION_ENTRY_WITH_ARGS(array_size, data_handle, source, mpi_tag); int ret = libstarpu_mpi_irecv_array_detached_unlock_tag (array_size, data_handle, source, mpi_tag, comm, tag); FUNCTION_EXIT; return ret; } void starpu_mpi_comm_amounts_retrieve (size_t* comm_amounts) { FUNCTION_ENTRY_WITH_ARGS(comm_amounts); libstarpu_mpi_comm_amounts_retrieve (comm_amounts); FUNCTION_EXIT; } void starpu_mpi_cache_flush (MPI_Comm comm, starpu_data_handle_t data_handle) { FUNCTION_ENTRY_WITH_ARGS(comm, data_handle); libstarpu_mpi_cache_flush (comm, data_handle); FUNCTION_EXIT; } void starpu_mpi_cache_flush_all_data (MPI_Comm comm) { FUNCTION_ENTRY_WITH_ARGS(comm); libstarpu_mpi_cache_flush_all_data (comm); FUNCTION_EXIT; } #ifndef HAVE_STARPU_MPI_DATA_REGISTER_COMM void starpu_mpi_data_register (starpu_data_handle_t data_handle, int tag, int rank) { FUNCTION_ENTRY; libstarpu_mpi_data_register (data_handle, tag, rank); FUNCTION_EXIT; } #else void starpu_mpi_data_register_comm(starpu_data_handle_t data_handle, int tag, int rank, MPI_Comm comm) { FUNCTION_ENTRY; libstarpu_mpi_data_register_comm (data_handle, tag, rank, comm); FUNCTION_EXIT; } #endif #endif void starpu_sched_ctx_add_workers (int* workerids_ctx, unsigned nworkers_ctx, unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(workerids_ctx, nworkers_ctx, sched_ctx_id); libstarpu_sched_ctx_add_workers (workerids_ctx, nworkers_ctx, sched_ctx_id); FUNCTION_EXIT; } void starpu_sched_ctx_remove_workers (int* workerids_ctx, unsigned nworkers_ctx, unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(workerids_ctx, nworkers_ctx, sched_ctx_id); libstarpu_sched_ctx_remove_workers (workerids_ctx, nworkers_ctx, sched_ctx_id); FUNCTION_EXIT; } void starpu_sched_ctx_delete (unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); libstarpu_sched_ctx_delete (sched_ctx_id); FUNCTION_EXIT; } void starpu_sched_ctx_set_inheritor (unsigned sched_ctx_id, unsigned inheritor) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id, inheritor); libstarpu_sched_ctx_set_inheritor (sched_ctx_id, inheritor); FUNCTION_EXIT; } void starpu_sched_ctx_set_context (unsigned* sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); libstarpu_sched_ctx_set_context (sched_ctx_id); FUNCTION_EXIT; } unsigned starpu_sched_ctx_get_context () { FUNCTION_ENTRY; unsigned ret = libstarpu_sched_ctx_get_context (); FUNCTION_EXIT; return ret; } void starpu_sched_ctx_stop_task_submission () { FUNCTION_ENTRY; libstarpu_sched_ctx_stop_task_submission (); FUNCTION_EXIT; } void starpu_sched_ctx_finished_submit (unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); libstarpu_sched_ctx_finished_submit (sched_ctx_id); FUNCTION_EXIT; } struct starpu_worker_collection * starpu_sched_ctx_create_worker_collection (unsigned sched_ctx_id, enum starpu_worker_collection_type type) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id, type); struct starpu_worker_collection * ret = libstarpu_sched_ctx_create_worker_collection (sched_ctx_id, type); FUNCTION_EXIT(ret); return ret; } void starpu_sched_ctx_delete_worker_collection (unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); libstarpu_sched_ctx_delete_worker_collection (sched_ctx_id); FUNCTION_EXIT; } struct starpu_worker_collection * starpu_sched_ctx_get_worker_collection (unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); struct starpu_worker_collection * ret = libstarpu_sched_ctx_get_worker_collection (sched_ctx_id); FUNCTION_EXIT; return ret; } int starpu_prefetch_task_input_on_node (struct starpu_task* task, unsigned node) { FUNCTION_ENTRY_WITH_ARGS(task, node); int ret = libstarpu_prefetch_task_input_on_node (task, node); FUNCTION_EXIT; return ret; } int starpu_malloc (void** A, size_t dim) { FUNCTION_ENTRY_WITH_ARGS(A, dim); int ret = libstarpu_malloc (A, dim); FUNCTION_EXIT; return ret; } int starpu_free (void* A) { FUNCTION_ENTRY_WITH_ARGS(A); int ret = libstarpu_free (A); FUNCTION_EXIT; return ret; } int starpu_malloc_flags (void** A, size_t dim, int flags) { FUNCTION_ENTRY_WITH_ARGS(A, dim, flags); int ret = libstarpu_malloc_flags (A, dim, flags); FUNCTION_EXIT; return ret; } int starpu_free_flags (void* A, size_t dim, int flags) { FUNCTION_ENTRY_WITH_ARGS(A, dim, flags); int ret = libstarpu_free_flags (A, dim, flags); FUNCTION_EXIT; return ret; } int starpu_tag_wait (starpu_tag_t id) { FUNCTION_ENTRY_WITH_ARGS(id); int ret = libstarpu_tag_wait (id); FUNCTION_EXIT; return ret; } int starpu_tag_wait_array (unsigned ntags, starpu_tag_t* id) { FUNCTION_ENTRY_WITH_ARGS(ntags, id); int ret = libstarpu_tag_wait_array (ntags, id); FUNCTION_EXIT; return ret; } void starpu_tag_notify_from_apps (starpu_tag_t id) { FUNCTION_ENTRY_WITH_ARGS(id); libstarpu_tag_notify_from_apps (id); FUNCTION_EXIT; } void starpu_task_init (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); libstarpu_task_init (task); FUNCTION_EXIT; } void starpu_task_clean (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); libstarpu_task_clean (task); FUNCTION_EXIT; } struct starpu_task * starpu_task_create () { FUNCTION_ENTRY; struct starpu_task * ret = libstarpu_task_create (); FUNCTION_EXIT; return ret; } void starpu_task_destroy (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); libstarpu_task_destroy (task); FUNCTION_EXIT; } int starpu_task_submit (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); int ret = libstarpu_task_submit (task); FUNCTION_EXIT; return ret; } int starpu_task_submit_to_ctx (struct starpu_task* task, unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(task, sched_ctx_id); int ret = libstarpu_task_submit_to_ctx (task, sched_ctx_id); FUNCTION_EXIT; return ret; } int starpu_task_wait (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); int ret = libstarpu_task_wait (task); FUNCTION_EXIT; return ret; } int starpu_task_wait_for_all () { FUNCTION_ENTRY; int ret = libstarpu_task_wait_for_all (); FUNCTION_EXIT; return ret; } int starpu_task_wait_for_all_in_ctx (unsigned sched_ctx_id) { FUNCTION_ENTRY_WITH_ARGS(sched_ctx_id); int ret = libstarpu_task_wait_for_all_in_ctx (sched_ctx_id); FUNCTION_EXIT; return ret; } int starpu_task_wait_for_no_ready () { FUNCTION_ENTRY; int ret = libstarpu_task_wait_for_no_ready (); FUNCTION_EXIT; return ret; } int starpu_task_nready () { FUNCTION_ENTRY; int ret = libstarpu_task_nready (); FUNCTION_EXIT; return ret; } int starpu_task_nsubmitted () { FUNCTION_ENTRY; int ret = libstarpu_task_nsubmitted (); FUNCTION_EXIT; return ret; } struct starpu_task * starpu_task_dup (struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(task); struct starpu_task * ret = libstarpu_task_dup (task); FUNCTION_EXIT_WITH_ARGS(ret); return ret; } void starpu_task_bundle_create (starpu_task_bundle_t* bundle) { FUNCTION_ENTRY_WITH_ARGS(bundle); libstarpu_task_bundle_create (bundle); FUNCTION_EXIT; } int starpu_task_bundle_insert (starpu_task_bundle_t bundle, struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(bundle, task); int ret = libstarpu_task_bundle_insert (bundle, task); FUNCTION_EXIT; return ret; } int starpu_task_bundle_remove (starpu_task_bundle_t bundle, struct starpu_task* task) { FUNCTION_ENTRY_WITH_ARGS(bundle, task); int ret = libstarpu_task_bundle_remove (bundle, task); FUNCTION_EXIT; return ret; } void starpu_task_bundle_close (starpu_task_bundle_t bundle) { FUNCTION_ENTRY_WITH_ARGS(bundle); libstarpu_task_bundle_close (bundle); FUNCTION_EXIT; } void starpu_create_sync_task (starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t* deps, void (* callback)(void *), void *callback_arg) { FUNCTION_ENTRY_WITH_ARGS(sync_tag, ndeps, deps); libstarpu_create_sync_task (sync_tag, ndeps, deps, callback, callback_arg); FUNCTION_EXIT; } void starpu_execute_on_each_worker (void (* func)(void *), void *arg, uint32_t where) { FUNCTION_ENTRY_WITH_ARGS(func, arg, where); libstarpu_execute_on_each_worker (func, arg, where); FUNCTION_EXIT; } void starpu_execute_on_each_worker_ex (void (* func)(void *), void *arg, uint32_t where, const char * name) { FUNCTION_ENTRY_WITH_ARGS(func, arg, where, name); libstarpu_execute_on_each_worker_ex (func, arg, where, name); FUNCTION_EXIT; } void starpu_execute_on_specific_workers (void (* func)(void*), void * arg, unsigned num_workers, unsigned * workers, const char * name) { FUNCTION_ENTRY_WITH_ARGS(func, arg, num_workers, workers, name); libstarpu_execute_on_specific_workers (func, arg, num_workers, workers, name); FUNCTION_EXIT; } int starpu_data_cpy (starpu_data_handle_t dst_handle, starpu_data_handle_t src_handle, int asynchronous, void (* callback_func)(void*), void *callback_arg) { FUNCTION_ENTRY_WITH_ARGS(dst_handle, src_handle, asynchronous, callback_func, callback_arg); int ret = libstarpu_data_cpy (dst_handle, src_handle, asynchronous, callback_func, callback_arg); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(starpu) INTERCEPT3("_starpu_driver_start_job", lib_starpu_driver_start_job) INTERCEPT3("_starpu_driver_end_job", lib_starpu_driver_end_job) INTERCEPT3("starpu_cublas_init", libstarpu_cublas_init) INTERCEPT3("starpu_cublas_shutdown", libstarpu_cublas_shutdown) INTERCEPT3("starpu_init", libstarpu_init) INTERCEPT3("starpu_pause", libstarpu_pause) INTERCEPT3("starpu_resume", libstarpu_resume) INTERCEPT3("starpu_shutdown", libstarpu_shutdown) INTERCEPT3("starpu_data_unregister", libstarpu_data_unregister) INTERCEPT3("starpu_data_unregister_no_coherency", libstarpu_data_unregister_no_coherency) INTERCEPT3("starpu_data_unregister_submit", libstarpu_data_unregister_submit) INTERCEPT3("starpu_data_invalidate", libstarpu_data_invalidate) INTERCEPT3("starpu_data_invalidate_submit", libstarpu_data_invalidate_submit) INTERCEPT3("starpu_data_acquire", libstarpu_data_acquire) INTERCEPT3("starpu_data_acquire_on_node", libstarpu_data_acquire_on_node) INTERCEPT3("starpu_data_acquire_cb", libstarpu_data_acquire_cb) INTERCEPT3("starpu_data_acquire_on_node_cb", libstarpu_data_acquire_on_node_cb) INTERCEPT3("starpu_data_release", libstarpu_data_release) INTERCEPT3("starpu_data_release_on_node", libstarpu_data_release_on_node) INTERCEPT3("starpu_data_request_allocation", libstarpu_data_request_allocation) INTERCEPT3("starpu_malloc_on_node", libstarpu_malloc_on_node) INTERCEPT3("starpu_free_on_node", libstarpu_free_on_node) #ifdef USE_MPI INTERCEPT3("starpu_mpi_isend", libstarpu_mpi_isend) INTERCEPT3("starpu_mpi_irecv", libstarpu_mpi_irecv) INTERCEPT3("starpu_mpi_send", libstarpu_mpi_send) INTERCEPT3("starpu_mpi_recv", libstarpu_mpi_recv) INTERCEPT3("starpu_mpi_isend_detached", libstarpu_mpi_isend_detached) INTERCEPT3("starpu_mpi_irecv_detached", libstarpu_mpi_irecv_detached) INTERCEPT3("starpu_mpi_wait", libstarpu_mpi_wait) INTERCEPT3("starpu_mpi_test", libstarpu_mpi_test) INTERCEPT3("starpu_mpi_barrier", libstarpu_mpi_barrier) INTERCEPT3("starpu_mpi_init", libstarpu_mpi_init) INTERCEPT3("starpu_mpi_initialize", libstarpu_mpi_initialize) INTERCEPT3("starpu_mpi_initialize_extended", libstarpu_mpi_initialize_extended) INTERCEPT3("starpu_mpi_shutdown", libstarpu_mpi_shutdown) INTERCEPT3("starpu_mpi_get_data_on_node", libstarpu_mpi_get_data_on_node) INTERCEPT3("starpu_mpi_get_data_on_node_detached", libstarpu_mpi_get_data_on_node_detached) INTERCEPT3("starpu_mpi_redux_data", libstarpu_mpi_redux_data) INTERCEPT3("starpu_mpi_scatter_detached", libstarpu_mpi_scatter_detached) INTERCEPT3("starpu_mpi_gather_detached", libstarpu_mpi_gather_detached) INTERCEPT3("starpu_mpi_isend_detached_unlock_tag", libstarpu_mpi_isend_detached_unlock_tag) INTERCEPT3("starpu_mpi_irecv_detached_unlock_tag", libstarpu_mpi_irecv_detached_unlock_tag) INTERCEPT3("starpu_mpi_isend_array_detached_unlock_tag", libstarpu_mpi_isend_array_detached_unlock_tag) INTERCEPT3("starpu_mpi_irecv_array_detached_unlock_tag", libstarpu_mpi_irecv_array_detached_unlock_tag) INTERCEPT3("starpu_mpi_comm_amounts_retrieve", libstarpu_mpi_comm_amounts_retrieve) INTERCEPT3("starpu_mpi_cache_flush", libstarpu_mpi_cache_flush) INTERCEPT3("starpu_mpi_cache_flush_all_data", libstarpu_mpi_cache_flush_all_data) #ifndef H3VE_STARPU_MPI_DATA_REGISTER_COMM INTERCEPT3("starpu_mpi_data_register", libstarpu_mpi_data_register) #else 3 INTERCEPT3("starpu_mpi_data_register_comm", libstarpu_mpi_data_register_comm) #endif 3 #endif INTERCEPT3("starpu_sched_ctx_add_workers", libstarpu_sched_ctx_add_workers) INTERCEPT3("starpu_sched_ctx_remove_workers", libstarpu_sched_ctx_remove_workers) INTERCEPT3("starpu_sched_ctx_delete", libstarpu_sched_ctx_delete) INTERCEPT3("starpu_sched_ctx_set_inheritor", libstarpu_sched_ctx_set_inheritor) INTERCEPT3("starpu_sched_ctx_set_context", libstarpu_sched_ctx_set_context) INTERCEPT3("starpu_sched_ctx_get_context", libstarpu_sched_ctx_get_context) INTERCEPT3("starpu_sched_ctx_stop_task_submission", libstarpu_sched_ctx_stop_task_submission) INTERCEPT3("starpu_sched_ctx_finished_submit", libstarpu_sched_ctx_finished_submit) INTERCEPT3("starpu_sched_ctx_create_worker_collection", libstarpu_sched_ctx_create_worker_collection) INTERCEPT3("starpu_sched_ctx_delete_worker_collection", libstarpu_sched_ctx_delete_worker_collection) INTERCEPT3("starpu_sched_ctx_get_worker_collection", libstarpu_sched_ctx_get_worker_collection) INTERCEPT3("starpu_prefetch_task_input_on_node", libstarpu_prefetch_task_input_on_node) INTERCEPT3("starpu_malloc", libstarpu_malloc) INTERCEPT3("starpu_free", libstarpu_free) INTERCEPT3("starpu_malloc_flags", libstarpu_malloc_flags) INTERCEPT3("starpu_free_flags", libstarpu_free_flags) INTERCEPT3("starpu_tag_wait", libstarpu_tag_wait) INTERCEPT3("starpu_tag_wait_array", libstarpu_tag_wait_array) INTERCEPT3("starpu_task_init", libstarpu_task_init) INTERCEPT3("starpu_task_clean", libstarpu_task_clean) INTERCEPT3("starpu_task_create", libstarpu_task_create) INTERCEPT3("starpu_task_destroy", libstarpu_task_destroy) INTERCEPT3("starpu_task_submit", libstarpu_task_submit) INTERCEPT3("starpu_task_submit_to_ctx", libstarpu_task_submit_to_ctx) INTERCEPT3("starpu_task_wait", libstarpu_task_wait) INTERCEPT3("starpu_task_wait_for_all", libstarpu_task_wait_for_all) INTERCEPT3("starpu_task_wait_for_all_in_ctx", libstarpu_task_wait_for_all_in_ctx) INTERCEPT3("starpu_task_wait_for_no_ready", libstarpu_task_wait_for_no_ready) INTERCEPT3("starpu_task_nready", libstarpu_task_nready) INTERCEPT3("starpu_task_nsubmitted", libstarpu_task_nsubmitted) INTERCEPT3("starpu_task_dup", libstarpu_task_dup) INTERCEPT3("starpu_task_bundle_create", libstarpu_task_bundle_create) INTERCEPT3("starpu_task_bundle_insert", libstarpu_task_bundle_insert) INTERCEPT3("starpu_task_bundle_remove", libstarpu_task_bundle_remove) INTERCEPT3("starpu_task_bundle_close", libstarpu_task_bundle_close) INTERCEPT3("starpu_create_sync_task", libstarpu_create_sync_task) INTERCEPT3("starpu_execute_on_each_worker", libstarpu_execute_on_each_worker) INTERCEPT3("starpu_execute_on_each_worker_ex", libstarpu_execute_on_each_worker_ex) INTERCEPT3("starpu_execute_on_specific_workers", libstarpu_execute_on_specific_workers) INTERCEPT3("starpu_data_cpy", libstarpu_data_cpy) INTERCEPT3("starpu_tag_notify_from_apps", libstarpu_tag_notify_from_apps) PPTRACE_END_INTERCEPT_FUNCTIONS(starpu) static void init_starpu() { INSTRUMENT_FUNCTIONS(starpu); if (eztrace_autostart_enabled()) eztrace_start(); } static void finalize_starpu() { if(_starpu_initialized) { _starpu_initialized = 0; eztrace_stop(); } } static void _starpu_finalize (void) __attribute__ ((destructor)); static void _starpu_finalize (void) { finalize_starpu(); } static void _starpu_init (void) __attribute__ ((constructor)); /* Initialize the current library */ static void _starpu_init (void) { EZT_REGISTER_MODULE(starpu, "Module for StarPU functions", init_starpu, finalize_starpu); } eztrace-2.1/src/plugin_creator/000077500000000000000000000000001447213526500166265ustar00rootroot00000000000000eztrace-2.1/src/plugin_creator/CMakeLists.txt000066400000000000000000000007271447213526500213740ustar00rootroot00000000000000set (INSTALL_INPUTDIR ${CMAKE_INSTALL_FULL_DATADIR}) set (INSTALL_BINDIR ${CMAKE_INSTALL_FULL_BINDIR}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eztrace_create_plugin.in ${CMAKE_CURRENT_BINARY_DIR}/eztrace_create_plugin @ONLY) list(APPEND SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/eztrace_create_plugin ) install(PROGRAMS ${SCRIPTS} DESTINATION ${CMAKE_INSTALL_BINDIR}) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/eztrace DESTINATION ${CMAKE_INSTALL_DATADIR}) eztrace-2.1/src/plugin_creator/eztrace/000077500000000000000000000000001447213526500202635ustar00rootroot00000000000000eztrace-2.1/src/plugin_creator/eztrace/Makefile.template000066400000000000000000000006501447213526500235360ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libeztrace-@MODULE@.so ldflags=$(LDFLAGS) `pkg-config --libs eztrace` @CUSTOM_LDFLAGS@ cflags=$(CFLAGS) `pkg-config --cflags eztrace` @CUSTOM_CFLAGS@ all: $(BIN) libeztrace-@MODULE@.so: @MODULE@.c $(CC) --shared -o libeztrace-@MODULE@.so @MODULE@.c -fPIC $(cflags) $(ldflags) -ldl clean: rm -f $(BIN) eztrace-2.1/src/plugin_creator/eztrace/example.c.template000066400000000000000000000015401447213526500236740ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ #include #include #include @HEADER_USER@ #define CURRENT_MODULE @MODULE@ DECLARE_CURRENT_MODULE; static int _module_initialized = 0; @RECORD_CALLBACKS@ @RECORD_FUNCTIONS@ PPTRACE_START_INTERCEPT_FUNCTIONS(@MODULE@) @RECORD_INTERCEPTS@ PPTRACE_END_INTERCEPT_FUNCTIONS(@MODULE@); static void init_@MODULE@() { INSTRUMENT_FUNCTIONS(@MODULE@); if (eztrace_autostart_enabled()) eztrace_start(); _module_initialized = 1; @POST_INIT@ } static void finalize_@MODULE@() { _module_initialized = 0; eztrace_stop(); } void _@MODULE@_init(void) __attribute__ ((constructor)); /* Initialize the current library */ void _@MODULE@_init(void) { EZT_REGISTER_MODULE(@MODULE@, @MODULE_DESC@, init_@MODULE@, finalize_@MODULE@); } eztrace-2.1/src/plugin_creator/eztrace/function.pm000066400000000000000000000121641447213526500224520ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. package Function; use warnings; use strict; use Carp; #contructor sub new { my ($classe) = @_; $classe = ref($classe) || $classe; my $this = {}; bless($this, $classe); $this->{RET_TYPE}="null"; $this->{FNAME}="null"; $this->{ARGS}=[]; $this->{NB_ARGS}=0; $this->{ALREADY_CALLED}=0; $this->{ENTRY_CODE}= 0; $this->{EXIT_CODE}= 0; #Needed for symbols called before the plugin is properly initialized $this->{BODY_BEGIN}=""; $this->{BODY_FCALL}=""; $this->{BODY_END}=""; $this->{USE_VARGS}=0; return $this; } sub add_body { my ($this, $new_line) = @_; if($this->{ALREADY_CALLED} == 0) { $this->{BODY_BEGIN}.="\t${new_line}\n"; } else { $this->{BODY_END}.="\t${new_line}\n"; } } sub create_intercept { my ($this) = @_; my $ret = "INTERCEPT3(\"".$this->{FNAME}."\", lib".$this->{FNAME}.")\n"; return $ret; } sub add_fcall { my ($this) = @_; if($this->{ALREADY_CALLED} != 0) { print "Error: calling twice function ".$this->{FNAME}."\n"; exit 1; } $this->{ALREADY_CALLED} = 1; if (index($this->{RET_TYPE}, "void") == -1){ $this->{BODY_FCALL} .= "\t".$this->{RET_TYPE}." ret = lib".$this->{FNAME}." ("; } else { $this->{BODY_FCALL} .= "\tlib".$this->{FNAME}." ("; } my $i; my $array_size = get_arg_num($this); for($i=0; $i<$array_size; $i++) { $this->{BODY_FCALL} .= get_arg_name($this, $i); my $num_remaining_args=$array_size - $i; if($num_remaining_args>1) { $this->{BODY_FCALL} .= ", "; } } $this->{BODY_FCALL} .= ");\n"; } # Create the callback string (type (*libfname)(arg1, arg2...)) # returns the string to insert sub create_callback { my ($this) = @_; # create the ' (*lib) (' string my $ret = $this->{RET_TYPE}." (*lib".$this->{FNAME}.") ("; my $i; my $nb_arg = get_arg_num($this); # add the parameters to the string for($i=0; $i<$nb_arg; $i++) { $ret .= get_arg_type($this, $i)." ".get_arg_name($this, $i); my $num_remaining_args=$nb_arg - $i; if($num_remaining_args>1) { $ret .=", "; } } # finalize the string $ret .= ") = NULL;\n"; return $ret; } # Create the function string (type fname(arg1, arg2...)) # returns the string to insert sub create_function { my ($this) = @_; # create the ' (' string my $ret = $this->{RET_TYPE}." ".$this->{FNAME}." ("; my $i; my $nb_arg = get_arg_num($this); # add the parameters to the string for($i=0; $i<$nb_arg; $i++) { $ret .= get_arg_type($this, $i)." ".get_arg_name($this, $i); my $num_remaining_args=$nb_arg - $i; if($num_remaining_args>1) { $ret .=", "; } } # finalize the string $ret .= ") {\n"; # Add block for va_arg parameters if ( $this->{USE_VARGS} ) { $ret .= "\tva_list myargs;\n"; $ret .= "\tva_start(myargs, ".$this->get_arg_name($nb_arg-2).");\n"; } $ret .= $this->{BODY_BEGIN}; if($this->{ALREADY_CALLED} == 0) { $this->add_fcall(); } $ret .= $this->{BODY_FCALL}; $ret .= $this->{BODY_END}; if (index($this->{RET_TYPE},"void") == -1){ $ret .="\treturn ret;\n"; } $ret .="}\n"; return $ret; } # return the number of parameters for the function sub get_arg_num { my ($this) = @_; return $this->{NB_ARGS}; } # return the ith parameter type # params # $arg_num i sub get_arg_type { my ($this, $arg_num) = @_; my @args = @{$this->{ARGS}}; my @ith_arg = @{$args[$arg_num]}; return $ith_arg[0]; } # return the ith parameter name # params # $arg_num i sub get_arg_name { my ($this, $arg_num) = @_; my @args = @{$this->{ARGS}}; my @ith_arg = @{$args[$arg_num]}; return $ith_arg[1]; } sub get_fname { my ($this) = @_; return $this->{FNAME}; } # print information on the function for debugging # params # $arg_num i sub print { my ($this) = @_; printf "\tret type = ".$this->{RET_TYPE}."\n"; printf "\tfname = ".$this->{FNAME}."\n"; my $i; for($i=0; $i<$this->get_arg_num(); $i++) { print "type '".$this->get_arg_type($i)."'\t"; print "name '".$this->get_arg_name($i)."'\n"; } } # change the type returned by the function # params # $ret_type return type sub set_ret_type { my ($this, $ret_type) = @_; $this->{RET_TYPE} = $ret_type; } # change the function name # params # $fname function name sub set_fname( $$ ) { my ($this, $fname) = @_; $this->{FNAME} = $fname; $this->{BODY_BEGIN} = "\tINTERCEPT_FUNCTION(\"".$this->{FNAME}."\", lib".$this->{FNAME}.");\n".$this->{BODY_BEGIN}; } # change the function name # params # $fname function name sub set_type( $$ ) { my ($this, $type) = @_; $this->{TYPE} = $type; } # add a parameter to the function # params # $new_arg_type parameter type # $new_arg_name parameter name sub add_arg( $$$ ) { my ($this, $new_arg_type, $new_arg_name) = @_; my @new_arg = [$new_arg_type, $new_arg_name]; push ((@{$this->{ARGS}}), @new_arg); $this->{NB_ARGS}++; $this->{USE_VARGS} = 1 if ($new_arg_name eq "..." ); } # end of the module 1; __END__ eztrace-2.1/src/plugin_creator/eztrace_create_plugin.in000077500000000000000000000427621447213526500235320ustar00rootroot00000000000000#!/usr/bin/perl -w # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. my $prefix; my $libdir; my $includedir; my $bindir; my $topdatadir; BEGIN { $prefix="@prefix@"; $libdir="@INSTALL_LIBDIR@"; $includedir="@INSTALL_INCLUDEDIR@"; $bindir="@INSTALL_BINDIR@"; $topdatadir="@INSTALL_INPUTDIR@"; $input_dir="${topdatadir}/eztrace"; } use lib "${input_dir}"; use function; use Getopt::Long; use Pod::Usage; my $common_cflags="`pkg-config --cflags eztrace`"; my $common_ldflags="`pkg-config --libs eztrace`"; my $header_name; my $module_name; my $module_desc; my $language; my $record_callbacks = ""; my $record_functions = ""; my $sampling_functions = ""; my $post_init = ""; my $record_intercepts = ""; my $record_counters = ""; my $event_definition = ""; my $cur_line = 0; my $cur_function; my %variables; my $include_str=""; my $header_user=""; my $output_dir="output"; my $keep_this_line = 0; sub parse_options { my $man = 0; my $help = 0; my $includedir_str = ""; GetOptions ('include_dir|I=s' => \$includedir_str, 'output|o=s' => \$output_dir, 'help|h' => \$help, man => \$man) or pod2usage(2); pod2usage(1) if $help; pod2usage(-exitstatus => 0, -verbose => 2) if $man; # Convert list of include directories to -I option foreach my $dir ( split( ',', $includedir_str ) ) { $common_cflags .= " -I$dir"; } } parse_options(); # Create the identifier of a variable. # params: # $var_name Name of the variable (may contain spaces) sub register_var_name( $ ) { my $var_name = shift; my $var_id_prefix = "${module_name}_VAR_"; $nb_vars = values(%variables); my $var_id = "${var_id_prefix}_${nb_vars}"; while (($c,$v) = each(%variables)) { if($v eq $var_name) { return "${var_id_prefix}_${c}"; } } $nb_vars = values(%variables); $variables{$nb_vars}=$var_name; $convert_init .= <add_body("FUNCTION_ENTRY;"); } # Add an event that restore the previous state # params: # $fname function name sub add_POP_STATE( $ ) { my $fname = shift; $cur_function->add_body("FUNCTION_EXIT;"); } # Add an LiTL event and fills the convert file in order to interpret # it as a addEvent # params: # $fname function name # $event_description description of the event in the output trace sub add_EVENT($$) { my $fname = shift; my $event_description = shift; printf "add_EVENT not implemented !\n"; exit -1; # $cur_function->add_event($cur_event_name); # convert_function_event($cur_event_name, $event_description); } # Add an LiTL event and fills the convert file in order to interpret # it as a set_var # params: # $fname function name # $var_name Name of the variable # $var_value Value of the variable sub add_SET_VAR($$$) { my $fname = shift; my $var_name = shift; my $var_value = shift; printf "add_SET_VAR not implemented !\n"; exit -1; # $var_id = register_var_name($var_name); # $cur_function->add_event($cur_event_name); # convert_function_set_var($cur_event_name, $var_id, $var_value); } # Add an LiTL event and fills the convert file in order to interpret # it as a add_var # params: # $fname function name # $var_name Name of the variable # $var_value Value of the variable sub add_ADD_VAR( $$$ ) { my $fname = shift; my $var_name = shift; my $var_value = shift; printf "add_ADD_VAR not implemented !\n"; exit -1; # $var_id = register_var_name($var_name); # $cur_function->add_event($cur_event_name); # convert_function_add_var($cur_event_name, $var_id, $var_value); } # Add an LiTL event and fills the convert file in order to interpret # it as a sub_var # params: # $fname function name # $var_name Name of the variable # $var_value Value of the variable sub add_SUB_VAR( $$$ ) { my $fname = shift; my $var_name = shift; my $var_value = shift; printf "add_SUB_VAR not implemented !\n"; exit -1; # $var_id = register_var_name($var_name); # $cur_function->add_event($cur_event_name); # convert_function_sub_var($cur_event_name, $var_id, $var_value); } sub write_sampling_function( $$$ ) { my $fname = shift; my $interval = shift; my $code = shift; printf "write_sampling_function not implemented !\n"; exit -1; @liste = split("\n",$code); foreach $instruction (@liste) { if( $instruction =~ m/\s*SAMPLING_RECORD\s*\([^\,]+\s*\,\s*[^\,]+\s*\)/ ) { # detect SAMPLING_RECORD(value, description) # and replace it by: # EZTRACE_RECORD1($event_name, value) ($value, $description) = ($instruction =~ m/\s*SAMPLING_RECORD\s*\(([^\,]+)\s*\,\s*([^\,]+)\s*\)/); $sampling_functions .= "$`EZTRACE_EVENT_PACKED_1($cur_event_name, $value)$'"; # Create the variable during initialisation $convert_init .= <); out: write_sampling_function($fname, $interval, $function_code); } sub handle_function { my $rettype; my $fname=""; my @args; my $nb_arg; $nb_arg=0; my $new_callback = ""; my $new_function; my $function_body=""; $cur_function = Function->new(); $cur_function->set_type($module_type); # retrieve the return type and the function name my $proto_string = ""; do { SWITCH: { /^$/ && do { next; }; /.*\.\.\..*/ && do { $proto_string.=$_; printf "Cannot process Function '%s'\n", $proto_string; return; }; /\(/ && ($fname eq "") && do { # this line contains ( so let's copy the beginning # of the line in the prototype. my $line_len = index($_, "\("); $proto_string .= substr($_, 0, $line_len); # in order to ease the parsing, add a space after each * we find $proto_string =~ s/\*/\* /g; # extract the return type and the function name ($rettype, $fname) = ($proto_string =~ m/^\s*([\S+\s*]+\**)\s+(\S+)\s*$/); substr($_, 0, $line_len, ""); s/\s*\(\s*//; $proto_string = ""; }; /\)/ && do { my $line_len = index($_, "\)"); $proto_string .= substr($_, 0, $line_len); # remove multiple spaces/newlines $proto_string =~ s/\s+/ /g; $proto_string =~ s/\n+/ /g; $proto_string =~ s/^\s*//g; $proto_string =~ s/\s*$//g; goto body; next; }; do { $proto_string .= $_; }; } } while(<>); body: # first, let's fill the Function object $cur_function->set_fname($fname); $cur_function->set_ret_type($rettype); # extract all the parameters for this function and give them # once at a time to the Function class my @params= (split m/,\s*/, $proto_string); my $i; my $nb_param=0; for($i=0; $i<@params; $i++) { my $cur_param = $params[$i]; #remove trailing white spaces $cur_param =~ s/^\s*//g; $cur_param =~ s/\s*$//g; my $arg_name =""; my $arg_type=""; my $suffix=""; # extract [] (if any) if( $cur_param =~ m/((\[\s*\]\s*)+)/) { ($suffix) = ($cur_param =~ m/((\[\s*\]\s*)+)/); $cur_param =~ s/((\[\s*\]\s*)+)/ /g; # convert [] into * (so that we can declare the parameter as "int []a") $suffix =~ s/\[\s*\]/\*/g; } # extract * (if any) if( $cur_param =~ m/((\*\s*)+)/) { ($suffix) = ($cur_param =~ m/((\*\s*)+)/); $cur_param =~ s/((\*\s*)+)/ /g; } # extract the parameter name $arg_name = (split m/\s+/, $cur_param)[-1]; # the remaining is the parameter type $arg_type = $cur_param; # escape special characters in arg_name (eg. []) so that they are not # interpreted during the substitution my $arg_name_pat=quotemeta($arg_name); $arg_type =~ s/\s*$arg_name_pat\s*$//; # add the [] or * that were found $arg_type .= $suffix; if($arg_name ne "" && $arg_type ne "") { $nb_param++; $cur_function->add_arg($arg_type, $arg_name); } } my $begin_detected = 0; while(<>) { SWITCH: { /^$/ && do { next; }; /^\s*BEGIN\s/ && do { $begin_detected = 1; $new_callback = $cur_function->create_callback(); next; }; /^\s*CALL_FUNC/ && do { chomp; $cur_function->add_fcall(); next; }; # handling of states /^\s*PUSH_STATE/ && do { chomp; s/^\s*PUSH_STATE\s*\(\"//; s/\s*\"\)//; s/\s*$//; $state_description=$_; $event = add_PUSH_STATE($fname, $state_description); next; }; /^\s*POP_STATE/ && do { chomp; $event = add_POP_STATE($fname); next; }; /^\s*RECORD_STATE/ && do { chomp; s/^\s*RECORD_STATE\s*\(\"//; s/\s*\"\)//; s/\s*$//; $state_description=$_; # push my $event = add_PUSH_STATE($fname, $state_description); # fcall $cur_function->add_fcall(); # pop $event = add_POP_STATE($fname); next; }; # handling of events /^\s*EVENT/ && do { chomp; s/^\s*EVENT\s*\(\"//; s/\s*\"\)//; s/\s*$//; $event_description=$_; $event = add_EVENT($fname, $event_description); next; }; # handling of variables /^\s*SET_VAR/ && do { chomp; s/^\s*SET_VAR\s*\(\"//; # retrieve the var name $var_name_len = index($_, "\""); if($var_name_len < 0) { printf "line $cur_line: syntax error in SET_VAR\n"; exit(1); } $var_name=substr($_, 0, $var_name_len); # remove the var name and the trailing ", s/^$var_name\",\s*//; # remove the ')' at the end of the line s/\s*\)\s*$//; $var_value=$_; $event = add_SET_VAR($fname, $var_name, $var_value); next; }; /^\s*ADD_VAR/ && do { chomp; s/^\s*ADD_VAR\s*\(\"//; # retrieve the var name $var_name_len = index($_, "\""); if($var_name_len < 0) { printf "line $cur_line: syntax error in ADD_VAR\n"; exit(1); } $var_name=substr($_, 0, $var_name_len); # remove the var name and the trailing ", s/^$var_name\",\s*//; # remove the ')' at the end of the line s/\s*\)\s*$//; $var_value=$_; $event = add_ADD_VAR($fname, $var_name, $var_value); next; }; /^\s*SUB_VAR/ && do { chomp; s/^\s*SUB_VAR\s*\(\"//; # retrieve the var name $var_name_len = index($_, "\""); if($var_name_len < 0) { printf "line $cur_line: syntax error in SUB_VAR\n"; exit(1); } $var_name=substr($_, 0, $var_name_len); # remove the var name and the trailing ", s/^$var_name\",\s*//; # remove the ')' at the end of the line s/\s*\)\s*$//; $var_value=$_; $event = add_SUB_VAR($fname, $var_name, $var_value); next; }; /^\s*END\s/ && do { $new_function = $cur_function->create_function(); goto out; }; if($begin_detected == 0) { # there was only the function prototype # Let's say that the user wants RECORD_STATE printf "\temulate record_state for '$fname'\n"; $new_callback = $cur_function->create_callback(); # push my $event = add_PUSH_STATE($fname, "Doing function $fname"); # fcall $cur_function->add_fcall(); # pop $event = add_POP_STATE($fname); $new_function = $cur_function->create_function(); $keep_this_line = 1; goto out; } printf "line $cur_line: unknown command '$_'\n"; exit 1; } $cur_line++; }; out: $new_intercept = $cur_function->create_intercept(); $record_intercepts .= "$new_intercept\n"; $record_callbacks .= "$new_callback\n"; $record_functions .= "$new_function\n"; printf "Function '%s' done\n", $fname; } sub handle_includes { while(<>) { $cur_line++; SWITCH: { /^\s*END_INCLUDE/ && do { return; }; do { $header_user .= $_; }; } } } sub handle_cflags { my $cflags = " "; while(<>) { $cur_line++; SWITCH: { /^\s*END_CFLAGS/ && do { goto end; }; /^\s*#/ && do { next; }; do { $cflags .= $_; }; } } end: $cflags =~ s/\n/ /g; $common_cflags .= $cflags } sub handle_ldflags { my $ldflags = " "; while(<>) { $cur_line++; SWITCH: { /^\s*END_LDFLAGS/ && do { goto end; }; /^\s*#/ && do { next; }; do { $ldflags .= $_; }; } } end: $ldflags =~ s/\n/ /g; $common_ldflags .= $ldflags } while (<>) { $cur_line++; main_loop: if($keep_this_line == 1) { $keep_this_line = 0; } SWITCH: { /^\s*$/ && do { next; }; /^\s*BEGIN_MODULE/ && do { printf "New Module\n"; next; }; /^\s*END_MODULE/ && do { printf "End of Module $module_name\n"; goto end_module; }; /^\s*BEGIN_INCLUDE/ && do { s/^\s*BEGIN_INCLUDE\s*//; # remove trailing whitespaces s/\s*$//; handle_includes; next; }; /^\s*BEGIN_CFLAGS/ && do { s/^\s*BEGIN_CFLAGS\s*//; # remove trailing whitespaces s/\s*$//; handle_cflags; next; }; /^\s*BEGIN_LDFLAGS/ && do { s/^\s*BEGIN_LDFLAGS\s*//; # remove trailing whitespaces s/\s*$//; handle_ldflags; next; }; /^\s*NAME/ && do { s/^\s*NAME\s*//; # remove trailing whitespaces s/\s*$//; chomp; $module_name=$_; if (!$module_name) { print "Choose a name for your module : operation stopped\n"; exit 1; } printf "Module name : '$module_name'\n"; next; }; /^\s*DESC/ && do { chomp; s/^\s*DESC\s*//; # remove trailing whitespaces s/\s*$//; $module_desc=$_; printf "Module description : '$module_desc'\n"; next; }; /^\s*LANGUAGE/ && do { chomp; s/^\s*LANGUAGE\s*//; # remove trailing whitespaces s/\s*$//; $language=$_; printf "Language : '$language'\n"; next; }; # DEFINE_SAMPLING_FUNCTION(function_name, interval) # code function # END_DEFINE /^\s*DEFINE_SAMPLING_FUNCTION/ && do { chomp; s/^\s*DEFINE_SAMPLING_FUNCTION//; define_sampling_function; next; }; /^\s*\#/ && do { # this is a comment, skip this line next; }; do { chomp; handle_function; if($keep_this_line == 1) { goto main_loop; } next; }; } } sub apply_changes($$) { my $ifile = shift; my $ofile = shift; open(OUTPUT_FILE, "> $ofile") or die "can't open $ofile"; open(INPUT_FILE, "< $ifile") or die "can't open $ifile"; while() { s/\@MODULE\@/$module_name/g; s/\@MODULE_DESC\@/$module_desc/g; s/\@HEADER_USER\@/$header_user/g; s/\@RECORD_CALLBACKS\@/$record_callbacks/g; # s/\@RECORD_COUNTERS\@/$record_counters/g; s/\@RECORD_FUNCTIONS\@/$record_functions/g; # s/\@SAMPLING_FUNCTIONS\@/$sampling_functions/g; s/\@POST_INIT\@/$post_init/g; s/\@RECORD_INTERCEPTS\@/$record_intercepts/g; s/\@CUSTOM_CFLAGS\@/$common_cflags/g; s/\@CUSTOM_LDFLAGS\@/$common_ldflags/g; (print OUTPUT_FILE $_); } close(OUTPUT_FILE) or die "can't close $ofile"; close(INPUT_FILE) or die "can't close $ifile"; } end_module: `mkdir -p $output_dir`; my $input_file = "${input_dir}/example.c.template"; my $input_makefile = "${input_dir}/Makefile.template"; $output_file="${module_name}.c"; $output_makefile="Makefile"; apply_changes($input_file, "$output_dir/$output_file"); apply_changes($input_makefile, "$output_dir/$output_makefile"); __DATA__ =head1 NAME eztrace_create_plugin - Generate EZTrace plugins =head1 SYNOPSIS Generate EZTrace plugins. eztrace_create_plugin [options] file Options: -I, --include_dir include directories -o, --ouput output directory -h, --help brief help message --man full documentation =head1 OPTIONS =over 8 =item B<-I , --include_dir=> Add specific include directories for the compilation of the generated code. =item B<-o , --output=> Select the output directory. =item B<-h --help> Print a brief help message and exits. =item B<--man> Prints the manual page and exits. =back =head1 DESCRIPTION B will read the given input file(s) and do something useful with the contents thereof. =cut eztrace-2.1/src/plugin_creator/eztrace_indent_fortran000077500000000000000000000026431447213526500233120ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; use warnings; #############################################################" package main; sub indent_file( $$ ) { my $input_handle = shift; my $output_handle = shift; my $concatenate=0; my $current_concatenation=""; while(<$input_handle>) { my $currentLine = $_; if($currentLine =~ m/^\s*subroutine.+\(/) { $concatenate=1; $current_concatenation=""; } if($concatenate == 1) { $currentLine=~ s/\n//; $currentLine=~ s/^\s*>//; $currentLine=~ s/^\s*\$//; $currentLine=~ s/^\s+//g; $current_concatenation.=$currentLine; if($currentLine =~ m/\)/) { # end of the subroutine prototype $concatenate=0; $currentLine=$current_concatenation."\n"; } } if($concatenate==0) { printf $output_handle "%s", $currentLine; } } } if(@ARGV < 1) { printf STDERR "Usage: $0 input_file [output_file]\n"; exit 1; } my $output_file; my $input_file=$ARGV[0]; my $input_handle; my $output_handle; if(@ARGV != 2) { $output_handle=*STDOUT; } else { $output_file=$ARGV[1]; open($output_handle, '>', $output_file) or die "Couldn't open $output_file for writing!"; } open($input_handle, '<', $input_file) or die "Couldn't open $input_file for reading!"; indent_file($input_handle, $output_handle); if(@ARGV == 2) { close($output_handle); printf "Output trace: %s\n", $output_file; } close($input_handle); eztrace-2.1/src/plugin_creator/eztrace_plugin_generator.in000077500000000000000000000157061447213526500242530ustar00rootroot00000000000000#!/usr/bin/perl -w # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. use File::Temp qw/ tempfile tempdir /; use File::Copy; use Getopt::Long; my $prefix; my $exec_prefix; my $libdir; my $includedir; my $bindir; my $create_plugin_options = ""; BEGIN { $prefix="@prefix@"; $exec_prefix="@exec_prefix@"; $libdir="@libdir@"; $includedir="@includedir@"; $bindir="@bindir@"; } sub parse_options { my $backtrace=""; GetOptions ('backtrace|b' => \$backtrace); if($backtrace ne "") { $create_plugin_options .= "-b"; } } parse_options(); my $indent_fortran="$prefix/bin/eztrace_indent_fortran"; # format a source file so that function prototypes # are properly formatted (eg. everything on line line) sub format_source_file( $ ) { my $fname = shift; my $fh; my $filename; my $suffix; if( $fname =~ m/.+\.c$/) { $suffix=".c"; } elsif( $fname =~ m/.+\.cpp$/) { $suffix=".cpp"; } elsif( $fname =~ m/.+\.f$/) { # todo .f77, .f90, .F, etc. $suffix=".f"; } ($fh, $filename) = tempfile(SUFFIX=>$suffix); copy($fname, $filename) or die "Copy failed: $!"; if($suffix eq ".c") { `indent -npsl --line-length10000 $filename`; } if($suffix eq ".cpp") { `indent -npsl --line-length10000 $filename`; } if($suffix eq ".f") { `$indent_fortran $fname $filename`; } return $filename; } # return the prototype of function $fname extracted from $filename sub extract_prototype( $$ ) { my $fname=shift; my $filename=shift; # in some cases, fname main contain (). Remove these parenthesis $fname =~ s/\(\s*\)//; # don't instrument the main function if($fname eq "main") { return ""; } # format the source code my $new_filename=format_source_file($filename); # extract symbols my $program_language; my $symbols=""; if ($new_filename =~ m/.\.c/) { $program_language="C"; $symbols=`ctags --c-kinds=pf --fields=+S -x $new_filename`; } elsif ($new_filename =~ m/.\.cpp/) { $program_language="CPP"; $symbols=`ctags --c++-kinds=pf --fields=+S -x $new_filename`; } elsif ($new_filename =~ m/.\.f/) { $prototype = "void ".$fname."()"; $symbols=`ctags --fortran-kinds=pfis --fields=+S -x $new_filename`; } else { # example: f90, c++, etc. # not implemented printf "Cannot extract information about function %s: file format not supported\n", $fname; printf "\tAssuming the function prototype is void %s()\n", $fname; $prototype = "void ".$fname."()"; unlink($new_filename); return $prototype; } my $fortran_fname=$fname; $fortran_fname=~ s/_$//; my @symbol_list = split('\n', $symbols); foreach $symbol(@symbol_list) { # each line should look like this: # function 22 if($symbol =~ m/^($fname)\s+(function)\s+\d+\s+\S+\s+(.+)/) { # fname was found. return the corresponding prototype ($prototype) = ($symbol =~ m/$fname\s+function\s+\d+\s+\S+\s+(.+)$/); unlink($new_filename); # remove any /* ... */ comment that we might have found $prototype =~ s/\/\*.*\*\///g; return $prototype; } # for fortran files, each line looks like this # subroutine 95 subroutine if($symbol =~ m/^($fortran_fname)\s+subroutine/) { # fname was found. return the corresponding prototype printf "$fname found in a subroutine\n"; ($prototype) = ($symbol =~ m/$fortran_fname\s+subroutine\s+\d+\s+\S+\s+(.+)$/); unlink($new_filename); # remove any /* ... */ comment that we might have found $prototype =~ s/\/\*.*\*\///g; # replace ^subroutine with void $prototype =~ s/^subroutine $fortran_fname/void $fname/; $prototype =~ s/>//g; # cast each parameter to int* $prototype =~ s/\(\s*(\S+)/\(int *$1/; $prototype =~ s/,/, int */g; if($prototype !~ m/\(/) { printf("Proto doesnt contain parenthesis!\n"); $prototype .= "( )"; } return $prototype; } } # not found unlink($new_filename); return ""; } if (@ARGV<1) { printf "Usage: eztrace_plugin_generator \n"; exit 1; } my $input_file=$ARGV[0]; my $input_file_parsed=$input_file; $input_file_parsed =~ s/\//_/g; $input_file_parsed =~ s/-/_/g; $input_file_parsed =~ s/\./_/g; my $output_file=$input_file_parsed.".tpl"; my $plugin_dir="plugin_".$input_file_parsed; my $module_name=$input_file_parsed; $module_name =~ s/\./_/g; open($output_handle, '>', $output_file) or die "Couldn't open $output_file for writing!"; printf $output_handle "BEGIN_MODULE\n"; printf $output_handle "NAME %s\n", $module_name; printf $output_handle "DESC \"Module for the %s program\"\n", $input_file; printf $output_handle "\n"; printf $output_handle "# In this section, insert the #include/#define directives that are needed for\n"; printf $output_handle "# compiling\n"; printf $output_handle "BEGIN_INCLUDE\n"; printf $output_handle "\n"; printf $output_handle "END_INCLUDE\n\n"; printf $output_handle "\n"; printf $output_handle "# In this section, insert the CFLAGS that are needed for compiling\n"; printf $output_handle "BEGIN_CFLAGS\n"; printf $output_handle "\n"; printf $output_handle "END_CFLAGS\n"; printf $output_handle "\n"; printf $output_handle "# In this section, insert the LDFLAGS that are needed for compiling\n"; printf $output_handle "BEGIN_LDFLAGS\n"; printf $output_handle "\n"; printf $output_handle "END_LDFLAGS\n"; printf $output_handle "\n"; my $symbols=`nm --demangle --defined -l $input_file`; my @symbol_list = split('\n', $symbols); my $nb_symbols=0; printf "Creating the plugin script %s\n", $output_file; foreach $symbol(@symbol_list) { if( $symbol =~ m/\s+T\s+(.+)\s+(.+)/ ) { ($fname, $file) = ( $symbol =~ m/\s+T\s+(\S+)\s+(.+):/ ); my $proto=extract_prototype($fname, $file); if ($proto ne "") { $nb_symbols++; printf "\tFound '%s'\n", $proto; printf $output_handle "%s\n\n", $proto; } } } printf $output_handle "END_MODULE\n"; close($output_handle); if ( $nb_symbols == 0) { # No symbol found printf "No symbol found!\n"; printf "Make sure the program contains debugging symbols (ie. compile it with -the -g option)\n"; exit ; } printf "%d symbols found\n", $nb_symbols; printf "\nGenerating the plugin...\n"; printf "\t\$ %s/eztrace_create_plugin %s -o %s %s\n", $bindir, $create_plugin_options, $plugin_dir, $output_file; `$bindir/eztrace_create_plugin $create_plugin_options -o $plugin_dir $output_file`; if ( $? != 0) { die "Plugin creation failed !\n"; } printf "\nCompiling the plugin...\n"; printf "\t\$ make -C %s\n", $plugin_dir; `make -C $plugin_dir`; if ( $? != 0) { die "Compilation failed ! Please fix the ".$output_file." template file and re-run the eztrace_create_plugin command\n"; } printf "\nYou can now use the generated plugin by setting the following environment variables:\n"; printf "\t\$ export EZTRACE_LIBRARY_PATH=\$EZTRACE_LIBRARY_PATH:%s\n", `readlink -f $plugin_dir`; eztrace-2.1/test/000077500000000000000000000000001447213526500140015ustar00rootroot00000000000000eztrace-2.1/test/CMakeLists.txt000066400000000000000000000015311447213526500165410ustar00rootroot00000000000000enable_testing() set(EZTRACE_LIBRARY_PATH "${CMAKE_BINARY_DIR}/src/eztrace-lib") set(TEST_ENVIRONMENT "EZTRACE_AVAIL_PATH=${CMAKE_BINARY_DIR}/src/eztrace_avail" "EZTRACE_CC_PATH=${CMAKE_BINARY_DIR}/src/modules/omp/bin/eztrace_cc" "EZTRACE_PATH=${CMAKE_BINARY_DIR}/src/eztrace" "OTF2_PRINT_PATH=${OTF2_PRINT}" "EZTRACE_TEST_OPTION=-p" ) add_subdirectory (unit_tests) if (EZTRACE_ENABLE_COMPILER_INSTRUMENTATION) add_subdirectory (compiler_instrumentation) endif() if (EZTRACE_ENABLE_MPI) add_subdirectory (mpi) endif() if (EZTRACE_ENABLE_MEMORY) add_subdirectory (memory) endif() if (EZTRACE_ENABLE_OPENMP) add_subdirectory (openmp) endif() if (EZTRACE_ENABLE_OMPT) add_subdirectory (ompt) endif() if (EZTRACE_ENABLE_PTHREAD) add_subdirectory (pthread) endif() if (EZTRACE_ENABLE_POSIXIO) add_subdirectory (posixio) endif() eztrace-2.1/test/compiler_instrumentation/000077500000000000000000000000001447213526500211365ustar00rootroot00000000000000eztrace-2.1/test/compiler_instrumentation/CMakeLists.txt000066400000000000000000000013751447213526500237040ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_COMPILER_INSTRUMENTATION) set(CMAKE_C_FLAGS "-finstrument-functions -O0") set(LINK_OPTIONS "-rdynamic") add_executable(foo foo.c) add_test(build_foo "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target foo) add_test (compiler_instrumentation_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS "build_foo_cat") set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/compiler_instrumentation") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/compiler_instrumentation/Makefile000066400000000000000000000002451447213526500225770ustar00rootroot00000000000000CFLAGS=-finstrument-functions -O0 LDFLAGS=-rdynamic BIN=foo all: $(BIN) %: %.c $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) test: $(BIN) ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/compiler_instrumentation/foo.c000066400000000000000000000005121447213526500220630ustar00rootroot00000000000000#include #include extern inline int baz(int a) { return a+1; } static int bar(int a) { return baz(a+1); } int foo(int a) { return bar(a+1); } int main(int argc, char**argv) { int sum = 0; for(int i=0; i<10; i++) { sum += foo(i); } printf("sum = %d\n", sum); return EXIT_SUCCESS; } eztrace-2.1/test/compiler_instrumentation/run.sh000077500000000000000000000005611447213526500223030ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "compiler_instrumentation" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/compiler_instrumentation/test_foo.sh000077500000000000000000000012271447213526500233210ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="foo" [ -n "$EZTRACE_PATH" ] || EZTRACE_PATH=eztrace run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "compiler_instrumentation" "./$name" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" trace_check_nb_enter "$trace_filename" "foo" 10 trace_check_nb_leave "$trace_filename" "foo" 10 trace_check_nb_enter "$trace_filename" "baz" 10 trace_check_nb_leave "$trace_filename" "baz" 10 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/cuda/000077500000000000000000000000001447213526500147155ustar00rootroot00000000000000eztrace-2.1/test/cuda/Makefile000066400000000000000000000002241447213526500163530ustar00rootroot00000000000000BIN=vectorAdd NVCC ?= nvcc all: $(BIN) vectorAdd: vectorAdd.cu $(NVCC) -o vectorAdd vectorAdd.cu $(NVCFLAGS) $(NVLDFLAGS) clean: rm -f $(BIN) eztrace-2.1/test/cuda/run.sh000077500000000000000000000005341447213526500160620ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "cuda" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/cuda/test_vector.sh000077500000000000000000000015601447213526500176170ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="vectorAdd" [ -n "$EZTRACE_PATH" ] || EZTRACE_PATH=eztrace run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "cuda" "./vectorAdd" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" trace_check_nb_enter "$trace_filename" "cuda::runtime::cudaMalloc" 3 trace_check_nb_leave "$trace_filename" "cuda::runtime::cudaMalloc" 3 trace_check_nb_enter "$trace_filename" "cuda::runtime::cudaFree" 3 trace_check_nb_leave "$trace_filename" "cuda::runtime::cudaFree" 3 trace_check_nb_enter "$trace_filename" "cuda::runtime::cudaLaunchKernel" 1 trace_check_nb_leave "$trace_filename" "cuda::runtime::cudaLaunchKernel" 1 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/cuda/vectorAdd.cu000066400000000000000000000127701447213526500171700ustar00rootroot00000000000000/** * Copyright 1993-2015 NVIDIA Corporation. All rights reserved. * * Please refer to the NVIDIA end user license agreement (EULA) associated * with this source code for terms and conditions that govern your use of * this software. Any use, reproduction, disclosure, or distribution of * this software and related documentation outside the terms of the EULA * is strictly prohibited. * */ /** * Vector addition: C = A + B. * * This sample is a very basic sample that implements element by element * vector addition. It is the same as the sample illustrating Chapter 2 * of the programming guide with some additions like error checking. */ #include // For the CUDA runtime routines (prefixed with "cuda_") #include /** * CUDA Kernel Device code * * Computes the vector addition of A and B into C. The 3 vectors have the same * number of elements numElements. */ __global__ void vectorAdd(const float *A, const float *B, float *C, int numElements) { int i = blockDim.x * blockIdx.x + threadIdx.x; if (i < numElements) { C[i] = A[i] + B[i]; } } /** * Host main routine */ int main(void) { // Error code to check return values for CUDA calls cudaError_t err = cudaSuccess; // Print the vector length to be used, and compute its size int numElements = 50000; size_t size = numElements * sizeof(float); printf("[Vector addition of %d elements]\n", numElements); // Allocate the host input vector A float *h_A = (float *)malloc(size); // Allocate the host input vector B float *h_B = (float *)malloc(size); // Allocate the host output vector C float *h_C = (float *)malloc(size); // Verify that allocations succeeded if (h_A == NULL || h_B == NULL || h_C == NULL) { fprintf(stderr, "Failed to allocate host vectors!\n"); exit(EXIT_FAILURE); } // Initialize the host input vectors for (int i = 0; i < numElements; ++i) { h_A[i] = rand()/(float)RAND_MAX; h_B[i] = rand()/(float)RAND_MAX; } // Allocate the device input vector A float *d_A = NULL; err = cudaMalloc((void **)&d_A, size); if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector A (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Allocate the device input vector B float *d_B = NULL; err = cudaMalloc((void **)&d_B, size); if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector B (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Allocate the device output vector C float *d_C = NULL; err = cudaMalloc((void **)&d_C, size); if (err != cudaSuccess) { fprintf(stderr, "Failed to allocate device vector C (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Copy the host input vectors A and B in host memory to the device input vectors in // device memory printf("Copy input data from the host memory to the CUDA device\n"); err = cudaMemcpy(d_A, h_A, size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "Failed to copy vector A from host to device (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } err = cudaMemcpy(d_B, h_B, size, cudaMemcpyHostToDevice); if (err != cudaSuccess) { fprintf(stderr, "Failed to copy vector B from host to device (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Launch the Vector Add CUDA Kernel int threadsPerBlock = 256; int blocksPerGrid =(numElements + threadsPerBlock - 1) / threadsPerBlock; printf("CUDA kernel launch with %d blocks of %d threads\n", blocksPerGrid, threadsPerBlock); vectorAdd<<>>(d_A, d_B, d_C, numElements); err = cudaGetLastError(); if (err != cudaSuccess) { fprintf(stderr, "Failed to launch vectorAdd kernel (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Copy the device result vector in device memory to the host result vector // in host memory. printf("Copy output data from the CUDA device to the host memory\n"); err = cudaMemcpy(h_C, d_C, size, cudaMemcpyDeviceToHost); if (err != cudaSuccess) { fprintf(stderr, "Failed to copy vector C from device to host (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Verify that the result vector is correct for (int i = 0; i < numElements; ++i) { if (fabs(h_A[i] + h_B[i] - h_C[i]) > 1e-5) { fprintf(stderr, "Result verification failed at element %d!\n", i); exit(EXIT_FAILURE); } } printf("Test PASSED\n"); // Free device global memory err = cudaFree(d_A); if (err != cudaSuccess) { fprintf(stderr, "Failed to free device vector A (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } err = cudaFree(d_B); if (err != cudaSuccess) { fprintf(stderr, "Failed to free device vector B (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } err = cudaFree(d_C); if (err != cudaSuccess) { fprintf(stderr, "Failed to free device vector C (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Free host memory free(h_A); free(h_B); free(h_C); printf("Done\n"); return 0; } eztrace-2.1/test/docker/000077500000000000000000000000001447213526500152505ustar00rootroot00000000000000eztrace-2.1/test/docker/eztrace.mpich/000077500000000000000000000000001447213526500200045ustar00rootroot00000000000000eztrace-2.1/test/docker/eztrace.mpich/Dockerfile000066400000000000000000000014671447213526500220060ustar00rootroot00000000000000FROM debian:bullseye # Install build tools RUN apt update \ && apt install -y build-essential cmake wget git gawk # Install OTF2 in /opt/otf2 and make otf-print available RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-2.3/otf2-2.3.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/otf2-2.3.tar.gz) \ && (cd /tmp/otf2-2.3 && ./configure --prefix=/opt/otf2 && make &&make install) \ && rm -rf /tmp/otf2-2.3 # Install Opari2 in /opt/opari2 RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/opari2/tags/opari2-2.0.6/opari2-2.0.6.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/opari2-2.0.6.tar.gz) \ && (cd /tmp/opari2-2.0.6 && ./configure --prefix=/opt/opari2 && make &&make install) \ && rm -rf /tmp/opari2-2.0.6 # Install MPICH RUN apt install -y mpich # Install Clang RUN apt install -y clangeztrace-2.1/test/docker/eztrace.openmpi/000077500000000000000000000000001447213526500203535ustar00rootroot00000000000000eztrace-2.1/test/docker/eztrace.openmpi/Dockerfile000066400000000000000000000015351447213526500223510ustar00rootroot00000000000000FROM debian:bullseye # Install build tools RUN apt update \ && apt install -y build-essential cmake wget git gawk # Install OTF2 in /opt/otf2 and make otf-print available RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-2.3/otf2-2.3.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/otf2-2.3.tar.gz) \ && (cd /tmp/otf2-2.3 && ./configure --prefix=/opt/otf2 && make &&make install) \ && rm -rf /tmp/otf2-2.3 # Install Opari2 in /opt/opari2 RUN wget http://perftools.pages.jsc.fz-juelich.de/cicd/opari2/tags/opari2-2.0.6/opari2-2.0.6.tar.gz -P /tmp \ && (cd /tmp && tar xzf /tmp/opari2-2.0.6.tar.gz) \ && (cd /tmp/opari2-2.0.6 && ./configure --prefix=/opt/opari2 && make &&make install) \ && rm -rf /tmp/opari2-2.0.6 # Install OpenMPI RUN apt install -y openmpi-bin openmpi-common libopenmpi-dev # Install Clang RUN apt install -y clangeztrace-2.1/test/memory/000077500000000000000000000000001447213526500153115ustar00rootroot00000000000000eztrace-2.1/test/memory/CMakeLists.txt000066400000000000000000000012751447213526500200560ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_MEMORY) set(CMAKE_C_FLAGS "-pthread") set(LINK_OPTIONS "-pthread") add_executable(memory memory.c) add_test (build_memory "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target memory) add_test (memory_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS build_memory) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/memory") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/memory/Makefile000066400000000000000000000003011447213526500167430ustar00rootroot00000000000000BIN=memory vector SHELL := /bin/bash CFLAGS= top_src_dir=$(PWD)/../../ cur_dir=$(PWD) all: $(BIN) vector: vector.cxx $(CXX) -o vector vector.cxx test: all ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/memory/memory.c000066400000000000000000000061171447213526500167720ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include #include /* Number of iterations */ #define ITER 10 /* Number of threads */ #define NTH 2 typedef union { unsigned long long tick; struct { unsigned low; unsigned high; }; } tick_t; int fd[2][2]; sem_t thread_ready; #define TICK_DIFF(t1, t2) \ ((t2).tick - (t1).tick) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("DEBUG_LEVEL"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 2) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stderr, fmt, va); va_end(va); } } // end of debugging part /* Fake computation of usec microseconds */ void compute(int usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } void test_malloc() { int i, j; char*buffer[ITER]; for (i = 0; i < ITER; i++) { int alloc_size = (1 + i) * 1024; debug("\tloop %d/%d: allocating %d bytes\n", i, ITER, alloc_size); buffer[i] = malloc(alloc_size); for (j = 0; j < (1 + i) * 1024; j++) { buffer[i][j] = 'a'; } /* compute for 1ms */ compute(50000); free(buffer[i]); compute(10000); } } void test_realloc() { int i, j; char*buffer[ITER]; for (i = 0; i < ITER; i++) { int alloc_size = (1 + i) * 1024; debug("\tloop %d/%d: allocating %d bytes\n", i, ITER, alloc_size); buffer[i] = malloc(alloc_size); for (j = 0; j < (1 + i) * 1024; j++) { buffer[i][j] = 'a'; } /* compute for 1ms */ compute(20000); alloc_size *= 2; debug("\t\tloop %d/%d: reallocating %d bytes\n", i, ITER, alloc_size); buffer[i] = realloc(buffer[i], alloc_size); compute(20000); free(buffer[i]); compute(10000); } } void test_calloc() { int i, j; char*buffer[ITER]; for (i = 0; i < ITER; i++) { int alloc_size = (1 + i) * 1024; debug("\tloop %d/%d: allocating %d bytes\n", i, ITER, alloc_size); buffer[i] = calloc(alloc_size, sizeof(uint8_t)); for (j = 0; j < (1 + i) * 1024; j++) { buffer[i][j] = 'a'; } /* compute for 1ms */ compute(50000); free(buffer[i]); compute(10000); } } int main(int argc, char**argv) { char* buffer[ITER]; int i, j; debug("Testing malloc\n"); test_malloc(); debug("1/2 done\n"); compute(100000); test_malloc(); debug("2/2 done\n"); compute(100000); debug("Testing realloc\n"); test_realloc(); debug("realloc done\n"); compute(100000); debug("Testing calloc\n"); test_calloc(); debug("calloc done\n"); return 0; } eztrace-2.1/test/memory/run.sh000077500000000000000000000005151447213526500164550ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "memory" || exit 1 check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/memory/test_memory.sh000077500000000000000000000013271447213526500202220ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="memory" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "memory" "./$name" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" || exit 1 trace_check_enter_leave_parity "$trace_filename" trace_check_nb_enter "$trace_filename" "realloc" 10 trace_check_nb_leave "$trace_filename" "realloc" 10 trace_check_nb_enter "$trace_filename" "calloc" 10 trace_check_nb_leave "$trace_filename" "calloc" 10 trace_check_nb_enter "$trace_filename" "malloc" 30 trace_check_nb_leave "$trace_filename" "malloc" 30 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/memory/vector.cxx000066400000000000000000000012071447213526500173370ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include // This program was used to demonstrate a bug in EZTrace in October 2011 // when compiled with -O3, running the program with eztrace causes a SIGSEGV // this was due to the memory module: // the implementation of malloc returned a buffer that is not 'aligned' // This bug was fixed by commit #701 int main(int argc, char **argv) { int rank = 0; std::cout << "MyRank : " << rank << std::endl; std::vector a; a.resize(10); return 0; } eztrace-2.1/test/module_generator/000077500000000000000000000000001447213526500173345ustar00rootroot00000000000000eztrace-2.1/test/module_generator/example.tpl000066400000000000000000000046461447213526500215220ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. # There are deliberately trailing whitespace everywhere. This # (<-- see?) is for stressing the script parser. # Sorry for the inconvenience. BEGIN_MODULE NAME example_lib DESC "module for the example library" LANGUAGE C ID 09 BEGIN_INCLUDE #include END_INCLUDE int example_do_event( int n) BEGIN EVENT("Do new function") END void appli_function1(double* array, int size) BEGIN RECORD_STATE("running appli_function1") END double example_function1(double* array, int array_size) int example_function2(int* array, int array_size) BEGIN RECORD_STATE("running example_function2") END int example_fcall( int* array, int array_size ) BEGIN CALL_FUNC END int example_push (int* array,int array_size) BEGIN PUSH_STATE("doing function example_push") END int example_event(int* array, int array_size) BEGIN EVENT("example_event called") END int example_set_var(int* array, int array_size) BEGIN SET_VAR("variable name", 5) END int example_add_var(int* array, int array_size) BEGIN ADD_VAR("variable name", 1) END int example_sub_var ( int* array, int array_size) BEGIN SUB_VAR("variable name", 4) END int example_set_var2 ( int* array, int array_size) BEGIN SET_VAR("another variable name", 21) END int example_set_var3( int* array, int array_size) BEGIN ADD_VAR("another variable name", 10) END int example_set_var4( int* array, int array_size) BEGIN SUB_VAR("another variable name", 3) END int example_set_var5( int* array, int array_size) BEGIN SET_VAR("another variable name", 13) END int example_set_var6( int* array, int array_size) BEGIN ADD_VAR("variable name", 2) CALL_FUNC SUB_VAR("variable name", 1) END int example_many_args( int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7) BEGIN ADD_VAR("variable name", 2) CALL_FUNC SUB_VAR("variable name", 1) END DEFINE_SAMPLING_FUNCTION (example_sampling, 1000) int example_sampling(struct ezt_sampling_callback_instance *instance) { double *ptr = NULL; if(!instance->plugin_data) { instance->plugin_data = malloc(sizeof(double)); ptr = instance->plugin_data; *ptr = 0; } ptr = instance->plugin_data; (*ptr) ++; if(*ptr>1) { SAMPLING_RECORD(*ptr, "Value of PTR"); } return 0; } END_DEFINE END_MODULE eztrace-2.1/test/module_generator/example_application/000077500000000000000000000000001447213526500233525ustar00rootroot00000000000000eztrace-2.1/test/module_generator/example_application/Makefile000066400000000000000000000006641447213526500250200ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libexample.so main CC = gcc CFLAGS = -O0 -g all: $(BIN) main: main.c example.h $(CC) $(CFLAGS) -o main main.c -L. -lexample libexample.so: example.o $(CC) $(CFLAGS) --shared -o libexample.so example.o -ldl example.o: example.c example.h $(CC) $(CFLAGS) -o example.o -c example.c -fPIC clean: rm -f $(BIN) *.o eztrace-2.1/test/module_generator/example_application/example.c000066400000000000000000000032211447213526500251470ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include "example.h" #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) void compute(unsigned usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } int example_do_event(int n) { fprintf(stderr, "Doing function #%d\n", n); return n + 1; } /* dummy function #1 */ double example_function1(double *array, int array_size) { compute(10); return 0; } /* dummy function #2 */ int example_function2(int *array, int array_size) { compute(10); return 0; } int example_fcall(int *array, int array_size) { compute(10); return 0; } int example_push(int *array, int array_size) { compute(10); return 0; } int example_pop(int *array, int array_size) { compute(10); return 0; } int example_event(int *array, int array_size) { compute(10); return 0; } int example_set_var(int *array, int array_size) { compute(10); return 0; } int example_set_var2(int *array, int array_size) { compute(10); return 0; } int example_set_var3(int *array, int array_size) { compute(10); return 0; } int example_set_var4(int *array, int array_size) { compute(10); return 0; } int example_set_var5(int *array, int array_size) { compute(10); return 0; } int example_add_var(int *array, int array_size) { compute(10); return 0; } int example_sub_var(int *array, int array_size) { compute(10); return 0; } eztrace-2.1/test/module_generator/example_application/example.h000066400000000000000000000016571447213526500251670ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef __EXAMPLE_H__ #define __EXAMPLE_H__ void compute(unsigned usec); int example_do_event(int n); /* dummy function #1 */ double example_function1(double*, int); /* dummy function #2 */ int example_function2(int*, int); int example_fcall(int *array, int array_size); int example_push(int *array, int array_size); int example_pop(int *array, int array_size); int example_event(int *array, int array_size); int example_set_var(int *array, int array_size); int example_add_var(int *array, int array_size); int example_sub_var(int *array, int array_size); int example_set_var2(int *array, int array_size); int example_set_var3(int *array, int array_size); int example_set_var4(int *array, int array_size); int example_set_var5(int *array, int array_size); #endif /* __EXAMPLE_H__ */ eztrace-2.1/test/module_generator/example_application/main.c000066400000000000000000000035661447213526500244540ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* simple program that calls the libexample library */ #include #include #include "example.h" #define SIZE (1024*1024) void appli_function1(double* array, int size) { fprintf(stderr, "appli function1 (%p, %d)\n", array, size); compute(10); } int main(int argc, char**argv) { double *double_array = NULL; int *int_array = NULL; int func_num = 0; func_num = example_do_event(func_num); example_function1(double_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_function2(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_fcall(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_push(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_pop(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_event(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_set_var(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_add_var(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_sub_var(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_set_var2(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_set_var3(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_set_var4(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); example_set_var5(int_array, SIZE); compute(200000); func_num = example_do_event(func_num); appli_function1(double_array, SIZE); compute(200000); return 0; } eztrace-2.1/test/module_generator/simple.tpl000066400000000000000000000012001447213526500213370ustar00rootroot00000000000000BEGIN_MODULE NAME simple_lib DESC "module for the simple example library" LANGUAGE C BEGIN_INCLUDE #include END_INCLUDE void appli_function1(double* array, int size) BEGIN RECORD_STATE("running appli_function1") END double example_function1(double* array, int array_size) int example_function2(int* array, int array_size) BEGIN RECORD_STATE("running example_function2") END int example_fcall( int* array, int array_size ) BEGIN CALL_FUNC END int example_pushpop (int* array,int array_size) BEGIN PUSH_STATE("doing function example_push") CALL_FUNC POP_STATE("doing function example_push") END END_MODULE eztrace-2.1/test/module_generator/test_pptrace.tbl000066400000000000000000000007501447213526500225360ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. # There are deliberately trailing whitespace everywhere. This # (<-- see?) is for stressing the script parser. # Sorry for the inconvenience. BEGIN_MODULE NAME test_pptrace DESC "Module to test the instrumentation by pptrace" LANGUAGE C ID 13 int test_pptrace_foo(uint32_t* array, uint32_t array_size) BEGIN RECORD_STATE("running test_pptrace_function1") END END_MODULE eztrace-2.1/test/module_generator/test_pptrace_application/000077500000000000000000000000001447213526500244145ustar00rootroot00000000000000eztrace-2.1/test/module_generator/test_pptrace_application/Makefile000066400000000000000000000017031447213526500260550ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. CC = gcc CFLAGS = -O0 -marm -march=armv7-a -g BIN = libtest_pptrace.static.a libtest_pptrace.shared.so main.shared main.static all: $(BIN) main.shared: main.c test_pptrace.h $(CC) $(CFLAGS) -o main.shared main.c -L. -ltest_pptrace.shared main.static: main.c test_pptrace.h $(CC) $(CFLAGS) -o main.static main.c -static -L. -ltest_pptrace.static libtest_pptrace.shared.so: test_pptrace.shared.o $(CC) $(CFLAGS) --shared -o libtest_pptrace.shared.so test_pptrace.shared.o -ldl libtest_pptrace.static.a: test_pptrace.static.o ar rcv libtest_pptrace.static.a test_pptrace.static.o test_pptrace.shared.o: test_pptrace.c test_pptrace.h $(CC) $(CFLAGS) -o test_pptrace.shared.o -c test_pptrace.c -fPIC test_pptrace.static.o: test_pptrace.c test_pptrace.h $(CC) $(CFLAGS) -o test_pptrace.static.o -c test_pptrace.c clean: rm -f $(BIN) *.o *.so eztrace-2.1/test/module_generator/test_pptrace_application/main.c000066400000000000000000000011311447213526500255000ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* * Simple program that calls the libexample library */ #include #include #include "test_pptrace.h" #define SIZE 1024 int main(int argc, char* argv) { uint32_t *int_array = malloc(sizeof(uint32_t) * SIZE); uint32_t i, sum; /* initialize the arrays */ for (i = 0; i < SIZE; i++) { int_array[i] = (i * i) % 31; } sum = test_pptrace_foo(int_array, SIZE); printf("sum int = %d\n", sum); return 0; } eztrace-2.1/test/module_generator/test_pptrace_application/test_pptrace.c000066400000000000000000000007541447213526500272630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include "test_pptrace.h" double test_pptrace_foo(uint32_t *array, uint32_t array_size) { printf("Entered test_pptrace_foo!\n"); uint32_t i, sum; sum = 0; for (i = 0; i < array_size; i++) { array[i] = array[i] * (i + 1); sum += array[i]; } printf("Leaving test_pptrace_foo!\n"); return sum; } eztrace-2.1/test/module_generator/test_pptrace_application/test_pptrace.h000066400000000000000000000004651447213526500272670ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef __TEST_PPTRACE_H__ #define __TEST_PPTRACE_H__ #include double test_pptrace_foo(uint32_t*, uint32_t); #endif /* __TEST_PPTRACE_H__ */ eztrace-2.1/test/mpi/000077500000000000000000000000001447213526500145665ustar00rootroot00000000000000eztrace-2.1/test/mpi/CMakeLists.txt000066400000000000000000000013231447213526500173250ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_MPI) set(CMAKE_C_COMPILER ${MPICC}) set(CMAKE_Fortran_COMPILER ${MPIF90}) add_executable(mpi_ping ../mpi/mpi_ping.c) add_test (build_mpi_ping "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target mpi_ping) add_test (mpi_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/../mpi/run.sh" DEPENDS build_mpi_ping) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/mpi") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/mpi/Makefile000066400000000000000000000002721447213526500162270ustar00rootroot00000000000000MPICC_PATH ?= mpicc CC=$(MPICC_PATH) BIN=mpi_ring mpi_multiring mpi_spawn test_mpi waitall waitany persistent mpi_ping allgather all: $(BIN) test: all ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/mpi/allgather.c000066400000000000000000000016031447213526500166750ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "mpi.h" #include #include int main(int argc, char **argv) { int rank, size; int errors = 0; MPI_Comm comm = MPI_COMM_WORLD; int sendarray[100]; int *rbuf; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); /* Exactly 2 processes can participate */ if (size < 2) { fprintf(stderr, "Number of processors must be at least 2\n"); fflush(stderr); MPI_Abort(MPI_COMM_WORLD, 1); } rbuf = (int *) malloc(size * 100 * sizeof(int)); MPI_Allgather(sendarray, 100, MPI_INT, rbuf, 100, MPI_INT, comm); MPI_Finalize(); if (errors) { printf("[%d] done with ERRORS(%d)!\n", rank, errors); fflush(stdout); } return errors; } eztrace-2.1/test/mpi/mpi_communicators/000077500000000000000000000000001447213526500203165ustar00rootroot00000000000000eztrace-2.1/test/mpi/mpi_communicators/Makefile000066400000000000000000000002501447213526500217530ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. CC=mpicc BIN=comm_p2p all: $(BIN) clean: rm -f $(BIN)eztrace-2.1/test/mpi/mpi_communicators/comm_p2p.c000066400000000000000000000054001447213526500221750ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "mpi.h" #include #include #define NPROCS 4 int main(int argc, char *argv[]) { int rank, new_rank, sendbuf, recvbuf, numtasks, ranks1[2] = {0, 1}, ranks2[2] = {2, 3}; MPI_Group orig_group, new_group; MPI_Comm new_comm; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); if (numtasks != NPROCS) { printf("Must specify MP_PROCS= %d. Terminating.\n", NPROCS); MPI_Finalize(); exit(0); } sendbuf = rank; /* Extract the original group handle */ MPI_Comm_group(MPI_COMM_WORLD, &orig_group); /* Divide tasks into two distinct groups based upon rank */ if (rank < NPROCS / 2) { MPI_Group_incl(orig_group, NPROCS / 2, ranks1, &new_group); } else { MPI_Group_incl(orig_group, NPROCS / 2, ranks2, &new_group); } /* Create new new communicator and then perform collective communications */ MPI_Comm_create(MPI_COMM_WORLD, new_group, &new_comm); int i; /* test blocking communications */ for (i = 0; i < NPROCS / 2; i++) { MPI_Send(&sendbuf, 1, MPI_INT, i, 0, new_comm); } for (i = 0; i < NPROCS / 2; i++) { MPI_Recv(&recvbuf, 1, MPI_INT, i, 0, new_comm, MPI_STATUS_IGNORE); } /* test non-blocking communications */ MPI_Request reqs[NPROCS / 2]; for (i = 0; i < NPROCS / 2; i++) { MPI_Isend(&sendbuf, 1, MPI_INT, i, 0, new_comm, &reqs[i]); } MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); for (i = 0; i < NPROCS / 2; i++) { MPI_Irecv(&recvbuf, 1, MPI_INT, i, 0, new_comm, &reqs[i]); } MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); /* test persistant requests */ for (i = 0; i < NPROCS / 2; i++) { MPI_Send_init(&sendbuf, 1, MPI_INT, i, 0, new_comm, &reqs[i]); } MPI_Startall(NPROCS / 2, reqs); MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); MPI_Startall(NPROCS / 2, reqs); MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); for (i = 0; i < NPROCS / 2; i++) { MPI_Recv_init(&recvbuf, 1, MPI_INT, i, 0, new_comm, &reqs[i]); } MPI_Startall(NPROCS / 2, reqs); MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); MPI_Startall(NPROCS / 2, reqs); MPI_Waitall(NPROCS / 2, reqs, MPI_STATUSES_IGNORE); MPI_Group_rank(new_group, &new_rank); printf("rank= %d newrank= %d recvbuf= %d\n", rank, new_rank, recvbuf); sleep(1); /* test blocking communications for MPI_COMM_WORLD */ for (i = 0; i < NPROCS; i++) { MPI_Send(&sendbuf, 1, MPI_INT, i, 0, MPI_COMM_WORLD); } for (i = 0; i < NPROCS; i++) { MPI_Recv(&recvbuf, 1, MPI_INT, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_eztrace_start.c000066400000000000000000000067041447213526500204600ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* This program tests the eztrace_start/eztrace_stop fonctions that permit to * record events during a small part of the application. * to compile it, run: * $ mpicc -o mpi_eztrace_start mpi_eztrace_start.c -I$EZTRACE_ROOT/include -L$EZTRACE_ROOT/lib -leztrace -leztrace-mpi -lmpich * then run it with: * $ mpirun -np 2 ./mpi_eztrace_start * The generated trace should contain only the final MPI_Barrier */ #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define LEN 1024 #define LOOPS 10 static int comm_rank = -1; static int comm_size = -1; static char host_name[1024] = ""; static unsigned char *main_buffer = NULL; /* fill the buffer */ void fill_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 'a' + (i % 26); } /* fill the buffer with 0 */ void zero_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 0; } /* check wether the buffer contains errornous data * return 1 if it contains an error */ int check_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) if (buffer[i] != 'a' + (i % 26)) return 1; return 0; } void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while ((t2 - t1) * 1e6 < usec); } int main(int argc, char **argv) { int ping_side; int rank_dst; int start_len = LEN; int iterations = LOOPS; MPI_Init(&argc, &argv); printf("MPI init done !\n"); MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size < 2) { fprintf(stderr, "This program requires at least 2 MPI processes, aborting...\n"); goto out; } debug("(%s): My rank is %d\n", host_name, comm_rank); ping_side = !(comm_rank & 1); main_buffer = malloc(start_len); fill_buffer(main_buffer, start_len); int size = 1024; int i; MPI_Barrier(MPI_COMM_WORLD); for (i = 0; i < iterations; i++) { if (!comm_rank) { MPI_Send(main_buffer, size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); MPI_Recv(main_buffer, size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } else { MPI_Recv(main_buffer, size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); compute(100); MPI_Send(main_buffer, size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); } MPI_Barrier(MPI_COMM_WORLD); } eztrace_start(); MPI_Barrier(MPI_COMM_WORLD); eztrace_stop(); out: free(main_buffer); MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_in_place.F90000066400000000000000000000010141447213526500174610ustar00rootroot00000000000000program test_mpi_in_place implicit none #include "mpif.h" integer ierr, rank, size call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr) call MPI_Comm_size(MPI_COMM_WORLD, size, ierr) call MPI_AllReduce(mpi_in_place, rank, 1, MPI_INTEGER, & MPI_MAX, MPI_COMM_WORLD, ierr) if(rank .ne. size - 1) then print *, "Max rank is:", rank print *, "It should be:", size call abort endif print *, "Max rank is:", rank call MPI_Finalize(ierr) end program test_mpi_in_place eztrace-2.1/test/mpi/mpi_multiring.c000066400000000000000000000060141447213526500176120ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #define LEN 1024 #define LOOPS 2 #define NB_MSG 4 static int comm_rank = -1; static int comm_size = -1; static char host_name[1024] = ""; static unsigned char **main_buffer = NULL; /* fill the buffer */ void fill_buffer(unsigned char** buffer, int buffer_size) { int i, j; for (i = 0; i < NB_MSG; i++) for (j = 0; j < buffer_size; j++) buffer[i][j] = 'a' + (j % 26); } /* fill the buffer with 0 */ void zero_buffer(unsigned char** buffer, int buffer_size) { int i, j; for (i = 0; i < NB_MSG; i++) for (j = 0; j < buffer_size; j++) buffer[i][j] = 0; } /* check wether the buffer contains errornous data * return 1 if it contains an error */ int check_buffer(unsigned char** buffer, int buffer_size) { int i, j; for (i = 0; i < NB_MSG; i++) for (j = 0; j < buffer_size; j++) if (buffer[i][j] != 'a' + (i % 26)) return 1; return 0; } void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while ((t2 - t1) * 1e6 < usec); } int main(int argc, char **argv) { int ping_side; int rank_dst; int start_len = LEN; int iterations = LOOPS; int i, j; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size < 2) { fprintf(stderr, "This program requires at least 2 MPI processes, aborting...\n"); goto out; } fprintf(stdout, "(%s): My rank is %d\n", host_name, comm_rank); ping_side = !(comm_rank & 1); main_buffer = malloc(sizeof(unsigned char*) * NB_MSG); for (i = 0; i < NB_MSG; i++) main_buffer[i] = malloc(start_len); fill_buffer(main_buffer, start_len); int size = 1024; //MPI_Barrier(MPI_COMM_WORLD); for (i = 0; i < iterations; i++) { for (j = 0; j < comm_rank; j++) compute(100); if (!comm_rank) { for (j = 0; j < NB_MSG; j++) MPI_Send(main_buffer[j], size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); } else { for (j = 0; j < NB_MSG; j++) MPI_Recv(main_buffer[j], size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } compute(100); if (!comm_rank) { for (j = 0; j < NB_MSG; j++) MPI_Recv(main_buffer[j], size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } else { for (j = 0; j < NB_MSG; j++) MPI_Send(main_buffer[j], size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); } } MPI_Barrier(MPI_COMM_WORLD); out: for (i = 0; i < NB_MSG; i++) free(main_buffer[i]); MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_openmp.c000066400000000000000000000046251447213526500171040ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include //#define LEN (1024*1024*100) #define LEN (10*1024*1024) #define LOOPS 5 static int comm_rank = -1; static int comm_size = -1; static char host_name[1024] = ""; static unsigned char *main_buffer = NULL; /* fill the buffer */ void fill_buffer(double* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = (double) i; } /* fill the buffer with 0 */ void zero_buffer(double* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 0; } /* 'Compute' for a fixed duration */ void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while (((t2 - t1) * 1e6) < (double) usec); } int main(int argc, char **argv) { int ping_side; int rank_dst; int required = MPI_THREAD_SERIALIZED; int provided; MPI_Init_thread(&argc, &argv, required, &provided); if (required != provided) { fprintf(stderr, "MPI does not support thread safety level %d\n", required); return 1; } MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size != 2) { fprintf(stderr, "This program requires 2 MPI processes, aborting...\n"); goto out; } fprintf(stdout, "(%s): My rank is %d\n", host_name, comm_rank); ping_side = !(comm_rank & 1); rank_dst = ping_side ? (comm_rank | 1) : (comm_rank & ~1); int i; int nb_iter = LOOPS; int size = LEN; int iter = 0; double *A = malloc(size * sizeof(double)); double *B = malloc(size * sizeof(double)); fill_buffer(A, size); zero_buffer(B, size); MPI_Request req[2]; MPI_Barrier(MPI_COMM_WORLD); for (iter = 0; iter < nb_iter; iter++) { fprintf(stderr, "[%d] loop %d\n", comm_rank, iter); #pragma omp parallel for for (i = 0; i < size; i++) { A[i] = B[i] + A[i]; } MPI_Isend(A, size, MPI_DOUBLE, rank_dst, 0, MPI_COMM_WORLD, &req[0]); MPI_Recv(B, size, MPI_DOUBLE, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); MPI_Wait(&req[0], MPI_STATUS_IGNORE); } MPI_Barrier(MPI_COMM_WORLD); free(A); free(B); out: MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_ping.c000066400000000000000000000043711447213526500165410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #define LEN 16 #define LOOPS 10000 #define WARMUP 100 static unsigned char *main_buffer = NULL; void SEND(char* buffer, int len, int dest, int tag) { MPI_Send(buffer, len, MPI_CHAR, dest, tag, MPI_COMM_WORLD); } void RECV(char* buffer, int len, int src, int tag) { MPI_Recv(buffer, len, MPI_CHAR, src, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } void fill_buffer(char *buffer, int len) { int i; for (i = 0; i < len; i++) { buffer[i] = 'a' + (i % 26); } } void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while ((t2 - t1) * 1e6 < usec); } int main(int argc, char **argv) { int comm_rank = -1; int comm_size = -1; char host_name[1024] = ""; int dest; int len = LEN; int iterations = LOOPS; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size != 2) { fprintf(stderr, "This program requires 2 MPI processes, aborting...\n"); goto out; } fprintf(stdout, "(%s): My rank is %d\n", host_name, comm_rank); dest = (comm_rank + 1) % 2; main_buffer = malloc(len); fill_buffer(main_buffer, len); int i; for (i = 0; i < WARMUP; i++) { if (!comm_rank) { SEND(main_buffer, len, dest, 0); RECV(main_buffer, len, dest, 0); } else { RECV(main_buffer, len, dest, 0); SEND(main_buffer, len, dest, 0); } } double t1, t2; t1 = MPI_Wtime(); MPI_Barrier(MPI_COMM_WORLD); for (i = 0; i < iterations; i++) { if (!comm_rank) { SEND(main_buffer, len, dest, 0); RECV(main_buffer, len, dest, 0); } else { RECV(main_buffer, len, dest, 0); SEND(main_buffer, len, dest, 0); } } MPI_Barrier(MPI_COMM_WORLD); t2 = MPI_Wtime(); if (!comm_rank) { double latency = 1e6 * (t2 - t1) / (2 * iterations); printf("%d\t%d\t%lf\n", iterations, len, latency); } out: free(main_buffer); MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_ring.c000066400000000000000000000056461447213526500165510ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define LEN 1024 #define LOOPS 10 static int comm_rank = -1; static int comm_size = -1; static char host_name[1024] = ""; static unsigned char *main_buffer = NULL; /* fill the buffer */ void fill_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 'a' + (i % 26); } /* fill the buffer with 0 */ void zero_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 0; } /* check wether the buffer contains errornous data * return 1 if it contains an error */ int check_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) if (buffer[i] != 'a' + (i % 26)) return 1; return 0; } void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while ((t2 - t1) * 1e6 < usec); } int main(int argc, char **argv) { int ping_side; int rank_dst; int start_len = LEN; int iterations = LOOPS; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size < 2) { fprintf(stderr, "This program requires at least 2 MPI processes, aborting...\n"); goto out; } debug("(%s): My rank is %d\n", host_name, comm_rank); ping_side = !(comm_rank & 1); main_buffer = malloc(start_len); fill_buffer(main_buffer, start_len); int size = 1024; int i; MPI_Barrier(MPI_COMM_WORLD); for (i = 0; i < iterations; i++) { if (!comm_rank) { MPI_Send(main_buffer, size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); MPI_Recv(main_buffer, size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } else { MPI_Recv(main_buffer, size, MPI_CHAR, (comm_rank + comm_size - 1) % comm_size, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); compute(100); MPI_Send(main_buffer, size, MPI_CHAR, (comm_rank + 1) % comm_size, 0, MPI_COMM_WORLD); } MPI_Barrier(MPI_COMM_WORLD); } out: free(main_buffer); MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/mpi_spawn.c000066400000000000000000000016541447213526500167350ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "mpi.h" #include #include #define NUM_SPAWNS 2 /* 'Compute' for a fixed duration */ void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while (((t2 - t1) * 1e6) < (double) usec); } int main(int argc, char *argv[]) { int np = NUM_SPAWNS; int errcodes[NUM_SPAWNS]; MPI_Comm parentcomm, intercomm; MPI_Init(&argc, &argv); MPI_Comm_get_parent(&parentcomm); compute(100000); if (parentcomm == MPI_COMM_NULL) { MPI_Comm_spawn("./mpi_spawn", MPI_ARGV_NULL, np, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm, errcodes); printf("I'm the parent.\n"); compute(1000000); } else { printf("I'm the spawned.\n"); } fflush(stdout); MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/persistent.c000066400000000000000000000035501447213526500171350ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include int main(int argc, char **argv) { int numtasks, rank; int rank_dst, ping_side; // Initialise MPI MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); if (numtasks != 2) { printf("Need 2 processes\n"); MPI_Abort(MPI_COMM_WORLD, 1); exit(1); } ping_side = !(rank & 1); rank_dst = ping_side ? (rank | 1) : (rank & ~1); if (ping_side) { int x = 42, y; MPI_Request send_request; MPI_Request recv_request; MPI_Send_init(&x, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD, &send_request); MPI_Start(&send_request); MPI_Wait(&send_request, MPI_STATUS_IGNORE); MPI_Start(&send_request); MPI_Wait(&send_request, MPI_STATUS_IGNORE); MPI_Recv_init(&y, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD, &recv_request); MPI_Start(&recv_request); MPI_Wait(&recv_request, MPI_STATUS_IGNORE); if (y == 42) printf("success\n"); else printf("failure\n"); MPI_Start(&recv_request); MPI_Wait(&recv_request, MPI_STATUS_IGNORE); if (y == 42) printf("success\n"); else printf("failure\n"); } else { int x, y; MPI_Recv(&x, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); MPI_Recv(&y, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); MPI_Send(&y, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD); MPI_Send(&y, 1, MPI_INT, rank_dst, 1, MPI_COMM_WORLD); if (x == 42) printf("success\n"); else printf("failure\n"); if (y == 42) printf("success\n"); else printf("failure\n"); } MPI_Barrier(MPI_COMM_WORLD); MPI_Finalize(); exit(0); } eztrace-2.1/test/mpi/run.sh000077500000000000000000000006331447213526500157330ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 [ -n "$MPI_MODULE_NAME" ] || MPI_MODULE_NAME=mpi check_module "$MPI_MODULE_NAME" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/mpi/test_mpi.c000066400000000000000000000432771447213526500165730ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #define LEN 1024 #define LOOPS 10 static int comm_rank = -1; static int comm_size = -1; static char host_name[1024] = ""; static unsigned char *main_buffer = NULL; /* fill the buffer */ void fill_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 'a' + (i % 26); } /* fill the buffer with 0 */ void zero_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) buffer[i] = 0; } /* check wether the buffer contains errornous data * return 1 if it contains an error */ int check_buffer(unsigned char* buffer, int buffer_size) { int i; for (i = 0; i < buffer_size; i++) if (buffer[i] != 'a' + (i % 26)) return 1; return 0; } /* 'Compute' for a fixed duration */ void compute(unsigned usec) { double t1, t2; t1 = MPI_Wtime(); do { t2 = MPI_Wtime(); } while (((t2 - t1) * 1e6) < (double) usec); } int main(int argc, char **argv) { int ping_side; int rank_dst; int start_len = LEN; int iterations = LOOPS; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &comm_size); MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank); if (gethostname(host_name, 1023) < 0) { perror("gethostname"); exit(1); } if (comm_size != 2) { fprintf(stderr, "This program requires 2 MPI processes, aborting...\n"); goto out; } fprintf(stdout, "(%s): My rank is %d\n", host_name, comm_rank); ping_side = !(comm_rank & 1); rank_dst = ping_side ? (comm_rank | 1) : (comm_rank & ~1); main_buffer = malloc(start_len); fill_buffer(main_buffer, start_len); MPI_Barrier(MPI_COMM_WORLD); /* Test */ if (ping_side) { int size = start_len; int nb_samples; MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Send/MPI_Recv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC+ANYTAG failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC+ANYTAG passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYTAG failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYTAG passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Ssend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Ssend/MPI_Recv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Ssend/MPI_Recv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { fill_buffer(main_buffer, size); MPI_Rsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Rsend/MPI_Recv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Rsend/MPI_Recv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* non blocking functions */ for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; fill_buffer(main_buffer, size); MPI_Isend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); compute(100); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Isend/MPI_Irecv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Isend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; fill_buffer(main_buffer, size); MPI_Issend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); compute(100); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Issend/MPI_Irecv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Issend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; fill_buffer(main_buffer, size); MPI_Irsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); compute(100); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Bsend */ int bufsize = 1024 + MPI_BSEND_OVERHEAD; char *buf = malloc(bufsize); MPI_Buffer_attach(buf, bufsize); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; fill_buffer(main_buffer, size); MPI_Bsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } } fprintf(stderr, "[%d] MPI_Bsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Ibsend */ for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; fill_buffer(main_buffer, size); MPI_Bsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); compute(100); zero_buffer(main_buffer, size); MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } } MPI_Buffer_detach(&buf, &bufsize); fprintf(stderr, "[%d] MPI_Ibsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Waitall */ for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req[4]; int vars[4]; int i; for (i = 0; i < 4; i++) { vars[i] = i * i; MPI_Isend(&vars[i], 1, MPI_INTEGER, rank_dst, 0, MPI_COMM_WORLD, &req[i]); } MPI_Waitall(4, req, MPI_STATUS_IGNORE); compute(100); for (i = 0; i < 4; i++) { vars[i] = -1; MPI_Irecv(&vars[i], 1, MPI_INTEGER, rank_dst, 0, MPI_COMM_WORLD, &req[i]); } MPI_Waitall(4, req, MPI_STATUS_IGNORE); for (i = 0; i < 4; i++) { if (vars[i] != i * i) { fprintf(stderr, "[%d] MPI_Waitall failed !\n", ping_side); goto out; } } } fprintf(stderr, "[%d] MPI_Waitall passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); } else { int size = start_len; int nb_samples; MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Send/MPI_Recv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC+ANYTAG failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYSRC+ANYTAG passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYTAG failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Send(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Send/MPI_Recv ANYTAG passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Ssend/MPI_Recv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Ssend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Ssend/MPI_Recv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Recv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Rsend/MPI_Recv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Rsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Rsend/MPI_Recv passed\n", ping_side); /* non blocking functions */ MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Isend/MPI_Irecv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Isend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Isend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Isend/MPI_Irecv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Issend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Issend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Irsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Bsend */ int bufsize = 1024 + MPI_BSEND_OVERHEAD; char *buf = malloc(bufsize); MPI_Buffer_attach(buf, bufsize); for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Bsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD); zero_buffer(main_buffer, size); } fprintf(stderr, "[%d] MPI_Bsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Ibsend */ for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req; MPI_Irecv(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); if (check_buffer(main_buffer, size)) { fprintf(stderr, "[%d] MPI_Irsend/MPI_Irecv failed !\n", ping_side); goto out; } fill_buffer(main_buffer, size); MPI_Ibsend(main_buffer, size, MPI_CHAR, rank_dst, 0, MPI_COMM_WORLD, &req); MPI_Wait(&req, MPI_STATUS_IGNORE); zero_buffer(main_buffer, size); } MPI_Buffer_detach(&buf, &bufsize); fprintf(stderr, "[%d] MPI_Ibsend/MPI_Irecv passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); /* MPI_Ibsend */ for (nb_samples = 0; nb_samples < iterations; nb_samples++) { MPI_Request req[4]; int vars[4]; int i; for (i = 0; i < 4; i++) { vars[i] = -1; MPI_Irecv(&vars[i], 1, MPI_INTEGER, rank_dst, 0, MPI_COMM_WORLD, &req[i]); } MPI_Waitall(4, req, MPI_STATUS_IGNORE); compute(100); for (i = 0; i < 4; i++) { MPI_Isend(&vars[i], 1, MPI_INTEGER, rank_dst, 0, MPI_COMM_WORLD, &req[i]); } MPI_Waitall(4, req, MPI_STATUS_IGNORE); for (i = 0; i < 4; i++) { if (vars[i] != i * i) { fprintf(stderr, "[%d] MPI_Waitall failed !\n", ping_side); goto out; } } } fprintf(stderr, "[%d] MPI_Waitall passed\n", ping_side); MPI_Barrier(MPI_COMM_WORLD); } free(main_buffer); out: MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/test_mpi_ping.sh000077500000000000000000000020201447213526500177600ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="mpi_ping" np="2" [ -n "$MPI_MODULE_NAME" ] || MPI_MODULE_NAME=mpi run_and_check_command "$MPIRUN_PATH" $MPIRUN_CLI_OPTION -np $np "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "$MPI_MODULE_NAME ./$name" trace_filename="${name}_trace/eztrace_log.otf2" if ! "$OTF2_PRINT_PATH" "$trace_filename" 2>&1 > /dev/null ; then print_error "Cannot parse trace '$trace_filename'" exit 1 fi trace_check_enter_leave_parity "$trace_filename" # 2 processes: 100 warmup + 10000 iterations = 2*(100+10000) = 20200 sends and recvs trace_check_event_type "$trace_filename" "MPI_SEND" 20200 trace_check_event_type "$trace_filename" "MPI_RECV" 20200 trace_check_nb_enter "$trace_filename" "MPI_Send" 20200 trace_check_nb_leave "$trace_filename" "MPI_Send" 20200 trace_check_nb_enter "$trace_filename" "MPI_Recv" 20200 trace_check_nb_leave "$trace_filename" "MPI_Recv" 20200 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/mpi/test_mpi_waitall.sh000077500000000000000000000023531447213526500204710ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="waitall" np="4" [ -n "$MPI_MODULE_NAME" ] || MPI_MODULE_NAME=mpi run_and_check_command "$MPIRUN_PATH" $MPIRUN_CLI_OPTION -np $np "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "$MPI_MODULE_NAME ./$name" trace_filename="${name}_trace/eztrace_log.otf2" if ! "$OTF2_PRINT_PATH" "$trace_filename" 2>&1 > /dev/null ; then print_error "Cannot parse trace '$trace_filename'" exit 1 fi trace_check_enter_leave_parity "$trace_filename" # 2 processes: 100 warmup + 10000 iterations = 2*(100+10000) = 20200 sends and recvs trace_check_event_type "$trace_filename" "MPI_ISEND" 3 trace_check_event_type "$trace_filename" "MPI_ISEND_COMPLETE" 3 trace_check_event_type "$trace_filename" "MPI_IRECV" 3 trace_check_event_type "$trace_filename" "MPI_IRECV_REQUEST" 3 trace_check_nb_enter "$trace_filename" "MPI_Isend" 3 trace_check_nb_leave "$trace_filename" "MPI_Isend" 3 trace_check_nb_enter "$trace_filename" "MPI_Irecv" 3 trace_check_nb_leave "$trace_filename" "MPI_Irecv" 3 trace_check_nb_enter "$trace_filename" "MPI_Waitall" 4 trace_check_nb_leave "$trace_filename" "MPI_Waitall" 4 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/mpi/waitall.c000066400000000000000000000030041447213526500163640ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "mpi.h" #include int main(int argc, char *argv[]) { int rank, size; int i, index; int buffer[400]; MPI_Request request[4]; MPI_Status status[4]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); if (size != 4) { printf("Please run with 4 processes.\n"); fflush(stdout); MPI_Finalize(); return 1; } MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { for (i = 0; i < size * 100; i++) buffer[i] = i / 100; for(int round = 0; round < 2; round++) { for (i = 0; i < size - 1; i++) { if(round == 0) { MPI_Isend(&buffer[i * 100], 100, MPI_INT, i + 1, 123, MPI_COMM_WORLD, &request[i]); } else MPI_Irecv(&buffer[i * 100], 100, MPI_INT, i + 1, 123, MPI_COMM_WORLD, &request[i]); } while (1) { /* just for testing if eztrace works when some of the requests are already successful when calling mpi_waitall */ int flag; MPI_Status status; MPI_Test(&request[0], &flag, &status); if (flag) { break; } } MPI_Waitall(size - 1, request, status); MPI_Waitall(size - 1, request, status); } } else { MPI_Recv(buffer, 100, MPI_INT, 0, 123, MPI_COMM_WORLD, &status[0]); printf("%d: buffer[0] = %d\n", rank, buffer[0]); MPI_Send(buffer, 100, MPI_INT, 0, 123, MPI_COMM_WORLD); fflush(stdout); } MPI_Finalize(); return 0; } eztrace-2.1/test/mpi/waitany.c000066400000000000000000000021461447213526500164110ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "mpi.h" #include int main(int argc, char *argv[]) { int rank, size; int i, index; int buffer[400]; MPI_Request request[4]; MPI_Status status[4]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); if (size != 4) { printf("Please run with 4 processes.\n"); fflush(stdout); MPI_Finalize(); return 1; } MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { for (i = 0; i < size * 100; i++) buffer[i] = i / 100; for (i = 0; i < size - 1; i++) { MPI_Isend(&buffer[i * 100], 100, MPI_INT, i + 1, 123, MPI_COMM_WORLD, &request[i]); } for (i = 0; i < size - 1; i++) { MPI_Waitany(size - 1, request, &index, status); fprintf(stderr, "index=%d\n", index); } } else { MPI_Recv(buffer, 100, MPI_INT, 0, 123, MPI_COMM_WORLD, &status[0]); printf("%d: buffer[0] = %d\n", rank, buffer[0]); fflush(stdout); } MPI_Finalize(); return 0; } eztrace-2.1/test/ompt/000077500000000000000000000000001447213526500147605ustar00rootroot00000000000000eztrace-2.1/test/ompt/CMakeLists.txt000066400000000000000000000025151447213526500175230ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_OMPT) set(CMAKE_C_FLAGS "-fopenmp") set(LINK_OPTIONS "-fopenmp") add_executable(ompt_test_lock test_lock.c) add_executable(ompt_test_parallel_for test_parallel_for.c) add_executable(ompt_test_task test_task.c) set_target_properties(ompt_test_lock PROPERTIES OUTPUT_NAME "test_lock") set_target_properties(ompt_test_parallel_for PROPERTIES OUTPUT_NAME "test_parallel_for") set_target_properties(ompt_test_task PROPERTIES OUTPUT_NAME "test_task") add_test(ompt_build_test_lock "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target ompt_test_lock) add_test(ompt_build_test_parallel_for "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target ompt_test_parallel_for) add_test(ompt_build_test_task "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target ompt_test_task) add_test (ompt_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS "ompt_build_test_lock;ompt_build_test_parallel_for;ompt_build_test_task") set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/ompt") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/ompt/Makefile000066400000000000000000000002021447213526500164120ustar00rootroot00000000000000CC=clang CFLAGS=-fopenmp LDFLAGS=-fopenmp BIN=test_lock test_task test_parallel_for test_ompt all: $(BIN) clean: rm -f $(BIN) eztrace-2.1/test/ompt/run.sh000077500000000000000000000005341447213526500161250ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "ompt" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/ompt/test_lock.c000066400000000000000000000006551447213526500171210ustar00rootroot00000000000000#include #include int main() { omp_lock_t lock1, lock2; omp_init_lock(&lock1); omp_init_lock(&lock2); int total = 0; #pragma omp parallel num_threads(50) { omp_set_lock(&lock1); omp_set_lock(&lock2); total += 1; omp_unset_lock(&lock1); omp_unset_lock(&lock2); } omp_destroy_lock(&lock1); omp_destroy_lock(&lock2); printf("Total threads: %d\n", total); return 0; } eztrace-2.1/test/ompt/test_lock.sh000077500000000000000000000014341447213526500173100ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="lock" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "ompt" "./test_$name" trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" #trace_check_enter_leave_parity "$trace_filename" trace_check_event_type "$trace_filename" "THREAD_ACQUIRE_LOCK" 100 trace_check_event_type "$trace_filename" "THREAD_RELEASE_LOCK" 100 trace_check_nb_enter "$trace_filename" "OpenMP acquire mutex" 100 trace_check_nb_leave "$trace_filename" "OpenMP acquire mutex" 100 trace_check_event_type "$trace_filename" "THREAD_BEGIN" 50 trace_check_event_type "$trace_filename" "THREAD_END" 50 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/ompt/test_ompt.c000066400000000000000000000022211447213526500171370ustar00rootroot00000000000000#include #include #include int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num, ompt_data_t *tool_data) { printf("[OMPT] Initialization done in %f\n", omp_get_wtime() - *(double *)(tool_data->ptr)); *(double *)(tool_data->ptr) = omp_get_wtime(); return 1; // success: activates tool } void ompt_finalize(ompt_data_t *tool_data) { printf("[OMPT] Terminaison. Application runtime: %f\n", omp_get_wtime() - *(double *)(tool_data->ptr)); } ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version, const char *runtime_version) { printf("[OMPT] Initializing...\n"); static double time = 0; // static defintion needs constant assigment time = omp_get_wtime(); static ompt_start_tool_result_t ompt_start_tool_result = { &ompt_initialize, &ompt_finalize, {.ptr = &time}}; return &ompt_start_tool_result; // success: registers tool } int main() { #pragma omp parallel num_threads(4) { printf("Hello from thread %i of %i!\n", omp_get_thread_num(), omp_get_num_threads()); } return 0; } eztrace-2.1/test/ompt/test_parallel_for.c000066400000000000000000000003271447213526500206270ustar00rootroot00000000000000#include #include int main() { #pragma omp parallel for num_threads(50) for (int i=0; i<100; i++) { printf("Thread %d running iteration %d\n", omp_get_thread_num(), i); } return 0; } eztrace-2.1/test/ompt/test_parallel_for.sh000077500000000000000000000010331447213526500210150ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="parallel_for" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "ompt" "./test_$name" trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" # trace_check_enter_leave_parity "$trace_filename" trace_check_nb_enter "$trace_filename" "OpenMP parallel" 1 trace_check_nb_leave "$trace_filename" "OpenMP parallel" 1 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/ompt/test_task.c000066400000000000000000000011431447213526500171240ustar00rootroot00000000000000#include #include #include #include _Atomic int nb_tasks=0; unsigned long long fib(int n) { unsigned long long x, y; if (n < 2) return n; #pragma omp task shared(x, n) nb_tasks += 1; x = fib(n-1); #pragma omp task shared(y, n) nb_tasks += 1; y = fib(n-2); #pragma omp taskwait return x+y; } int main() { int n = 10; unsigned long long res = 0; omp_set_num_threads(4); #pragma omp parallel { res = fib(n); } printf("fibonnacci(%d) = %llu\n", n, res); assert(res == 55); printf("Number of executed tasks: %d\n", nb_tasks); } eztrace-2.1/test/ompt/test_task.sh000077500000000000000000000013631447213526500173230ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="task" nb_tasks=$("$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "ompt" "./test_$name" 2>&1 | grep "Number of executed tasks" | cut -d' ' -f5) trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" #trace_check_enter_leave_parity "$trace_filename" trace_check_event_type "$trace_filename" "THREAD_TASK_CREATE" $nb_tasks trace_check_event_type "$trace_filename" "THREAD_TASK_SWITCH" "$((2*nb_tasks))" trace_check_nb_enter "$trace_filename" "OpenMP task" "$((2*nb_tasks))" trace_check_nb_leave "$trace_filename" "OpenMP task" "$((2*nb_tasks))" echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/openmp/000077500000000000000000000000001447213526500152775ustar00rootroot00000000000000eztrace-2.1/test/openmp/CMakeLists.txt000066400000000000000000000036011447213526500200370ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_OPENMP) # openmp tests need to be instrumented with eztrace_cc set(CMAKE_C_FLAGS "-fopenmp") set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/src/modules/omp/bin/eztrace_cc") add_executable(openmp_openmp_simple openmp_simple.c) add_executable(openmp_test_lock test_lock.c) add_executable(openmp_test_nest_lock test_nest_lock.c) add_executable(openmp_test_task test_task.c) target_link_libraries(openmp_openmp_simple eztpomp) target_link_libraries(openmp_test_lock eztpomp) target_link_libraries(openmp_test_nest_lock eztpomp) target_link_libraries(openmp_test_task eztpomp) set_target_properties(openmp_openmp_simple PROPERTIES OUTPUT_NAME "openmp_simple") set_target_properties(openmp_test_lock PROPERTIES OUTPUT_NAME "test_lock") set_target_properties(openmp_test_nest_lock PROPERTIES OUTPUT_NAME "test_nest_lock") set_target_properties(openmp_test_task PROPERTIES OUTPUT_NAME "test_task") add_test(build_openmp_simple "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target openmp_openmp_simple) add_test(build_test_lock "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target openmp_test_lock) add_test(build_test_nest_lock "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target openmp_test_nest_lock) add_test(build_test_task "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target openmp_test_task) add_test (openmp_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS "openmp_build_openmp_simple;openmp_build_test_lock;openmp_build_test_task") set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/omp") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/openmp/Makefile000066400000000000000000000005471447213526500167450ustar00rootroot00000000000000EZTRACE_CC_PATH ?= eztrace_cc CC=$(EZTRACE_CC_PATH) cc CXX=$(EZTRACE_CC_PATH) g++ CFLAGS=-fopenmp LDFLAGS=-fopenmp -lm BIN=openmp_nowait_c openmp_simple openmp_cpp parallel test_lock test_nest_lock test_task all: $(BIN) %: %.c $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) %: %.cpp $(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS) test: $(BIN) ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/openmp/openmp_cpp.cpp000066400000000000000000000034071447213526500201470ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define SIZE (1024*1024) int main(void) { int i; int *A = (int *)malloc(sizeof(int) * SIZE); int *B = (int *)malloc(sizeof(int) * SIZE); int *C = (int *)malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } omp_set_num_threads(4); //compute for real! int j; for (j = 0; j < 3; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel for schedule(static) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } debug("\trunning parallel for schedule(runtime)\n"); #pragma omp parallel for schedule(runtime) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } debug("\trunning parallel for schedule(dynamic)\n"); #pragma omp parallel for schedule(dynamic) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } debug("\trunning parallel for schedule(guided)\n"); #pragma omp parallel for schedule(guided) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } } printf("C[3] = %d\n", C[3]); return 0; } eztrace-2.1/test/openmp/openmp_nowait.f000066400000000000000000000023071447213526500203270ustar00rootroot00000000000000! Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis ! See COPYING in top-level directory. program squelette_RECOM implicit none integer n, i, j, m parameter (n=8, m=100) real*8 a(0:n),b(0:n),c(0:n),r do i=0,n a(i)=sqrt(REAL(i)) b(i)=0 enddo !$OMP PARALLEL !$OMP DO private(i) do i=0,n A(i) = A(i) +1 enddo !$omp end do nowait !$OMP DO private(i) do i=0,n do j=0,((i/10000)+1)*m b(i) = b(i) + sqrt(a(i))/3 enddo enddo !$omp end do nowait !$OMP DO private(i) do i=0,n do j=0,((i/10000)+1)*m c(i) = c(i) + sqrt(a(i))/3 enddo enddo !$omp end do !$OMP DO private(i) do i=0,n-1 do j=0,((i/10000)+1)*m b(i+1) = b(i+1) + sqrt(a(i)) enddo enddo !$omp end do nowait !$omp do private(i) do i=0,n-1 c(i+1) = c(i+1) + sqrt(a(i)) enddo !$omp end do !$omp do private(i) do i=0,n-1 b(i+1) = b(i+1) + sqrt(a(i)) + c(i) enddo !$omp end do !$omp master do i=0,n r=r+b(i) enddo print *, r !$omp end master !$OMP END PARALLEL end eztrace-2.1/test/openmp/openmp_nowait_c.c000066400000000000000000000030101447213526500206160ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define N 100000 #define M 10 int main() { int i, j; double a[N], b[N], c[N]; double r = 0; for (i = 0; i < N; i++) { a[i] = sqrt(i); b[i] = 0; c[i] = 0; } #pragma omp parallel { #pragma omp for private(i, j) nowait for (i = 0; i < N; i++) { for (j = 0; j < ((i / 10000) + 1) * M; j++) { b[i] = b[i] + sqrt(a[i]) / 3; } } #pragma omp for private(i, j) for (i = 0; i < N; i++) { for (j = 0; j < ((i / 10000) + 1) * M; j++) { c[i] = c[i] + sqrt(a[i]); } } #pragma omp for private(i, j) for (i = 0; i < N; i++) { for (j = 0; j < ((i / 10000) + 1) * M; j++) { b[i] = b[i] + sqrt(a[i]) / 3 + c[i]; } } #pragma omp barrier #pragma omp master { for (i = 0; i < N; i++) { r = r + b[i]; } debug("r = %lf\n", r); } } return 0; } eztrace-2.1/test/openmp/openmp_parallel.c000066400000000000000000000037671447213526500206320ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part void fake_compute() { struct timeval t1, t2; gettimeofday(&t1, NULL); do { gettimeofday(&t2, NULL); } while(((t2.tv_sec-t1.tv_sec)*1e6)+(t2.tv_usec-t1.tv_usec) < 100000); } #define SIZE (1024*1024*8) int main(void) { int i; int *A = malloc(sizeof(int) * SIZE); int *B = malloc(sizeof(int) * SIZE); int *C = malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } //compute for real! int j; for (j = 0; j < 3; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel { #pragma omp for schedule(static) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(runtime)\n"); #pragma omp for schedule(runtime) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(dynamic)\n"); #pragma omp for schedule(dynamic) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(guided)\n"); #pragma omp for schedule(guided) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); } } printf("C[3] = %d\n", C[3]); return 0; } eztrace-2.1/test/openmp/openmp_simple.c000066400000000000000000000040001447213526500203040ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part void fake_compute() { struct timeval t1, t2; gettimeofday(&t1, NULL); do { gettimeofday(&t2, NULL); } while(((t2.tv_sec-t1.tv_sec)*1e6)+(t2.tv_usec-t1.tv_usec) < 10000); } #define SIZE (1024*1024) int main(void) { int i; int *A = malloc(sizeof(int) * SIZE); int *B = malloc(sizeof(int) * SIZE); int *C = malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } omp_set_num_threads(4); //compute for real! int j; for (j = 0; j < 3; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel for schedule(static) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(runtime)\n"); #pragma omp parallel for schedule(runtime) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(dynamic)\n"); #pragma omp parallel for schedule(dynamic) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(guided)\n"); #pragma omp parallel for schedule(guided) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); } printf("C[3] = %d\n", C[3]); return 0; } eztrace-2.1/test/openmp/parallel.c000066400000000000000000000037151447213526500172450ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part void fake_compute() { struct timeval t1, t2; gettimeofday(&t1, NULL); do { gettimeofday(&t2, NULL); } while(((t2.tv_sec-t1.tv_sec)*1e6)+(t2.tv_usec-t1.tv_usec) < 100000); } #define SIZE (1024*1024*8) int main(void) { int i; int *A = malloc(sizeof(int) * SIZE); int *B = malloc(sizeof(int) * SIZE); int *C = malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } //compute for real! int j; for (j = 0; j < 3; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel { #pragma omp for schedule(static) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(runtime)\n"); #pragma omp for schedule(runtime) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(dynamic)\n"); #pragma omp for schedule(dynamic) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); debug("\trunning parallel for schedule(guided)\n"); #pragma omp for schedule(guided) for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; } fake_compute(); } } return 0; } eztrace-2.1/test/openmp/run.sh000077500000000000000000000005361447213526500164460ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "openmp" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/openmp/test_lock.c000066400000000000000000000026461447213526500174420ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define SIZE (1024*1024*8) int main(void) { int i; int *A = malloc(sizeof(int) * SIZE); int *B = malloc(sizeof(int) * SIZE); int *C = malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } omp_lock_t lock; omp_init_lock(&lock); int somme = 0; //compute for real! int j; omp_set_num_threads(4); for (j = 0; j < 1; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel for for (i = 0; i < SIZE; i++) { C[i] = A[i] + B[i]; if (i % 1000 == 0) { omp_set_lock(&lock); somme += C[i]; omp_unset_lock(&lock); } } } printf("somme = %d\n", somme); return 0; } eztrace-2.1/test/openmp/test_lock.sh000077500000000000000000000020151447213526500176230ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="lock" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "openmp" "./test_$name" || ((nb_fail++)) trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" || ((nb_fail++)) trace_check_enter_leave_parity "$trace_filename" nb_locks=$(echo "(1024*1024*8/1000)+ 1"|bc) trace_check_event_type "$trace_filename" "THREAD_ACQUIRE_LOCK" $nb_locks trace_check_event_type "$trace_filename" "THREAD_RELEASE_LOCK" $nb_locks trace_check_nb_enter "$trace_filename" "OpenMP Set Lock" $nb_locks trace_check_nb_leave "$trace_filename" "OpenMP Set Lock" $nb_locks trace_check_nb_enter "$trace_filename" "OpenMP Unset Lock" $nb_locks trace_check_nb_leave "$trace_filename" "OpenMP Unset Lock" $nb_locks trace_check_event_type "$trace_filename" "THREAD_TEAM_BEGIN" 4 trace_check_event_type "$trace_filename" "THREAD_TEAM_END" 4 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/openmp/test_nest_lock.c000066400000000000000000000032631447213526500204670ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define SIZE (1024*1024*8) void compute(unsigned usec) { #define TIME_DIFF(t1, t2) ((t2.tv_sec - t1.tv_sec)*1e6) + (t2.tv_usec - t1.tv_usec) struct timeval t1, t2; gettimeofday(&t1, NULL); do { gettimeofday(&t2, NULL); } while (TIME_DIFF(t1, t2) < usec); } int main(void) { int i; int *A = malloc(sizeof(int) * SIZE); int *B = malloc(sizeof(int) * SIZE); int *C = malloc(sizeof(int) * SIZE); for (i = 0; i < SIZE; i++) { A[i] = i * 17 % 7; B[i] = i * 19 % 7; C[i] = 0; } omp_nest_lock_t lock; omp_init_nest_lock(&lock); omp_set_num_threads(4); int somme = 0; //compute for real! int j; for (j = 0; j < 1; j++) { debug("loop %d\n", j); debug("\trunning parallel for schedule(static)\n"); #pragma omp parallel for for (i = 0; i < 100; i++) { omp_set_nest_lock(&lock); compute(10); { omp_set_nest_lock(&lock); compute(10); omp_unset_nest_lock(&lock); } omp_unset_nest_lock(&lock); } } return 0; } eztrace-2.1/test/openmp/test_nest_lock.sh000077500000000000000000000020451447213526500206570ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="nest_lock" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "openmp" "./test_$name" || ((nb_fail++)) trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" || return 1 trace_check_enter_leave_parity "$trace_filename" nb_locks=100 nb_calls=$(echo "$nb_locks * 2"|bc) trace_check_event_type "$trace_filename" "THREAD_ACQUIRE_LOCK" $nb_locks trace_check_event_type "$trace_filename" "THREAD_RELEASE_LOCK" $nb_locks trace_check_nb_enter "$trace_filename" "OpenMP Set Nest Lock" $nb_calls trace_check_nb_leave "$trace_filename" "OpenMP Set Nest Lock" $nb_calls trace_check_nb_enter "$trace_filename" "OpenMP Unset Nest Lock" $nb_calls trace_check_nb_leave "$trace_filename" "OpenMP Unset Nest Lock" $nb_calls trace_check_event_type "$trace_filename" "THREAD_TEAM_BEGIN" 4 trace_check_event_type "$trace_filename" "THREAD_TEAM_END" 4 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/openmp/test_openmp_simple.sh000077500000000000000000000013651447213526500215510ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="openmp_simple" export OMP_NUM_THREADS=4 run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "openmp" "./$name" || ((nb_fail++)) trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" || exit 1 trace_check_enter_leave_parity "$trace_filename" nb_locks=100 nb_calls=$(echo "$nb_locks * 2"|bc) trace_check_event_type "$trace_filename" "THREAD_TEAM_BEGIN" 48 trace_check_event_type "$trace_filename" "THREAD_TEAM_END" 48 trace_check_event_type "$trace_filename" "THREAD_FORK" 12 trace_check_event_type "$trace_filename" "THREAD_JOIN" 12 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/openmp/test_task.c000066400000000000000000000024671447213526500174550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ # include # include # include # include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define SIZE (100) _Atomic int res = 0; omp_lock_t lock; void task_function(int n) { // printf("task_function(%d) : res = %d\n", n, res); if (n % 2) { omp_set_lock(&lock); res += 1; omp_unset_lock(&lock); } } int main(void) { omp_init_lock(&lock); omp_set_num_threads(4); int j; #pragma omp parallel for for (j = 0; j < 10; j++) { debug("loop %d\n", j); for (int i = 0; i < SIZE; i++) { if (j % 2) { #pragma omp task untied task_function(i); } else { #pragma omp task task_function(i); } } #pragma omp taskwait } debug("result = %d\n", res); return 0; } eztrace-2.1/test/openmp/test_task.sh000077500000000000000000000014621447213526500176420ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="task" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "openmp" "./test_$name" || ((nb_fail++)) trace_filename="test_${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" || exit 1 trace_check_enter_leave_parity "$trace_filename" nb_locks=100 nb_calls=$(echo "$nb_locks * 2"|bc) trace_check_event_type "$trace_filename" "THREAD_TEAM_BEGIN" 4 trace_check_event_type "$trace_filename" "THREAD_TEAM_END" 4 trace_check_event_type "$trace_filename" "THREAD_TASK_CREATE" 1000 trace_check_event_type "$trace_filename" "THREAD_TASK_SWITCH" 1000 trace_check_event_type "$trace_filename" "THREAD_TASK_COMPLETE" 1000 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/performance/000077500000000000000000000000001447213526500163025ustar00rootroot00000000000000eztrace-2.1/test/performance/example_application/000077500000000000000000000000001447213526500223205ustar00rootroot00000000000000eztrace-2.1/test/performance/example_application/Makefile000066400000000000000000000006641447213526500237660ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libexample.so main CC = gcc CFLAGS = -O0 -g all: $(BIN) main: main.c example.h $(CC) $(CFLAGS) -o main main.c -L. -lexample libexample.so: example.o $(CC) $(CFLAGS) --shared -o libexample.so example.o -ldl example.o: example.c example.h $(CC) $(CFLAGS) -o example.o -c example.c -fPIC clean: rm -f $(BIN) *.o eztrace-2.1/test/performance/example_application/example.c000066400000000000000000000010651447213526500241210ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include "example.h" int lib_function(double *t, int size, int n) { int res = n; int i; for(i=0; i #include #include #include #include "example.h" #define NITER 100000 #define ARRAY_SIZE (1024*1024) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1e9 + (t2.tv_nsec - t1.tv_nsec)) int bin_function(double *t, int size, int n) { int res = n; int i; for(i=0; i #include #include "eztrace_convert.h" #include "main_ev_codes.h" int eztrace_convert_main_init(); int handle_main_events(eztrace_event_t *ev); int handle_main_stats(eztrace_event_t *ev); void print_main_stats(); void handleEZTRACE_bin_function_1() ; void handleEZTRACE_bin_function_2() ; void handleEZTRACE_lib_function_1() ; void handleEZTRACE_lib_function_2() ; /* thread-specific structure */ struct main_thread_info_t { struct thread_info_t *p_thread; /* TO COMPLETE: You can add per-thread counters here */ }; static struct main_thread_info_t *__register_thread_hook( struct thread_info_t *p_thread) { struct main_thread_info_t *ptr = (struct main_thread_info_t*) malloc( sizeof(struct main_thread_info_t)); ptr->p_thread = p_thread; /* TO COMPLETE: If you added per-thread counters, initialize them here*/ /* add the hook in the thread info structure */ ezt_hook_list_add(&ptr->p_thread->hooks, ptr, (uint8_t) main_EVENTS_ID); return ptr; } #define INIT_main_THREAD_INFO(p_thread, var) \ struct main_thread_info_t *var = (struct main_thread_info_t*) \ ezt_hook_list_retrieve_data(&p_thread->hooks, (uint8_t)main_EVENTS_ID); \ if(!(var)) { \ var = __register_thread_hook(p_thread); \ } /* Constructor of the plugin. * This function registers the current module to eztrace_convert */ struct eztrace_convert_module main_module; void libinit(void) __attribute__ ((constructor)); void libinit(void) { main_module.api_version = EZTRACE_API_VERSION; /* Specify the initialization function. * This function will be called once all the plugins are loaded * and the trace is started. * This function usually declared StateTypes, LinkTypes, etc. */ main_module.init = eztrace_convert_main_init; /* Specify the function to call for handling an event */ main_module.handle = handle_main_events; /* Specify the function to call for handling an event when * eztrace_stats is called */ main_module.handle_stats = handle_main_stats; /* Specify the function to call for printinf statistics */ main_module.print_stats = print_main_stats; /* Specify the module prefix */ main_module.module_prefix = main_EVENTS_ID; asprintf(&main_module.name, "main"); asprintf(&main_module.description, "Module for the main program"); main_module.token.data = &main_module; /* Register the module to eztrace_convert */ eztrace_convert_register_module(&main_module); //printf("module main loaded\n"); } void libfinalize(void) __attribute__ ((destructor)); void libfinalize(void) { } /* * This function will be called once all the plugins are loaded * and the trace is started. * This function usually declared StateTypes, LinkTypes, etc. */ int eztrace_convert_main_init() { if(get_mode() == EZTRACE_CONVERT) { addEntityValue("main_STATE_0", "ST_Thread", "Doing function lib_function", GTG_DARKGREY); } if(get_mode() == EZTRACE_CONVERT) { addEntityValue("main_STATE_1", "ST_Thread", "Doing function bin_function", GTG_DARKGREY); } } /* This function is called by eztrace_convert for each event to * handle. * It shall return 1 if the event was handled successfully or * 0 otherwise. */ int handle_main_events(eztrace_event_t *ev) { if(! CUR_TRACE->start) return 0; switch (LITL_READ_GET_CODE(ev)) { case EZTRACE_bin_function_1: handleEZTRACE_bin_function_1(); break; case EZTRACE_bin_function_2: handleEZTRACE_bin_function_2(); break; case EZTRACE_lib_function_1: handleEZTRACE_lib_function_1(); break; case EZTRACE_lib_function_2: handleEZTRACE_lib_function_2(); break; default: /* The event was not handled */ return 0; } return 1; } /* This function is called by eztrace_stats for each event to * handle. * It shall return 1 if the event was handled successfully or * 0 otherwise. */ int handle_main_stats(eztrace_event_t *ev) { /* By default, use the same function as for eztrace_convert */ return handle_main_events(ev); } void print_main_stats() { printf("\nmain:\n"); printf("-------\n"); int i; /* Browse the list of processes */ for (i = 0; i < NB_TRACES; i++) { struct eztrace_container_t *p_process = GET_PROCESS_CONTAINER(i); int j; /* For each process, browse the list of threads */ for(j=0; jnb_children; j++) { struct eztrace_container_t *thread_container = p_process->children[j]; struct thread_info_t *p_thread = (struct thread_info_t*) thread_container->container_info; if(!p_thread) continue; INIT_main_THREAD_INFO(p_thread, ptr); printf("\tThread %s\n", thread_container->name); /* TO COMPLETE: you can print per-thread counters here */ } } } void handleEZTRACE_bin_function_1() { FUNC_NAME; DECLARE_THREAD_ID_STR(thread_id, CUR_INDEX, CUR_THREAD_ID); DECLARE_CUR_THREAD(p_thread); INIT_main_THREAD_INFO(p_thread, ptr); CHANGE() pushState (CURRENT, "ST_Thread", thread_id, "main_STATE_1"); } void handleEZTRACE_bin_function_2() { FUNC_NAME; DECLARE_THREAD_ID_STR(thread_id, CUR_INDEX, CUR_THREAD_ID); DECLARE_CUR_THREAD(p_thread); INIT_main_THREAD_INFO(p_thread, ptr); CHANGE() popState (CURRENT, "ST_Thread", thread_id); } void handleEZTRACE_lib_function_1() { FUNC_NAME; DECLARE_THREAD_ID_STR(thread_id, CUR_INDEX, CUR_THREAD_ID); DECLARE_CUR_THREAD(p_thread); INIT_main_THREAD_INFO(p_thread, ptr); CHANGE() pushState (CURRENT, "ST_Thread", thread_id, "main_STATE_0"); } void handleEZTRACE_lib_function_2() { FUNC_NAME; DECLARE_THREAD_ID_STR(thread_id, CUR_INDEX, CUR_THREAD_ID); DECLARE_CUR_THREAD(p_thread); INIT_main_THREAD_INFO(p_thread, ptr); CHANGE() popState (CURRENT, "ST_Thread", thread_id); } eztrace-2.1/test/performance/example_application/plugin_main/main.c000066400000000000000000000026361447213526500257210ustar00rootroot00000000000000/* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "eztrace.h" #include "eztrace_sampling.h" #include "main_ev_codes.h" int (*libbin_instrumented_function) (double *t, int size, int n); int (*liblib_instrumented_function) (double *t, int size, int n); int lib_instrumented_function (double *t, int size, int n) { FUNCTION_ENTRY; EZTRACE_EVENT_PACKED_1 (EZTRACE_lib_function_1, n); int ret = liblib_instrumented_function (t, size, n); EZTRACE_EVENT_PACKED_1 (EZTRACE_lib_function_2, n); return ret; } int bin_instrumented_function (double *t, int size, int n) { FUNCTION_ENTRY; EZTRACE_EVENT_PACKED_1 (EZTRACE_bin_function_1, n); int ret = libbin_instrumented_function (t, size, n); EZTRACE_EVENT_PACKED_1 (EZTRACE_bin_function_2, n); return ret; } START_INTERCEPT INTERCEPT2("lib_instrumented_function", liblib_instrumented_function) INTERCEPT2("bin_instrumented_function", libbin_instrumented_function) END_INTERCEPT static void __main_init (void) __attribute__ ((constructor)); /* Initialize the current library */ static void __main_init (void) { DYNAMIC_INTERCEPT_ALL(); /* start event recording */ #ifdef EZTRACE_AUTOSTART eztrace_start (); #endif } static void __main_conclude (void) __attribute__ ((destructor)); static void __main_conclude (void) { /* stop event recording */ eztrace_stop (); } eztrace-2.1/test/performance/example_application/plugin_main/main_ev_codes.h000066400000000000000000000017151447213526500275720ustar00rootroot00000000000000/* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef __main_EV_CODES_H__ #define __main_EV_CODES_H__ /* This file defines the event codes that are used by the example * module. */ #include "ev_codes.h" /* 7-bits event codes prefix. This identifies the module and thus should be * unique. * The 0x0? prefix is reserved for eztrace internal use. Thus you can * use any prefix between 0x80 and 0xff. */ #define main_EVENTS_ID USER_MODULE_ID(0x99) #define main_PREFIX (main_EVENTS_ID << NB_BITS_EVENTS) /* Define various event codes used by the example module * The 2 most significant bytes should correspond to the module id, * as below: */ #define EZTRACE_lib_function_1 (main_PREFIX | 0x1) #define EZTRACE_lib_function_2 (main_PREFIX | 0x2) #define EZTRACE_bin_function_1 (main_PREFIX | 0x3) #define EZTRACE_bin_function_2 (main_PREFIX | 0x4) #endif /* __main_EV_CODES_H__ */ eztrace-2.1/test/posixio/000077500000000000000000000000001447213526500154735ustar00rootroot00000000000000eztrace-2.1/test/posixio/CMakeLists.txt000066400000000000000000000015201447213526500202310ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_POSIXIO) set(CMAKE_C_FLAGS "-pthread") set(LINK_OPTIONS "-pthread") add_executable(posixio posixio.c) add_test(build_posixio "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target posixio) add_executable(my_cat my_cat.c) add_test(build_my_cat "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target my_cat) add_test (posixio_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS "build_posixio;build_my_cat") set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/posixio") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/posixio/Makefile000066400000000000000000000002241447213526500171310ustar00rootroot00000000000000CFLAGS= LDFLAGS=-pthread BIN=posixio my_cat all: $(BIN) %: %.c $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) test: $(BIN) ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/posixio/my_cat.c000066400000000000000000000017021447213526500171130ustar00rootroot00000000000000#include #include #include #include #include int main(int argc, char**argv) { struct timeval t1, t2; gettimeofday(&t1, NULL); if(argc < 2) { fprintf(stderr, "Usage: %s inpu_file output_file\n", argv[0]); return EXIT_FAILURE; } FILE* f_in= fopen(argv[1], "r"); FILE* f_out= fopen(argv[2], "w"); assert(f_in); assert(f_out); sleep(1); int n_bytes=0; char c; while(fread(&c, sizeof(char), 1, f_in)) { fwrite(&c, sizeof(char), 1, f_out); n_bytes++; } fclose(f_in); fclose(f_out); gettimeofday(&t2, NULL); double duration = (t2.tv_sec - t1.tv_sec)*1e6 + (t2.tv_usec - t1.tv_usec); double rate=n_bytes/duration; printf("%d bytes copied in %lf usec -> %lf MB/s\n", n_bytes, duration, rate); int n_functions=2*n_bytes; double cost_per_function=duration/n_functions; printf("-> %lf usec/ function call\n", cost_per_function); return EXIT_SUCCESS; } eztrace-2.1/test/posixio/my_cat_fd.c000066400000000000000000000021451447213526500175660ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include int main(int argc, char**argv) { struct timeval t1, t2; gettimeofday(&t1, NULL); if(argc < 2) { fprintf(stderr, "Usage: %s input_file output_file\n", argv[0]); return EXIT_FAILURE; } int f_in= open(argv[1], O_RDONLY); int f_out= open(argv[2], O_WRONLY|O_CREAT|O_TRUNC|O_SYNC|O_DIRECT, S_IRUSR); assert(f_in >= 0); assert(f_out >= 0); int n_bytes=0; char c; while(read(f_in, &c, sizeof(char))) { write(f_out, &c, sizeof(char)); n_bytes++; } close(f_in); close(f_out); gettimeofday(&t2, NULL); double duration = (t2.tv_sec - t1.tv_sec)*1e6 + (t2.tv_usec - t1.tv_usec); double rate=n_bytes/duration; printf("%d bytes copied in %lf usec -> %lf MB/s\n", n_bytes, duration, rate); int n_functions=2*n_bytes; double cost_per_function=duration/n_functions; printf("-> %lf usec/ function call\n", cost_per_function); return EXIT_SUCCESS; } eztrace-2.1/test/posixio/posixio.c000066400000000000000000000055701447213526500173400ustar00rootroot00000000000000/* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } va_list va; va_start(va, fmt); if (_debug >= 0) { // debug verbose mode vfprintf(stderr, fmt, va); } else { // Don't print out => redirect to /dev/null FILE *f = fopen("/dev/null", "a"); vfprintf(f, fmt, va); fclose(f); } va_end(va); } // end of debugging part #define __STDIO_TEST_STATIC #ifdef __STDIO_TEST_STATIC /*ssize_t read(int fd, void *buf, size_t size) { if(size > 30) size = 30; memcpy(buf, "012345678901234567890123456789", size); sleep(0.1); return (ssize_t)size; } */ #endif // __STDIO_TEST_STATIC /* Number of iterations */ #define ITER 10 /* Number of threads */ #define NTH 2 typedef union { unsigned long long tick; struct { unsigned low; unsigned high; }; } tick_t; int fd[2][2]; sem_t* thread_ready; #define TICK_DIFF(t1, t2) \ ((t2).tick - (t1).tick) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) /* Fake computation of usec microseconds */ void compute(int usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } void* f_thread(void* arg) { int my_id = *(int*) arg; /* Notify the main thread that we got the args */ sem_post(thread_ready); debug("Running thread #%d\n", my_id); int buf = -1; int i; for (i = 0; i < ITER; i++) { /* Wait until the previous thread has finished his job */ read(fd[my_id][0], &buf, sizeof(int)); debug("[%d] [thread #%d] read %d\n", getpid(), my_id, buf); /* compute for 1ms */ compute(50000); buf++; /* Wake up the next thread */ write(fd[(my_id + 1) % 2][1], &buf, sizeof(int)); buf = 0; } debug("End of thread #%d\n", my_id); return NULL; } int main(int argc, char**argv) { pthread_t tid[NTH]; int i; if (pipe(fd[0]) || pipe(fd[1])) { fprintf(stderr, "error while calling pipe\n"); return 1; } sem_unlink("ready"); thread_ready = sem_open("ready", O_CREAT, 0666, 0); for (i = 0; i < NTH; i++) { pthread_create(&tid[i], NULL, f_thread, &i); sem_wait(thread_ready); } sem_unlink("ready"); i = 0; debug("Main thread writes %d\n", i); write(fd[0][1], &i, sizeof(int)); for (i = 0; i < NTH; i++) { pthread_join(tid[i], NULL); } return 0; } eztrace-2.1/test/posixio/run.sh000077500000000000000000000005401447213526500166350ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "posixio" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/posixio/test_my_cat.sh000077500000000000000000000013361447213526500203500ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="my_cat" input_file="input_file.tmp" output_file="output_file.tmp" size=1000 dd if=/dev/random of="$input_file" count=1000 bs=1 run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "posixio" "./$name" "${input_file}" "$output_file" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" nevent=$(echo "$size * 2 +1"|bc) trace_check_event_type "$trace_filename" "IO_OPERATION_BEGIN" $nevent trace_check_event_type "$trace_filename" "IO_OPERATION_COMPLETE" $nevent echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/posixio/test_posixio.sh000077500000000000000000000006301447213526500205620ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="posixio" run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "posixio" "./$name" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/pptrace/000077500000000000000000000000001447213526500154375ustar00rootroot00000000000000eztrace-2.1/test/pptrace/automatic/000077500000000000000000000000001447213526500174255ustar00rootroot00000000000000eztrace-2.1/test/pptrace/automatic/Makefile.in000066400000000000000000000042061447213526500214740ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BITS=@TARGET_BITS@ CORE_DIRECTORY=@abs_top_builddir@/src/core CORE_SRC_DIRECTORY=@abs_top_srcdir@/src/core PPTRACE_DIRECTORY=@abs_top_srcdir@/src/pptrace TEST_DIRECTORY=@abs_top_srcdir@/test/pptrace/automatic ifeq "@HAVE_LIBBFD@" "1" TESTS=errors binary tracing opcodes wait_open hijack endif DEBUG_LEVEL=0 ifeq "@PPTRACE_BINARY_TYPE@" "1" LIBBIN=-lbfd -lopcodes else LIBBIN=-lelf endif PPTRACE_DEPS=errors.c\ binary.c ADDITIONAL_DEPS=$(CORE_SRC_DIRECTORY)/ezt_demangle.c errors_FLAGS=$(LIBBIN) errors_DEPS=$(PPTRACE_DEPS) binary_FLAGS=$(LIBBIN) binary_DEPS=$(PPTRACE_DEPS) wait_open_FLAGS=$(LIBBIN) wait_open_DEPS=$(PPTRACE_DEPS)\ tracing.c tracing_FLAGS=$(LIBBIN) tracing_DEPS=$(PPTRACE_DEPS)\ tracing.c opcodes_FLAGS=$(LIBBIN) opcodes_DEPS=$(PPTRACE_DEPS)\ opcodes.c hijack_FLAGS=$(LIBBIN) hijack_DEPS= $(PPTRACE_DEPS)\ opcodes.c\ tracing.c\ hijack.c\ memory.c\ isize.c TESTCASES_=$(patsubst %.c,%,$(wildcard $(TEST_DIRECTORY)/testcase/*.c)) TESTCASES=$(foreach testcase,$(TESTCASES_),$(foreach b,$(BITS),$(testcase).$(b) $(testcase).$(b).so)) TESTS_CHECK=$(foreach test,$(TESTS),$(test).check) CFLAGS = -O0 -g -I$(PPTRACE_DIRECTORY) -I$(CORE_DIRECTORY) -I$(CORE_SRC_DIRECTORY) -D__PPTRACE_DEBUG_LEVEL=$(DEBUG_LEVEL) .PHONY: check testcase all: distdir: check: testcase $(TESTS) testcase: @make -C $(TEST_DIRECTORY)/testcase BITS='$(BITS)' %.check: % @echo -n " *** RUNNING TEST $<... " @./$<.test || (echo "FAILED!"; false) @echo "OK" %:: $(TEST_DIRECTORY)/%.c @echo CC $@ @$(CC) $(CFLAGS) $^ $(foreach d,$($@_DEPS),$(PPTRACE_DIRECTORY)/$d) $(ADDITIONAL_DEPS) -o $@ $($@_FLAGS) @echo "#!/bin/sh" >$@.test @echo "cd $$PWD" >>$@.test @echo './$@ ${TESTCASES} $$*' >>$@.test @echo 'RES=$$?' >>$@.test @echo 'cd - >/dev/null' >>$@.test @echo 'exit $$RES'>>$@.test @chmod +x $@.test install: installcheck: uninstall: distclean: clean clean: @rm -f $(TESTS) $(foreach d,$(TESTS),$d.test) @if [ -d $(TEST_DIRECTORY)/testcase ] ; then make -C $(TEST_DIRECTORY)/testcase BITS='$(BITS)' clean ; fi eztrace-2.1/test/pptrace/automatic/binary.c000066400000000000000000000127411447213526500210620ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * binary.h -- tests of binary reading functions (binary.h) * * Created on: 4 Aug. 2011 * Author: Damien Martin-Guillerez */ #include #include #include #include #include #include #include #include char *readline(int fd) { char buf; size_t size = 1024; int index = 0; char *buffer = (char*) malloc(size); buffer[index] = 0; int r; while (0 <= (r = read(fd, &buf, 1))) { if (buf == '\n') { return buffer; } //printf("%d ", buf); buffer[index++] = buf; if (index >= size) { size += 1024; buffer = (char*) realloc(buffer, size); } buffer[index] = 0; } if (r < 0) { free(buffer); return NULL; } return buffer; } int compare_name(char *line, char *symbol) { if (strlen(symbol) + 1 >= strlen(line)) return 0; int i = strlen(line) - strlen(symbol) - 1; if (!isblank(line[i])) return 0; return strcmp(line + i + 1, symbol) == 0 ? 1 : 0; } char *get_nm_symbol(char *path, char *symbol) { int p[2]; if (pipe(p) == -1) return NULL; pid_t child = fork(); if (child == -1) { close(p[1]); close(p[0]); return NULL; } if (child == 0) { close(p[0]); close(STDOUT_FILENO); dup2(p[1], STDOUT_FILENO); close(p[1]); execlp("nm", "nm", path, NULL); exit(-1); } else { close(p[1]); char* buffer = readline(p[0]); while (buffer != NULL) { if (compare_name(buffer, symbol)) { close(p[0]); return buffer; } free(buffer); buffer = readline(p[0]); } close(p[0]); } return NULL; } int compare_result(char *path, zzt_symbol *sym, char *symbol) { if (strcmp(sym->symbol_name, symbol)) return -__LINE__; char *nm = get_nm_symbol(path, symbol); if (!nm) return -__LINE__; zzt_word addr = strtoul(nm, NULL, 16); free(nm); if (!addr) return -__LINE__; if (addr != sym->section_addr + sym->symbol_offset) return -__LINE__; return EXIT_SUCCESS; } int test_read_zstring_array(void *bin, char *symbol, char **model) { char **frombin = read_zstring_array(bin, symbol); if (frombin == NULL && model != NULL) return -__LINE__; if (model == NULL && frombin != NULL) return -__LINE__; int i = 0; while (frombin[i] || model[i]) { if (strcmp(frombin[i], model[i]) != 0) return -__LINE__; i++; } if (frombin[i]) return -__LINE__; if (model[i]) return -__LINE__; free_zstring_array(frombin); return 0; } int test_dump_symbol(void *bin, int bits, zzt_symbol *sym, char **model) { char buf[1024]; char buf2[1024]; uint32_t* val32 = (uint32_t*) buf; word_uint* val64 = (word_uint*) buf; int i = 0; ssize_t size = read_symbol(bin, sym, buf, 1024); bits >>= 3; size /= bits; //printf("Size of symbol %s: %d\n", sym->symbol_name, (int)size); for (i = 0; model[i] && i < size; i++) { zzt_word w = (bits == 4) ? val32[i] : val64[i]; size_t s = read_zstring(bin, sym, w, buf2, 1024); // printf("\t[%d] %p %s\n", i, (void*)w, buf2); if (strcmp(model[i], buf2) != 0) return -__LINE__; } if (i < size) { zzt_word w = (bits == 4) ? val32[i] : val64[i]; if (w != 0) return -__LINE__; } else if (model[i]) { return -__LINE__; } return EXIT_SUCCESS; } char *sym_model[] = {"absolutely", "dummy", "heho", NULL}; int testcase(char *path, int bits, char *symbol, char *arraysym, char *nonsym) { void *bin = open_binary(path); if (bin == NULL) return -__LINE__; if (get_binary_bits(bin) != bits) return -__LINE__; if (get_symbol(bin, nonsym) != NULL) return -__LINE__; zzt_symbol *sym = get_symbol(bin, symbol); if (sym == NULL) return -__LINE__; int r = compare_result(path, sym, symbol); free_symbol(sym); if (r < 0) { close_binary(bin); return r; } sym = get_symbol(bin, arraysym); if (sym == NULL) return -__LINE__; r = test_dump_symbol(bin, bits, sym, sym_model); free_symbol(sym); if (r < 0) { close_binary(bin); return r; } r = test_read_zstring_array(bin, arraysym, sym_model); close_binary(bin); return r; } int nulltest() { return open_binary("/path/to/unknown") == NULL ? EXIT_SUCCESS : -__LINE__; } int getbits(char *path) { int i = strlen(path); if (i > 3 && strncmp(path + strlen(path) - 3, ".so", 3) == 0) { i -= 3; } for (i--; i >= 0 && path[i] != '.'; i--) ; return atoi(path + i + 1); } char* getname(char *path) { char *name = strdup(path); char *bnam = basename(name); int i = strlen(bnam); if (i > 3 && strncmp(bnam + strlen(bnam) - 3, ".so", 3) == 0) { i -= 3; } for (i--; i >= 0 && bnam[i] != '.'; i--) ; if (i > 0) { bnam[i] = 0; char *result = strdup(bnam); free(name); return result; } free(name); return NULL; } int main(int argc, char **argv) { int i, r; if ((r = nulltest())) { fprintf(stderr, "Failed nulltest() at line %d\n", -r); exit(r); } for (i = 1; i < argc; i++) { char *name = getname(argv[i]); if (name != NULL) { r = testcase(argv[i], getbits(argv[i]), name, "dummy_symbol", "_stup_dummy42__45642"); if (r) { fprintf(stderr, "Failed for testcase %s at line %d\n", argv[i], -r); exit(r); } } } exit(EXIT_SUCCESS); return 0; } eztrace-2.1/test/pptrace/automatic/common.h000066400000000000000000000041041447213526500210650ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * common.h - common basis for several tests * * Created on: 3 sep. 2012 * Author: Damien Martin-Guillerez */ #include #include int debug; // Common parts #define DEBUG(x) if(debug > 1) fprintf(stderr, "\tDEBUG %s: " x "\n", __method__) #define DEBUG1(x, p1) if(debug > 1) fprintf(stderr, "\tDEBUG %s: " x "\n", __method__, p1) #define DEBUG2(x, p1, p2) if(debug > 1) fprintf(stderr, "\tDEBUG %s: " x "\n", __method__, p1, p2) #define BEGIN_TEST(method) \ int do_run_test_##method; \ int test_##method() { static const char *__method__ = #method; if(debug > 0) fprintf(stderr, "%s\n", __method__); #define END_TEST(method) return 0; } #define RUN_TEST(x) do { \ if(runall || do_run_test_##x) { \ r = test_##x(); \ if(r < 0) { \ return r; \ } \ } \ } while(0) #define PARSE_TEST(x) do { \ if(strcmp(av[i], #x) == 0) { \ do_run_test_##x = 1; \ runall = 0; \ } \ } while(0) #define TEST0(test, testname, msg) do { \ if(!(test)) { \ fprintf(stderr, "FAIL %s for test `" #testname "` with message: " msg "\n", __method__); \ return -__LINE__; \ } \ DEBUG(#testname " succeeded"); \ } while(0) #define TEST1(test, testname, msg, p1) do { \ if(!(test)) { \ fprintf(stderr, "FAIL %s for test `" #testname "` with message: " msg "\n", __method__, p1); \ return -__LINE__; \ } \ DEBUG(#testname " succeeded"); \ } while(0) #define TEST2(test, testname, msg, p1, p2) do { \ if(!(test)) { \ fprintf(stderr, "FAIL %s for test `" #testname "` with message: " msg "\n", __method__, p1, p2); \ return -__LINE__; \ } \ DEBUG(#testname " succeeded"); \ } while(0) #define TEST3(test, testname, msg, p1, p2, p3) do { \ if(!(test)) { \ fprintf(stderr, "FAIL %s for test `" #testname "` with message: " msg "\n", __method__, p1, p2, p3); \ return -__LINE__; \ } \ DEBUG(#testname " succeeded"); \ } while(0) // End of common parts eztrace-2.1/test/pptrace/automatic/errors.c000066400000000000000000000021161447213526500211050ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * errors.c -- test of errors function (errors.h) * * Created on: 4 Aug. 2011 * Author: Damien Martin-Guillerez */ #include #include #include #include #include int test_pptrace_error_reporting() { pptrace_clear_error(); const char *err = pptrace_get_error(); if (err != NULL) return -__LINE__; pptrace_report_error("ERROR"); err = pptrace_get_error(); if (err == NULL || strcmp(err, "ERROR")) return -__LINE__; pptrace_report_error("ERROR %d", 1); err = pptrace_get_error(); if (err == NULL || strcmp(err, "ERROR 1")) return -__LINE__; pptrace_clear_error(); malloc(-1); // Force error err = pptrace_get_error(); if (errno) { return err != NULL && (strcmp(strerror(errno), err) == 0) ? 0 : -__LINE__; } return err == NULL ? 0 : -__LINE__; } int main() { return test_pptrace_error_reporting(); } eztrace-2.1/test/pptrace/automatic/hijack.c000066400000000000000000000115251447213526500210260ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * hijack.c - test for symbol hijacking * * Created on: 4 Sep. 2012 * Author: Damien Martin-Guillerez */ #include #include #include #include #include #include #include #include #include #include #include #include "common.h" int testfork; int waitattach; // Common parts pid_t child; int fds[2]; void *bin; char *prog; static inline int run_ipc() { if (testfork) return 0; pipe(fds); child = trace_run(NULL, NULL, NULL, 1); if (child > 0) { close(fds[1]); bin = open_binary(prog); return 1; } return 0; } static inline void close_ipc() { close_binary(bin); close(fds[0]); } #define FINISH_IPC() do { \ trace_detach(child); \ trace_wait(child); \ DEBUG("process finished"); \ } while(0) #define IPC_END() do { \ DEBUG("traced process is exiting"); \ exit(0); \ } while(0) #define READ_WORD(w) TEST1(-1 != read(fds[0], &w, sizeof(w)), read, "read failed with error %s!", strerror(errno)) #define WRITE_WORD(w) write(fds[1], &w, sizeof(w)) void buffer_function() { asm("nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop"); } void bad_function() { char *__method__ = "bad_function"; int r = 3; DEBUG("in"); WRITE_WORD(r); } void (*original_pointer)() = bad_function; void original_function() { char *__method__ = "original_function"; int r = 1; DEBUG("in"); WRITE_WORD(r); } void good_function() { char *__method__ = "good_function"; int r = 2; DEBUG2("in (original_pointer = %p, r = %d)", original_pointer, r); WRITE_WORD(r); original_pointer(); WRITE_WORD(r); DEBUG("out"); } #define BEGIN_TEST_HIJACK(name) \ BEGIN_TEST(name) \ if(run_ipc()) { #define END_TEST_HIJACK(name) \ FINISH_IPC(); \ int r; \ READ_WORD(r); TEST1(r == 2, prolog, "Not in good_function() (r = %d)!", r); \ READ_WORD(r); TEST1(r == 1, original, "Not in original_function() (r = %d)!", r); \ READ_WORD(r); TEST1(r == 2, epilog, "Not in good_function() (r = %d)!", r); \ close_ipc(); \ } else { \ if(waitattach) { fprintf(stderr, "child pid = %d\n", getpid()); sleep(10); } \ original_function(); \ IPC_END(); \ } \ END_TEST(name) // End of common parts BEGIN_TEST_HIJACK(hijack_code) ssize_t res = hijack_code( bin, child, (word_uint) (word_uint) original_function, (word_uint) (word_uint) good_function - (word_uint) (word_uint) original_function, (word_uint) (word_uint) buffer_function, (word_uint) (word_uint) &original_pointer, (word_uint) (word_uint) good_function); TEST1(res > 0, result, "hijack_code returned negative value ("WORD_DEC_FORMAT")!", res); END_TEST_HIJACK(hijack_code) BEGIN_TEST_HIJACK(hijack) INIT_ZZT_SYMBOL(toHijack, (word_uint )original_function, (word_uint )good_function - (word_uint )original_function); INIT_ZZT_SYMBOL(orig, (word_uint )&original_pointer, sizeof(original_pointer)); INIT_ZZT_SYMBOL(repl, (word_uint )good_function, 0); ssize_t res = hijack(bin, child, &toHijack, &orig, &repl); TEST1(res > 0, result, "hijack returned negative value ("WORD_DEC_FORMAT")!", res); END_TEST_HIJACK(hijack) void usage(char **av, char option) { if (option != 0) { fprintf(stderr, "Unknown option '%c'", option); } fprintf( stderr, "Usage: %s [-v[v]dg] [test1 test2 test3 ...]\n" "\t-v output verbose debugging information (the more d option, the more verbose the output)\n" "\t-d don't actually run the tests, simply execute the child (used in conjunction with test specifiers to debug)\n" "\t-g print the pid of the child and sleep 10 seconds after detachment to enable GDB attachment.\n" "\ttest specifies the tests to runs (default is all tests). Available tests: hijack_code, hijack.\n", av[0]); exit(-1); } int main(int ac, char **av) { int r, i, j; debug = 0; testfork = 0; waitattach = 0; int runall = 1; prog = av[0]; for (i = 1; i < ac; i++) { if (av[i][0] == '-') { for (j = 1; av[i][j] != 0; j++) { switch (av[i][j]) { case 'v': debug++; break; case 'g': waitattach++; break; case 'd': testfork++; break; default: usage(av, av[i][j]); } } } else { PARSE_TEST(hijack_code); PARSE_TEST(hijack); } } RUN_TEST(hijack_code); RUN_TEST(hijack); return 0; } eztrace-2.1/test/pptrace/automatic/opcodes.c000066400000000000000000000156551447213526500212410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * opcodes.c - tests for opcode generation * * Created on: 3 Sep. 2012 * Author: Damien Martin-Guillerez */ #include #include #include #include #include #include #include #include #include #include "common.h" #define MIN(a,b) (((a) > (b)) ? (b) : (a)) BEGIN_TEST(insert_opcodes) // Try to insert opcodes in a a buffer size_t size = 10; uint8_t buf[15]; int i; for (i = 0; i < 15; i++) buf[i] = 0; ssize_t offset = 0; ssize_t prev = 0; #define INSERT_OP_TEST(str, expected) do { \ DEBUG2("inserting %s at offset "WORD_DEC_FORMAT, str, offset); \ offset = insert_opcodes((uint8_t*)str, strlen(str), buf, size, offset); \ buf[14] = 0; \ TEST2(offset == MIN(prev + strlen(str), size), return, "returned "WORD_DEC_FORMAT" while awaiting "WORD_DEC_FORMAT"!", offset, MIN(prev + strlen(str), size)); \ TEST2(strcmp(buf, expected) == 0, result, "buffer is `%s` while awaiting `%s`!", buf, expected); \ prev = offset; \ } while(0) INSERT_OP_TEST("ABC", "ABC"); INSERT_OP_TEST("ABCDE", "ABCABCDE"); INSERT_OP_TEST("ABCDE", "ABCABCDEAB"); END_TEST(insert_opcodes) int test_function() { return 1; } BEGIN_TEST(generate_trampoline) void *maped_area; void *maped_area2; ssize_t offset; int (*f)(void); #define GENTRAMP_TEST(options, off) do { \ offset = 0; \ maped_area = mmap(NULL, 1024, PROT_READ|PROT_WRITE|PROT_EXEC, options, -1, 0); \ TEST0(maped_area != MAP_FAILED, set-up_##off, "mmap failed!"); \ maped_area2 = (void*)((uint8_t*)maped_area + off); \ offset = generate_trampoline(maped_area, off, (word_uint)(word_uint)maped_area, (word_uint)(word_uint)test_function); \ TEST1(offset > 0, result_##off, "returned value from generate_trampoline is null or negative ("WORD_DEC_FORMAT")!", offset); \ offset = generate_trampoline(maped_area2, 1024-off, (word_uint)(word_uint)maped_area2, (word_uint)(word_uint)maped_area); \ TEST1(offset > 0, result_##off, "returned value from generate_trampoline is null or negative ("WORD_DEC_FORMAT")!", offset); \ f = (int (*)(void))maped_area2; \ int r = f(); \ TEST1(f() == 1, jump_##off, "jump returned %d while awaiting 1!", r); \ munmap(maped_area, 1024); \ } while(0) GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE, 512); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE, 128); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE, 127); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE, 126); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE, 125); #if __WORDSIZE == 64 // Trying 32-bits mapping in 64 bits environment GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, 512); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, 128); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, 127); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, 126); GENTRAMP_TEST(MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, 125); #endif END_TEST(generate_trampoline) BEGIN_TEST(read_jump) uint8_t buffer[] = { // from testcase/test.cc main function 0x55,// push %rbp 0x48, 0x89, 0xe5, // mov %rsp,%rbp 0x48, 0x83, 0xec, 0x10, // sub $0x10,%rsp 0xc7, 0x45, 0xf8, 0x00, 0x00, 0x00, 0x00, // movl $0x0,-0x8(%rbp) 0xeb, 0x34, // jmp , 0x400539 0xc7, 0x45, 0xfc, 0x00, 0x00, 0x00, 0x00, // movl $0x0,-0x4(%rbp) 0xeb, 0x1c, // jmp , 0x40052a 0x8b, 0x45, 0xf8, // mov -0x8(%rbp),%eax 0x0f, 0xaf, 0x45, 0xfc, // imul -0x4(%rbp),%eax 0x89, 0xc6, // mov %eax,%esi 0xbf, 0x3c, 0x06, 0x40, 0x00, // mov $0x40063c,%edi 0xb8, 0x00, 0x00, 0x00, 0x00, // mov $0x0,%eax 0xe8, 0xca, 0xfe, 0xff, 0xff, // callq , 0x4003f0 0x83, 0x45, 0xfc, 0x01, // addl $0x1,-0x4(%rbp) 0x83, 0x7d, 0xfc, 0x13, // cmpl $0x13,-0x4(%rbp) 0x0f, 0x9e, 0xc0, // setle %al 0x84, 0xc0, // test %al,%al 0x75, 0xd9, // jne , 0x40050e 0x83, 0x45, 0xf8, 0x01, // addl $0x1,-0x8(%rbp) 0x83, 0x7d, 0xf8, 0x09, // cmpl $0x9,-0x8(%rbp) 0x0f, 0x9e, 0xc0, // setle %al 0x84, 0xc0, // test %al,%al 0x75, 0xc1, // jne 400505 0xb8, 0x00, 0x00, 0x00, 0x00, // mov $0x0,%eax 0xc9, // leaveq 0xc3, // retq }; int sizes[] = {1, 3, 4, 7, 2, 7, 2, 3, 4, 2, 5, 5, 5, 4, 4, 3, 2, 2, 4, 4, 3, 2, 2, 5, 1, 1, 0}; int jumps[] = {0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1}; int i; size_t offset = 0; // the actual test for (i = 0; sizes[i] != 0; i++) { /* - read_jump(buf, size, offset, prefix): read a jump part that was prefixed * by *prefix* and that is contained at offset *offset* of *buf* (*size* is * the size of *buf*). The returned value is the size of the instruction * if a jump is read, 0 if a valid prefix for a jump was encountered, and < 0 * if the instruction is not a jump. */ ssize_t r = read_jump(buffer, 87, offset, 0); if (r == 0) { r = read_jump(buffer, 87, offset + 1, buffer[offset]); if (r > 0) r++; } if (r < 0) { TEST1(jumps[i] == 0, notjump, "instruction %d was a jump but wasn't detected!", i); } else { TEST2( jumps[i] == 1, jump, "instruction %d wasn't a jump but was detected as one with size "WORD_DEC_FORMAT"!", i, r); TEST3(sizes[i] == r, size, "instruction %d has size %d but got "WORD_DEC_FORMAT"!", i, sizes[i], r); } offset += sizes[i]; } END_TEST(read_jump) void usage(char **av, char option) { if (option != 0) { fprintf(stderr, "Unknown option '%c'", option); } fprintf( stderr, "Usage: %s [-v[v]] [test1 test2 test3 ...]\n" "\t-v output verbose debugging information (the more d option, the more verbose the output)\n" "\ttest specifies the tests to runs (default is all tests). Available tests: insert_opcodes, generate_trampoline, read_jump.\n", av[0]); exit(-1); } int main(int ac, char **av) { int r, i, j; debug = 0; int runall = 1; for (i = 1; i < ac; i++) { if (av[i][0] == '-') { for (j = 1; av[i][j] != 0; j++) { switch (av[i][j]) { case 'v': debug++; break; default: usage(av, av[i][j]); } } } else { PARSE_TEST(insert_opcodes); PARSE_TEST(generate_trampoline); PARSE_TEST(read_jump); } } RUN_TEST(insert_opcodes); RUN_TEST(generate_trampoline); RUN_TEST(read_jump); return 0; } eztrace-2.1/test/pptrace/automatic/testcase/000077500000000000000000000000001447213526500212405ustar00rootroot00000000000000eztrace-2.1/test/pptrace/automatic/testcase/Makefile000066400000000000000000000011631447213526500227010ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. TESTCASES_=$(patsubst %.c,%,$(wildcard *.c)) ifeq "32" "$(shell getconf LONG_BIT)" BITS=32 else BITS=32 64 endif TESTCASES=$(foreach testcase,$(TESTCASES_),$(foreach b,$(BITS),$(testcase).$(b) $(testcase).$(b).so)) all: $(TESTCASES) echo: echo '$(BITS) + $(TESTCASES_) = $(TESTCASES)' %.32: %.c @$(CC) -m32 -o $@ $^ %.64: %.c @$(CC) -m64 -o $@ $^ %.32.so: %.c @$(CC) -m32 -shared -fPIC -Wl,-Bsymbolic -o $@ $^ %.64.so: %.c @$(CC) -m64 -shared -fPIC -Wl,-Bsymbolic -o $@ $^ clean: @rm -f $(TESTCASES) eztrace-2.1/test/pptrace/automatic/testcase/titi.c000066400000000000000000000027401447213526500223600ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * titi.c -- test case for automated tests * * Created on: 2 March. 2011 * Author: Damien Martin-Guillerez */ #include #include #include char *dummy_symbol[] = {"absolutely", "dummy", "heho", NULL}; int silent = 0; void postface() { if (!silent) printf("In postface()\n"); if (!silent) printf("Out postface()\n"); } void preface() { if (!silent) printf("In preface()\n"); if (!silent) printf("Out preface()\n"); } void tata(char *test) { if (!silent) printf("In tata()\n"); if (!silent) printf("%s\n", test); if (!silent) printf("Out tata()\n"); } void titi() { if (!silent) printf("In titi()\n"); tata("Hello, World!"); if (!silent) printf("Out titi()\n"); } int main(int argc, char **argv) { int i; int pause = 0; for (i = 0; i < argc; i++) { if (strcmp(argv[i], "-p") == 0) { pause = 1; } if (strcmp(argv[i], "-s") == 0) { silent = 1; } } if (!silent) { printf("Entering program with usage : "); for (i = 0; i < argc; i++) { printf("%s ", argv[i]); } printf("\n"); } if (pause) { printf("Enter a key to continue: "); getchar(); printf("\n"); } titi(); if (!silent) { printf("Exiting program\n"); } return 0; } eztrace-2.1/test/pptrace/automatic/tracing.c000066400000000000000000000171121447213526500212220ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * tracing.c - test for tracing functions * * Created on: 26 Aug. 2012 * Author: Damien Martin-Guillerez */ #include #include #include #include #include #include #include #include #include "common.h" int testfork; // Common parts #if __x86_64__ // x86_64 #define instr_call_parent() asm("int3") #elif __arm__ // ARMv7 #define instr_call_parent() asm("bkpt #0") #endif #define call_parent() \ do { \ DEBUG("traced process is before call_parent"); \ instr_call_parent(); \ DEBUG("traced process is after call_parent"); \ } while(0) #define call_parent_lbl(lbl) \ do { \ DEBUG("traced process is before call_parent"); \ instr_call_parent(); \ do_lbl(lbl); \ } while(0) #define lbl_name(lbl) test_##lbl #define lbl_addr(lbl) &&lbl_name(lbl) #define do_lbl(lbl) do { \ lbl_name(lbl): \ DEBUG("traced process is after label " #lbl); \ } while(0) pid_t child; int fds[2]; static inline int run_ipc() { if (testfork) return 0; pipe(fds); child = trace_run(NULL, NULL, NULL, 1); return child > 0 ? 1 : 0; } static inline void close_ipc() { close(fds[0]); close(fds[1]); } #define FINISH_IPC() do { \ trace_detach(child); \ trace_wait(child); \ DEBUG("process finished"); \ } while(0) #define IPC_END() do { \ DEBUG("traced process is exiting"); \ exit(0); \ } while(0) #define READ_WORD(w) read(fds[0], &w, sizeof(w)) #define WRITE_WORD(w) write(fds[1], &w, sizeof(w)) // End of common parts BEGIN_TEST(getset_ip) void* r; word_uint rr; // print the ip of the int 3 instruction and propose a function ip if (run_ipc()) { // The tracing process trace_continue(child); r = (void*) get_ip(child); TEST2(lbl_addr(getset_ip_lbl1) == r, get_ip, "returned %p while awaiting %p!", r, lbl_addr(getset_ip_lbl1)); set_ip(child, (word_uint)lbl_addr(getset_ip_lbl2)); FINISH_IPC() ; READ_WORD(rr); TEST1(rr == 1, set_ip, "returned "WORD_DEC_FORMAT" while awaiting 1!", rr); close_ipc(); } else { // The traced process rr = 1; call_parent_lbl(getset_ip_lbl1); rr = 0; do_lbl(getset_ip_lbl2); WRITE_WORD(rr); IPC_END(); } END_TEST(getset_ip) BEGIN_TEST(trace_readwrite) static word_uint result; // try write then read result and compares if (run_ipc()) { word_uint rr; trace_continue(child); READ_WORD(result); trace_read(child, (word_uint) &result, (uint8_t*) &rr, sizeof(rr)); TEST2(rr == result, trace_read, "returned "WORD_HEX_FORMAT" while awaiting "WORD_HEX_FORMAT"!", rr, result); rr = 42; trace_write(child, (word_uint) &result, (uint8_t*) &rr, sizeof(rr)); FINISH_IPC() ; READ_WORD(result); TEST2( rr == result, trace_write, "trace_write(): value of result is "WORD_HEX_FORMAT" while awaiting "WORD_HEX_FORMAT"!", rr, result); close_ipc(); } else { result = 4242; WRITE_WORD(result); call_parent(); WRITE_WORD(result); IPC_END(); } END_TEST(trace_readwrite) BEGIN_TEST(trace_replace) // give one address and the original value and a value to replace static uint8_t value; if (run_ipc()) { trace_continue(child); READ_WORD(value); uint8_t rr = trace_replace(child, (word_uint) &value, 42); TEST2(value == rr, trace_replace, "returned %x while awaiting %x", rr, value); FINISH_IPC() ; READ_WORD(value); TEST1(value == 42, trace_replace, "written %x while awaiting 42", value); close_ipc(); } else { value = 24; WRITE_WORD(value); call_parent(); WRITE_WORD(value); IPC_END(); } END_TEST(trace_replace) BEGIN_TEST(trace_copy) // give two addresses and a string then print the resulting string static char buffer[10]; static const char *tocopy = "BBBBBBBBB\0ABC"; word_uint val = -1; if (run_ipc()) { trace_copy(child, (word_uint) tocopy, (word_uint) buffer, strlen(tocopy) + 1); FINISH_IPC() ; READ_WORD(val); TEST0(val == 1, trace_copy, "the buffer comparison failed"); close_ipc(); } else { val = strcmp(buffer, tocopy) == 0 ? 1 : 0; if (!val) { DEBUG2("%s != %s!", buffer, tocopy); } WRITE_WORD(val); IPC_END(); } END_TEST(trace_copy) BEGIN_TEST(trace_singlestep) void *r; if (run_ipc()) { trace_continue(child); r = (void*) get_ip(child); TEST2(lbl_addr(singlestep_lbl1) == r, set-up, "eip is %p while awaiting %p!", r, lbl_addr(singlestep_lbl1)); trace_singlestep(child); r = (void*) get_ip(child); TEST2(lbl_addr(singlestep_lbl2) == r, singlestep, "eip is %p while awaiting %p!", r, lbl_addr(singlestep_lbl2)); FINISH_IPC() ; close_ipc(); } else { instr_call_parent(); lbl_name(singlestep_lbl1): #if __x86_64__ // x86_64 #if __WORDSIZE == 64 asm("inc %rax"); #else asm("inc %eax"); #endif #elif __arm__ // ARMv7 asm("add r0, r0, #1"); #endif lbl_name(singlestep_lbl2): IPC_END(); } END_TEST(trace_singlestep) BEGIN_TEST(trace_mmap) static char *buf1 = "ABCDEF"; static char *buf2; if (run_ipc()) { word_uint mmap = trace_mmap(child, 0, 1024, PROT_READ | PROT_WRITE); TEST0(mmap != 0, mmap_nonnull, "mmap returned null!"); int errcode = (int) (-(word_uint) mmap); TEST2(errcode < 0 || errcode > 127, mmap_failed, "mmap returned the error code %d (strerror = %s)!", errcode, strerror(errcode)); DEBUG1("trace_mmap returned %p", (void* )mmap); trace_write(child, (word_uint) &buf2, (uint8_t*) &mmap, sizeof(mmap)); DEBUG("written the address of mmap to buf2"); trace_copy(child, (word_uint) buf1, mmap, strlen(buf1) + 1); DEBUG("copied content of buf1 to mmap'd content"); FINISH_IPC() ; READ_WORD(mmap); TEST0(mmap == 1, mmap_copy, "data comparison failed!"); close_ipc(); } else { DEBUG1("buf2 = %p", buf2); word_uint val = strcmp(buf1, buf2) == 0 ? 1 : 0; if (!val) { DEBUG2("%s != %s!", buf1, buf2); } WRITE_WORD(val); IPC_END(); } END_TEST(trace_mmap) void usage(char **av, char option) { if (option != 0) { fprintf(stderr, "Unknown option '%c'", option); } fprintf( stderr, "Usage: %s [-v[v]] [test1 test2 test3 ...]\n" "\t-v output verbose debugging information (the more d option, the more verbose the output)\n" "\t-d don't actually run the tests, simply execute the child (used in conjunction with test specifiers to debug)\n" "\ttest specifies the tests to runs (default is all tests). Available tests: getset_ip, readwrite, replace, copy, singlestep, mmap.\n", av[0]); exit(-1); } int main(int ac, char **av) { int r, i, j; debug = 0; testfork = 0; int runall = 1; for (i = 1; i < ac; i++) { if (av[i][0] == '-') { for (j = 1; av[i][j] != 0; j++) { switch (av[i][j]) { case 'v': debug++; break; case 'd': testfork++; break; default: usage(av, av[i][j]); } } } else { PARSE_TEST(getset_ip); PARSE_TEST(trace_readwrite); PARSE_TEST(trace_replace); PARSE_TEST(trace_copy); PARSE_TEST(trace_singlestep); PARSE_TEST(trace_mmap); } } RUN_TEST(getset_ip); RUN_TEST(trace_readwrite); RUN_TEST(trace_replace); RUN_TEST(trace_copy); RUN_TEST(trace_singlestep); RUN_TEST(trace_mmap); return 0; } eztrace-2.1/test/pptrace/automatic/wait_open.c000066400000000000000000000074141447213526500215640ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * wait_open.c - test waiting for open and mmap in both 32 and 64 bits * * Created on: 5 Aug. 2011 * Author: Damien Martin-Guillerez */ #include #include #include #include #include #include #include #include #include char **new_envp(char **envp, char *ldpreload) { int i; for (i = 0; envp[i]; i++) ; char **env = (char**) malloc(sizeof(char*) * (i + 1)); env[0] = (char*) malloc(15 + strlen(ldpreload)); snprintf(env[0], 15 + strlen(ldpreload), "LD_PRELOAD=%s", ldpreload); for (i = 0; envp[i]; i++) env[i + 1] = envp[i]; env[i + 1] = NULL; return env; } int test(int debug, char *prog, char *lib, char **envp) { char *argv[] = {NULL, "-s", NULL}; argv[0] = prog; char **env = new_envp(envp, lib); void *bin = open_binary(prog); if (bin == NULL) { fprintf(stderr, "Failed to open binary %s!\n", prog); return -__LINE__; } trace_set_bits(get_binary_bits(bin)); close_binary(bin); pid_t child = trace_run(prog, argv, env, 1); //memory leak here to avoid double free on hydra //free(env[0]); //free(env); if (child <= 0) { fprintf(stderr, "Failed to trace process %s!\n", prog); return -__LINE__; } //open("/etc/ld.so.cache", *) word_uint fd; if (trace_wait_syscall(child, &fd, TRACE_SYSCALL(open), SYSCALL_ARGTYPE_ZSTRING, lib, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_END) < 0) { fprintf(stderr, "Failed to wait for open(\"%s\", *) for process %s (pid = %d)!\n", lib, prog, child); trace_detach(child); return -__LINE__; } if (debug) printf("open(\"%s\", *) = "WORD_DEC_FORMAT"\n", lib, fd); if ((int) fd < 3) { fprintf( stderr, "open(\"%s\", *) returned a negative value or a reserved file descriptor ("WORD_DEC_FORMAT" - "WORD_HEX_FORMAT") for process %s (pid = %d)!\n", lib, fd, fd, prog, child); return -__LINE__; } //mmap(NULL, 22967, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4b50756000 //mmap(NULL, *, *, *, fd, 0) word_uint addr; if (trace_wait_syscall(child, &addr, MMAP_SYSCALLS, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_INT, (word_uint) (PROT_READ | PROT_EXEC), SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_INT, (word_uint) fd, SYSCALL_ARGTYPE_IGNORE, SYSCALL_ARGTYPE_END) < 0) { fprintf( stderr, "Failed to wait for mmap(*, *, PROT_READ|PROT_EXEC, *, "WORD_DEC_FORMAT", *) for process %s (pid = %d)!\n", fd, prog, child); trace_detach(child); return -__LINE__; } if (debug) printf( "mmap(*, *, PROT_READ|PROT_EXEC, *, "WORD_DEC_FORMAT", *) = "WORD_HEX_FORMAT"\n", fd, addr); if ((void*) addr == MAP_FAILED) { fprintf( stderr, "mmap(*, *, PROT_READ|PROT_EXEC, *, "WORD_DEC_FORMAT", *) returned MAP_FAILED for process %s (pid = %d)!\n", fd, prog, child); return -__LINE__; } trace_detach(child); trace_wait(child); return EXIT_SUCCESS; } int main(int argc, char **argv, char **envp) { int debug = 0; int i; for (i = 1; argv[i] != NULL; i++) { if (strcasecmp(argv[i], "-d") == 0) { debug = 1; } else if (strstr(argv[i], ".so") == NULL) { char lib[1024]; strcpy(lib, argv[i]); strcat(lib, ".so"); int r = test(debug, argv[i], lib, envp); if (r) { return r; } } } return EXIT_SUCCESS; } eztrace-2.1/test/pptrace/comparison/000077500000000000000000000000001447213526500176115ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/Makefile000066400000000000000000000005001447213526500212440ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. DIRS=programs/md programs/simple all: recursive-all run: all recursive-run clean: recursive-clean rm -f $(BINARY) recursive-%: @for i in $(DIRS); do \ make -C $$i $(subst recursive-,,$@); \ done; eztrace-2.1/test/pptrace/comparison/instrument/000077500000000000000000000000001447213526500220215ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/Makefile000066400000000000000000000012271447213526500234630ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. DIRS=libinstrument-dummy libinstrument-real pin dyninst pptrace EZTRACE_PREFIX=$(shell printenv EZTRACE_PREFIX) DYNINST_ROOT=$(shell printenv DYNINST_ROOT) FXT_ROOT=$(shell printenv FXT_ROOT) PIN_ROOT=$(shell printenv PIN_ROOT) LIBDWARF_DIR=$(shell printenv DWARF_LIBDIR) all: recursive-all run: all recursive-run clean: recursive-clean recursive-%: @for i in $(DIRS); do make -C $$i $(subst recursive-,,$@) EZTRACE_PREFIX=$(EZTRACE_PREFIX) DYNINST_ROOT=$(DYNINST_ROOT) FXT_ROOT=$(FXT_ROOT) PIN_ROOT=$(PIN_ROOT) LIBDWARF_DIR=$(LIBDWARF_DIR); done eztrace-2.1/test/pptrace/comparison/instrument/dyninst/000077500000000000000000000000001447213526500235115ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/dyninst/Makefile000066400000000000000000000044521447213526500251560ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=my_dyninst my_dyninst_simple LIBINSTRUMENT_SIMPLE=$(realpath ../libinstrument-dummy) LIBINSTRUMENT_REAL=$(realpath ../libinstrument-real) DYNINST_ROOT=$(shell printenv DYNINST_ROOT) DYNINST_LIBDIR=$(DYNINST_ROOT)/x86_64-unknown-linux2.4/lib/ DYNINST_CFLAGS=-I$(DYNINST_ROOT)/include/ DYNINST_LDFLAGS=-Wl,--rpath,$(DYNINST_LIBDIR) -L$(DYNINST_LIBDIR) -ldyninstAPI -liberty LDLIBPATH=$(shell printenv LD_LIBRARY_PATH):$(DYNINST_LIBDIR): DYNINST_RT=$(DYNINST_LIBDIR)/libdyninstAPI_RT.so LDPRELOAD=$(DYNINST_LIBDIR)/libdyninstAPI.so TARGET=instrumented all: $(BINARIES) my_dyninst: my_dyninst.cpp g++ -o my_dyninst my_dyninst.cpp $(DYNINST_CFLAGS) $(DYNINST_LDFLAGS) -O0 -g -DLIB_EZTRACE_SO=\"$(LIBINSTRUMENT_REAL)/libinstrument.so\" my_dyninst_simple: my_dyninst.cpp g++ -o my_dyninst_simple my_dyninst.cpp $(DYNINST_CFLAGS) $(DYNINST_LDFLAGS) -O0 -g -DLIB_EZTRACE_SO=\"$(LIBINSTRUMENT_SIMPLE)/libinstrument.so\" run: @for i in $(TARGETS); do \ make run-simple run-real SOURCE=$$i DYNINST_ROOT=$(DYNINST_ROOT); \ done run-simple: instrument-simple @echo ================================================================================ @echo Running DynInst on `basename $(SOURCE)` for simple instrumentation @echo ================================================================================ @echo @DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT_SIMPLE) ./$(TARGET) || true @rm -f instrumented || true run-real: instrument @echo ================================================================================ @echo Running DynInst on `basename $(SOURCE)` for real instrumentation @echo ================================================================================ @echo @DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT_REAL) ./$(TARGET) || true @rm -f instrumented || true instrument: LD_PRELOAD=$(LD_PRELOAD) DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT_REAL) ./my_dyninst $(SOURCE) $(TARGET) 1>&2 instrument-simple: LD_PRELOAD=$(LD_PRELOAD) DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT_SIMPLE) ./my_dyninst_simple $(SOURCE) $(TARGET) 1>&2 clean: rm -f *.o $(BINARIES)eztrace-2.1/test/pptrace/comparison/instrument/dyninst/my_dyninst.cpp000066400000000000000000000166331447213526500264230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include "BPatch.h" #include "BPatch_function.h" #include "BPatch_basicBlock.h" #include #include #include "BPatch.h" #include "BPatch_callbacks.h" #include "BPatch_function.h" #define CREATE_BINARY 1 //#define LIB_EZTRACE_SO "/home/trahay/Documents/recherche/articles/PROPER_2012/programmes/instrument/libinstrument/libinstrument.so" //#define LIB_EZTRACE_SO "/home/trahay/Documents/recherche/articles/PROPER_2012/programmes/instrument/libinstrument/libinstrument.so" // describe a function to instrument struct eztrace_dyninst_func { char* fname; uint32_t code_entry; uint32_t code_exit; struct eztrace_dyninst_func *next; }; typedef struct eztrace_dyninst_func *eztrace_dyninst_func_t; // list of registered functions eztrace_dyninst_func_t func_list = NULL; static int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit); static int nb_func = 0; // register a function extern "C" void eztrace_dyninst_register(const char* fname, uint32_t code_entry, uint32_t code_exit) { struct eztrace_dyninst_func *new_func = (struct eztrace_dyninst_func *) malloc(sizeof(struct eztrace_dyninst_func)); asprintf(&new_func->fname, "%s", fname); new_func->code_entry = code_entry; new_func->code_exit = code_exit; if (func_list) new_func->next = func_list; else new_func->next = NULL; func_list = new_func; } // instrument all the registered functions extern "C" int eztrace_dyninst_instrument(BPatch_addressSpace *app) { int ret = 0; eztrace_dyninst_func_t func = func_list; ret = 0; while (func != NULL) { ret += __intercept_function(app, func->fname, func->code_entry, func->code_exit); func = func->next; } return ret; } extern "C" int eztrace_dyninst_nb_function_to_register() { eztrace_dyninst_func_t func = func_list; int ret = 0; while (func && func->next != func_list) { func = func->next; ret++; } return ret; } // Instrument a function: eztrace_code0(code_entry) is called at the // beginning of the function and eztrace_code0(code_entry) is called // at the end of the function. // If code_entry or code_exit is null, the corresponding call to // eztrace_code0 is skipped static int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit) { BPatch_image *appImage; BPatch_Vector *points; BPatch_Vector functions; BPatch_Vector record_event0_ptr; appImage = app->getImage(); // search for record_event0 function BPatch_Vector *loaded_modules = appImage->getModules(); printf("Threre are %d modules\n", loaded_modules->size()); for (int i = 0; i < loaded_modules->size(); i++) { BPatch_module* cur_mod = (*loaded_modules)[i]; char mod_name[80]; cur_mod->getName(mod_name, 80); cur_mod->findFunction("record_event0", record_event0_ptr, false); if (!record_event0_ptr.size()) { printf("\tfunction record_event0 not found in module %s\n", mod_name); } else { printf("Found ! \n"); break; } } if (!record_event0_ptr.size()) { printf("Cannot find record_event0 function\n"); return -1; } printf("PLOP\n"); for (int i = 0; i < loaded_modules->size(); i++) { BPatch_module* cur_mod = (*loaded_modules)[i]; char mod_name[80]; cur_mod->getName(mod_name, 80); cur_mod->findFunction(function_name, functions, false); if (!functions.size()) { printf("\tfunction %s not found in module %s\n", function_name, mod_name); } else { printf("Found %s! \n", function_name); break; } } if (!functions.size()) { fprintf(stderr, "warning: cannot find function %s in executable\n", function_name); return 0; } // Instrument the entry of the function if (code_entry) { // We need to call eztrace_generic(code, nb_param, param1, param2, ...) points = functions[0]->findPoint(BPatch_entry); BPatch_Vector dummyArgs; // Create the parameter (code_entry) BPatch_constExpr code(code_entry); dummyArgs.push_back(&code); // Create the function call #if 0 BPatch_Vector funcs; appImage->findFunction("record_event0", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); #else BPatch_funcCallExpr dummyCall(*record_event0_ptr[0], dummyArgs); #endif //Insert the function call at the point app->insertSnippet(dummyCall, *points); } // Instrument the exit of the function if (code_exit) { // the function parameters are not available here, so we have to // call eztrace_code0(code) points = functions[0]->findPoint(BPatch_exit); // Create the parameter (code_entry) BPatch_Vector dummyArgs; BPatch_constExpr code(code_exit); dummyArgs.push_back(&code); // Create the function call #if 0 BPatch_Vector funcs; appImage->findFunction("record_event0", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); #else BPatch_funcCallExpr dummyCall(*record_event0_ptr[0], dummyArgs); #endif //Insert the function call at the point app->insertSnippet(dummyCall, *points); } return 1; } // instrument all the registered functions extern "C" int eztrace_dyninst_instrument(BPatch_addressSpace *app); static BPatch bpatch; static BPatch_addressSpace *app = NULL; static BPatch_binaryEdit *appBin = NULL; int main(int argc, char**argv) { if (argc != 3) { printf("usage: %s orig_prog new_prog\n", argv[0]); return 1; } char* file = argv[1]; char* newFile = argv[2]; bool ret; eztrace_dyninst_register("foo", 1, 2); if (!eztrace_dyninst_nb_function_to_register()) { printf("0 functions instrumented\n"); return 1; } #ifdef CREATE_BINARY //Create the BPatch_addressSpace and BPatch_binaryEdit appBin = bpatch.openBinary(file, true); if (!appBin) { fprintf(stderr, "Cannot open %s\n", file); return -1; } app = static_cast(appBin); if (!app->loadLibrary(LIB_EZTRACE_SO)) { printf("Cannot load %s\n", LIB_EZTRACE_SO); return 1; } #else // run the program BPatch_process *appProc = bpatch.processCreate(file, NULL); if(!appProc) { printf("Cannot load program %s\n", file); } if(! appProc->loadLibrary(LIB_EZTRACE_SO, true)) { printf("Cannot load %s\n", LIB_EZTRACE_SO); return 1; } app = static_cast(appProc); #endif // Instrument all the specified functions int nb_inst = eztrace_dyninst_instrument(app); printf("%d functions instrumented\n", nb_inst); if (!nb_inst) return 1; #ifdef CREATE_BINARY if (appBin != NULL) { //Write a new instrumented executable appBin->writeFile(newFile); } else { fprintf(stderr, "cannot write %s\n", newFile); return -1; } #else appProc->continueExecution(); while(!appProc->isTerminated()) { bpatch.waitForStatusChange(); } #endif return 0; } eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-dummy/000077500000000000000000000000001447213526500260515ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-dummy/Makefile000066400000000000000000000010001447213526500275000ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. LIBRARIES=libinstrument.a libinstrument.so all: $(LIBRARIES) libinstrument.a: instrument.c gcc -c instrument.c -o instrument_static.o ar rcv libinstrument.a instrument_static.o libinstrument.so: instrument.c gcc -c instrument.c -o instrument_dynamic.o -fPIC gcc instrument_dynamic.o -shared -o libinstrument.so ar rcv libinstrument.a instrument_static.o run: clean: rm -f *.o $(LIBRARIES)eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-dummy/instrument.c000066400000000000000000000022241447213526500304250ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include "instrument.h" static uint64_t nb_events = 0; void record_event0(uint64_t code) { //printf("record_event0\n"); nb_events++; } void record_event1(uint64_t code, uint64_t arg1) { nb_events++; } void record_event2(uint64_t code, uint64_t arg1, uint64_t arg2) { nb_events++; } void record_event3(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3) { nb_events++; } void record_event4(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4) { nb_events++; } void record_event5(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5) { nb_events++; } void __init(void) __attribute__ ((constructor)); void __init(void) { fprintf(stderr, "Starting instrument-dummy...\n"); } void __conclude(void) __attribute__ ((destructor)); void __conclude(void) { fprintf(stderr, "Stopping instrument-dummy...\n"); fprintf(stderr, "\t%ld events\n", nb_events); } eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-dummy/instrument.h000066400000000000000000000015241447213526500304340ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef INSTRUMENT_H #define INSTRUMENT_H #include #ifdef __cplusplus extern "C" { #endif void record_event0(uint64_t code); void record_event1(uint64_t code, uint64_t arg1); void record_event2(uint64_t code, uint64_t arg1, uint64_t arg2); void record_event3(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3); void record_event4(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4); void record_event5(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5); void __init(void); void __conclude(void); #ifdef __cplusplus } ; #endif #endif eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-real/000077500000000000000000000000001447213526500256415ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-real/Makefile000066400000000000000000000011731447213526500273030ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. LIBRARIES=libinstrument.a libinstrument.so FXT_ROOT=$$EZTRACE_PREFIX TL_CFLAGS=-I$(FXT_ROOT)/include TL_LDFLAGS=-Wl,--rpath,$(FXT_ROOT)/lib -L$(FXT_ROOT)/lib $(TL_LIB) all: $(LIBRARIES) libinstrument.a: instrument.c gcc -c instrument.c -o instrument_static.o $(TL_CFLAGS) ar rcv libinstrument.a instrument_static.o libinstrument.so: instrument.c gcc -c instrument.c -o instrument_dynamic.o -fPIC $(TL_CFLAGS) gcc instrument_dynamic.o -shared -o libinstrument.so $(TL_LDFLAGS) run: clean: rm -f *.o $(LIBRARIES)eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-real/instrument.c000066400000000000000000000052631447213526500302230ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ /* don't forget this line, otherwise, FUT_DO_PROBE0 is defined to (void) 0 */ #define CONFIG_FUT #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include /* For SYS_xxx definitions */ #include "fxt/fxt.h" #include "fxt/fut.h" #include "instrument.h" static int PROF_BUFFER_SIZE = (128 * 1024 * 1024); static uint64_t nb_events = 0; #define EZTRACE_EVENT0(code) FUT_DO_PROBE0(code) /* create an event with one value */ #define EZTRACE_EVENT1(code, arg1) FUT_DO_PROBE1(code, arg1) /* create an event with two value */ #define EZTRACE_EVENT2(code, arg1, arg2) FUT_DO_PROBE2(code, arg1, arg2) /* etc. */ #define EZTRACE_EVENT3(code, arg1, arg2, arg3) FUT_DO_PROBE3(code, arg1, arg2, arg3) #define EZTRACE_EVENT4(code, arg1, arg2, arg3, arg4) FUT_DO_PROBE4(code, arg1, arg2, arg3, arg4) #define EZTRACE_EVENT5(code, arg1, arg2, arg3, arg4, arg5) FUT_DO_PROBE5(code, arg1, arg2, arg3, arg4, arg5) void record_event0(uint64_t code) { EZTRACE_EVENT0(code); } void record_event1(uint64_t code, uint64_t arg1) { EZTRACE_EVENT1(code, arg1); } void record_event2(uint64_t code, uint64_t arg1, uint64_t arg2) { EZTRACE_EVENT2(code, arg1, arg2); } void record_event3(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3) { EZTRACE_EVENT3(code, arg1, arg2, arg3); } void record_event4(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4) { EZTRACE_EVENT4(code, arg1, arg2, arg3, arg4); } void record_event5(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5) { EZTRACE_EVENT5(code, arg1, arg2, arg3, arg4, arg5); } static char PROF_FILE_USER[1024]; static int initialized = 0; void __init(void) __attribute__ ((constructor)); void __init(void) { fprintf(stderr, "Starting FxT instrumentation...\n"); if (initialized) return; sprintf(PROF_FILE_USER, "/var/tmp/%s_trace", getenv("USER")); //fut_enable_tid_logging(); /* start FxT */ if (fut_setup(PROF_BUFFER_SIZE, FUT_KEYMASKALL, syscall(SYS_gettid)) < 0) { perror("fut_setup"); exit(EXIT_FAILURE); } fprintf(stderr, "Init Done\n"); initialized = 1; } void __conclude(void) __attribute__ ((destructor)); void __conclude(void) { fprintf(stderr, "Stopping FxT instrumentation...\n"); if (!initialized) { printf("nope\n"); return; } initialized = 0; fut_endup(PROF_FILE_USER); fut_done(); fprintf(stderr, "Stopping FxT instrumentation... saving trace %s\n", PROF_FILE_USER); } eztrace-2.1/test/pptrace/comparison/instrument/libinstrument-real/instrument.h000066400000000000000000000015241447213526500302240ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #ifndef INSTRUMENT_H #define INSTRUMENT_H #include #ifdef __cplusplus extern "C" { #endif void record_event0(uint64_t code); void record_event1(uint64_t code, uint64_t arg1); void record_event2(uint64_t code, uint64_t arg1, uint64_t arg2); void record_event3(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3); void record_event4(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4); void record_event5(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5); void __init(void); void __conclude(void); #ifdef __cplusplus } ; #endif #endif eztrace-2.1/test/pptrace/comparison/instrument/pin/000077500000000000000000000000001447213526500226075ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/pin/Makefile000066400000000000000000000045211447213526500242510ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=my_pin.so my_pin_dummy.so LIBINSTRUMENT_SIMPLE_ROOT=$(realpath ../libinstrument-dummy) LIBINSTRUMENT_ROOT=$(realpath ../libinstrument-real) PIN_ROOT=$(shell printenv PIN_ROOT) LIBDWARF_DIR=$(shell printenv DWARF_LIBDIR) PIN_CFLAGS=-DTARGET_IA32E -DFUND_TC_HOSTCPU=FUND_CPU_INTEL64 -DFUND_TC_TARGETCPU=FUND_CPU_INTEL64 -DTARGET_LINUX -DFUND_TC_HOSTOS=FUND_OS_LINUX -DFUND_TC_TARGETOS=FUND_OS_LINUX \ -fpermissive \ -I$(PIN_ROOT)/source/InstLib -I$(PIN_ROOT)/extras/xed2-intel64/include -I$(PIN_ROOT)/extras/components/include -I$(PIN_ROOT)/source/include -I$(PIN_ROOT)/source/include/gen LIBINSTRUMENT_CFLAGS=-I$(LIBINSTRUMENT_ROOT) LIBINSTRUMENT_DUMMY_CFLAGS=-I$(LIBINSTRUMENT_SIMPLE_ROOT) PIN_LDFLAGS=-Wl,--version-script=$(PIN_ROOT)/source/include/pintool.ver -L../Lib/ -L../ExtLib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib -L$(PIN_ROOT)/intel64/lib -L$(PIN_ROOT)/intel64/lib-ext \ -Wl,--rpath,$(PIN_ROOT)/extras/xed2-intel64/lib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib/\ -lpin -lxed -lelf -ldl -Wl,--rpath,$(LIBDWARF_DIR) -L$(LIBDWARF_DIR) -ldwarf LIBINSTRUMENT_LDFLAGS=-Wl,--rpath,$(LIBINSTRUMENT_ROOT) -L$(LIBINSTRUMENT_ROOT) -linstrument LIBINSTRUMENT_DUMMY_LDFLAGS=-Wl,--rpath,$(LIBINSTRUMENT_SIMPLE_ROOT) -L$(LIBINSTRUMENT_SIMPLE_ROOT) -linstrument all: $(BINARIES) my_pin.so: my_pin.cpp g++ -shared -o my_pin.so -fPIC my_pin.cpp $(PIN_CFLAGS) $(PIN_LDFLAGS) $(LIBINSTRUMENT_CFLAGS) $(LIBINSTRUMENT_LDFLAGS) my_pin_dummy.so: my_pin.cpp g++ -shared -o my_pin_dummy.so -fPIC my_pin.cpp $(PIN_CFLAGS) $(PIN_LDFLAGS) $(LIBINSTRUMENT_DUMMY_CFLAGS) $(LIBINSTRUMENT_DUMMY_LDFLAGS) run: @for i in $(TARGETS); do \ echo ================================================================================; \ echo Running PIN on `basename $$i` for simple instrumentation; \ echo ================================================================================; \ echo; \ $(PIN_ROOT)/pin -t my_pin_dummy.so -- $$i; \ echo ================================================================================; \ echo Running PIN on `basename $$i` for real instrumentation; \ echo ================================================================================; \ echo; \ $(PIN_ROOT)/pin -t my_pin.so -- $$i; \ done clean: rm -f *.o $(BINARIES)eztrace-2.1/test/pptrace/comparison/instrument/pin/my_pin.cpp000066400000000000000000000075561447213526500246230ustar00rootroot00000000000000/*BEGIN_LEGAL Intel Open Source License Copyright (c) 2002-2012 Intel Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_LEGAL */ /* * This tool counts the number of times a routine is executed and * the number of instructions executed in a routine */ #include #include #include #include #include "pin.H" #include "instrument.h" // record one event before function foo is called /* ===================================================================== */ /* Print Help Message */ /* ===================================================================== */ INT32 Usage() { cerr << "This Pintool counts the number of times a routine is executed" << endl; cerr << "and the number of instructions executed in a routine" << endl; cerr << endl << KNOB_BASE::StringKnobSummary() << endl; return -1; } int instrument_function(IMG img, const char* function_name, AFUNPTR callback) { __init(); RTN rtn = RTN_FindByName(img, function_name); if (rtn == RTN_Invalid()) { //printf("RTN_FindByName failed\n"); return -1; } RTN_Open(rtn); RTN_InsertCall(rtn, IPOINT_BEFORE, callback, IARG_UINT32, 1, IARG_END); RTN_InsertCall(rtn, IPOINT_AFTER, callback, IARG_UINT32, 2, IARG_END); RTN_Close(rtn); printf("callback inserted for function %s\n", function_name); return 0; } void my_function(int n) { //printf("my_function was called with param %d\n", n); record_event0(1); } void my_fini(void* arg) { __conclude(); } VOID ImageLoad(IMG img, VOID *v) { printf("Loading %s, Image id = %d\n", IMG_Name(img).c_str(), IMG_Id(img)); //instrument_function(img, "foo", AFUNPTR(record_event0)); instrument_function(img, "foo", AFUNPTR(my_function)); } /* ===================================================================== */ /* Main */ /* ===================================================================== */ int main(int argc, char * argv[]) { // Initialize symbol table code, needed for rtn instrumentation PIN_InitSymbols(); // Initialize pin if (PIN_Init(argc, argv)) return Usage(); IMG img = IMG_Open(argv[argc - 1]); if (img == IMG_Invalid()) { printf("Can't open file %s\n", argv[argc - 1]); return 1; } PIN_AddFiniFunction(FINI_CALLBACK(my_fini), NULL); IMG_AddInstrumentFunction(ImageLoad, 0); // Start the program, never returns PIN_StartProgram(); return 0; } eztrace-2.1/test/pptrace/comparison/instrument/pptrace/000077500000000000000000000000001447213526500234575ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/instrument/pptrace/Makefile000066400000000000000000000033741447213526500251260ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=libeztrace-autostart-foodummy.so libeztrace-autostart-foo.so LIBINSTRUMENT_ROOT_DUMMY=$(realpath ../libinstrument-dummy) LIBINSTRUMENT_ROOT=$(realpath ../libinstrument-real) EZTRACE_PREFIX=$(shell printenv EZTRACE_PREFIX) EZTRACE_CFLAGS=-I$(EZTRACE_PREFIX)/include/ -I$(EZTRACE_PREFIX)/include/fxt EZTRACE_LDFLAGS=-Wl,--rpath,$(EZTRACE_PREFIX)/lib/ -L$(EZTRACE_PREFIX)/lib -leztrace all: $(BINARIES) instrument_pptrace.o: instrument_pptrace.c $(CC) -c instrument_pptrace.c -fPIC $(EZTRACE_CFLAGS) -I$(LIBINSTRUMENT_ROOT) -O3 libeztrace-autostart-foodummy.so: instrument_pptrace.o $(CC) -shared -o $@ $< $(EZTRACE_LDFLAGS) -Wl,--rpath,$(LIBINSTRUMENT_ROOT_DUMMY) -L$(LIBINSTRUMENT_ROOT_DUMMY) -linstrument libeztrace-autostart-foo.so: instrument_pptrace.o $(CC) -shared -o $@ $< $(EZTRACE_LDFLAGS) -Wl,--rpath,$(LIBINSTRUMENT_ROOT) -L$(LIBINSTRUMENT_ROOT) -linstrument run: @for i in $(TARGETS); do \ echo ================================================================================; \ echo Running EZTrace on `basename $$i` for simple instrumentation; \ echo ================================================================================; \ echo; \ EZTRACE_LIBRARY_PATH=$(CURDIR) EZTRACE_TRACE=foodummy $(EZTRACE_PREFIX)/bin/eztrace_pptrace $$i; \ echo ================================================================================; \ echo Running EZTrace on `basename $$i` for real instrumentation; \ echo ================================================================================; \ echo; \ EZTRACE_LIBRARY_PATH=$(CURDIR) EZTRACE_TRACE=foo $(EZTRACE_PREFIX)/bin/eztrace_pptrace $$i; \ done clean: rm -f *.o $(BINARIES)eztrace-2.1/test/pptrace/comparison/instrument/pptrace/instrument_pptrace.c000066400000000000000000000012341447213526500275510ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include "eztrace.h" #include "instrument.h" static int __foo_initialized = 0; static int nb_events = 0; int (*libfoo_local)() = NULL; int (*libfoo)() = NULL; int foo() { record_event0(1); int ret = libfoo(); record_event0(2); return ret; } START_INTERCEPT INTERCEPT2("foo", libfoo) END_INTERCEPT static void __foo_init(void) __attribute__ ((constructor)); static void __foo_init(void) { DYNAMIC_INTERCEPT_ALL(); fprintf(stderr, "libfoo = %p\n", libfoo); } eztrace-2.1/test/pptrace/comparison/instrument/results.txt000066400000000000000000000004411447213526500242620ustar00rootroot00000000000000 With libinstrument-real (1 event) simple_dynamic simple_static dyninst ? 0.047054 pin 0.053162 0.049323 pptrace 0.042727 0.043607 With libinstrument-dummy simple_dynamic simple_static dyninst ? 0.010853 pin 0.017902 0.018723 dynamorio 0.154782 - pptrace 0.006558 0.007933 eztrace-2.1/test/pptrace/comparison/instrument/results_extended.txt000066400000000000000000000035241447213526500261470ustar00rootroot00000000000000Dynamic / dummy iteration dynamorio pin dyninst pptrace 100 13.700000 41.37000 - 0.020000 1000 0.163000 0.019000 - 0.009000 10000 0.156000 0.019900 - 0.008200 100000 0.158640 0.018810 - 0.007660 1000000 0.155871 0.019843 - 0.007542 10000000 0.155872 0.018824 - 0.007649 100000000 0.159217 0.018788 - 0.007588 static/dummy iteration dynamorio pin dyninst pptrace 100 - 28.790000 0.030000 0.010000 1000 - 0.017000 0.026000 0.008000 10000 - 0.017800 0.019300 0.007900 100000 - 0.015480 0.024550 0.007340 1000000 - 0.016116 0.016292 0.007215 10000000 - 0.015507 0.009805 0.007304 Dynamic / real iteration dynamorio pin dyninst pptrace 100 - 45.800000 - 0.070000 1000 - 0.056000 - 0.048000 10000 - 0.054800 - 0.045000 100000 - 0.053740 - 0.043810 1000000 - 0.054756 - 0.044014 10000000 - 0.054247 - 0.043329 Static / real iteration dynamorio pin dyninst pptrace 100 - 28.79000 0.060000 0.070000 1000 - 0.054000 0.049000 0.048000 10000 - 0.052600 0.044600 0.044800 100000 - 0.050860 0.046490 0.043150 1000000 - 0.051198 0.045870 0.044878 10000000 - 0.050965 0.046245 0.045831 /* enregistrement de 2 events (entree et sortie de fonction) Static / dummy iteration dynamorio pin dyninst pptrace 100 - 29.97000 0.020000 0.010000 1000 - 0.021000 0.025000 0.008000 10000 - 0.021700 0.018300 0.007900 100000 - 0.020590 0.034030 0.007340 1000000 - 0.021142 0.023252 0.007244 10000000 - 0.020469 0.014952 0.007297 Static / real iteration dynamorio pin dyninst pptrace 100 - 37.50000 0.110000 0.110000 1000 - 0.105000 0.091000 0.081000 10000 - 0.102600 0.086100 0.079600 100000 - 0.102470 0.082310 0.079700 1000000 - 0.101541 0.082859 0.081640 10000000 - 0.093467 0.083495 0.082291 eztrace-2.1/test/pptrace/comparison/programs/000077500000000000000000000000001447213526500214435ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/compute/000077500000000000000000000000001447213526500231175ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/compute/Makefile000066400000000000000000000002751447213526500245630ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=compute all: $(BINARIES) clean: rm -f $(BINARIES) *.o $(LIBRARIES)eztrace-2.1/test/pptrace/comparison/programs/compute/compute.c000066400000000000000000000023611447213526500247410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #define NB_ITER 1000000 #define SIZE 100 #define TIME_DIFF(t1, t2) ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec)) double foo_compute(int n, double* a, double*b, double*c) { double res = 0; int i; for (i = 0; i < n; i++) { c[i] = a[i] + b[i]; res += c[i]; } return res; } int main() { int i; double res = 0; struct timeval t1, t2; double *a, *b, *c; a = malloc(sizeof(double) * SIZE); b = malloc(sizeof(double) * SIZE); c = malloc(sizeof(double) * SIZE); for (i = 0; i < SIZE; i++) { a[i] = i; b[i] = i; } printf("START !\n"); if (gettimeofday(&t1, NULL)) { perror("gettimeofday"); } for (i = 0; i < NB_ITER; i++) { res += foo_compute(SIZE, a, b, c); } /* fin de la mesure */ if (gettimeofday(&t2, NULL)) { perror("gettimeofday"); } printf("STOP !\n"); /* affichage du resultat */ printf("res = %lf\n", res); printf("%d iterations in %lf s (%lf µs per iteration)\n", NB_ITER, TIME_DIFF(t1, t2) / 1e6, TIME_DIFF(t1, t2) / NB_ITER); return 0; } eztrace-2.1/test/pptrace/comparison/programs/md/000077500000000000000000000000001447213526500220435ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/md/Makefile000066400000000000000000000015601447213526500235050ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARY=md_open_mp DIRS=dyninst eztrace_plugin pin TARGETS=$(CURDIR)/$(BINARY) NBRUNS=50 all: $(BINARY) recursive-all run: all simple-run recursive-run simple-run: @echo ================================================================================ @echo Running $(BINARY) without instrumentation @echo ================================================================================ @for i in {1..$(NBRUNS)}; do \ $(TARGETS) | grep seconds | xargs echo | cut -f 1 -d " " | xargs echo -n; \ echo -n " "; \ done @echo recursive-%: @for i in $(DIRS); do \ make -C $$i $(subst recursive-,,$@) TARGETS=$(TARGETS) NBRUNS=$(NBRUNS); \ done; md_open_mp: md_open_mp.f gfortran -o md_open_mp md_open_mp.f -fopenmp clean: recursive-clean rm -f $(BINARY)eztrace-2.1/test/pptrace/comparison/programs/md/dyninst/000077500000000000000000000000001447213526500235335ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/md/dyninst/Makefile000066400000000000000000000030671447213526500252010ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=my_dyninst LIBINSTRUMENT=$(realpath ../../../instrument/libinstrument-real) DYNINST_ROOT=$(shell printenv DYNINST_ROOT) DYNINST_LIBDIR=$(DYNINST_ROOT)/x86_64-unknown-linux2.4/lib/ DYNINST_CFLAGS=-I$(DYNINST_ROOT)/include/ DYNINST_LDFLAGS=-Wl,--rpath,$(DYNINST_LIBDIR) -L$(DYNINST_LIBDIR) -ldyninstAPI -liberty LDLIBPATH=$(shell printenv LD_LIBRARY_PATH):$(DYNINST_LIBDIR): DYNINST_RT=$(DYNINST_LIBDIR)/libdyninstAPI_RT.so LDPRELOAD=$(DYNINST_LIBDIR)/libdyninstAPI.so TARGET=instrumented all: $(BINARIES) my_dyninst: my_dyninst.cpp g++ -o my_dyninst my_dyninst.cpp $(DYNINST_CFLAGS) $(DYNINST_LDFLAGS) -O0 -g -DLIB_EZTRACE_SO=\"$(LIBINSTRUMENT)/libinstrument.so\" run: @for i in $(TARGETS); do \ make run-real SOURCE=$$i DYNINST_ROOT=$(DYNINST_ROOT); \ done run-real: instrument @echo ================================================================================ @echo Running DynInst on `basename $(SOURCE)` for real-life instrumentation @echo ================================================================================ @for i in {1..$(NBRUNS)}; do \ DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT) ./$(TARGET) | grep seconds | xargs echo | cut -f 1 -d " " | xargs echo -n; \ echo -n " "; \ done @echo @rm -f $(TARGET) || true instrument: LD_PRELOAD=$(LDPRELOAD) DYNINSTAPI_RT_LIB=$(DYNINST_RT) LD_LIBRARY_PATH=$(LDLIBPATH)$(LIBINSTRUMENT) ./my_dyninst $(SOURCE) $(TARGET) 1>&2 clean: rm -f *.o $(BINARIES)eztrace-2.1/test/pptrace/comparison/programs/md/dyninst/my_dyninst.cpp000066400000000000000000000165441447213526500264460ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include "BPatch.h" #include "BPatch_function.h" #include "BPatch_basicBlock.h" #include #include #include "BPatch.h" #include "BPatch_callbacks.h" #include "BPatch_function.h" #define CREATE_BINARY 1 // describe a function to instrument struct eztrace_dyninst_func { char* fname; uint32_t code_entry; uint32_t code_exit; struct eztrace_dyninst_func *next; }; typedef struct eztrace_dyninst_func *eztrace_dyninst_func_t; // list of registered functions eztrace_dyninst_func_t func_list = NULL; static int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit); static int nb_func = 0; // register a function extern "C" void eztrace_dyninst_register(const char* fname, uint32_t code_entry, uint32_t code_exit) { struct eztrace_dyninst_func *new_func = (struct eztrace_dyninst_func *) malloc(sizeof(struct eztrace_dyninst_func)); asprintf(&new_func->fname, "%s", fname); new_func->code_entry = code_entry; new_func->code_exit = code_exit; if (func_list) new_func->next = func_list; else new_func->next = NULL; func_list = new_func; } // instrument all the registered functions extern "C" int eztrace_dyninst_instrument(BPatch_addressSpace *app) { int ret = 0; eztrace_dyninst_func_t func = func_list; ret = 0; while (func != NULL) { ret += __intercept_function(app, func->fname, func->code_entry, func->code_exit); func = func->next; } return ret; } extern "C" int eztrace_dyninst_nb_function_to_register() { eztrace_dyninst_func_t func = func_list; int ret = 0; while (func && func->next != func_list) { func = func->next; ret++; } return ret; } // Instrument a function: eztrace_code0(code_entry) is called at the // beginning of the function and eztrace_code0(code_entry) is called // at the end of the function. // If code_entry or code_exit is null, the corresponding call to // eztrace_code0 is skipped static int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit) { BPatch_image *appImage; BPatch_Vector *points; BPatch_Vector functions; BPatch_Vector record_event0_ptr; appImage = app->getImage(); // search for record_event0 function BPatch_Vector *loaded_modules = appImage->getModules(); printf("Threre are %d modules\n", loaded_modules->size()); for (int i = 0; i < loaded_modules->size(); i++) { BPatch_module* cur_mod = (*loaded_modules)[i]; char mod_name[80]; cur_mod->getName(mod_name, 80); cur_mod->findFunction("record_event0", record_event0_ptr, false); if (!record_event0_ptr.size()) { printf("\tfunction record_event0 not found in module %s\n", mod_name); } else { printf("Found ! in module %s\n", mod_name); break; } } if (!record_event0_ptr.size()) { printf("Cannot find record_event0 function\n"); return -1; } printf("PLOP\n"); for (int i = 0; i < loaded_modules->size(); i++) { BPatch_module* cur_mod = (*loaded_modules)[i]; char mod_name[80]; cur_mod->getName(mod_name, 80); cur_mod->findFunction(function_name, functions, false); if (!functions.size()) { printf("\tfunction %s not found in module %s\n", function_name, mod_name); } else { printf("Found %s! \n", function_name); break; } } if (!functions.size()) { fprintf(stderr, "warning: cannot find function %s in executable\n", function_name); return 0; } // Instrument the entry of the function if (code_entry) { // We need to call eztrace_generic(code, nb_param, param1, param2, ...) points = functions[0]->findPoint(BPatch_entry); BPatch_Vector dummyArgs; // Create the parameter (code_entry) BPatch_constExpr code(code_entry); dummyArgs.push_back(&code); // Create the function call #if 0 BPatch_Vector funcs; appImage->findFunction("record_event0", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); #else BPatch_funcCallExpr dummyCall(*record_event0_ptr[0], dummyArgs); #endif //Insert the function call at the point app->insertSnippet(dummyCall, *points); } // Instrument the exit of the function if (code_exit) { // the function parameters are not available here, so we have to // call eztrace_code0(code) points = functions[0]->findPoint(BPatch_exit); // Create the parameter (code_entry) BPatch_Vector dummyArgs; BPatch_constExpr code(code_exit); dummyArgs.push_back(&code); // Create the function call #if 0 BPatch_Vector funcs; appImage->findFunction("record_event0", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); #else BPatch_funcCallExpr dummyCall(*record_event0_ptr[0], dummyArgs); #endif //Insert the function call at the point app->insertSnippet(dummyCall, *points); } return 1; } // instrument all the registered functions extern "C" int eztrace_dyninst_instrument(BPatch_addressSpace *app); static BPatch bpatch; static BPatch_addressSpace *app = NULL; static BPatch_binaryEdit *appBin = NULL; int main(int argc, char**argv) { if (argc != 3) { printf("usage: %s orig_prog new_prog\n", argv[0]); return 1; } char* file = argv[1]; char* newFile = argv[2]; bool ret; eztrace_dyninst_register("compute_", 1, 2); eztrace_dyninst_register("dist_", 3, 4); eztrace_dyninst_register("initialize_", 5, 6); eztrace_dyninst_register("timestamp_", 7, 8); eztrace_dyninst_register("update_", 9, 10); if (!eztrace_dyninst_nb_function_to_register()) { printf("0 functions instrumented\n"); return 1; } #ifdef CREATE_BINARY //Create the BPatch_addressSpace and BPatch_binaryEdit appBin = bpatch.openBinary(file, true); if (!appBin) { fprintf(stderr, "Cannot open %s\n", file); return -1; } app = static_cast(appBin); if (!app->loadLibrary(LIB_EZTRACE_SO)) { printf("Cannot load %s\n", LIB_EZTRACE_SO); return 1; } #else // run the program BPatch_process *appProc = bpatch.processCreate(file, NULL); if(!appProc) { printf("Cannot load program %s\n", file); } if(! appProc->loadLibrary(LIB_EZTRACE_SO, true)) { printf("Cannot load %s\n", LIB_EZTRACE_SO); return 1; } app = static_cast(appProc); #endif // Instrument all the specified functions int nb_inst = eztrace_dyninst_instrument(app); printf("%d functions instrumented\n", nb_inst); if (!nb_inst) return 1; #ifdef CREATE_BINARY if (appBin != NULL) { //Write a new instrumented executable appBin->writeFile(newFile); } else { fprintf(stderr, "cannot write %s\n", newFile); return -1; } #else appProc->continueExecution(); while(!appProc->isTerminated()) { bpatch.waitForStatusChange(); } #endif return 0; } eztrace-2.1/test/pptrace/comparison/programs/md/example.tpl000066400000000000000000000010411447213526500242130ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BEGIN_MODULE NAME example_lib DESC "module for md" LANGUAGE C ID 98 int compute_ (int* np,int* nd,int* pos,int* vel,int* mass,int* f,int* pot,int* kin ) int dist_ (int* nd,int* r1,int* r2,int* dr,int* d ) int initialize_ (int* np,int* nd,int* box,int* seed,int* pos,int* vel,int* acc ) int timestamp_ ( ) int update_ (int* np,int* nd,int* pos,int* vel,int* f,int* acc,int* mass,int* dt ) END_MODULE eztrace-2.1/test/pptrace/comparison/programs/md/eztrace_plugin/000077500000000000000000000000001447213526500250565ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/md/eztrace_plugin/Makefile000066400000000000000000000024261447213526500265220ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BIN = libeztrace-autostart-example_lib.so LIBINSTRUMENT_ROOT=$(realpath ../../../instrument/libinstrument-real) EZTRACE_PREFIX=$(shell printenv EZTRACE_PREFIX) EZTRACE_CFLAGS=-I$(EZTRACE_PREFIX)/include/ -I$(EZTRACE_PREFIX)/include/fxt EZTRACE_LDFLAGS=-Wl,--rpath,$(EZTRACE_PREFIX)/lib/ -L$(EZTRACE_PREFIX)/lib -leztrace all: $(BIN) instrument_pptrace.o: instrument_pptrace.c $(CC) -c instrument_pptrace.c -fPIC $(EZTRACE_CFLAGS) -I$(LIBINSTRUMENT_ROOT) -O3 libeztrace-autostart-example_lib.so: instrument_pptrace.o $(CC) -shared -o $@ $< $(EZTRACE_LDFLAGS) -Wl,--rpath,$(LIBINSTRUMENT_ROOT) -L$(LIBINSTRUMENT_ROOT) -linstrument run: @for i in $(TARGETS); do \ echo ================================================================================; \ echo Running EZTrace on `basename $$i` for real-life instrumentation; \ echo ================================================================================; \ for j in {1..$(NBRUNS)}; do \ EZTRACE_LIBRARY_PATH=$(CURDIR) EZTRACE_TRACE=example_lib $(EZTRACE_PREFIX)/bin/eztrace_pptrace $$i | grep seconds | xargs echo | cut -f 1 -d " " | xargs echo -n; \ echo -n " "; \ done; \ echo; \ done clean: rm -f $(BIN) eztrace-2.1/test/pptrace/comparison/programs/md/eztrace_plugin/instrument_pptrace.c000066400000000000000000000037031447213526500311530ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include "eztrace.h" #include "instrument.h" static int __foo_initialized = 0; static int nb_events = 0; int (*libcompute_)(int* np, int* nd, int* pos, int* vel, int* mass, int* f, int* pot, int* kin); int (*libdist_)(int* nd, int* r1, int* r2, int* dr, int* d); int (*libinitialize_)(int* np, int* nd, int* box, int* seed, int* pos, int* vel, int* acc); int (*libtimestamp_)(); int (*libupdate_)(int* np, int* nd, int* pos, int* vel, int* f, int* acc, int* mass, int* dt); int compute_(int* np, int* nd, int* pos, int* vel, int* mass, int* f, int* pot, int* kin) { record_event0(1); int ret = libcompute_(np, nd, pos, vel, mass, f, pot, kin); record_event0(2); return ret; } int dist_(int* nd, int* r1, int* r2, int* dr, int* d) { record_event0(1); int ret = libdist_(nd, r1, r2, dr, d); record_event0(2); return ret; } int initialize_(int* np, int* nd, int* box, int* seed, int* pos, int* vel, int* acc) { record_event0(1); int ret = libinitialize_(np, nd, box, seed, pos, vel, acc); record_event0(2); return ret; } int timestamp_() { record_event0(1); int ret = libtimestamp_(); record_event0(2); return ret; } int update_(int* np, int* nd, int* pos, int* vel, int* f, int* acc, int* mass, int* dt) { record_event0(1); int ret = libupdate_(np, nd, pos, vel, f, acc, mass, dt); record_event0(2); return ret; } START_INTERCEPT INTERCEPT2("update_", libupdate_) INTERCEPT2("timestamp_", libtimestamp_) INTERCEPT2("initialize_", libinitialize_) INTERCEPT2("dist_", libdist_) INTERCEPT2("compute_", libcompute_) END_INTERCEPT static void __foo_init(void) __attribute__ ((constructor)); static void __foo_init(void) { DYNAMIC_INTERCEPT_ALL(); } eztrace-2.1/test/pptrace/comparison/programs/md/md_open_mp.f000066400000000000000000000365211447213526500243360ustar00rootroot00000000000000 program main c*********************************************************************72 c Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis c See COPYING in top-level directory. c cc cc MAIN is the main program for MD_OPEN_MP. c c Discussion: c c The program implements a simple molecular dynamics simulation. c c The program uses Open MP directives to allow parallel computation. c c The velocity Verlet time integration scheme is used. c c The particles interact with a central pair potential. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 30 July 2009 c c Author: c c Original FORTRAN90 version by Bill Magro. c FORTRAN77 version by John Burkardt. c c Parameters: c c None c implicit none include 'omp_lib.h' integer nd parameter ( nd = 3 ) integer np parameter ( np = 100 ) integer step_num parameter ( step_num = 400 ) double precision acc(nd,np) double precision box(nd) double precision dt parameter ( dt = 0.0001D+00 ) double precision e0 double precision force(nd,np) integer i integer id double precision kinetic double precision mass parameter ( mass = 1.0D+00 ) double precision pos(nd,np) double precision potential integer proc_num integer seed integer step integer step_print integer step_print_index integer step_print_num integer thread_num double precision vel(nd,np) double precision wtime call timestamp ( ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'MD_OPEN_MP' write ( *, '(a)' ) ' FORTRAN77/OpenMP version' write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' A molecular dynamics program.' write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) & ' NP, the number of particles in the simulation is ', np write ( *, '(a,i8)' ) & ' STEP_NUM, the number of time steps, is ', step_num write ( *, '(a,g14.6)' ) & ' DT, the size of each time step, is ', dt write ( *, '(a)' ) ' ' write ( *, '(a,i8)' ) & ' The number of processors = ', omp_get_num_procs ( ) write ( *, '(a,i8)' ) & ' The number of threads = ', omp_get_max_threads ( ) c c Set the dimensions of the box. c do i = 1, nd box(i) = 10.0D+00 end do c c Set initial positions, velocities, and accelerations. c write ( *, '(a)' ) ' ' write ( *, '(a)' ) & ' Initializing positions, velocities, and accelerations.' seed = 123456789 call initialize ( np, nd, box, seed, pos, vel, acc ) c c Compute the forces and energies. c write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Computing initial forces and energies.' call compute ( np, nd, pos, vel, mass, force, potential, & kinetic ) e0 = potential + kinetic c c This is the main time stepping loop. c write ( *, '(a)' ) ' ' write ( *, '(a)' ) & ' At each step, we report the potential and kinetic energies.' write ( *, '(a)' ) & ' The sum of these energies should be a constant.' write ( *, '(a)' ) & ' As an accuracy check, we also print the relative error' write ( *, '(a)' ) ' in the total energy.' write ( *, '(a)' ) ' ' write ( *, '(a)' ) & ' Step Potential Kinetic (P+K-E0)/E0' write ( *, '(a)' ) & ' Energy P Energy K ' // & 'Relative Energy Error' write ( *, '(a)' ) ' ' step_print = 0 step_print_index = 0 step_print_num = 10 step = 0 write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' ) & step, potential, kinetic, ( potential + kinetic - e0 ) / e0 step_print_index = step_print_index + 1 step_print = ( step_print_index * step_num ) / step_print_num wtime = omp_get_wtime ( ) do step = 1, step_num call compute ( np, nd, pos, vel, mass, force, potential, & kinetic ) if ( step .eq. step_print ) then write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' ) & step, potential, kinetic, ( potential + kinetic - e0 ) / e0 step_print_index = step_print_index + 1 step_print = ( step_print_index * step_num ) / step_print_num end if call update ( np, nd, pos, vel, force, acc, mass, dt ) end do wtime = omp_get_wtime ( ) - wtime write ( *, '(a)' ) ' ' write ( *, '(a)' ) & ' Elapsed time for main computation:' write ( *, '(2x,g14.6,a)' ) wtime, ' seconds' write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'MD_OPEN_MP' write ( *, '(a)' ) ' Normal end of execution.' write ( *, '(a)' ) ' ' call timestamp ( ) stop end subroutine compute ( np, nd, pos, vel, mass, f, pot, kin ) c*********************************************************************72 c cc COMPUTE computes the forces and energies. c c Discussion: c c The computation of forces and energies is fully parallel. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 31 July 2009 c c Author: c c Original FORTRAN90 version by Bill Magro. c FORTRAN77 version by John Burkardt. c c Parameters: c c Input, integer NP, the number of particles. c c Input, integer ND, the number of spatial dimensions. c c Input, double precision POS(ND,NP), the position of each particle. c c Input, double precision VEL(ND,NP), the velocity of each particle. c c Input, double precision MASS, the mass of each particle. c implicit none integer np integer nd double precision d double precision d2 double precision dv double precision f(nd,np) integer i integer j integer k double precision kin double precision mass double precision PI2 parameter ( PI2 = 3.141592653589793D+00 / 2.0D+00 ) double precision pos(nd,np) double precision pot double precision rij(nd) double precision v double precision vel(nd,np) pot = 0.0D+00 kin = 0.0D+00 c$omp parallel c$omp& shared ( f, nd, np, pos, vel ) c$omp& private ( d, d2, i, j, k, rij ) c$omp& reduction ( + : pot, kin ) c$omp do do i = 1, np c c Compute the potential energy and forces. c do k = 1, nd f(k,i) = 0.0D+00 end do do j = 1, np if ( i .ne. j ) then call dist ( nd, pos(1,i), pos(1,j), rij, d ) c c Attribute half of the potential energy to particle J. c d2 = min ( d, pi2 ) pot = pot + 0.5D+00 * ( sin ( d2 ) )**2 do k = 1, nd f(k,i) = f(k,i) - rij(k) * sin ( 2.0D+00 * d2 ) / d end do end if end do c c Compute the kinetic energy. c do k = 1, nd kin = kin + vel(k,i)**2 end do end do c$omp end do c$omp end parallel kin = kin * 0.5D+00 * mass return end subroutine dist ( nd, r1, r2, dr, d ) c*********************************************************************72 c cc DIST computes the displacement (and its norm) between two particles. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 13 November 2007 c c Author: c c Original FORTRAN90 version by Bill Magro. c FORTRAN77 version by John Burkardt. c c Parameters: c c Input, integer ND, the number of spatial dimensions. c c Input, double precision R1(ND), R2(ND), the positions of the particles. c c Output, double precision DR(ND), the displacement vector. c c Output, double precision D, the Euclidean norm of the displacement. c implicit none integer nd double precision d double precision dr(nd) integer i double precision r1(nd) double precision r2(nd) do i = 1, nd dr(i) = r1(i) - r2(i) end do d = 0.0D+00 do i = 1, nd d = d + dr(i)**2 end do d = sqrt ( d ) return end subroutine initialize ( np, nd, box, seed, pos, vel, acc ) c*********************************************************************72 c cc INITIALIZE initializes the positions, velocities, and accelerations. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 13 November 2007 c c Author: c c Original FORTRAN90 version by Bill Magro. c FORTRAN77 version by John Burkardt. c c Parameters: c c Input, integer NP, the number of particles. c c Input, integer ND, the number of spatial dimensions. c c Input, double precision BOX(ND), specifies the maximum position c of particles in each dimension. c c Input/output, integer SEED, a seed for the random number generator. c c Output, double precision POS(ND,NP), the position of each particle. c c Output, double precision VEL(ND,NP), the velocity of each particle. c c Output, double precision ACC(ND,NP), the acceleration of each particle. c implicit none integer np integer nd double precision acc(nd,np) double precision box(nd) integer i integer j double precision pos(nd,np) double precision r8_uniform_01 integer seed double precision vel(nd,np) c c Give the particles random positions within the box. c do i = 1, nd do j = 1, np pos(i,j) = r8_uniform_01 ( seed ) end do end do c$omp parallel c$omp& shared ( acc, box, nd, np, pos, vel ) c$omp& private ( i, j ) c$omp do do j = 1, np do i = 1, nd pos(i,j) = box(i) * pos(i,j) vel(i,j) = 0.0D+00 acc(i,j) = 0.0D+00 end do end do c$omp end do c$omp end parallel return end function r8_uniform_01 ( seed ) c*********************************************************************72 c cc R8_UNIFORM_01 returns a unit pseudorandom R8. c c Discussion: c c This routine implements the recursion c c seed = 16807 * seed mod ( 2**31 - 1 ) c r8_uniform_01 = seed / ( 2**31 - 1 ) c c The integer arithmetic never requires more than 32 bits, c including a sign bit. c c If the initial seed is 12345, then the first three computations are c c Input Output R8_UNIFORM_01 c SEED SEED c c 12345 207482415 0.096616 c 207482415 1790989824 0.833995 c 1790989824 2035175616 0.947702 c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 11 August 2004 c c Author: c c John Burkardt c c Reference: c c Paul Bratley, Bennett Fox, Linus Schrage, c A Guide to Simulation, c Springer Verlag, pages 201-202, 1983. c c Pierre L'Ecuyer, c Random Number Generation, c in Handbook of Simulation, c edited by Jerry Banks, c Wiley Interscience, page 95, 1998. c c Bennett Fox, c Algorithm 647: c Implementation and Relative Efficiency of Quasirandom c Sequence Generators, c ACM Transactions on Mathematical Software, c Volume 12, Number 4, pages 362-376, 1986. c c Peter Lewis, Allen Goodman, James Miller, c A Pseudo-Random Number Generator for the System/360, c IBM Systems Journal, c Volume 8, pages 136-143, 1969. c c Parameters: c c Input/output, integer SEED, the "seed" value, which should NOT be 0. c On output, SEED has been updated. c c Output, double precision R8_UNIFORM_01, a new pseudorandom variate, c strictly between 0 and 1. c implicit none double precision r8_uniform_01 integer k integer seed if ( seed .eq. 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'R8_UNIFORM_01 - Fatal error!' write ( *, '(a)' ) ' Input value of SEED = 0.' stop end if k = seed / 127773 seed = 16807 * ( seed - k * 127773 ) - k * 2836 if ( seed .lt. 0 ) then seed = seed + 2147483647 end if c c Although SEED can be represented exactly as a 32 bit integer, c it generally cannot be represented exactly as a 32 bit real number! c r8_uniform_01 = dble ( seed ) * 4.656612875D-10 return end subroutine timestamp ( ) c*********************************************************************72 c cc TIMESTAMP prints out the current YMDHMS date as a timestamp. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 12 January 2007 c c Author: c c John Burkardt c c Parameters: c c None c implicit none character * ( 8 ) ampm integer d character * ( 8 ) date integer h integer m integer mm character * ( 9 ) month(12) integer n integer s character * ( 10 ) time integer y save month data month / & 'January ', 'February ', 'March ', 'April ', & 'May ', 'June ', 'July ', 'August ', & 'September', 'October ', 'November ', 'December ' / call date_and_time ( date, time ) read ( date, '(i4,i2,i2)' ) y, m, d read ( time, '(i2,i2,i2,1x,i3)' ) h, n, s, mm if ( h .lt. 12 ) then ampm = 'AM' else if ( h .eq. 12 ) then if ( n .eq. 0 .and. s .eq. 0 ) then ampm = 'Noon' else ampm = 'PM' end if else h = h - 12 if ( h .lt. 12 ) then ampm = 'PM' else if ( h .eq. 12 ) then if ( n .eq. 0 .and. s .eq. 0 ) then ampm = 'Midnight' else ampm = 'AM' end if end if end if write ( *, & '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) & d, month(m), y, h, ':', n, ':', s, '.', mm, ampm return end subroutine update ( np, nd, pos, vel, f, acc, mass, dt ) c*********************************************************************72 c cc UPDATE performs the time integration, using a velocity Verlet algorithm. c c Discussion: c c The time integration is fully parallel. c c Licensing: c c This code is distributed under the GNU LGPL license. c c Modified: c c 13 November 2007 c c Author: c c Original FORTRAN90 version by Bill Magro. c FORTRAN77 version by John Burkardt. c c Parameters: c c Input, integer NP, the number of particles. c c Input, integer ND, the number of spatial dimensions. c c Input/output, double precision POS(ND,NP), the position of each particle. c c Input/output, double precision VEL(ND,NP), the velocity of each particle. c c Input, double precision MASS, the mass of each particle. c c Input/output, double precision ACC(ND,NP), the acceleration of each c particle. c implicit none integer np integer nd double precision acc(nd,np) double precision dt double precision f(nd,np) integer i integer j double precision mass double precision pos(nd,np) double precision rmass double precision vel(nd,np) rmass = 1.0D+00 / mass c$omp parallel c$omp& shared ( acc, dt, f, nd, np, pos, rmass, vel ) c$omp& private ( i, j ) c$omp do do j = 1, np do i = 1, nd pos(i,j) = pos(i,j) & + vel(i,j) * dt + 0.5D+00 * acc(i,j) * dt * dt vel(i,j) = vel(i,j) & + 0.5D+00 * dt * ( f(i,j) * rmass + acc(i,j) ) acc(i,j) = f(i,j) * rmass end do end do c$omp end do c$omp end parallel return end eztrace-2.1/test/pptrace/comparison/programs/md/pin/000077500000000000000000000000001447213526500226315ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/md/pin/Makefile000066400000000000000000000035261447213526500242770ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=my_pin.so LIBINSTRUMENT_ROOT=$(realpath ../../../instrument/libinstrument-real) PIN_ROOT=$(shell printenv PIN_ROOT) LIBDWARF_DIR=$(shell printenv DWARF_LIBDIR) PIN_CFLAGS=-DTARGET_IA32E -DFUND_TC_HOSTCPU=FUND_CPU_INTEL64 -DFUND_TC_TARGETCPU=FUND_CPU_INTEL64 -DTARGET_LINUX -DFUND_TC_HOSTOS=FUND_OS_LINUX -DFUND_TC_TARGETOS=FUND_OS_LINUX \ -fpermissive \ -I$(PIN_ROOT)/source/InstLib -I$(PIN_ROOT)/extras/xed2-intel64/include -I$(PIN_ROOT)/extras/components/include -I$(PIN_ROOT)/source/include -I$(PIN_ROOT)/source/include/gen LIBINSTRUMENT_CFLAGS=-I$(LIBINSTRUMENT_ROOT) LIBINSTRUMENT_DUMMY_CFLAGS=-I$(LIBINSTRUMENT_SIMPLE_ROOT) PIN_LDFLAGS=-Wl,--version-script=$(PIN_ROOT)/source/include/pintool.ver -L../Lib/ -L../ExtLib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib -L$(PIN_ROOT)/intel64/lib -L$(PIN_ROOT)/intel64/lib-ext \ -Wl,--rpath,$(PIN_ROOT)/extras/xed2-intel64/lib/ -L$(PIN_ROOT)/extras/xed2-intel64/lib/\ -lpin -lxed -lelf -ldl -Wl,--rpath,$(LIBDWARF_DIR) -L$(LIBDWARF_DIR) -ldwarf LIBINSTRUMENT_LDFLAGS=-Wl,--rpath,$(LIBINSTRUMENT_ROOT) -L$(LIBINSTRUMENT_ROOT) -linstrument all: $(BINARIES) my_pin.so: my_pin.cpp g++ -shared -o my_pin.so -fPIC my_pin.cpp $(PIN_CFLAGS) $(PIN_LDFLAGS) $(LIBINSTRUMENT_CFLAGS) $(LIBINSTRUMENT_LDFLAGS) run: @for i in $(TARGETS); do \ echo ================================================================================; \ echo Running PIN on `basename $$i` for real-life instrumentation; \ echo ================================================================================; \ echo; \ for j in {1..$(NBRUNS)}; do \ $(PIN_ROOT)/pin -t my_pin.so -- $$i | grep seconds | xargs echo | cut -f 1 -d " " | xargs echo -n; \ echo -n " "; \ done; \ echo; \ done clean: rm -f *.o $(BINARIES) eztrace-2.1/test/pptrace/comparison/programs/md/pin/my_pin.cpp000066400000000000000000000101531447213526500246300ustar00rootroot00000000000000/*BEGIN_LEGAL Intel Open Source License Copyright (c) 2002-2012 Intel Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_LEGAL */ /* * This tool counts the number of times a routine is executed and * the number of instructions executed in a routine */ #include #include #include #include #include "pin.H" #include "instrument.h" // record one event before function foo is called /* ===================================================================== */ /* Print Help Message */ /* ===================================================================== */ INT32 Usage() { cerr << "This Pintool counts the number of times a routine is executed" << endl; cerr << "and the number of instructions executed in a routine" << endl; cerr << endl << KNOB_BASE::StringKnobSummary() << endl; return -1; } int instrument_function(IMG img, const char* function_name, AFUNPTR callback) { __init(); RTN rtn = RTN_FindByName(img, function_name); if (rtn == RTN_Invalid()) { //printf("RTN_FindByName failed\n"); return -1; } RTN_Open(rtn); RTN_InsertCall(rtn, IPOINT_BEFORE, callback, IARG_UINT32, 1, IARG_END); RTN_InsertCall(rtn, IPOINT_AFTER, callback, IARG_UINT32, 2, IARG_END); RTN_Close(rtn); printf("callback inserted for function %s\n", function_name); return 0; } void my_function(int n) { //printf("my_function was called with param %d\n", n); record_event0(1); } void my_fini(void* arg) { __conclude(); } VOID ImageLoad(IMG img, VOID *v) { printf("Loading %s, Image id = %d\n", IMG_Name(img).c_str(), IMG_Id(img)); //instrument_function(img, "foo", AFUNPTR(record_event0)); instrument_function(img, "compute_", AFUNPTR(my_function)); instrument_function(img, "dist_", AFUNPTR(my_function)); instrument_function(img, "initialize_", AFUNPTR(my_function)); instrument_function(img, "timestamp_", AFUNPTR(my_function)); instrument_function(img, "update_", AFUNPTR(my_function)); } /* ===================================================================== */ /* Main */ /* ===================================================================== */ int main(int argc, char * argv[]) { // Initialize symbol table code, needed for rtn instrumentation PIN_InitSymbols(); // Initialize pin if (PIN_Init(argc, argv)) return Usage(); IMG img = IMG_Open(argv[argc - 1]); if (img == IMG_Invalid()) { printf("Can't open file %s\n", argv[argc - 1]); return 1; } PIN_AddFiniFunction(FINI_CALLBACK(my_fini), NULL); IMG_AddInstrumentFunction(ImageLoad, 0); // Start the program, never returns PIN_StartProgram(); return 0; } eztrace-2.1/test/pptrace/comparison/programs/simple/000077500000000000000000000000001447213526500227345ustar00rootroot00000000000000eztrace-2.1/test/pptrace/comparison/programs/simple/Makefile000066400000000000000000000023611447213526500243760ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. BINARIES=simple_static simple_dynamic LIBRARIES=libsimple.a libsimple.so PWD=`pwd` all: $(BINARIES) $(LIBRARIES) simple_static: simple.o libsimple.a $(CC) -o simple_static simple.o -L. -lsimple simple_dynamic: simple.o libsimple.so $(CC) -rdynamic -o simple_dynamic simple.o -Wl,--rpath,$(PWD) -L. -lsimple libsimple.a: foo.c gcc -c foo.c -o foo_static.o ar rcv libsimple.a foo_static.o libsimple.so: foo.c gcc -c foo.c -o foo_dynamic.o -fPIC gcc foo_dynamic.o -shared -o libsimple.so clean: rm -f $(BINARIES) *.o $(LIBRARIES) run: all @echo ================================================================================ @echo Running simple_static without instrumentation @echo ================================================================================ @echo @./simple_static @echo ================================================================================ @echo Running simple_dynamic without instrumentation @echo ================================================================================ @echo @./simple_dynamic @make -C ../../instrument run TARGETS="$(CURDIR)/simple_static $(CURDIR)/simple_dynamic" eztrace-2.1/test/pptrace/comparison/programs/simple/foo.c000066400000000000000000000002641447213526500236650ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ int foo() { return 0; } eztrace-2.1/test/pptrace/comparison/programs/simple/simple.c000066400000000000000000000016301447213526500243710ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #define NB_ITER 1000000000 #define TIME_DIFF(t1, t2) ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec)) int foo_local() { return 42; } int main() { int i, j; unsigned res = 0; struct timeval t1, t2; for (j = 100; j < NB_ITER; j *= 10) { fprintf(stderr, "START %d iter!\n", j); if (gettimeofday(&t1, NULL)) { perror("gettimeofday"); } for (i = 0; i < j; i++) { res += foo(); res += foo_local(); } /* fin de la mesure */ if (gettimeofday(&t2, NULL)) { perror("gettimeofday"); } fprintf(stderr, "STOP !\n"); /* affichage du resultat */ fprintf(stderr, "res = %d\n", res); printf("%d\t%lf\n", j, TIME_DIFF(t1, t2) / j); } return 0; } eztrace-2.1/test/pptrace/comparison/programs/simple/tests.txt000066400000000000000000000015261447213526500246430ustar00rootroot00000000000000Sans instrumentation: $ ./simple_static START ! STOP ! res = -1243309312 1000000000 iterations in 2.654223 s (0.002654 µs per iteration) $ ./simple_dynamic START ! STOP ! res = -1243309312 1000000000 iterations in 2.650895 s (0.002651 µs per iteration) avec DynamoRIO: $ cd /home/trahay/Soft/opt/instrumentation/DynamoRIO-Linux-3.2.0-3 $ bin64/drrun -client samples/bin64/libcountcalls.so 0x1 "" /home/trahay/Documents/recherche/articles/PROPER_2012/programmes/simple/simple_dynamic Client countcalls is running START ! STOP ! res = -1243309312 1000000000 iterations in 24.358811 s (0.024359 µs per iteration) Thread 2792 exited - Instrumentation results: saw 1000000240 direct calls saw 43 indirect calls saw 1000000282 returns Instrumentation results: saw 1000000240 direct calls saw 43 indirect calls saw 1000000282 returns eztrace-2.1/test/pptrace/comparison/results-fourmi.clean.txt000066400000000000000000000114521447213526500244360ustar00rootroot00000000000000uname -a Linux fourmi001 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Intel(R) Xeon(R) CPU X5550 @ 2.67GHz Table 1: counting occurence no instr PIN DynInst EZTrace static 4.7ns 20.2ns 28.8ns 12.3ns dynamic 5.2ns 24.0ns - 11.3ns Table 2: recording events no instr PIN DynInst EZTrace static 4.7ns 1287ns 1294ns 245.2ns dynamic 5.3ns 1293ns - 227.4ns Table 3: MD mean no instr DynInst EZTrace PIN 0.45329196 3.2790614 2.2580954 3.159607 (+412.89ns) (+227.26ns) (+340.77ns) (+ 623%) (+398%) (+597%) ================================================================================ md_open_mp ================================================================================ no instru 0.532864 0.461902 0.583653 0.359002 0.459387 0.352485 0.365641 0.584841 0.535299 0.479720 0.402940 0.254865 0.349434 0.519278 0.445743 0.410172 0.303743 0.489029 0.538106 0.423888 0.328128 0.636694 0.537201 0.505497 0.502450 0.312180 0.523413 0.610288 0.421799 0.434802 0.410622 0.353954 0.551207 0.592233 0.449906 0.471554 0.536091 0.474126 0.314388 0.516685 0.350576 0.499704 0.530599 0.469511 0.490600 0.286135 0.398017 0.382504 0.433371 0.488371 DynInst 3.01896 3.41280 3.09959 3.30649 3.08854 3.31057 3.01316 3.13387 3.29879 3.47987 3.32949 2.97569 3.10052 3.68433 3.10704 3.15737 2.99199 3.13288 3.08114 4.14798 3.55148 3.10216 3.39243 3.13619 4.22233 3.04036 3.09401 3.15482 3.26160 3.83897 3.16330 3.44519 3.21188 3.53251 3.19244 3.11199 3.18483 3.38203 3.05331 3.82256 3.36778 3.08512 3.13417 3.10377 3.20565 3.33692 3.15777 3.38527 3.23563 3.17553 EZTrace 2.60531 2.23551 2.31026 2.64503 2.21275 2.24793 2.19368 2.28691 2.14216 2.31118 2.23545 2.29639 2.19996 2.30567 2.24411 2.14517 2.30632 2.26648 2.22264 2.12458 2.43135 2.20622 2.26245 2.35333 2.19366 2.17644 2.24330 2.14710 2.33247 2.36485 2.21434 2.31727 2.15138 2.17449 2.26511 2.17862 2.23899 2.25997 2.14113 2.17463 2.17624 2.18081 2.20534 2.38239 2.15928 2.32251 2.40468 2.15801 2.29093 2.25999 PIN 3.06422 3.00611 3.19813 3.16279 3.32765 3.05949 3.04068 3.08266 3.60830 3.04145 3.01838 3.31953 3.14387 3.42050 3.06975 3.09955 3.34193 3.27505 3.30954 3.01742 3.05890 3.14436 3.15151 3.01572 3.10245 3.02469 3.32410 3.26512 3.14921 3.40197 3.01741 3.29885 3.02361 3.12741 3.18027 3.21547 3.03236 3.02377 3.16640 3.22372 3.15237 3.28082 3.27699 3.06317 3.09612 3.13758 3.08211 3.04818 3.20694 3.08177 ================================================================================ simple_static - Simple Instrumentation ================================================================================ no instru PIN DynInst EZTrace 100 0.010000 25.100000 0.040000 0.040000 1000 0.005000 0.021000 0.032000 0.013000 10000 0.004700 0.020200 0.031000 0.012300 100000 0.004690 0.020330 0.031070 0.012420 1000000 0.004698 0.020175 0.031066 0.012293 10000000 0.004694 0.020186 0.028761 0.012296 100000000 0.004313 0.020175 0.028185 0.012302 1000000000 0.004272 0.020190 0.030650 0.012328 ================================================================================ simple_static - Real Instrumentation ================================================================================ no instru PIN DynInst EZTrace 100 0.010000 26.260000 1.310000 1.330000 1000 0.005000 1.283000 1.283000 1.282000 10000 0.004700 1.285900 1.286000 1.285400 100000 0.004690 1.289550 1.287370 1.287080 1000000 0.004698 1.288052 1.288999 1.285285 10000000 0.004694 1.287550 1.294174 0.245188 100000000 0.004313 0.165155 0.166655 0.013729 1000000000 0.004272 0.021573 0.022877 0.013688 ================================================================================ simple_dynamic - Simple instrumentation ================================================================================ no instru PIN EZTrace 100 0.020000 38.500000 0.040000 1000 0.006000 0.152000 0.012000 10000 0.005300 0.024200 0.011300 100000 0.005260 0.023330 0.011320 1000000 0.005298 0.023274 0.011266 10000000 0.005278 0.024006 0.011265 100000000 0.004802 0.023239 0.011267 1000000000 0.004781 0.023577 0.011332 ================================================================================ simple_dynamic - Real instrumentation ================================================================================ no instru PIN EZTrace 100 0.020000 38.680000 1.330000 1000 0.006000 1.416000 1.287000 10000 0.005300 1.305100 1.284700 100000 0.005260 1.291460 1.287900 1000000 0.005298 1.291221 1.287444 10000000 0.005278 1.293498 0.227407 100000000 0.004802 0.168196 0.012796 1000000000 0.004781 0.024622 0.012625 eztrace-2.1/test/pptrace/comparison/results-fourmi.raw.txt000066400000000000000000000154471447213526500241550ustar00rootroot00000000000000uname -a Linux fourmi001 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Intel(R) Xeon(R) CPU X5550 @ 2.67GHz ================================================================================ Running md_open_mp without instrumentation ================================================================================ 0.532864 0.461902 0.583653 0.359002 0.459387 0.352485 0.365641 0.584841 0.535299 0.479720 0.402940 0.254865 0.349434 0.519278 0.445743 0.410172 0.303743 0.489029 0.538106 0.423888 0.328128 0.636694 0.537201 0.505497 0.502450 0.312180 0.523413 0.610288 0.421799 0.434802 0.410622 0.353954 0.551207 0.592233 0.449906 0.471554 0.536091 0.474126 0.314388 0.516685 0.350576 0.499704 0.530599 0.469511 0.490600 0.286135 0.398017 0.382504 0.433371 0.488371 ================================================================================ Running DynInst on md_open_mp for real-life instrumentation ================================================================================ 3.01896 3.41280 3.09959 3.30649 3.08854 3.31057 3.01316 3.13387 3.29879 3.47987 3.32949 2.97569 3.10052 3.68433 3.10704 3.15737 2.99199 3.13288 3.08114 4.14798 3.55148 3.10216 3.39243 3.13619 4.22233 3.04036 3.09401 3.15482 3.26160 3.83897 3.16330 3.44519 3.21188 3.53251 3.19244 3.11199 3.18483 3.38203 3.05331 3.82256 3.36778 3.08512 3.13417 3.10377 3.20565 3.33692 3.15777 3.38527 3.23563 3.17553 ================================================================================ Running EZTrace on md_open_mp for real-life instrumentation ================================================================================ 2.60531 2.23551 2.31026 2.64503 2.21275 2.24793 2.19368 2.28691 2.14216 2.31118 2.23545 2.29639 2.19996 2.30567 2.24411 2.14517 2.30632 2.26648 2.22264 2.12458 2.43135 2.20622 2.26245 2.35333 2.19366 2.17644 2.24330 2.14710 2.33247 2.36485 2.21434 2.31727 2.15138 2.17449 2.26511 2.17862 2.23899 2.25997 2.14113 2.17463 2.17624 2.18081 2.20534 2.38239 2.15928 2.32251 2.40468 2.15801 2.29093 2.25999 ================================================================================ Running PIN on md_open_mp for real-life instrumentation ================================================================================ 3.06422 3.00611 3.19813 3.16279 3.32765 3.05949 3.04068 3.08266 3.60830 3.04145 3.01838 3.31953 3.14387 3.42050 3.06975 3.09955 3.34193 3.27505 3.30954 3.01742 3.05890 3.14436 3.15151 3.01572 3.10245 3.02469 3.32410 3.26512 3.14921 3.40197 3.01741 3.29885 3.02361 3.12741 3.18027 3.21547 3.03236 3.02377 3.16640 3.22372 3.15237 3.28082 3.27699 3.06317 3.09612 3.13758 3.08211 3.04818 3.20694 3.08177 ================================================================================ Running simple_static without instrumentation ================================================================================ 100 0.010000 1000 0.005000 10000 0.004700 100000 0.004690 1000000 0.004694 10000000 0.004627 100000000 0.004330 1000000000 0.004272 ================================================================================ Running simple_dynamic without instrumentation ================================================================================ 100 0.020000 1000 0.006000 10000 0.005300 100000 0.005260 1000000 0.005268 10000000 0.005261 100000000 0.004818 1000000000 0.004781 ================================================================================ Running PIN on simple_static for simple instrumentation ================================================================================ 100 25.100000 1000 0.021000 10000 0.020200 100000 0.020330 1000000 0.022633 10000000 0.020143 100000000 0.020220 1000000000 0.020190 ================================================================================ Running PIN on simple_static for real instrumentation ================================================================================ 100 26.260000 1000 1.283000 10000 1.285900 100000 1.289550 1000000 1.286838 10000000 1.283702 100000000 0.165678 1000000000 0.021573 ================================================================================ Running PIN on simple_dynamic for simple instrumentation ================================================================================ 100 38.500000 1000 0.152000 10000 0.024200 100000 0.023330 1000000 0.027402 10000000 0.023588 100000000 0.023562 1000000000 0.023577 ================================================================================ Running PIN on simple_dynamic for real instrumentation ================================================================================ 100 38.680000 1000 1.416000 10000 1.305100 100000 1.291460 1000000 1.295080 10000000 1.291080 100000000 0.169166 1000000000 0.024622 ================================================================================ Running DynInst on simple_static for simple instrumentation ================================================================================ 100 0.040000 1000 0.032000 10000 0.031000 100000 0.031070 1000000 0.033896 10000000 0.031174 100000000 0.030927 1000000000 0.030650 ================================================================================ Running DynInst on simple_static for real instrumentation ================================================================================ 100 1.310000 1000 1.283000 10000 1.286000 100000 1.287370 1000000 1.283781 10000000 1.283619 100000000 0.166968 1000000000 0.022877 ================================================================================ Running EZTrace on simple_static for simple instrumentation ================================================================================ 100 0.040000 1000 0.013000 10000 0.012300 100000 0.012420 1000000 0.012383 10000000 0.012288 100000000 0.012291 1000000000 0.012328 ================================================================================ Running EZTrace on simple_static for real instrumentation ================================================================================ 100 1.330000 1000 1.282000 10000 1.285400 100000 1.287080 1000000 1.286315 10000000 0.245188 100000000 0.013650 1000000000 0.013688 ================================================================================ Running EZTrace on simple_dynamic for simple instrumentation ================================================================================ 100 0.040000 1000 0.012000 10000 0.011300 100000 0.011320 1000000 0.012396 10000000 0.011587 100000000 0.011427 1000000000 0.011332 ================================================================================ Running EZTrace on simple_dynamic for real instrumentation ================================================================================ 100 1.330000 1000 1.287000 10000 1.284700 100000 1.287900 1000000 1.282105 10000000 0.242202 100000000 0.012626 1000000000 0.012625 eztrace-2.1/test/pptrace/comparison/results-fourmi0.raw.txt000066400000000000000000000633371447213526500242360ustar00rootroot00000000000000uname -a Linux fourmi001 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Intel(R) Xeon(R) CPU X5550 @ 2.67GHz ================================================================================ Running md_open_mp without instrumentation ================================================================================ 19 July 2012 0:35:16.838 AM MD_OPEN_MP FORTRAN77/OpenMP version A molecular dynamics program. NP, the number of particles in the simulation is 100 STEP_NUM, the number of time steps, is 400 DT, the size of each time step, is 0.100000E-03 The number of processors = 8 The number of threads = 8 Initializing positions, velocities, and accelerations. Computing initial forces and energies. At each step, we report the potential and kinetic energies. The sum of these energies should be a constant. As an accuracy check, we also print the relative error in the total energy. Step Potential Kinetic (P+K-E0)/E0 Energy P Energy K Relative Energy Error 0 4937.10 0.00000 0.00000 40 4937.10 0.407768E-03 0.138956E-10 80 4937.09 0.169528E-02 0.136329E-10 120 4937.09 0.386330E-02 0.129029E-10 160 4937.09 0.691206E-02 0.114666E-10 200 4937.08 0.108419E-01 0.908574E-11 240 4937.08 0.156532E-01 0.552244E-11 280 4937.07 0.213464E-01 0.540491E-12 320 4937.07 0.279223E-01 -0.609628E-11 360 4937.06 0.353815E-01 -0.146504E-10 400 4937.05 0.437248E-01 -0.254344E-10 Elapsed time for main computation: 0.265122 seconds MD_OPEN_MP Normal end of execution. 19 July 2012 0:35:17.112 AM opening binary /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/md/md_open_mp Threre are 13 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c function record_event0 not found in module libinstrument.so function record_event0 not found in module ld-linux-x86-64.so.2 function record_event0 not found in module libc.so.6 function record_event0 not found in module libm.so.6 function record_event0 not found in module libpthread.so.0 function record_event0 not found in module librt.so.1 function record_event0 not found in module libgcc_s.so.1 function record_event0 not found in module libgfortran.so.3 function record_event0 not found in module libgomp.so.1 function record_event0 not found in module libquadmath.so.0 Cannot find record_event0 function Threre are 13 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c function record_event0 not found in module libinstrument.so function record_event0 not found in module ld-linux-x86-64.so.2 function record_event0 not found in module libc.so.6 function record_event0 not found in module libm.so.6 function record_event0 not found in module libpthread.so.0 function record_event0 not found in module librt.so.1 function record_event0 not found in module libgcc_s.so.1 function record_event0 not found in module libgfortran.so.3 function record_event0 not found in module libgomp.so.1 function record_event0 not found in module libquadmath.so.0 Cannot find record_event0 function Threre are 13 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c function record_event0 not found in module libinstrument.so function record_event0 not found in module ld-linux-x86-64.so.2 function record_event0 not found in module libc.so.6 function record_event0 not found in module libm.so.6 function record_event0 not found in module libpthread.so.0 function record_event0 not found in module librt.so.1 function record_event0 not found in module libgcc_s.so.1 function record_event0 not found in module libgfortran.so.3 function record_event0 not found in module libgomp.so.1 function record_event0 not found in module libquadmath.so.0 Cannot find record_event0 function Threre are 13 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c function record_event0 not found in module libinstrument.so function record_event0 not found in module ld-linux-x86-64.so.2 function record_event0 not found in module libc.so.6 function record_event0 not found in module libm.so.6 function record_event0 not found in module libpthread.so.0 function record_event0 not found in module librt.so.1 function record_event0 not found in module libgcc_s.so.1 function record_event0 not found in module libgfortran.so.3 function record_event0 not found in module libgomp.so.1 function record_event0 not found in module libquadmath.so.0 Cannot find record_event0 function Threre are 13 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c function record_event0 not found in module libinstrument.so function record_event0 not found in module ld-linux-x86-64.so.2 function record_event0 not found in module libc.so.6 function record_event0 not found in module libm.so.6 function record_event0 not found in module libpthread.so.0 function record_event0 not found in module librt.so.1 function record_event0 not found in module libgcc_s.so.1 function record_event0 not found in module libgfortran.so.3 function record_event0 not found in module libgomp.so.1 function record_event0 not found in module libquadmath.so.0 Cannot find record_event0 function -5 functions instrumented ================================================================================ Running DynInst on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/md/md_open_mp for real-life instrumentation ================================================================================ 19 July 2012 0:35:17.730 AM MD_OPEN_MP FORTRAN77/OpenMP version A molecular dynamics program. NP, the number of particles in the simulation is 100 STEP_NUM, the number of time steps, is 400 DT, the size of each time step, is 0.100000E-03 The number of processors = 8 The number of threads = 8 Initializing positions, velocities, and accelerations. Computing initial forces and energies. At each step, we report the potential and kinetic energies. The sum of these energies should be a constant. As an accuracy check, we also print the relative error in the total energy. Step Potential Kinetic (P+K-E0)/E0 Energy P Energy K Relative Energy Error 0 4937.10 0.00000 0.00000 40 4937.10 0.407768E-03 0.138956E-10 80 4937.09 0.169528E-02 0.136331E-10 120 4937.09 0.386330E-02 0.129031E-10 160 4937.09 0.691206E-02 0.114667E-10 200 4937.08 0.108419E-01 0.908556E-11 240 4937.08 0.156532E-01 0.552244E-11 280 4937.07 0.213464E-01 0.540491E-12 320 4937.07 0.279223E-01 -0.609609E-11 360 4937.06 0.353815E-01 -0.146506E-10 400 4937.05 0.437248E-01 -0.254344E-10 Elapsed time for main computation: 0.549772 seconds MD_OPEN_MP Normal end of execution. 19 July 2012 0:35:18.289 AM ================================================================================ Running EZTrace on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/md/md_open_mp for real-life instrumentation ================================================================================ Starting EZTrace... done Stopping EZTrace... saving trace /tmp/martin-g_eztrace_log_rank_1 19 July 2012 0:35:18.483 AM MD_OPEN_MP FORTRAN77/OpenMP version A molecular dynamics program. NP, the number of particles in the simulation is 100 STEP_NUM, the number of time steps, is 400 DT, the size of each time step, is 0.100000E-03 The number of processors = 8 The number of threads = 8 Initializing positions, velocities, and accelerations. Computing initial forces and energies. At each step, we report the potential and kinetic energies. The sum of these energies should be a constant. As an accuracy check, we also print the relative error in the total energy. Step Potential Kinetic (P+K-E0)/E0 Energy P Energy K Relative Energy Error 0 4937.10 0.00000 0.00000 40 4937.10 0.407768E-03 0.138953E-10 80 4937.09 0.169528E-02 0.136328E-10 120 4937.09 0.386330E-02 0.129025E-10 160 4937.09 0.691206E-02 0.114664E-10 200 4937.08 0.108419E-01 0.908538E-11 240 4937.08 0.156532E-01 0.552226E-11 280 4937.07 0.213464E-01 0.540307E-12 320 4937.07 0.279223E-01 -0.609628E-11 360 4937.06 0.353815E-01 -0.146507E-10 400 4937.05 0.437248E-01 -0.254348E-10 Elapsed time for main computation: 1.11351 seconds MD_OPEN_MP Normal end of execution. 19 July 2012 0:35:19.613 AM ================================================================================ Running PIN on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/md/md_open_mp for real-life instrumentation ================================================================================ Starting FxT instrumentation... Init Done Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... 19 July 2012 0:35:20.722 AM MD_OPEN_MP FORTRAN77/OpenMP version A molecular dynamics program. NP, the number of particles in the simulation is 100 STEP_NUM, the number of time steps, is 400 DT, the size of each time step, is 0.100000E-03 The number of processors = 8 The number of threads = 8 Initializing positions, velocities, and accelerations. Computing initial forces and energies. At each step, we report the potential and kinetic energies. The sum of these energies should be a constant. As an accuracy check, we also print the relative error in the total energy. Step Potential Kinetic (P+K-E0)/E0 Energy P Energy K Relative Energy Error 0 4937.10 0.00000 0.00000 40 4937.10 0.407768E-03 0.138956E-10 80 4937.09 0.169528E-02 0.136333E-10 120 4937.09 0.386330E-02 0.129031E-10 160 4937.09 0.691206E-02 0.114669E-10 200 4937.08 0.108419E-01 0.908593E-11 240 4937.08 0.156532E-01 0.552281E-11 280 4937.07 0.213464E-01 0.540676E-12 320 4937.07 0.279223E-01 -0.609591E-11 360 4937.06 0.353815E-01 -0.146504E-10 400 4937.05 0.437248E-01 -0.254342E-10 Elapsed time for main computation: 3.07412 seconds MD_OPEN_MP Normal end of execution. 19 July 2012 0:35:24.190 AM Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/md/md_open_mp, Image id = 1 callback inserted for function compute_ callback inserted for function dist_ callback inserted for function initialize_ callback inserted for function timestamp_ callback inserted for function update_ Loading /lib64/ld-linux-x86-64.so.2, Image id = 2 Loading /opt/cluster/compiler/gcc/latest/lib64/libgfortran.so.3, Image id = 3 Loading /lib64/libm.so.6, Image id = 4 Loading /opt/cluster/compiler/gcc/latest/lib64/libgomp.so.1, Image id = 5 Loading /opt/cluster/compiler/gcc/latest/lib64/libgcc_s.so.1, Image id = 6 Loading /opt/cluster/compiler/gcc/latest/lib64/libquadmath.so.0, Image id = 7 Loading /lib64/libpthread.so.0, Image id = 8 Loading /lib64/libc.so.6, Image id = 9 Loading /lib64/librt.so.1, Image id = 10 ================================================================================ Running simple_static without instrumentation ================================================================================ START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 0.010000 1000 0.009000 10000 0.005800 100000 0.004240 1000000 0.003883 10000000 0.004207 ================================================================================ Running simple_dynamic without instrumentation ================================================================================ START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 0.010000 1000 0.010000 10000 0.006800 100000 0.004780 1000000 0.004779 10000000 0.004777 ================================================================================ Running PIN on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for simple instrumentation ================================================================================ Starting instrument-dummy... Starting instrument-dummy... Starting instrument-dummy... Starting instrument-dummy... START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 24.790000 1000 0.021000 10000 0.020200 100000 0.020120 1000000 0.020176 10000000 0.020924 Stopping instrument-dummy... 22222200 events Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static, Image id = 1 callback inserted for function foo Loading /lib64/ld-linux-x86-64.so.2, Image id = 2 Loading /lib64/libc.so.6, Image id = 3 ================================================================================ Running PIN on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for real instrumentation ================================================================================ Starting FxT instrumentation... Init Done Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 26.500000 1000 1.411000 10000 1.281000 100000 1.288990 1000000 1.287311 10000000 1.286958 Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static, Image id = 1 callback inserted for function foo Loading /lib64/ld-linux-x86-64.so.2, Image id = 2 Loading /lib64/libc.so.6, Image id = 3 ================================================================================ Running PIN on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic for simple instrumentation ================================================================================ Starting instrument-dummy... Starting instrument-dummy... Starting instrument-dummy... Starting instrument-dummy... Starting instrument-dummy... START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 38.220000 1000 0.025000 10000 0.023600 100000 0.023530 1000000 0.023582 10000000 0.023565 Stopping instrument-dummy... 22222200 events Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic, Image id = 1 Loading /lib64/ld-linux-x86-64.so.2, Image id = 2 Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/libsimple.so, Image id = 3 callback inserted for function foo Loading /lib64/libc.so.6, Image id = 4 ================================================================================ Running PIN on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic for real instrumentation ================================================================================ Starting FxT instrumentation... Init Done Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... Starting FxT instrumentation... START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 100 35.660000 1000 1.304000 10000 1.291500 100000 1.287830 1000000 1.293879 10000000 1.294397 Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic, Image id = 1 Loading /lib64/ld-linux-x86-64.so.2, Image id = 2 Loading /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/libsimple.so, Image id = 3 callback inserted for function foo Loading /lib64/libc.so.6, Image id = 4 opening binary /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static Threre are 6 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c Found ! PLOP Found foo! 1 functions instrumented ================================================================================ Running DynInst on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for simple instrumentation ================================================================================ Starting instrument-dummy... START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping instrument-dummy... 22222200 events 100 0.040000 1000 0.032000 10000 0.031900 100000 0.031020 1000000 0.031250 10000000 0.028648 opening binary /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static Threre are 6 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c Found ! PLOP Found foo! 1 functions instrumented ================================================================================ Running DynInst on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for real instrumentation ================================================================================ Starting FxT instrumentation... Init Done START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace 100 1.320000 1000 1.299000 10000 1.299700 100000 1.290630 1000000 1.284926 10000000 1.285110 warning: cannot find function foo in executable opening binary /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic Threre are 4 modules function record_event0 not found in module DEFAULT_MODULE function record_event0 not found in module start.S function record_event0 not found in module elf-init.c Found ! PLOP function foo not found in module DEFAULT_MODULE function foo not found in module start.S function foo not found in module elf-init.c function foo not found in module libinstrument.so 0 functions instrumented make[4]: *** [instrument-simple] Error 1 make[3]: *** [run] Error 2 ================================================================================ Running EZTrace on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for simple instrumentation ================================================================================ Starting instrument-dummy... libfoo = 0x4000000c Starting EZTrace... done START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping EZTrace... saving trace /tmp/martin-g_eztrace_log_rank_1 Stopping instrument-dummy... 22222200 events 100 0.030000 1000 0.023000 10000 0.012300 100000 0.012390 1000000 0.012306 10000000 0.012303 ================================================================================ Running EZTrace on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_static for real instrumentation ================================================================================ Starting FxT instrumentation... Init Done libfoo = 0x4000000c Starting EZTrace... done START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping EZTrace... saving trace /tmp/martin-g_eztrace_log_rank_1 Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace 100 1.320000 1000 1.306000 10000 1.287500 100000 1.285900 1000000 1.283585 10000000 0.227849 ================================================================================ Running EZTrace on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic for simple instrumentation ================================================================================ Starting instrument-dummy... libfoo = 0x2aaaab0d153c Starting EZTrace... done START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping EZTrace... saving trace /tmp/martin-g_eztrace_log_rank_1 Stopping instrument-dummy... 22222200 events 100 0.030000 1000 0.019000 10000 0.012500 100000 0.012440 1000000 0.012394 10000000 0.011514 ================================================================================ Running EZTrace on /home/martin-g/perf/eztrace-pedron-orig/test/pptrace/comparison/programs/simple/simple_dynamic for real instrumentation ================================================================================ Starting FxT instrumentation... Init Done libfoo = 0x2aaaab0d153c Starting EZTrace... done START 100 iter! STOP ! res = 4200 START 1000 iter! STOP ! res = 46200 START 10000 iter! STOP ! res = 466200 START 100000 iter! STOP ! res = 4666200 START 1000000 iter! STOP ! res = 46666200 START 10000000 iter! STOP ! res = 466666200 Stopping EZTrace... saving trace /tmp/martin-g_eztrace_log_rank_1 Stopping FxT instrumentation... Stopping FxT instrumentation... saving trace /var/tmp/martin-g_trace 100 1.340000 1000 1.289000 10000 1.296100 100000 1.292250 1000000 1.284866 10000000 0.226875 eztrace-2.1/test/pptrace/comparison/results-proper.txt000066400000000000000000000022411447213526500233570ustar00rootroot00000000000000Dyninst 7.0.1 PIN v2.11 Devel08 (Intel(R) Xeon(R) CPU X5570 @ 2.93GHz) ========================================================= Test with dummy instrumentation Instr no PIN DynInst EZTrace static 0.006199 0.022507 0.028198 0.012277 dynamic 0.006798 0.023189 - 0.011253 Test with FxT instrumentation Instr no PIN DynInst EZTrace static 0.006199 0.106648 0.124855 0.035167 dynamic 0.006798 0.120469 - 0.027284 Test on MD (inconsistent) no 0.367597 PIN 1.36079 DynInst 0.530015 EZTrace 0.640010 Fourmi001 (Intel(R) Xeon(R) CPU X5550 @ 2.93GHz) Linux 2.6.27.39-0.3 ===================================================================== Test with dummy instrumentation Instr no PIN DynInst EZTrace static 0.004207 0.020924 0.028648 0.012303 dynamic 0.004777 0.023565 - 0.011514 Test with FxT instrumentation Instr no PIN DynInst EZTrace static 0.004207 1.286958 1.285110 0.227849 dynamic 0.004777 1.294397 - 0.226875 Test on MD (inconsistent) no 0.265122 PIN 3.07412 DynInst 0.549772 EZTrace 1.11351 eztrace-2.1/test/pptrace/perf/000077500000000000000000000000001447213526500163735ustar00rootroot00000000000000eztrace-2.1/test/pptrace/perf/Makefile.in000066400000000000000000000006301447213526500204370ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. all: instruments progs progs: make -C tests instruments: make -C instrumentation clean: make -C tests clean make -C instrumentation clean distclean: clean rm -f config.log config.status configure rm -f tests/Makefile instrumentation/Makefile dyninst.conf Makefile rm -fr autom4te.cache eztrace-2.1/test/pptrace/perf/configure.ac000066400000000000000000000041521447213526500206630ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. AC_PREREQ([2.60]) AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_MAKE_SET # Checks for libraries. AC_CHECK_LIB(bfd, bfd_get_error) AC_CHECK_LIB(dl, dlsym) AC_CHECK_LIB(pthread, pthread_create) # Checks for header files. AC_CHECK_HEADERS([stdint.h stdlib.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_TYPE_UINT32_T # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([setenv]) # arguments for dyninst AC_ARG_WITH(dyninst, AS_HELP_STRING([--with-dyninst], [Activate DynInst and set its path to ARG (default is /usr/local/lib)]), [have_dyninst=yes]) AC_ARG_WITH(dyninst_inc, AS_HELP_STRING([--with-dyninst-inc], [Path to dyninst include (default is /usr/local/include)])) # arguments for pin AC_ARG_WITH(pin, AS_HELP_STRING([--with-pin], [Activate PIN and set its path to ARG (default is /usr/shared/pin)]), [have_pin=yes]) # Config files AC_CONFIG_FILES([Makefile instrumentation/Makefile tests/Makefile]) AS_IF([test "x$have_dyninst" = "xyes"], [AC_CONFIG_FILES([dyninst.conf]) AC_SUBST(dyninst, "ddyninst dyninst") AC_SUBST(dyninst_mk, "include ../dyninst.conf") AS_IF(test "x$with_dyninst" = "xyes", [AC_SUBST(dyninst_lib, /usr/local/lib)], [AC_SUBST(dyninst_lib, "$with_dyninst")]) AS_IF(test "x$with_dyninst_inc" = "x", [AC_SUBST(dyninst_inc, /usr/local/include)], [AC_SUBST(dyninst_inc, "$with_dyninst_inc")]) ]) AS_IF([test "x$have_dyninst" = "xyes"], [AC_CONFIG_FILES([pin.conf]) AC_SUBST(pin, "pin_fast.so") AC_SUBST(pin_mk, "include ../pin.conf") AS_IF(test "x$with_pin" = "xyes", [AC_SUBST(pin_path, /usr/shared/pin)], [AC_SUBST(pin_path, "$with_pin")]) AS_IF(test "x$with_pin" = "xyes", [AC_SUBST(pin_mk2, "include /usr/shared/pin/source/tools/makefile.gnu.config")], [AC_SUBST(pin_mk2, "include $with_pin/source/tools/makefile.gnu.config")]) ]) AC_OUTPUT eztrace-2.1/test/pptrace/perf/dyninst.conf.in000066400000000000000000000002431447213526500213360ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. DYNINST_LIB=@dyninst_lib@ DYNINST_INC=@dyninst_inc@ eztrace-2.1/test/pptrace/perf/dyninst.sh000077500000000000000000000010321447213526500204160ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. if [ ! -f "./dyninst.conf" ]; then exit 1 fi if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ]; then echo "Usage: $0 progname destination arg1 arg2" >&2 exit 1 fi . ./dyninst.conf . ./timing.sh LD_PATH=$DYNINST_LIB: ./instrument.sh $1 $2 dprogcreated=$$ if [ "$dprogcreated" -ge 0 ]; then timing "" ./$2 $3 $4 if [ "$dprogcreated" -gt 0 ]; then rm $2 fi fi exit 0 eztrace-2.1/test/pptrace/perf/instrument.sh000077500000000000000000000007741447213526500211520ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. if [ -z "$1" -o -z "$2" ]; then echo "Usage: $0 progname destination" >&2 exit -1 fi . ./dyninst.conf dyninst=./instrumentation/ddyninst LIB_PATH=/usr/local/lib:$DYNINST_LIB if [ ! -x "$dyninst" ]; then exit -2 else if [ -f "$2" ]; then exit 0 else LD_LIBRARY_PATH=$LIB_PATH DYNINSTAPI_RT_LIB=$DYNINST_LIB/libdyninstAPI_RT.so $dyninst tests/$1 $2 >/dev/null exit 1 fi fi eztrace-2.1/test/pptrace/perf/instrumentation/000077500000000000000000000000001447213526500216365ustar00rootroot00000000000000eztrace-2.1/test/pptrace/perf/instrumentation/Makefile.in000066400000000000000000000016511447213526500237060ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. PPTRACE_LIBS=-lbfd -lpthread -lm -ldl PPTRACE_PATH=../../../../src/pptrace PPTRACE_INC=$(PPTRACE_PATH) PPTRACE_FILES=$(PPTRACE_PATH)/*.c DYNINST_LIBS= -ldyninstAPI -lcommon -linstructionAPI -lsymtabAPI -ldwarf -lelf -lparseAPI -lpthread @dyninst_mk@ @pin_mk@ @pin_mk2@ all: pptrace @dyninst@ @pin@ ddyninst: dummy_dyninst.cc dyninst_common.h g++ -O2 -L$(DYNINST_LIB) -I$(DYNINST_INC) -o $@ $< $(DYNINST_LIBS) dyninst: dyninst.cc dyninst_common.h g++ -O2 -L$(DYNINST_LIB) -I$(DYNINST_INC) -o $@ $< $(DYNINST_LIBS) pptrace: pptrace.c $(PPTRACE_FILES) gcc -O2 -I$(PPTRACE_INC) $(PPTRACE_FILES) -o $@ $< $(PPTRACE_LIBS) pin%.o: pin%.cc $(CXX) -I../tests $(CXXFLAGS) $(PIN_CXXFLAGS) -c -o $@ $< pin%.so: pin%.o ${PIN_LD} $(PIN_LDFLAGS) -o $@ $< ${PIN_LPATHS} $(PIN_LIBS) clean: rm -f pptrace @dyninst@ @pin@ *.o eztrace-2.1/test/pptrace/perf/instrumentation/dummy_dyninst.cc000066400000000000000000000024131447213526500250500ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * Ripped from /src/core/eztrace_dyninst_core.h * October, 3rd - 2011 - Damien Martin-Guillerez */ #include "dyninst_common.h" static BPatch bpatch; static BPatch_addressSpace *app = NULL; static BPatch_binaryEdit *appBin = NULL; int main(int argc, char**argv) { if (argc != 3) { printf("usage: %s orig_prog new_prog\n", argv[0]); return 1; } // Correcting stupid dyninst behavior setenv("LD_LIBRARY_PATH", "", 0); char* file = argv[1]; char* newFile = argv[2]; bool ret; //Create the BPatch_addressSpace and BPatch_binaryEdit appBin = bpatch.openBinary(file, false); if (!appBin) { fprintf(stderr, "Cannot open %s\n", file); return -1; } app = static_cast(appBin); // Instrument all the specified functions int nb_inst = dummy_dyninst_instrument(app); printf("%d functions instrumented\n", nb_inst); if (!nb_inst) return 1; if (appBin != NULL) { //Write a new instrumented executable appBin->writeFile(newFile); } else { fprintf(stderr, "cannot write %s\n", newFile); return -1; } return 0; } eztrace-2.1/test/pptrace/perf/instrumentation/dyninst.cc000066400000000000000000000023571447213526500236440ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * Ripped from /src/core/eztrace_dyninst_core.h * October, 3rd - 2011 - Damien Martin-Guillerez */ #include "dyninst_common.h" static BPatch bpatch; static BPatch_process *app = NULL; static BPatch_addressSpace *appImg = NULL; int main(int argc, char**argv) { if (argc < 2) { printf("usage: %s orig_prog [arg1 arg2 ... argn]\n", argv[0]); return 1; } // Correcting stupid dyninst behavior setenv("LD_LIBRARY_PATH", "", 0); char* file = argv[1]; char* newFile = argv[2]; bool ret; char **nargv = &(argv[1]); //Create the BPatch_addressSpace and BPatch_binaryEdit app = bpatch.processCreate(file, (const char**) nargv); if (!app) { fprintf(stderr, "Cannot open %s\n", file); return -1; } appImg = static_cast(app); // Instrument all the specified functions int nb_inst = dummy_dyninst_instrument(appImg); printf("%d functions instrumented\n", nb_inst); // Run the child process app->continueExecution(); while (!app->isTerminated()) { bpatch.waitForStatusChange(); } return 0; } eztrace-2.1/test/pptrace/perf/instrumentation/dyninst_common.h000066400000000000000000000074561447213526500250630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * Ripped from /src/core/eztrace_dyninst_core.h * Common part of both dyninst instrumentation test * October, 3rd - 2011 - Damien Martin-Guillerez */ #ifndef __DYNINST_COMMON_H #define __DYNINST_COMMON_H #include #include #include "BPatch.h" #include "BPatch_function.h" #include "BPatch_basicBlock.h" // list of registered functions int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit); // instrument all the registered functions int dummy_dyninst_instrument(BPatch_addressSpace *app) { int ret = 0; ret += __intercept_function(app, "foo", 1, 2); ret += __intercept_function(app, "bar", 1, 2); return ret; } // Instrument a function: eztrace_code0(code_entry) is called at the // beginning of the function and eztrace_code0(code_entry) is called // at the end of the function. // If code_entry or code_exit is null, the corresponding call to // eztrace_code0 is skipped int __intercept_function(BPatch_addressSpace *app, const char* function_name, uint32_t code_entry, uint32_t code_exit) { BPatch_image *appImage; BPatch_Vector *points; BPatch_Vector functions; appImage = app->getImage(); void *ret = appImage->findFunction(function_name, functions, false); if (ret == NULL) { fprintf(stderr, "warning: cannot find function %s in executable\n", function_name); return 0; } // Instrument the entry of the function if (code_entry) { // We need to call eztrace_generic(code, nb_param, param1, param2, ...) points = functions[0]->findPoint(BPatch_entry); BPatch_Vector dummyArgs; // Create the parameter (code_entry) BPatch_constExpr code(code_entry); dummyArgs.push_back(&code); // get the function parameters BPatch_function *f = functions[0]; BPatch_Vector *args = f->getParams(); int i; BPatch_constExpr expr_nb_params(args->size()); int nb_args = args->size(); BPatch_paramExpr* local_args[6]; // retrieve the parameters switch (nb_args) { case 4: local_args[3] = new BPatch_paramExpr(3); case 3: local_args[2] = new BPatch_paramExpr(2); case 2: local_args[1] = new BPatch_paramExpr(1); case 1: local_args[0] = new BPatch_paramExpr(0); break; default: // more than 5 args local_args[4] = new BPatch_paramExpr(4); } dummyArgs.push_back(&expr_nb_params); for (i = 0; i < nb_args; i++) dummyArgs.push_back(local_args[i]); // Create the function call BPatch_Vector funcs; appImage->findFunction("eztrace_generic", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); //Insert the function call at the point app->insertSnippet(dummyCall, *points); } // Instrument the exit of the function if (code_exit) { // the function parameters are not available here, so we have to // call eztrace_code0(code) points = functions[0]->findPoint(BPatch_exit); // Create the parameter (code_entry) BPatch_Vector dummyArgs; BPatch_constExpr code(code_exit); dummyArgs.push_back(&code); // Create the function call BPatch_Vector funcs; appImage->findFunction("eztrace_code0", funcs); BPatch_function *dummyFunc = funcs[0]; BPatch_funcCallExpr dummyCall(*dummyFunc, dummyArgs); //Insert the function call at the point app->insertSnippet(dummyCall, *points); } return 1; } #endif // __DYNINST_COMMON_H eztrace-2.1/test/pptrace/perf/instrumentation/pin_dummy.cc000066400000000000000000000032421447213526500241470ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "pin.H" #include "hijacks.h" int foo_hijack(CONTEXT * ctxt, AFUNPTR orig_foo, int a, int b) { hijack_foo_intro(a, b); int r; PIN_CallApplicationFunction(ctxt, PIN_ThreadId(), CALLINGSTD_DEFAULT, orig_foo, PIN_PARG(int), &r, PIN_PARG(int), a, PIN_PARG(int), b, PIN_PARG_END()); hijack_foo_outro(a, b, r); return r; } int bar_hijack(CONTEXT * ctxt, AFUNPTR orig_bar) { hijack_bar_intro(); int r; PIN_CallApplicationFunction(ctxt, PIN_ThreadId(), CALLINGSTD_DEFAULT, orig_bar, PIN_PARG(int), &r, PIN_PARG_END()); hijack_bar_outro(r); return r; } void ImageLoad(IMG img, void* v) { PROTO proto; RTN rtn = RTN_FindByName(img, "foo"); if (RTN_Valid(rtn)) { proto = PROTO_Allocate(PIN_PARG(int), CALLINGSTD_DEFAULT, "foo", PIN_PARG(int), PIN_PARG(int), PIN_PARG_END()); RTN_ReplaceSignature(rtn, AFUNPTR(foo_hijack), IARG_PROTOTYPE, proto, IARG_CONST_CONTEXT, IARG_ORIG_FUNCPTR, IARG_FUNCARG_ENTRYPOINT_VALUE, 0, IARG_FUNCARG_ENTRYPOINT_VALUE, 1, IARG_END); } rtn = RTN_FindByName(img, "bar"); if (RTN_Valid(rtn)) { proto = PROTO_Allocate(PIN_PARG(int), CALLINGSTD_DEFAULT, "bar", PIN_PARG_END()); RTN_ReplaceSignature(rtn, AFUNPTR(bar_hijack), IARG_PROTOTYPE, proto, IARG_CONST_CONTEXT, IARG_ORIG_FUNCPTR, IARG_END); } } int main(int argc, char **argv) { PIN_InitSymbols(); PIN_Init(argc, argv); IMG_AddInstrumentFunction(ImageLoad, 0); PIN_StartProgram(); } eztrace-2.1/test/pptrace/perf/instrumentation/pin_fast.cc000066400000000000000000000044471447213526500237610ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include "pin.H" #include "hijacks.h" ADDRINT fooReturnIp = 0; int fooA = 0; int fooB = 0; ADDRINT barReturnIp = 0; ADDRINT returnIp = 0; int CheckReturn(ADDRINT sp, ADDRINT returnRegVal) { // is this a return from foo or bar ADDRINT retIp = *(reinterpret_cast(sp)); if ((fooReturnIp == retIp) || (barReturnIp == retIp)) { returnIp = retIp; return 1; } return 0; } VOID ProcessReturnFromFoobar(ADDRINT ip, ADDRINT returnVal) { if (returnIp == fooReturnIp) { hijack_foo_outro(fooA, fooB, returnVal); fooReturnIp = 0; } else if (returnIp == barReturnIp) { hijack_bar_outro(returnVal); barReturnIp = 0; } else { printf( "[fubar] return from foo/bar at %p returns %p but it was not detected at either foo (%p) or bar (%p)\n", ip, fooReturnIp, barReturnIp, returnVal); } returnIp = 0; } void foo_hijack(ADDRINT returnIp, int a, int b) { hijack_foo_intro(a, b); fooReturnIp = returnIp; fooA = a; fooB = b; } void bar_hijack(ADDRINT returnIp) { hijack_bar_intro(); barReturnIp = returnIp; } void ImageLoad(IMG img, void* v) { PROTO proto; RTN rtn = RTN_FindByName(img, "foo"); if (RTN_Valid(rtn)) { RTN_Open(rtn); RTN_InsertCall(rtn, IPOINT_BEFORE, AFUNPTR(foo_hijack), IARG_RETURN_IP, IARG_FUNCARG_ENTRYPOINT_VALUE, 0, IARG_FUNCARG_ENTRYPOINT_VALUE, 1, IARG_END); RTN_Close(rtn); } rtn = RTN_FindByName(img, "bar"); if (RTN_Valid(rtn)) { RTN_Open(rtn); RTN_InsertCall(rtn, IPOINT_BEFORE, AFUNPTR(bar_hijack), IARG_RETURN_IP, IARG_END); RTN_Close(rtn); } } static void Instruction(INS ins, void *v) { if (INS_IsRet(ins)) { INS_InsertIfCall(ins, IPOINT_BEFORE, (AFUNPTR) CheckReturn, IARG_REG_VALUE, REG_STACK_PTR, IARG_END); INS_InsertThenCall(ins, IPOINT_BEFORE, (AFUNPTR) ProcessReturnFromFoobar, IARG_INST_PTR, IARG_FUNCRET_EXITPOINT_VALUE, IARG_END); } } int main(int argc, char **argv) { PIN_InitSymbols(); PIN_Init(argc, argv); IMG_AddInstrumentFunction(ImageLoad, 0); INS_AddInstrumentFunction(Instruction, 0); PIN_StartProgram(); } eztrace-2.1/test/pptrace/perf/instrumentation/pin_probed.cc000066400000000000000000000032211447213526500242640ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * This segfault for some unknown reason at program startup. Impossible to debug it */ #include "pin.H" #include "hijacks.h" typedef int (*foo_ptr)(int, int); int foo_hijack(foo_ptr orig_foo, int a, int b) { hijack_foo_intro(a, b); int r = orig_foo(a, b); hijack_foo_outro(a, b, r); return r; } typedef int (*bar_ptr)(); int bar_hijack(bar_ptr orig_bar) { hijack_bar_intro(); int r = orig_bar(); hijack_bar_outro(r); return r; } void ImageLoad(IMG img, void* v) { PROTO proto; RTN rtn = RTN_FindByName(img, "foo"); if (RTN_Valid(rtn) && RTN_IsSafeForProbedReplacement(rtn)) { printf("Instrumenting foo\n"); proto = PROTO_Allocate(PIN_PARG(int), CALLINGSTD_DEFAULT, "foo", PIN_PARG(int), PIN_PARG(int), PIN_PARG_END()); RTN_ReplaceSignatureProbed(rtn, AFUNPTR(foo_hijack), IARG_PROTOTYPE, proto, IARG_ORIG_FUNCPTR, IARG_FUNCARG_ENTRYPOINT_VALUE, 0, IARG_FUNCARG_ENTRYPOINT_VALUE, 1, IARG_END); } rtn = RTN_FindByName(img, "bar"); if (RTN_Valid(rtn) && RTN_IsSafeForProbedReplacement(rtn)) { printf("Instrumenting bar\n"); proto = PROTO_Allocate(PIN_PARG(int), CALLINGSTD_DEFAULT, "bar", PIN_PARG_END()); RTN_ReplaceSignatureProbed(rtn, AFUNPTR(bar_hijack), IARG_PROTOTYPE, proto, IARG_ORIG_FUNCPTR, IARG_END); } } int main(int argc, char **argv) { PIN_InitSymbols(); PIN_Init(argc, argv); IMG_AddInstrumentFunction(ImageLoad, 0); PIN_StartProgramProbed(); } eztrace-2.1/test/pptrace/perf/instrumentation/pptrace.c000066400000000000000000000017011447213526500234370ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * pptrace.c -- full test of pptrace * * Created on: 4 Aug. 2011 * Author: Damien Martin-Guillerez */ #include #include #include int main(int argc, char **argv, char **envp) { if (argc < 3) { fprintf(stderr, "usage: %s libhijack program [args]\n", argv[0]); return EXIT_FAILURE; } void *bin = pptrace_prepare_binary(argv[2]); if (!bin) { fprintf(stderr, "Unable to load binary %s\n", argv[2]); return EXIT_FAILURE; } if (pptrace_load_module(bin, argv[1])) { fprintf(stderr, "Unable to load module %s\n", argv[1]); return EXIT_FAILURE; } if (pptrace_run(bin, argv + 2, envp)) { fprintf(stderr, "Unable to run the target\n"); return EXIT_FAILURE; } return EXIT_SUCCESS; } eztrace-2.1/test/pptrace/perf/onetest.sh000077500000000000000000000021251447213526500204130ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. if [ -z "$1" ]; then echo "usage: $0 iterations [matrix_size]" >&2 exit 1 fi . ./timing.sh if [ -z "$2" ]; then PROG=prog DYNPROG=dynprog DPROG=dprog LIBALACON=libalacon.so MSIZE=0 else PROG=mprog DYNPROG=dynprog DPROG=mdprog LIBALACON=libmatrix.so MSIZE=$2 fi cp tests/$LIBALACON libalacon.so echo -n "$1 " # static timing "" tests/$PROG $1 $MSIZE # dynamic timing "" tests/$DYNPROG $1 $MSIZE # preload timing ./tests/libpreload.so tests/$DYNPROG $1 $MSIZE # pptrace timing "" ./instrumentation/pptrace ./tests/libpptrace.so tests/$PROG $1 $MSIZE rm -f libalacon.so # dyninst ./dyninst.sh $PROG $DPROG $1 $MSIZE # dyninst 2 if [ -x ./instrumentation/dyninst -a -f ./dyninst.conf ]; then . ./dyninst.conf LD_PATH=$DYNINST_LIB: timing2 "$DYNINST_LIB/libdyninstAPI_RT.so" ./instrumentation/dyninst tests/$PROG $1 $MSIZE fi # pin ./pin.sh dummy $PROG $1 $MSIZE 1 # pin fast ./pin.sh fast $PROG $1 $MSIZE 1 # pin_probed ./pin.sh probed $PROG $1 $MSIZE 1 echo eztrace-2.1/test/pptrace/perf/pin.conf.in000066400000000000000000000021221447213526500204320ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. PIN_KIT=@pin_path@ PIN_ROOT=@pin_path@/source PIN_HOME=@pin_path@/source/tools #PIN_INC=-I../tests -I@pin_path@/source/include -I@pin_path@/source/include/gen -I@pin_path@/extras/xed2-intel64/include -I@pin_path@/extras/components/include #PIN_FLAGS=-DTARGET_IA32E -DHOST_IA32E -DTARGET_LINUX -Wl,--hash-style=sysv -shared -Wl,-Bsymbolic -Wl,--version-script=@pin_path@/source/include/pintool.ver # -L../Lib/ -L../ExtLib/ -L../../../extras/xed2-intel64/lib -L../../../intel64/lib -L../../../intel64/lib-ext -o obj-intel64/opcodemix.so obj-intel64/opcodemix.o -L../Lib/ -L../ExtLib/ -L../../../extras/xed2-intel64/lib -L../../../intel64/lib -L../../../intel64/lib-ext -lpin -lxed -ldwarf -lelf -ldl #PIN_LIBS=-L$PIN_PATH/Lib/ -L$PIN_PATH/ExtLib/ -L$PIN_PATH/intel64/lib -L../../../intel64/lib-ext -o obj-intel64/opcodemix.so obj-intel64/opcodemix.o -L../Lib/ -L../ExtLib/ -L../../../extras/xed2-intel64/lib -L../../../intel64/lib -L../../../intel64/lib-ext -lpin -lxed -ldwarf -lelf -ldl eztrace-2.1/test/pptrace/perf/pin.sh000077500000000000000000000011071447213526500175170ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. . ./timing.sh if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ]; then echo "usage: $0 pin_module prog iterations matrix_size [time]" >&2 exit 1 fi if [ -x ./instrumentation/pin_$1.so -a -f ./pin.conf ]; then . ./pin.conf if [ -z "$5" ]; then $PIN_KIT/pin -t ./instrumentation/pin_$1.so -- tests/$2 $3 $4 else x=`2>&1 time -p $PIN_KIT/pin -t ./instrumentation/pin_$1.so -- tests/$2 $3 $4 | grep user | cut -d " " -f 2` echo -n "$x " fi fi exit 0eztrace-2.1/test/pptrace/perf/results/000077500000000000000000000000001447213526500200745ustar00rootroot00000000000000eztrace-2.1/test/pptrace/perf/results/dancharia.desc000066400000000000000000000003071447213526500226460ustar00rootroot00000000000000uname -a Linux dancharia 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Six-Core AMD Opteron(tm) Processor 8439 SE eztrace-2.1/test/pptrace/perf/results/dancharia.m100000066400000000000000000000014621447213526500224100ustar00rootroot00000000000000# Arguments: m 100 1 10 100 200 300 500 1000 2000 3000 5000 10000 # It. Static Dynamic PRELOAD ptrace DynInst DynInst-ptrace # Matrix 100 x 100 1 0.02 0.01 0.01 0.02 0.02 1.44 10 0.18 0.16 0.16 0.19 0.18 1.62 100 0.84 0.47 0.80 0.86 0.73 1.98 200 1.30 1.22 1.10 1.06 1.31 2.81 300 1.85 1.70 1.63 1.78 1.59 3.26 500 2.90 2.66 2.68 2.96 2.86 4.41 1000 5.56 5.06 4.89 5.58 5.30 6.97 2000 10.93 9.69 9.72 10.79 10.59 12.25 3000 15.88 14.52 14.54 15.88 16.14 17.52 5000 26.79 23.69 23.95 26.72 26.80 27.95 10000 53.17 47.61 47.79 53.27 53.01 54.70 eztrace-2.1/test/pptrace/perf/results/dancharia.simple000066400000000000000000000017371447213526500232310ustar00rootroot00000000000000# Arguments: 1 10 100 1000 10000 100000 1000000 10000000 100000000 200000000 500000000 700000000 1000000000 # It. Static Dynamic PRELOAD ptrace DynInst DynInst-ptrace 1 0.00 0.00 0.00 0.00 0.00 1.48 10 0.00 0.00 0.00 0.00 0.00 1.43 100 0.00 0.00 0.00 0.00 0.00 1.41 1000 0.00 0.00 0.00 0.00 0.00 1.32 10000 0.00 0.00 0.00 0.00 0.00 1.35 100000 0.00 0.00 0.00 0.00 0.02 1.50 1000000 0.02 0.00 0.03 0.10 0.24 1.69 10000000 0.27 0.26 0.55 0.54 0.88 2.24 100000000 0.77 1.12 3.46 3.22 7.34 8.53 200000000 1.76 1.82 6.58 5.74 14.13 15.34 500000000 4.07 3.92 16.42 14.65 35.53 35.68 700000000 5.66 5.93 22.61 20.43 49.64 49.18 1000000000 7.99 7.86 33.17 29.03 70.99 69.42 eztrace-2.1/test/pptrace/perf/results/fourmi.m100000066400000000000000000000017521447213526500220010ustar00rootroot00000000000000# Arguments: m 100 1 10 100 200 300 500 1000 2000 3000 5000 10000 20000 # It. Static Dynamic PRELOAD ptrace DynInst DynInst-ptrace PIN-fast# Matrix 100 x 100 1 0.00 0.00 0.00 0.00 0.00 0.85 0.26 10 0.03 0.03 0.03 0.03 0.03 0.86 0.33 100 0.33 0.32 0.33 0.32 0.31 1.19 0.59 200 0.65 0.64 0.64 0.64 0.65 1.43 0.92 300 0.96 0.96 0.96 0.96 0.96 1.83 1.28 500 1.60 1.60 1.60 1.60 1.61 2.46 1.94 1000 3.22 3.19 3.19 3.19 3.20 4.01 3.59 2000 6.43 6.42 6.42 6.40 6.41 7.31 6.88 3000 9.61 9.62 9.61 9.62 9.57 10.44 10.20 5000 16.02 15.99 16.01 16.00 16.00 16.94 16.77 10000 32.01 32.04 32.07 31.96 32.20 32.98 33.54 20000 64.29 64.43 64.42 64.34 64.32 65.15 66.66 eztrace-2.1/test/pptrace/perf/results/fourmi.m100.desc000066400000000000000000000003141447213526500227070ustar00rootroot00000000000000uname -a Linux fourmi002 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Intel(R) Xeon(R) CPU X5550 @ 2.67GHz eztrace-2.1/test/pptrace/perf/results/fourmi.simple000066400000000000000000000021361447213526500226120ustar00rootroot00000000000000# Arguments: 1 10 100 1000 10000 100000 1000000 10000000 100000000 200000000 500000000 700000000 1000000000 # It. Static Dynamic PRELOAD ptrace DynInst DynInst-ptrace PIN-fast1 0.00 0.00 0.00 0.00 0.00 0.82 0.24 10 0.00 0.00 0.00 0.00 0.00 0.83 0.25 100 0.00 0.00 0.00 0.00 0.00 0.81 0.26 1000 0.00 0.00 0.00 0.00 0.00 0.82 0.27 10000 0.00 0.00 0.00 0.00 0.00 0.83 0.25 100000 0.00 0.00 0.00 0.00 0.00 0.89 0.26 1000000 0.00 0.00 0.02 0.02 0.08 0.99 0.29 10000000 0.06 0.06 0.18 0.22 0.76 1.56 0.88 100000000 0.61 0.62 1.84 2.22 7.66 8.44 4.63 200000000 1.22 1.24 3.69 4.45 15.33 16.03 9.02 500000000 3.04 3.09 9.24 11.20 38.26 38.82 22.22 700000000 4.24 4.32 12.95 15.63 53.75 54.18 30.99 1000000000 6.10 6.16 18.44 22.27 76.92 76.85 44.09 eztrace-2.1/test/pptrace/perf/results/fourmi.simple.desc000066400000000000000000000003141447213526500235230ustar00rootroot00000000000000uname -a Linux fourmi003 2.6.27.39-0.3-perfctr #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux /proc/cpuinfo -- model name Intel(R) Xeon(R) CPU X5550 @ 2.67GHz eztrace-2.1/test/pptrace/perf/test.sh000077500000000000000000000020131447213526500177050ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. if [ -z "$1" ]; then echo "usage: $0 [m MATRIX_SIZE] nbit1 nbit2 .. nbitn" exit 1 fi echo "# Arguments: $*" dprogcreated=0 echo -n "# It. Static Dynamic PRELOAD ptrace" if [ -x "instrumentation/ddyninst" -a -f "./dyninst.conf" ]; then ./instrument.sh prog dprog ./instrument.sh mprog mdprog dprogcreated=1 echo -n " DynInst DynInst-ptrace" fi if [ -x "instrumentation/pin_dummy.so" -a -f "./pin.conf" ]; then echo -n " PIN" fi if [ -x "instrumentation/pin_fast.so" -a -f "./pin.conf" ]; then echo -n " PIN-fast" fi if [ -x "instrumentation/pin_probed.so" -a -f "./pin.conf" ]; then echo -n " PIN-probed" fi mat=0 for i in $*; do if [ "m" = "$i" ]; then mat="-1" elif [ "$mat" -lt "0" ]; then mat="$i" echo "# Matrix $i x $i" elif [ "$mat" -gt "0" ]; then ./onetest.sh "$i" "$mat" else ./onetest.sh "$i" fi done if [ dprogcreated -a -f dprog ]; then rm -f dprog mdprog fi eztrace-2.1/test/pptrace/perf/tests/000077500000000000000000000000001447213526500175355ustar00rootroot00000000000000eztrace-2.1/test/pptrace/perf/tests/Makefile.in000066400000000000000000000013541447213526500216050ustar00rootroot00000000000000# Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. CC=gcc -m64 PPTRACE_DIR=../../../../src/pptrace BINS=libalacon.so libmatrix.so prog dynprog mprog libpreload.so libpptrace.so all: $(BINS) # optimization 1 to avoid the gap between dynamic and static performances %.so: %.c $(CC) -O1 -shared -I$(PPTRACE_DIR) -fPIC -o $@ $< -ldl mprog: prog.c libmatrix.c $(CC) -O1 -o $@ $^ # Static program for the dummy is however compiled with optimization 0 to avoid function shrinking prog: prog.c libalacon.c $(CC) -O0 -o $@ $^ dynprog: prog.c libalacon.so $(CC) -O1 -L. -o $@ $< -lalacon pptrace: pptrace.c clean: rm -f $(BINS) find . -name '*.o' -delete find . -name '*~' -delete eztrace-2.1/test/pptrace/perf/tests/alacon.h000066400000000000000000000005211447213526500211410ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * alacon.h * * Created on: 4 Aug. 2011 * Author: Charles Aulagnon */ #ifndef ALACON_H #define ALACON_H int foo(int, int); int bar(); #endif eztrace-2.1/test/pptrace/perf/tests/hijacks.h000066400000000000000000000012301447213526500213160ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * hijacks.h * * Created on: 03 Oct. 2011 * Author: Damien Martin-Guillerez */ #include static int foo_intro_count = 0; static int foo_outro_count = 0; static int bar_intro_count = 0; static int bar_outro_count = 0; void hijack_foo_intro(int a, int b) { ++foo_intro_count; } void hijack_foo_outro(int a, int b, int r) { ++foo_outro_count; } void hijack_bar_intro() { ++bar_intro_count; } void hijack_bar_outro(int r) { ++bar_outro_count; } eztrace-2.1/test/pptrace/perf/tests/libalacon.c000066400000000000000000000005501447213526500216250ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * libalacon.c * * Created on: 4 Aug. 2011 * Author: Charles Aulagnon */ #include "alacon.h" int foo(int a, int b) { return (a + b); } int bar() { return 42; } eztrace-2.1/test/pptrace/perf/tests/libdyninst.c000066400000000000000000000010221447213526500220530ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include "hijacks.h" void eztrace_code0(int code) { switch (code) { case 1: hijack_foo_intro(42, 42); return; case 2: hijack_foo_outro(42, 42, 84); return; case 3: hijack_bar_intro(); return; case 4: hijack_bar_outro(42); return; } } void eztrace_generic(int code, int nb_args, ...) { eztrace_code0(code); } eztrace-2.1/test/pptrace/perf/tests/libmatrix.c000066400000000000000000000021011447213526500216660ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * libmatrix.c * * Created on: 28 Sep. 2011 * Author: Damien Martin-Guillerez */ #include #include "alacon.h" double *matrix1; double *matrix2; int _h; int _w; int foo(int h, int w) { int i, j; _h = h; _w = w; matrix1 = (double*) malloc(sizeof(double) * h * w); matrix2 = (double*) malloc(sizeof(double) * h * w); for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { matrix1[i * w + j] = (i + 1) * (j + 1); matrix2[i + j * h] = (i + 1) * (j + 1); } } return (h + w); } int bar() { int i, j, k; double *result = (double*) malloc(sizeof(double) * _h * _h); for (i = 0; i < _h; i++) { for (j = 0; j < _h; j++) { result[i * _h + j] = 0; for (k = 0; k < _w; k++) { result[i * _h + j] += matrix1[i * _w + k] * matrix2[k * _h + j]; } } } free(result); free(matrix1); free(matrix2); return 42; } eztrace-2.1/test/pptrace/perf/tests/libpptrace.c000066400000000000000000000014701447213526500220300ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * libpptrace.c * * Created on: 4 Aug. 2011 * Author: Charles Aulagnon * Revised by: Damien Martin-Guillerez */ #include "hijacks.h" #include int (*orig_foo)(int a, int b); int (*orig_bar)(); int foo_hijack(int a, int b) { hijack_foo_intro(a, b); int r = orig_foo(a, b); hijack_foo_outro(r, a, b); return r; } int bar_hijack() { hijack_bar_intro(); int r = orig_bar(); hijack_bar_outro(r); return r; } PPTRACE_START_INTERCEPT PPTRACE_INTERCEPT_FULL( foo, foo_hijack, orig_foo) PPTRACE_INTERCEPT_FULL( bar, bar_hijack, orig_bar) PPTRACE_END_INTERCEPT eztrace-2.1/test/pptrace/perf/tests/libpreload.c000066400000000000000000000015241447213526500220200ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * libpreload.c * * Created on: 29 Sep. 2011 * Author: Damien Martin-Guillerez */ #include #include "hijacks.h" int (*orig_foo)(int, int); int (*orig_bar)(); int foo(int a, int b) { hijack_foo_intro(a, b); int r = orig_foo(a, b); hijack_foo_outro(a, b, r); return r; } int bar() { hijack_bar_intro(); int r = orig_bar(); hijack_bar_outro(r); return r; } void __hijack_init(void) __attribute__ ((constructor)); /* Initialize the current library */ void __hijack_init(void) { void* handle = dlopen("libalacon.so", RTLD_NOW); if (handle) { orig_foo = dlsym(handle, "foo"); orig_bar = dlsym(handle, "bar"); } } eztrace-2.1/test/pptrace/perf/tests/prog.c000066400000000000000000000016051447213526500206520ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. * * * prog.c * * Created on: 4 Aug. 2011 * Author: Charles Aulagnon * Modified on: 28 Sep. 2011 * Author: Damien Martin-Guillerez */ #include #include #include #include "alacon.h" // Tired of trying to make dyninst work perfectly #include "libdyninst.c" int main(int argc, char **argv) { int i, l, s, r; if (argc != 3) { fprintf(stderr, "usage: %s number_of_iterations matrix_size\n", argv[0]); exit(EXIT_FAILURE); } l = atoi(argv[1]); s = atoi(argv[2]); for (i = 0; i < l; i++) { r = foo(s, s); assert(r == s + s); r = bar(); assert(r == 42); } printf("%d\n", l); return EXIT_SUCCESS; } eztrace-2.1/test/pptrace/perf/timing.sh000066400000000000000000000014431447213526500202200ustar00rootroot00000000000000#!/bin/sh # Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis # See COPYING in top-level directory. timing2() { if [ -z "$1" ]; then x=`LD_LIBRARY_PATH=$LD_PATH.:./tests 2>&1 time -p $2 $3 $4 $5 $6 $7 | grep user | cut -d " " -f 2` else x=`DYNINSTAPI_RT_LIB=$1 LD_LIBRARY_PATH=$LD_PATH.:./tests 2>&1 time -p $2 $3 $4 $5 $6 $7 | grep user | cut -d " " -f 2` fi echo -n "$x " } timing() { if [ -z "$1" ]; then x=`LD_LIBRARY_PATH=$LD_PATH.:./tests 2>&1 time -p $2 $3 $4 $5 $6 $7 | grep user | cut -d " " -f 2` else x=`LD_PRELOAD=$1 LD_LIBRARY_PATH=$LD_PATH.:./tests 2>&1 time -p $2 $3 $4 $5 $6 $7 | grep user | cut -d " " -f 2` fi echo -n "$x " }eztrace-2.1/test/pthread/000077500000000000000000000000001447213526500154305ustar00rootroot00000000000000eztrace-2.1/test/pthread/CMakeLists.txt000066400000000000000000000013361447213526500201730ustar00rootroot00000000000000enable_testing() if (EZTRACE_ENABLE_PTHREAD) set(CMAKE_C_FLAGS "-pthread") set(LINK_OPTIONS "-pthread") add_executable(dummy_thread dummy_thread.c) add_test(build_dummy_thread "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target dummy_thread) add_test (pthread_tests bash "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" DEPENDS build_dummy_thread) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/pthread") # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ${TEST_ENVIRONMENT} ) endif() eztrace-2.1/test/pthread/Makefile000066400000000000000000000002771447213526500170760ustar00rootroot00000000000000CFLAGS= LDFLAGS=-pthread BIN=cond dummy_thread race_cond test_pthread test_sigsegv all: $(BIN) %: %.c $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) test: $(BIN) ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/pthread/cond.c000066400000000000000000000020121447213526500165120ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part int main() { pthread_cond_t cond; pthread_mutex_t mutex; debug("Testing pthread_cond_*\n"); pthread_cond_init(&cond, NULL); pthread_mutex_init(&mutex, NULL); pthread_mutex_lock(&mutex); pthread_cond_signal(&cond); pthread_cond_broadcast(&cond); pthread_mutex_unlock(&mutex); pthread_cond_destroy(&cond); debug("OK ! \n"); return 0; } eztrace-2.1/test/pthread/dummy_thread.c000066400000000000000000000050401447213526500202550ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part /* Number of iterations */ #define ITER 10 /* Number of threads */ #define NTH 2 typedef union { unsigned long long tick; struct { unsigned low; unsigned high; }; } tick_t; #define TICK_DIFF(t1, t2) \ ((t2).tick - (t1).tick) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) /* Only used during thread creating to make sure that the thread * got the correct args. */ sem_t thread_ready; /* Block/unblock a thread */ sem_t sem[NTH]; pthread_mutex_t mutex; /* Fake computation of usec microseconds */ void compute(int usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } void* f_thread(void* arg) { int my_id = *(int*) arg; /* Notify the main thread that we got the args */ sem_post(&thread_ready); debug("Running thread #%d\n", my_id); int i; for (i = 0; i < ITER; i++) { /* Wait until the previous thread has finished his job */ sem_wait(&sem[my_id]); debug("[thread #%d] loop %d\n", my_id, i); /* compute for 1ms */ pthread_mutex_lock(&mutex); compute(50000); pthread_mutex_unlock(&mutex); compute(50000); /* Wake up the next thread */ sem_post(&sem[(my_id + 1) % NTH]); } debug("End of thread #%d\n", my_id); return NULL; } int main(int argc, char**argv) { pthread_t tid[NTH]; int i; pthread_mutex_init(&mutex, NULL); sem_init(&thread_ready, 0, 0); for (i = 0; i < NTH; i++) sem_init(&sem[i], 0, 0); for (i = 0; i < NTH; i++) { pthread_create(&tid[i], NULL, f_thread, &i); sem_wait(&thread_ready); } /* Unblock the first thread so that it can start working */ sem_post(&sem[0]); for (i = 0; i < NTH; i++) { pthread_join(tid[i], NULL); } return 0; } eztrace-2.1/test/pthread/race_cond.c000066400000000000000000000036111447213526500175120ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part // Number of threads #define NBTHREAD 2 // Number of iterations #define NBITER 10000 /* * Only used during thread creating to make sure that the thread * got the correct args. */ sem_t thread_ready; pthread_barrier_t barrier; volatile int sum = 0; void compute() __attribute__((optimize("-O0"))); void compute() { int i; for (i = 0; i < NBITER; i++) { void *ptr = malloc(1); free(ptr); sum += 1; } } void* do_work(void* arg) { uint8_t my_id = *(uint8_t*) arg; // Notify the main thread that we got the args sem_post(&thread_ready); debug("Running thread #%d\n", my_id); pthread_barrier_wait(&barrier); compute(); pthread_barrier_wait(&barrier); debug("End of thread #%d\n", my_id); return NULL; } int main() { pthread_t tid[NBTHREAD]; int i; pthread_barrier_init(&barrier, NULL, NBTHREAD); sem_init(&thread_ready, 0, 0); for (i = 0; i < NBTHREAD; i++) { pthread_create(&tid[i], NULL, do_work, &i); sem_wait(&thread_ready); } for (i = 0; i < NBTHREAD; i++) pthread_join(tid[i], NULL); printf("Thread sum: %d\n", sum); sum = NBTHREAD * NBITER; printf("Check sum: %d\n", sum); pthread_barrier_destroy(&barrier); return 0; } eztrace-2.1/test/pthread/run.sh000077500000000000000000000005371447213526500166000ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "pthread" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/pthread/test_dummy.sh000077500000000000000000000011031447213526500201540ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="dummy_thread" [ -n "$EZTRACE_PATH" ] || EZTRACE_PATH=eztrace run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "pthread" "./dummy_thread" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" trace_check_event_type "$trace_filename" "THREAD_BEGIN" 3 trace_check_event_type "$trace_filename" "THREAD_END" 3 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/pthread/test_pthread.c000066400000000000000000000070131447213526500202630ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part /* Number of iterations */ #define ITER 10 /* Number of threads */ #define NTH 2 typedef union { unsigned long long tick; struct { unsigned low; unsigned high; }; } tick_t; #define TICK_DIFF(t1, t2) \ ((t2).tick - (t1).tick) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) /* Only used during thread creating to make sure that the thread * got the correct args. */ sem_t thread_ready; /* Block/unblock a thread */ sem_t sem[NTH]; pthread_mutex_t mutex; pthread_spinlock_t spinlock; pthread_barrier_t barrier; pthread_cond_t cond; pthread_rwlock_t rwlock; /* Fake computation of usec microseconds */ void compute(int usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } void* f_thread(void* arg) { int my_id = *(int*) arg; /* Notify the main thread that we got the args */ sem_post(&thread_ready); debug("Running thread #%d\n", my_id); pthread_barrier_wait(&barrier); int i; for (i = 0; i < ITER; i++) { /* Wait until the previous thread has finished his job */ sem_wait(&sem[my_id]); debug("[thread #%d] loop %d\n", my_id, i); /* test mutex */ pthread_mutex_lock(&mutex); compute(5000); pthread_mutex_unlock(&mutex); compute(5000); /* test spinlock */ pthread_spin_lock(&spinlock); compute(5000); pthread_spin_unlock(&spinlock); compute(5000); /* test spinlock */ pthread_spin_lock(&spinlock); compute(5000); pthread_spin_unlock(&spinlock); compute(5000); /* test rwlock */ pthread_rwlock_rdlock(&rwlock); compute(5000); pthread_rwlock_unlock(&rwlock); compute(5000); pthread_rwlock_wrlock(&rwlock); compute(5000); pthread_rwlock_unlock(&rwlock); compute(5000); /* Wake up the next thread */ sem_post(&sem[(my_id + 1) % NTH]); } pthread_barrier_wait(&barrier); debug("End of thread #%d\n", my_id); return NULL; } int main(int argc, char**argv) { pthread_t tid[NTH]; int i; pthread_mutex_init(&mutex, NULL); pthread_spin_init(&spinlock, 0); pthread_barrier_init(&barrier, NULL, NTH); pthread_cond_init(&cond, NULL); pthread_rwlock_init(&rwlock, NULL); sem_init(&thread_ready, 0, 0); for (i = 0; i < NTH; i++) sem_init(&sem[i], 0, 0); for (i = 0; i < NTH; i++) { pthread_create(&tid[i], NULL, f_thread, &i); sem_wait(&thread_ready); } /* Unblock the first thread so that it can start working */ sem_post(&sem[0]); for (i = 0; i < NTH; i++) { pthread_join(tid[i], NULL); } pthread_mutex_destroy(&mutex); pthread_spin_destroy(&spinlock); pthread_barrier_destroy(&barrier); pthread_cond_destroy(&cond); pthread_rwlock_destroy(&rwlock); return 0; } eztrace-2.1/test/pthread/test_sigsegv.c000066400000000000000000000044161447213526500203070ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part /* This program calls functions (more or less) randomly and recursively. * At some point, it raises a SIGSEGV. */ typedef union { unsigned long long tick; struct { unsigned low; unsigned high; }; } tick_t; #define TICK_DIFF(t1, t2) \ ((t2).tick - (t1).tick) #define TIME_DIFF(t1, t2) \ ((t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec)) void func1(int a); void func2(int a); void func3(int a); /* Fake computation of usec microseconds */ void compute(int usec) { struct timeval tv1, tv2; gettimeofday(&tv1, NULL); do { gettimeofday(&tv2, NULL); } while (TIME_DIFF(tv1, tv2) < usec); } void func1(int a) { debug("func1(%d)\n", a); compute(100 * a); int alea = rand() % 7; if (!alea) *(int*) 0 = 0; switch (a % 3) { case 0: func1(a - 1); break; case 1: func2(a - 1); break; case 2: func3(a - 1); break; } } void func2(int a) { debug("func2(%d)\n", a); compute(100 * a); int alea = rand() % 6; if (!alea) *(int*) 0 = 0; switch (a % 3) { case 0: func1(a - 1); break; case 1: func2(a - 1); break; case 2: func3(a - 1); break; } } void func3(int a) { debug("func3(%d)\n", a); compute(100 * a); int alea = rand() % 5; if (!alea) *(int*) 0 = 0; switch (a % 3) { case 0: func1(a - 1); break; case 1: func2(a - 1); break; case 2: func3(a - 1); break; } } int main(int argc, char**argv) { srand(time(NULL)); while (1) func1(rand() % 101); return 0; } eztrace-2.1/test/run000077500000000000000000000025601447213526500145360ustar00rootroot00000000000000#!/bin/bash # Load function print_info, print_warning, print_error and print_ok source test_utils/test_utils.sh available_options=" pthread memory ompt openmp posixio mpi starpu cuda compiler_instrumentation " # module_generator performance pptrace static function usage { >&2 echo "Available tests are : $available_options" >&2 echo '"test/run list" print all the available tests on standard output' >&2 echo '"test/run ALL" is a shortcut for "test/run $(test/run list)" and run all the tests' } if [[ "$@" == "" ]] ; then usage exit fi asked_options="$@" if [[ "$asked_options" == "ALL" ]] ; then asked_options="$available_options" fi if [[ "$asked_options" == "list" ]] ; then echo "$available_options" exit 0 fi invalid_options="" for opt in $asked_options ; do found=false for avail in $available_options ; do if [[ $opt == $avail ]] ; then found=true fi done if [[ $found == false ]]; then invalid_options+=$opt fi done if [[ $invalid_options != "" ]] ; then print_error "Invalid options found : \"$invalid_options\", available_options are : \"$available_options\"" exit 1 fi success=0 for opt in $asked_options ; do print_info $opt (cd $opt ; ./run.sh) if [[ $? == 0 ]] ; then print_ok "Test $opt succeded" else print_error "Test $opt failed : $res" success=1 fi done exit $success eztrace-2.1/test/starpu/000077500000000000000000000000001447213526500153175ustar00rootroot00000000000000eztrace-2.1/test/starpu/Makefile000066400000000000000000000003241447213526500167560ustar00rootroot00000000000000CFLAGS=`pkg-config --cflags starpu-1.3` LDFLAGS=`pkg-config --libs starpu-1.3` BIN=starpu_hello starpu_mult all: $(BIN) %: %.c $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) test: $(BIN) ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/starpu/run.sh000077500000000000000000000005361447213526500164660ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" check_dependencies "$OTF2_PRINT_PATH" || exit 1 check_module "starpu" || exit 1 # Building tests check_compilation || exit 1 nfailed=0 # Running test scripts for test in $CUR_PATH/test_*.sh; do run_test "$test" || ((nfailed++)) done exit $nfailed eztrace-2.1/test/starpu/starpu_hello.c000066400000000000000000000012111447213526500201570ustar00rootroot00000000000000#include void cpu_func(void *buffers[], void *cl_arg) { printf("Hello world\n"); } struct starpu_codelet cl = { .cpu_funcs = { cpu_func }, .nbuffers = 0 }; int main(int argc, char **argv) { /* initialize StarPU */ starpu_init(NULL); struct starpu_task *task = starpu_task_create(); task->cl = &cl; /* Pointer to the codelet defined above */ /* starpu_task_submit will be a blocking call. If unset, starpu_task_wait() needs to be called after submitting the task. */ task->synchronous = 1; /* submit the task to StarPU */ starpu_task_submit(task); /* terminate StarPU */ starpu_shutdown(); return 0; } eztrace-2.1/test/starpu/starpu_mult.c000066400000000000000000000310601447213526500200420ustar00rootroot00000000000000/* StarPU --- Runtime system for heterogeneous multicore architectures. * * Copyright (C) 2010-2011, 2013-2014, 2022 Université de Bordeaux 1 * Copyright (C) 2010 Mehdi Juhoor * Copyright (C) 2010, 2011, 2012, 2013, 2014 Centre National de la Recherche Scientifique * * StarPU is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * StarPU is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ /* * This example shows a simple implementation of a blocked matrix * multiplication. Note that this is NOT intended to be an efficient * implementation of sgemm! In this example, we show: * - how to declare dense matrices (starpu_matrix_data_register) * - how to manipulate matrices within codelets (eg. descr[0].blas.ld) * - how to use filters to partition the matrices into blocks * (starpu_data_partition and starpu_data_map_filters) * - how to unpartition data (starpu_data_unpartition) and how to stop * monitoring data (starpu_data_unregister) * - how to manipulate subsets of data (starpu_data_get_sub_data) * - how to construct an autocalibrated performance model (starpu_perfmodel) * - how to submit asynchronous tasks */ #include #include #include #include #include #include static float *A, *B, *C; static starpu_data_handle_t A_handle, B_handle, C_handle; static unsigned nslicesx = 4; static unsigned nslicesy = 4; static unsigned xdim = 1024; static unsigned ydim = 1024; static unsigned zdim = 512; /* * That program should compute C = A * B * * A of size (z,y) * B of size (x,z) * C of size (x,y) |---------------| z | B | |---------------| z x |----| |---------------| | | | | | | | | | A | y | C | | | | | | | | | |----| |---------------| * Note: we use FORTRAN ordering. */ /* * The codelet is passed 3 matrices, the "descr" union-type field gives a * description of the layout of those 3 matrices in the local memory (ie. RAM * in the case of CPU, GPU frame buffer in the case of GPU etc.). Since we have * registered data with the "matrix" data interface, we use the matrix macros. */ void cpu_mult(void *descr[], void *arg) { (void)arg; float *subA, *subB, *subC; uint32_t nxC, nyC, nyA; uint32_t ldA, ldB, ldC; /* ptr gives a pointer to the first element of the local copy */ subA = (float *)STARPU_MATRIX_GET_PTR(descr[0]); subB = (float *)STARPU_MATRIX_GET_PTR(descr[1]); subC = (float *)STARPU_MATRIX_GET_PTR(descr[2]); /* * Note: STARPU_MATRIX_GET_NX/NY is different from X/Y of the FORTRAN * ordering: * - nx is the number of consecutive elements (thus the number of rows * in FORTRAN order) * - ny is the number of series that are separated by ld elements (thus * the number of columns in FORTRAN order) * - ld stands for leading dimension * * NB: in case some filters were used, the leading dimension is not * guaranteed to be the same in main memory (on the original matrix) * and on the accelerator! */ nxC = STARPU_MATRIX_GET_NX(descr[2]); nyC = STARPU_MATRIX_GET_NY(descr[2]); nyA = STARPU_MATRIX_GET_NY(descr[0]); ldA = STARPU_MATRIX_GET_LD(descr[0]); ldB = STARPU_MATRIX_GET_LD(descr[1]); ldC = STARPU_MATRIX_GET_LD(descr[2]); /* we use a FORTRAN-ordering! */ unsigned i,j,k; for (i = 0; i < nyC; i++) /* iterate over columns of C */ { for (j = 0; j < nxC; j++) /* iterate over rows of C */ { float sum = 0.0; for (k = 0; k < nyA; k++) { sum += subA[j+k*ldA]*subB[k+i*ldB]; } subC[j + i*ldC] = sum; } } } static void init_problem_data(void) { unsigned i,j; /* we initialize matrices A, B and C in the usual way */ A = (float *) malloc(zdim*ydim*sizeof(float)); B = (float *) malloc(xdim*zdim*sizeof(float)); C = (float *) malloc(xdim*ydim*sizeof(float)); /* fill the A and B matrices */ srand(2009); for (j=0; j < ydim; j++) { for (i=0; i < zdim; i++) { A[j+i*ydim] = (float)(starpu_drand48()); } } for (j=0; j < zdim; j++) { for (i=0; i < xdim; i++) { B[j+i*zdim] = (float)(starpu_drand48()); } } for (j=0; j < ydim; j++) { for (i=0; i < xdim; i++) { C[j+i*ydim] = (float)(0); } } } static void partition_mult_data(void) { /* note that we assume a FORTRAN ordering here! */ /* The BLAS data interface is described by 4 parameters: * - the location of the first element of the matrix to monitor (3rd * argument) * - the number of elements between columns, aka leading dimension * (4th arg) * - the number of (contiguous) elements per column, ie. contiguous * elements (5th arg) * - the number of columns (6th arg) * The first elements is a pointer to the data_handle that will be * associated to the matrix, and the second elements gives the memory * node in which resides the matrix: 0 means that the 3rd argument is * an adress in main memory. */ starpu_matrix_data_register(&A_handle, 0, (uintptr_t)A, ydim, ydim, zdim, sizeof(float)); starpu_matrix_data_register(&B_handle, 0, (uintptr_t)B, zdim, zdim, xdim, sizeof(float)); starpu_matrix_data_register(&C_handle, 0, (uintptr_t)C, ydim, ydim, xdim, sizeof(float)); /* A filter is a method to partition a data into disjoint chunks, it is * described by the means of the "struct starpu_data_filter" structure that * contains a function that is applied on a data handle to partition it * into smaller chunks, and an argument that is passed to the function * (eg. the number of blocks to create here). */ /* StarPU supplies some basic filters such as the partition of a matrix * into blocks, note that we are using a FORTRAN ordering so that the * name of the filters are a bit misleading */ struct starpu_data_filter vert = { .filter_func = starpu_matrix_filter_vertical_block, .nchildren = nslicesx }; struct starpu_data_filter horiz = { .filter_func = starpu_matrix_filter_block, .nchildren = nslicesy }; /* * Illustration with nslicex = 4 and nslicey = 2, it is possible to access * sub-data by using the "starpu_data_get_sub_data" method, which takes a data handle, * the number of filters to apply, and the indexes for each filters, for * instance: * * A' handle is starpu_data_get_sub_data(A_handle, 1, 1); * B' handle is starpu_data_get_sub_data(B_handle, 1, 2); * C' handle is starpu_data_get_sub_data(C_handle, 2, 2, 1); * * Note that here we applied 2 filters recursively onto C. * * "starpu_data_get_sub_data(C_handle, 1, 3)" would return a handle to the 4th column * of blocked matrix C for example. * * |---|---|---|---| * | | | B'| | B * |---|---|---|---| * 0 1 2 3 * |----| |---|---|---|---| * | | | | | | | * | | 0 | | | | | * |----| |---|---|---|---| * | A' | | | | C'| | * | | | | | | | * |----| |---|---|---|---| * A C * * IMPORTANT: applying filters is equivalent to partitionning a piece of * data in a hierarchical manner, so that memory consistency is enforced * for each of the elements independantly. The tasks should therefore NOT * access inner nodes (eg. one column of C or the whole C) but only the * leafs of the tree (ie. blocks here). Manipulating inner nodes is only * possible by disapplying the filters (using starpu_data_unpartition), to * enforce memory consistency. */ starpu_data_partition(B_handle, &vert); starpu_data_partition(A_handle, &horiz); /* starpu_data_map_filters is a variable-arity function, the first argument * is the handle of the data to partition, the second argument is the * number of filters to apply recursively. Filters are applied in the * same order as the arguments. * This would be equivalent to starpu_data_partition(C_handle, &vert) and * then applying horiz on each sub-data (ie. each column of C) */ starpu_data_map_filters(C_handle, 2, &vert, &horiz); } static struct starpu_perfmodel mult_perf_model = { .type = STARPU_HISTORY_BASED, .symbol = "mult_perf_model" }; static struct starpu_codelet cl = { /* we can only execute that kernel on a CPU yet */ /* CPU implementation of the codelet */ .cpu_funcs = {cpu_mult, NULL}, /* the codelet manipulates 3 buffers that are managed by the * DSM */ .nbuffers = 3, .modes = {STARPU_R, STARPU_R, STARPU_W}, /* in case the scheduling policy may use performance models */ .model = &mult_perf_model }; static int launch_tasks(void) { int ret; /* partition the work into slices */ unsigned taskx, tasky; for (taskx = 0; taskx < nslicesx; taskx++) { for (tasky = 0; tasky < nslicesy; tasky++) { /* C[taskx, tasky] = A[tasky] B[taskx] */ /* by default, starpu_task_create() returns an * asynchronous task (ie. task->synchronous = 0) */ struct starpu_task *task = starpu_task_create(); /* this task implements codelet "cl" */ task->cl = &cl; /* * |---|---|---|---| * | | * | | | B * |---|---|---|---| * X * |----| |---|---|---|---| * |****| Y | |***| | | * |****| | |***| | | * |----| |---|---|---|---| * | | | | | | | * | | | | | | | * |----| |---|---|---|---| * A C */ /* there was a single filter applied to matrices A * (respectively B) so we grab the handle to the chunk * identified by "tasky" (respectively "taskx). The "1" * tells StarPU that there is a single argument to the * variable-arity function starpu_data_get_sub_data */ task->handles[0] = starpu_data_get_sub_data(A_handle, 1, tasky); task->handles[1] = starpu_data_get_sub_data(B_handle, 1, taskx); /* 2 filters were applied on matrix C, so we give * starpu_data_get_sub_data 2 arguments. The order of the arguments * must match the order in which the filters were * applied. * NB: starpu_data_get_sub_data(C_handle, 1, k) would have returned * a handle to the column number k of matrix C. * NB2: starpu_data_get_sub_data(C_handle, 2, taskx, tasky) is * equivalent to * starpu_data_get_sub_data(starpu_data_get_sub_data(C_handle, 1, taskx), 1, tasky)*/ task->handles[2] = starpu_data_get_sub_data(C_handle, 2, taskx, tasky); /* this is not a blocking call since task->synchronous = 0 */ ret = starpu_task_submit(task); if (ret == -ENODEV) return ret; STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit"); } } return 0; } int main(STARPU_ATTRIBUTE_UNUSED int argc, STARPU_ATTRIBUTE_UNUSED char **argv) { int ret; /* start the runtime */ ret = starpu_init(NULL); if (ret == -ENODEV) return 77; STARPU_CHECK_RETURN_VALUE(ret, "starpu_init"); /* initialize matrices A, B and C and register them to StarPU */ init_problem_data(); /* partition matrices into blocks that can be manipulated by the * codelets */ partition_mult_data(); /* submit all tasks in an asynchronous fashion */ ret = launch_tasks(); if (ret == -ENODEV) goto enodev; /* wait for termination */ starpu_task_wait_for_all(); /* remove the filters applied by the means of starpu_data_map_filters; now * it's not possible to manipulate a subset of C using starpu_data_get_sub_data until * starpu_data_map_filters is called again on C_handle. * The second argument is the memory node where the different subsets * should be reassembled, 0 = main memory (RAM) */ starpu_data_unpartition(A_handle, 0); starpu_data_unpartition(B_handle, 0); starpu_data_unpartition(C_handle, 0); /* stop monitoring matrix C : after this, it is not possible to pass C * (or any subset of C) as a codelet input/output. This also implements * a barrier so that the piece of data is put back into main memory in * case it was only available on a GPU for instance. */ starpu_data_unregister(A_handle); starpu_data_unregister(B_handle); starpu_data_unregister(C_handle); free(A); free(B); free(C); starpu_shutdown(); return 0; enodev: starpu_shutdown(); return 77; } eztrace-2.1/test/starpu/test_starpu_hello.sh000077500000000000000000000014621447213526500214210ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="starpu_hello" [ -n "$EZTRACE_PATH" ] || EZTRACE_PATH=eztrace run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "starpu" "./${name}" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" trace_check_nb_enter "$trace_filename" "StarPU job" 1 trace_check_nb_enter "$trace_filename" "starpu_task_create" 1 trace_check_nb_enter "$trace_filename" "starpu_task_submit" 1 trace_check_nb_leave "$trace_filename" "StarPU job" 1 trace_check_nb_leave "$trace_filename" "starpu_task_create" 1 trace_check_nb_leave "$trace_filename" "starpu_task_submit" 1 echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/starpu/test_starpu_mult.sh000077500000000000000000000007141447213526500212760ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) source "$CUR_PATH/../test_utils/test_utils.sh" name="starpu_hello" [ -n "$EZTRACE_PATH" ] || EZTRACE_PATH=eztrace run_and_check_command "$EZTRACE_PATH" $EZTRACE_TEST_OPTION -t "starpu" "./${name}" trace_filename="${name}_trace/eztrace_log.otf2" trace_check_integrity "$trace_filename" trace_check_enter_leave_parity "$trace_filename" echo PASS: $nb_pass, FAILED:$nb_failed, TOTAL: $nb_test exit $nb_failed eztrace-2.1/test/static/000077500000000000000000000000001447213526500152705ustar00rootroot00000000000000eztrace-2.1/test/static/Makefile000066400000000000000000000003301447213526500167240ustar00rootroot00000000000000CC=cc BIN=static libeztrace-staticlib.so all: $(BIN) libeztrace-staticlib.so: staticlib.c $(CC) -fPIC -shared -o libeztrace-staticlib.so staticlib.c $(CFLAGS) $(LDFLAGS) test: all ./run.sh clean: rm -f $(BIN) eztrace-2.1/test/static/static.c000066400000000000000000000022011447213526500167160ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #include #include #include #include // Debugging part, print out only if debugging level of the system is verbose or more int _debug = -77; void debug(char *fmt, ...) { if (_debug == -77) { char *buf = getenv("EZTRACE_DEBUG"); if (buf == NULL) _debug = 0; else _debug = atoi(buf); } if (_debug >= 0) { // debug verbose mode va_list va; va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); } } // end of debugging part #define microsleep(us) do { struct timespec tm; tm.tv_sec = (time_t)us / 1000; tm.tv_nsec = (long)(us % 1000) * 1000; nanosleep(&tm, NULL); } while(0) int mafunc(int n) { debug("i sleep %d microsec\n", n); microsleep(n); return EXIT_SUCCESS; } int main() { int i = 0; debug("hello i m in main an i will wait 4 microsec\n"); microsleep(4); for (i = 0; i < 4; i++) { mafunc(i); debug("main sleep 1 microsec\n"); microsleep(1); } return EXIT_SUCCESS; } eztrace-2.1/test/static/staticlib.c000066400000000000000000000017521447213526500174170ustar00rootroot00000000000000/* -*- c-file-style: "GNU" -*- */ /* * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis * See COPYING in top-level directory. */ #define _GNU_SOURCE #include #include #define CURRENT_MODULE staticlib DECLARE_CURRENT_MODULE; int (*libmafunc)(int n); int mafunc(int n) { INTERCEPT_FUNCTION("mafunc", libmafunc); FUNCTION_ENTRY; int ret = libmafunc(n); FUNCTION_EXIT; return ret; } PPTRACE_START_INTERCEPT_FUNCTIONS(staticlib) INTERCEPT3("mafunc", libmafunc) PPTRACE_END_INTERCEPT_FUNCTIONS(staticlib) static void init_staticlib() { INSTRUMENT_FUNCTIONS(staticlib); if (eztrace_autostart_enabled()) eztrace_start(); } static void finalize_staticlib() { eztrace_stop(); } static void __staticlib_init(void) __attribute__((constructor)); static void __staticlib_init(void) { EZT_REGISTER_MODULE(staticlib, "Example module for static instrumentation", init_staticlib, finalize_staticlib); } eztrace-2.1/test/test_utils/000077500000000000000000000000001447213526500162005ustar00rootroot00000000000000eztrace-2.1/test/test_utils/test_utils.sh000066400000000000000000000122011447213526500207270ustar00rootroot00000000000000#!/bin/bash CUR_PATH=$(dirname $(realpath $0)) cd "$CUR_PATH" [ -n "$OTF2_PRINT_PATH" ] || export OTF2_PRINT_PATH=otf2-print [ -n "$EZTRACE_PATH" ] || export EZTRACE_PATH=eztrace [ -n "$EZTRACE_AVAIL_PATH" ] || export EZTRACE_AVAIL_PATH=eztrace_avail [ -n "$EZTRACE_CC_PATH" ] || export EZTRACE_CC_PATH=eztrace_cc [ -n "$MPIRUN_PATH" ] || export MPIRUN_PATH=mpirun [ -n "$MPICC_PATH" ] || export MPICC_PATH=mpicc C_BLACK='\033[0;30m' C_DGRAY='\033[1;30m' C_LGRAY='\033[0;37m' C_WHITE='\033[1;37m' C_GREEN='\033[0;32m' C_LGREEN='\033[1;32m' C_BLUE='\033[0;34m' C_LBLUE='\033[1;34m' C_CYAN='\033[0;36m' C_LCYAN='\033[1;36m' C_ORANGE='\033[0;33m' C_YELLOW='\033[1;33m' C_RED='\033[0;31m' C_LRED='\033[1;31m' C_PURPLE='\033[0;35m' C_LPURPLE='\033[1;35m' C_NC='\033[0m' C_BOLD='\033[1m' function print_error { echo -e " [${C_LRED}${C_BOLD}ERROR${C_NC}] $@" } function print_warning { echo -e "[${C_YELLOW}${C_BOLD}WARNING${C_NC}] $@" } function print_info { echo -e " [${C_LBLUE}INFO${C_NC}] ${C_BOLD}$@${C_NC}" } function print_ok { echo -e " [${C_LGREEN}OK${C_NC}] $@" } function print_simple { echo " $@" } function check_last_return { if [[ $? != 0 ]] ; then if [[ "$@" != "" ]]; then print_error $@ fi error_occured=true elif [[ "$@" != "" ]] ; then print_ok $@ fi } function check_dependencies { echo "> Checking for dependencies..." for d in $@; do if ! command -v $d &>/dev/null; then print_error "Missing command: $d" return 1 fi done print_ok } function check_module { module=$1 echo "> Checking for eztrace module '$module'..." [ -n "$EZTRACE_AVAIL_PATH" ] || EZTRACE_AVAIL_PATH=eztrace_avail if "$EZTRACE_AVAIL_PATH" | grep "^$module[[:space:]]" > /dev/null ; then print_ok else print_error "Module '$module' not found" return 1 fi } function check_compilation { echo "> Compiling test programs..." if [ -n "$verbose" ]; then make -C "$CUR_PATH" else make -C "$CUR_PATH" > /dev/null fi if [ "$?" != "0" ]; then print_error "Compilation failed" return 1 fi print_ok } function run_test { test=$1 if ! [ -x "$test" ]; then return fi echo "> Running $test..." if [ -n "$verbose" ]; then $test else $test > /dev/null 2>&1 fi if [ "$?" != "0" ]; then print_error "Test $test failed" return 1 fi print_ok } function run_and_check_command { cmd=$@ echo "> Running $cmd" ((nb_test++)) if [ -n "$verbose" ]; then $cmd else $cmd > /dev/null 2>&1 fi if [ "$?" != "0" ]; then print_error "command '$cmd' failed" return 1 fi print_ok ((nb_pass++)) return 0 } function trace_get_nb_event_of_type { trace_filename=$1 event_type=$2 "$OTF2_PRINT_PATH" "$trace_filename" 2>/dev/null |grep "^$event_type[[:space:]]"|wc -l } function trace_check_integrity { trace_filename=$1 ((nb_test++)) echo " > Checking for trace integrity" if ! "$OTF2_PRINT_PATH" "$trace_filename" > /dev/null 2>&1 ; then print_error "Cannot parse trace '$trace_filename'" ((nb_failed++)) return 1 else ((nb_pass++)) print_ok return 0 fi } function trace_check_enter_leave_parity { trace_filename=$1 ((nb_test++)) echo " > Checking for ENTER/LEAVE parity" nb_enter=$(trace_get_nb_event_of_type "$trace_filename" "ENTER") nb_leave=$(trace_get_nb_event_of_type "$trace_filename" "LEAVE") if [ $nb_enter -ne $nb_leave ]; then print_error "$nb_enter ENTER events / $nb_leave LEAVE events" ((nb_failed++)) return 1 else print_ok "$nb_enter event of each type" ((nb_pass++)) return 0 fi } function trace_check_event_type { trace_filename=$1 event_type=$2 expected_nb=$3 actual_nb=$(trace_get_nb_event_of_type "$trace_filename" "$event_type") ((nb_test++)) echo " > Checking the number of $event_type events" if [ $expected_nb -ne $actual_nb ]; then print_error "$actual_nb events (expected: $expected_nb)" ((nb_failed++)) return 1 else print_ok ((nb_pass++)) return 0 fi } function trace_check_nb_enter { trace_filename=$1 event_type="$2" expected_nb=$3 ((nb_test++)) echo " > Checking the number of ENTER $event_type events" actual_nb=$("$OTF2_PRINT_PATH" "$trace_filename" 2>/dev/null |grep "^ENTER[[:space:]]"|awk -vFPAT='([^ ]+)|("[^"]+")' '{print $5}' | grep "\"$event_type\""| wc -l) if [ $expected_nb -ne $actual_nb ]; then print_error "$actual_nb events (expected: $expected_nb)" ((nb_failed++)) return 1 else print_ok ((nb_pass++)) return 0 fi } function trace_check_nb_leave { trace_filename=$1 event_type=$2 expected_nb=$3 ((nb_test++)) echo " > Checking the number of LEAVE $event_type events" actual_nb=$("$OTF2_PRINT_PATH" "$trace_filename" 2>/dev/null |grep "^LEAVE[[:space:]]"|awk -vFPAT='([^ ]+)|("[^"]+")' '{print $5}' | grep "\"$event_type\""| wc -l) if [ $expected_nb -ne $actual_nb ]; then print_error "$actual_nb events (expected: $expected_nb)" ((nb_failed++)) return 1 else print_ok ((nb_pass++)) return 0 fi } eztrace-2.1/test/unit_tests/000077500000000000000000000000001447213526500162025ustar00rootroot00000000000000eztrace-2.1/test/unit_tests/CMakeLists.txt000066400000000000000000000032321447213526500207420ustar00rootroot00000000000000enable_testing() add_executable(htable htable.c) # depending on the framework, you need to link to it target_link_libraries(htable eztrace-core) target_compile_options(htable PRIVATE -Wall -Wextra -Wpedantic -Werror ) target_include_directories(htable PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/ ) add_test(NAME htable COMMAND htable) set(EZTRACE_LIBRARY_PATH "${CMAKE_BINARY_DIR}/src/eztrace-lib") if (EZTRACE_ENABLE_MPI) add_test (mpi_tests bash ${CMAKE_CURRENT_SOURCE_DIR}/../mpi/run.sh) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/mpi") endif() if (EZTRACE_ENABLE_MEMORY) add_test (memory_tests bash ${CMAKE_CURRENT_SOURCE_DIR}/../memory/run.sh) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/memory") endif() if (EZTRACE_ENABLE_OPENMP) add_test (openmp_tests bash ${CMAKE_CURRENT_SOURCE_DIR}/../openmp/run.sh) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/omp") endif() if (EZTRACE_ENABLE_OMPT) add_test (ompt_tests bash ${CMAKE_CURRENT_SOURCE_DIR}/../ompt/run.sh) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/ompt") endif() if (EZTRACE_ENABLE_STARPU) add_test (starpu_tests bash ${CMAKE_CURRENT_SOURCE_DIR}/../starpu/run.sh) set(EZTRACE_LIBRARY_PATH "${EZTRACE_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/modules/starpu") endif() # Get the list of tests, and set environment variables get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS) set_property(TEST ${test_list} PROPERTY ENVIRONMENT "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}" ) eztrace-2.1/test/unit_tests/htable.c000066400000000000000000000022151447213526500176050ustar00rootroot00000000000000#include #include #include #include #include #if 0 void test1() { struct ezt_hashtable ht; ezt_hashtable_init(&ht, sizeof(int), 64, NULL); int key_int=42; char* key=(char*)&key_int; uint64_t value = 17; /* get non-existing key in an empty hashtable*/ void * ret = ezt_hashtable_get(&ht, key); assert( ret == NULL); /* insert a key,value, then retrieve it */ ezt_hashtable_insert(&ht, key, &value); ret = ezt_hashtable_get(&ht, key); assert( ret == &value); /* get non-existing key in a non-empty hashtable*/ int key2_int = key_int+1; char*key2 = (char*)&key2_int; ret = ezt_hashtable_get(&ht, key2); assert( ret == NULL); /* get non-existing key in an hashtable that used to contain the key*/ ezt_hashtable_remove(&ht, key); ret = ezt_hashtable_get(&ht, key); assert( ret == NULL); /* remove a non existing key */ ezt_hashtable_remove(&ht, key2); ezt_hashtable_finalize(&ht); printf("%s OK\n", __func__); } #endif int main(int argc __attribute__((unused)), char** argv __attribute__((unused))) { // test1(); return EXIT_SUCCESS; }