3
# Test if adios can write and read global arrays over time correctly
4
# Uses codes from examples/C/global-array and examples/Fortran/global-array
6
# Environment variables set by caller:
8
# NP_MPIRUN Run commands option to set number of processes
9
# MAXPROCS Max number of processes allowed
10
# HAVE_FORTRAN yes or no
11
# SRCDIR Test source dir (.. of this script)
12
# TRUNKDIR ADIOS trunk dir
17
if [ $MAXPROCS -lt $PROCS ]; then
18
echo "WARNING: Needs $PROCS processes at least"
19
exit 77 # not failure, just skip
22
# copy codes and inputs to .
23
cp $TRUNKDIR/examples/C/global-array/no_xml_write_byid .
24
cp $TRUNKDIR/examples/C/global-array/read_no_xml_write_byid .
26
echo "Run C no_xml_write_byid"
27
ls -l ./no_xml_write_byid
28
echo $MPIRUN $NP_MPIRUN $PROCS ./no_xml_write_byid
29
$MPIRUN $NP_MPIRUN $PROCS ./no_xml_write_byid
31
if [ ! -f no_xml_write_byid.bp ]; then
32
echo "ERROR: C version of no_xml_write_byid failed. No BP file is created. Exit code=$EX"
36
echo "Check output with bpls"
37
$TRUNKDIR/utils/bpls/bpls -lav no_xml_write_byid.bp -d -n 10 | grep -v endianness > c_bpls.txt
38
diff -q c_bpls.txt $SRCDIR/reference/no_xml_write_byid_bpls.txt
40
echo "ERROR: C version of no_xml_write_byid produced a file different from the reference."
41
echo "Compare \"bpls -lav $PWD/no_xml_write_byid.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/no_xml_write_byid_bpls.txt"
45
echo "Run C read_no_xml_write_byid"
46
$MPIRUN $NP_MPIRUN $READPROCS ./read_no_xml_write_byid > c_read.txt
49
echo "ERROR: C version of read_no_xml_write_byid exited with $EX"
50
echo "Check $PWD/c_read.txt"
55
diff -q c_read.txt $SRCDIR/reference/no_xml_write_byid_read.txt
57
echo "ERROR: C version of read_no_xml_write_byid produced a file different from the reference."
58
echo "$PWD/c_read.txt to reference $SRCDIR/reference/no_xml_write_byid_read.txt"
63
if [ $HAVE_FORTRAN != yes ]; then
66
# run the Fortran tests too if available
68
mv no_xml_write_byid.bp no_xml_write_byid_c.bp
69
cp $TRUNKDIR/examples/Fortran/global-array/no_xml_write_byid no_xml_write_byid_f
71
echo "Run Fortran no_xml_write_byid"
72
$MPIRUN $NP_MPIRUN $PROCS ./no_xml_write_byid_f
74
if [ ! -f no_xml_write_byid.bp ]; then
75
echo "ERROR: Fortran version of no_xml_write_byid failed. No BP file is created. Exit code=$EX"
79
echo "Check output with bpls"
80
$TRUNKDIR/utils/bpls/bpls -lav no_xml_write_byid.bp -d -n 10 | grep -v endianness > f_bpls.txt
81
diff -q f_bpls.txt $SRCDIR/reference/no_xml_write_byid_f_bpls.txt
83
echo "ERROR: Fortran version of no_xml_write_byid produced a file different from the reference."
84
echo "Compare \"bpls -lav $PWD/no_xml_write_byid.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/no_xml_write_byid_f_bpls.txt"