| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: Apache-2.0 |
| 6 |
|
| 7 |
FNAME=$1 |
| 8 |
if [ "x$FNAME" == "x" ]; then |
| 9 |
echo "Missing BP data set name" |
| 10 |
exit 1 |
| 11 |
fi |
| 12 |
|
| 13 |
if [ ! -d $FNAME ]; then |
| 14 |
echo "Not a valid BP output: $FNAME" |
| 15 |
echo "BP data set should be a directory" |
| 16 |
exit 2 |
| 17 |
fi |
| 18 |
|
| 19 |
if [ ! -f $FNAME/md.idx ]; then |
| 20 |
echo "Not a valid BP output: $FNAME" |
| 21 |
echo "Missing $FNAME/md.idx file" |
| 22 |
exit 3 |
| 23 |
fi |
| 24 |
|
| 25 |
# Get BP version |
| 26 |
v=`od -An -j 37 -N 1 -tu1 $FNAME/md.idx` |
| 27 |
|
| 28 |
if (( v == 4 )); then |
| 29 |
printf '\x00' | dd of=$FNAME/md.idx bs=1 seek=38 conv=notrunc |
| 30 |
elif (( v == 5 )); then |
| 31 |
printf '\x00' | dd of=$FNAME/md.idx bs=1 seek=39 conv=notrunc |
| 32 |
else |
| 33 |
echo "This BP version is not supported by this script. Version found: $v" |
| 34 |
fi |
| 35 |
|
| 36 |
|