Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Simplified wrappers for adios2_reorganize #2579

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
chuckatkins marked this conversation as resolved.
Show resolved Hide resolved
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