~ubuntu-branches/ubuntu/utopic/adios/utopic

« back to all changes in this revision

Viewing changes to tests/suite/tests/13_write_byid.sh

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2013-12-09 15:21:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131209152131-jtd4fpmdv3xnunnm
Tags: 1.5.0-1
* New upstream.
* Standards-Version: 3.9.5
* Include latest config.{sub,guess} 
* New watch file.
* Create libadios-bin for binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
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
 
5
#
 
6
# Environment variables set by caller:
 
7
# MPIRUN        Run command
 
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
 
13
 
 
14
PROCS=7
 
15
READPROCS=3
 
16
 
 
17
if [ $MAXPROCS -lt $PROCS ]; then
 
18
    echo "WARNING: Needs $PROCS processes at least"
 
19
    exit 77  # not failure, just skip
 
20
fi
 
21
 
 
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 .
 
25
 
 
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
 
30
EX=$?
 
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"
 
33
    exit 1
 
34
fi
 
35
 
 
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
 
39
if [ $? != 0 ]; then
 
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"
 
42
    exit 1
 
43
fi
 
44
 
 
45
echo "Run C read_no_xml_write_byid"
 
46
$MPIRUN $NP_MPIRUN $READPROCS ./read_no_xml_write_byid > c_read.txt
 
47
EX=$?
 
48
if [ $? != 0 ]; then
 
49
    echo "ERROR: C version of read_no_xml_write_byid exited with $EX"
 
50
    echo "Check $PWD/c_read.txt"
 
51
    exit 1
 
52
fi
 
53
 
 
54
echo "Check output"
 
55
diff -q c_read.txt $SRCDIR/reference/no_xml_write_byid_read.txt
 
56
if [ $? != 0 ]; then
 
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"
 
59
    exit 1
 
60
fi
 
61
 
 
62
 
 
63
if [ $HAVE_FORTRAN != yes ]; then
 
64
    exit 0
 
65
fi
 
66
# run the Fortran tests too if available
 
67
 
 
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
 
70
 
 
71
echo "Run Fortran no_xml_write_byid"
 
72
$MPIRUN $NP_MPIRUN $PROCS ./no_xml_write_byid_f
 
73
EX=$?
 
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"
 
76
    exit 1
 
77
fi
 
78
 
 
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
 
82
if [ $? != 0 ]; then
 
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"
 
85
    exit 1
 
86
fi
 
87
 
 
88