diff --git a/source/utils/CMakeLists.txt b/source/utils/CMakeLists.txt index 041c39ac3c..eeefbcfe1f 100644 --- a/source/utils/CMakeLists.txt +++ b/source/utils/CMakeLists.txt @@ -77,3 +77,26 @@ install(PROGRAMS adios_deactivate_bp.sh RENAME adios2_deactivate_bp DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT adios2_scripts-runtime) + +# Simplified wrappers for adios2_reorganize +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/adios_reorganize/adios2_reorganize_wrapper + ${PROJECT_BINARY_DIR}/adios2_reorganize_wrapper + @ONLY +) +if(ADIOS2_HAVE_HDF5) + install(PROGRAMS ${PROJECT_BINARY_DIR}/adios2_reorganize_wrapper + RENAME adios2_reorganize_wrapper${ADIOS2_EXECUTABLE_SUFFIX} + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + install(PROGRAMS adios_reorganize/bp2h5 + RENAME bp2h5${ADIOS2_EXECUTABLE_SUFFIX} + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + if(ADIOS2_HAVE_MPI) + install(PROGRAMS adios_reorganize/bp2h5_mpi + RENAME bp2h5_mpi${ADIOS2_EXECUTABLE_SUFFIX} + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif() +endif() diff --git a/source/utils/adios_reorganize/adios2_reorganize_wrapper b/source/utils/adios_reorganize/adios2_reorganize_wrapper new file mode 100755 index 0000000000..f2e3a2e302 --- /dev/null +++ b/source/utils/adios_reorganize/adios2_reorganize_wrapper @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ $# -ne 2 ] +then + echo "Usage: $0 /path/to/input /path/to/output" + exit 1 +fi + +input="$1" +output="$2" +base_dir="$(dirname $(readlink -f "${BASH_SOURCE}"))" +wrapper=$(basename "$0") +case ${wrapper} in + bp2h5*@ADIOS2_EXECUTABLE_SUFFIX@) + in_engine=BPFile + in_params="StreamReader=ON" + out_engine=HDF5 + out_params="" + ;; + *) + echo "Error: Unrecognized wrapper: ${wrapper}" + exit 2 + ;; +esac +case ${wrapper} in + *_mpi@ADIOS2_EXECUTABLE_SUFFIX@) + reorg_tool="${base_dir}/adios2_reorganize_mpi@ADIOS2_EXECUTABLE_SUFFIX@" + ;; + *@ADIOS2_EXECUTABLE_SUFFIX@) + reorg_tool="${base_dir}/adios2_reorganize@ADIOS2_EXECUTABLE_SUFFIX@" + ;; + *) + echo "Error: Unrecognized wrapper: ${wrapper}" + exit 2 + ;; +esac + +set -x +exec "${reorg_tool}" "${input}" "${output}" ${in_engine} "${in_params}" ${out_engine} "${out_params}" diff --git a/source/utils/adios_reorganize/bp2h5 b/source/utils/adios_reorganize/bp2h5 new file mode 120000 index 0000000000..0ad254a021 --- /dev/null +++ b/source/utils/adios_reorganize/bp2h5 @@ -0,0 +1 @@ +adios2_reorganize_wrapper \ No newline at end of file diff --git a/source/utils/adios_reorganize/bp2h5_mpi b/source/utils/adios_reorganize/bp2h5_mpi new file mode 120000 index 0000000000..0ad254a021 --- /dev/null +++ b/source/utils/adios_reorganize/bp2h5_mpi @@ -0,0 +1 @@ +adios2_reorganize_wrapper \ No newline at end of file