Skip to content

Commit

Permalink
Merge pull request #2579 from chuckatkins/add-bp2h5-tool
Browse files Browse the repository at this point in the history
utils: Simplified wrappers for adios2_reorganize
  • Loading branch information
Chuck Atkins authored Jan 11, 2021
2 parents 6112208 + 8b1d239 commit 1c999f5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
39 changes: 39 additions & 0 deletions source/utils/adios_reorganize/adios2_reorganize_wrapper
Original file line number Diff line number Diff line change
@@ -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}"
1 change: 1 addition & 0 deletions source/utils/adios_reorganize/bp2h5
1 change: 1 addition & 0 deletions source/utils/adios_reorganize/bp2h5_mpi

0 comments on commit 1c999f5

Please sign in to comment.