Skip to content

Commit

Permalink
Merge pull request #3072 from pnorbert/deactivate-script
Browse files Browse the repository at this point in the history
make adios2_deactivate_bp work with bp4 and bp5 formats.
  • Loading branch information
pnorbert authored Feb 24, 2022
2 parents fe5814a + 874daba commit 17aeb7c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
2 changes: 1 addition & 1 deletion source/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if(Python_Interpreter_FOUND)
add_subdirectory(bp5dbg)
endif()

install(PROGRAMS adios_deactivate_bp.sh
install(PROGRAMS adios2_deactivate_bp
RENAME adios2_deactivate_bp
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT adios2_scripts-runtime)
Expand Down
32 changes: 32 additions & 0 deletions source/utils/adios2_deactivate_bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

FNAME=$1
if [ "x$FNAME" == "x" ]; then
echo "Missing BP data set name"
exit 1
fi

if [ ! -d $FNAME ]; then
echo "Not a valid BP output: $FNAME"
echo "BP data set should be a directory"
exit 2
fi

if [ ! -f $FNAME/md.idx ]; then
echo "Not a valid BP output: $FNAME"
echo "Missing $FNAME/md.idx file"
exit 3
fi

# Get BP version
v=`od -An -j 37 -N 1 -tu1 $FNAME/md.idx`

if (( v == 4 )); then
printf '\x00' | dd of=$FNAME/md.idx bs=1 seek=38 conv=notrunc
elif (( v == 5 )); then
printf '\x00' | dd of=$FNAME/md.idx bs=1 seek=39 conv=notrunc
else
echo "This BP version is not supported by this script. Version found: $v"
fi


22 changes: 0 additions & 22 deletions source/utils/adios_deactivate_bp.sh

This file was deleted.

0 comments on commit 17aeb7c

Please sign in to comment.