From 26ccf1fcf712a3622cd024c54bd927be81b72bb0 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Thu, 17 Nov 2016 13:35:14 -0500 Subject: [PATCH] Updated tests 01 and 19 to filter job manager stdout on Titan before comparing results --- .../examples/scalars/scalars_read_C.c | 28 +++++++++-------- .../examples/scalars/scalars_read_F.F90 | 30 +++++++++++-------- tests/suite/tests/01_scalars.sh | 4 +-- tests/suite/tests/19_query.sh | 9 ++++-- 4 files changed, 41 insertions(+), 30 deletions(-) diff --git a/tests/suite/programs/examples/scalars/scalars_read_C.c b/tests/suite/programs/examples/scalars/scalars_read_C.c index dca789d95..3ae47649b 100644 --- a/tests/suite/programs/examples/scalars/scalars_read_C.c +++ b/tests/suite/programs/examples/scalars/scalars_read_C.c @@ -60,6 +60,7 @@ int main (int argc, char ** argv) MPI_Init (&argc, &argv); MPI_Comm_rank (comm, &rank); + FILE* outf = fopen ("c_read.txt", "w"); strcpy (filename, "scalars_C.bp"); adios_read_init_method (method, comm, "verbose=3"); @@ -83,28 +84,29 @@ int main (int argc, char ** argv) adios_perform_reads (f,1); if (rank == 0) { - printf("byte v1 = %d\n", v1); - printf("short v2 = %d\n", v2); - printf("integer v3 = %d\n", v3); - printf("long v4 = %lld\n", v4); + fprintf (outf, "byte v1 = %d\n", v1); + fprintf (outf, "short v2 = %d\n", v2); + fprintf (outf, "integer v3 = %d\n", v3); + fprintf (outf, "long v4 = %lld\n", v4); - printf("uns.byte v5 = %u\n", v5); - printf("uns.short v6 = %u\n", v6); - printf("uns.int v7 = %u\n", v7); - printf("uns.long v8 = %llu\n", v8); + fprintf (outf, "uns.byte v5 = %u\n", v5); + fprintf (outf, "uns.short v6 = %u\n", v6); + fprintf (outf, "uns.int v7 = %u\n", v7); + fprintf (outf, "uns.long v8 = %llu\n", v8); - printf("float v9 = %g\n", v9); - printf("double v10 = %g\n", v10); + fprintf (outf, "float v9 = %g\n", v9); + fprintf (outf, "double v10 = %g\n", v10); - printf("string v11 = %s\n", v11); + fprintf (outf, "string v11 = %s\n", v11); - printf("complex v12 = (%g, i%g)\n", v12.r, v12.i); - printf("dbl-complex v13 = (%g, i%g)\n", v13.r, v13.i); + fprintf (outf, "complex v12 = (%g, i%g)\n", v12.r, v12.i); + fprintf (outf, "dbl-complex v13 = (%g, i%g)\n", v13.r, v13.i); } adios_read_close (f); MPI_Barrier (comm); adios_read_finalize_method (ADIOS_READ_METHOD_BP); + fclose (outf); MPI_Finalize (); return 0; diff --git a/tests/suite/programs/examples/scalars/scalars_read_F.F90 b/tests/suite/programs/examples/scalars/scalars_read_F.F90 index 3c4bb832e..46e094eb0 100644 --- a/tests/suite/programs/examples/scalars/scalars_read_F.F90 +++ b/tests/suite/programs/examples/scalars/scalars_read_F.F90 @@ -46,6 +46,8 @@ program scalars_read call MPI_Comm_rank (comm, rank, ierr) call MPI_Comm_size (comm, size, ierr); + OPEN(1,FILE="f_read.txt",FORM="FORMATTED",STATUS="REPLACE",ACTION="WRITE") + call adios_read_init_method (method, comm, "verbose=3", ierr); call adios_read_open (f, filename, method, comm, ADIOS_LOCKMODE_NONE, 1.0, ierr); @@ -74,23 +76,23 @@ program scalars_read ! the above variables contain the value only at this point if (rank == 0) then - write (*, '("int*1 v1 = ",i3)') v1 - write (*, '("int*2 v2 = ",i3)') v2 - write (*, '("int*4 v3 = ",i3)') v3 - write (*, '("int*8 v4 = ",i3)') v4 + write (1, '("int*1 v1 = ",i3)') v1 + write (1, '("int*2 v2 = ",i3)') v2 + write (1, '("int*4 v3 = ",i3)') v3 + write (1, '("int*8 v4 = ",i3)') v4 - write (*, '("int*1 v5 = ",i3)') v5 - write (*, '("int*2 v6 = ",i3)') v6 - write (*, '("int*4 v7 = ",i3)') v7 - write (*, '("int*8 v8 = ",i3)') v8 + write (1, '("int*1 v5 = ",i3)') v5 + write (1, '("int*2 v6 = ",i3)') v6 + write (1, '("int*4 v7 = ",i3)') v7 + write (1, '("int*8 v8 = ",i3)') v8 - write (*, '("real*4 v9 = ",f6.2)') v9 - write (*, '("real*8 v10 = ",f6.2)') v10 + write (1, '("real*4 v9 = ",f6.2)') v9 + write (1, '("real*8 v10 = ",f6.2)') v10 - write (*, '("string v11 = ",a)') trim(v11) + write (1, '("string v11 = ",a)') trim(v11) - write (*, '("complex*8 v12 = (",f6.2,", ", f6.2,")")') v12 - write (*, '("complex*16 v13 = (",f6.2,", ", f6.2,")")') v13 + write (1, '("complex*8 v12 = (",f6.2,", ", f6.2,")")') v12 + write (1, '("complex*16 v13 = (",f6.2,", ", f6.2,")")') v13 endif call adios_read_close (f, ierr) @@ -98,5 +100,7 @@ program scalars_read call adios_read_finalize_method (method, ierr); call MPI_Finalize (ierr); + CLOSE(UNIT=1) + end program diff --git a/tests/suite/tests/01_scalars.sh b/tests/suite/tests/01_scalars.sh index bd67b7c9e..044ba13c9 100755 --- a/tests/suite/tests/01_scalars.sh +++ b/tests/suite/tests/01_scalars.sh @@ -46,7 +46,7 @@ if [ $? != 0 ]; then fi echo "Run C scalars_read" -$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_read_C > c_read.txt +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_read_C # produces c_read.txt EX=$? if [ $? != 0 ]; then echo "ERROR: C version of scalars_read failed with exit code $EX" @@ -90,7 +90,7 @@ if [ $? != 0 ]; then fi echo "Run Fortran scalars_read" -$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_read_F > f_read.txt +$MPIRUN $NP_MPIRUN $PROCS $EXEOPT ./scalars_read_F # produces f_read.txt EX=$? if [ $? != 0 ]; then echo "ERROR: Fortran version of scalars_read failed with exit code $EX" diff --git a/tests/suite/tests/19_query.sh b/tests/suite/tests/19_query.sh index 13c885e60..6d87fb26b 100755 --- a/tests/suite/tests/19_query.sh +++ b/tests/suite/tests/19_query.sh @@ -238,9 +238,11 @@ function query_datasets() { echo "====== COMPUTING EXPECTED OUTPUT OF QUERY $QUERY_NAME ON DATASET $DSID IN $FILEMODE MODE ======" echo set -o xtrace - $MPIRUN_SERIAL "$QUERY_SEQSCAN_EXE_LOCAL" "$NOINDEX_DS" "$QUERY_XML_LOCAL" "$FILEMODE" > "$EXPECTED_POINTS_FILE" || + $MPIRUN_SERIAL "$QUERY_SEQSCAN_EXE_LOCAL" "$NOINDEX_DS" "$QUERY_XML_LOCAL" "$FILEMODE" > "$EXPECTED_POINTS_FILE".raw || die "ERROR: $QUERY_SEQSCAN_EXE_LOCAL failed with exit code $?" set +o xtrace + # filter out job manager's output line at the end of stdout + grep -v "^Application" "$EXPECTED_POINTS_FILE".raw > "$EXPECTED_POINTS_FILE" # NOTE: the sequential scan program produces a point list that is guaranteed to be sorted in C array order, so no need to sort it here done @@ -270,9 +272,12 @@ function query_datasets() { echo "====== RUNNING QUERY $QUERY_NAME USING QUERY ENGINE $QUERY_ENGINE ON DATASET $DSID IN $FILEMODE MODE ======" echo set -o xtrace - $MPIRUN_SERIAL "$QUERY_EXE_LOCAL" "$INDEXED_DS" "$QUERY_XML_LOCAL" "$QUERY_ENGINE" "$FILEMODE" > "$OUTPUT_POINTS_FILE" || + $MPIRUN_SERIAL "$QUERY_EXE_LOCAL" "$INDEXED_DS" "$QUERY_XML_LOCAL" "$QUERY_ENGINE" "$FILEMODE" > "$OUTPUT_POINTS_FILE".raw || die "ERROR: $QUERY_EXE_LOCAL failed with exit code $?" set +o xtrace + # filter out job manager's output line at the end of stdout + grep -v "^Application" "$OUTPUT_POINTS_FILE".raw > "$OUTPUT_POINTS_FILE" + # Sort the output points in C array order, since the query engine makes no guarantee as to the ordering of the results # Sort file in place (-o FILE) with numerical sort order (-n) on each of the first 9 fields (-k1,1 ...)