Skip to content

Commit

Permalink
Updated tests 01 and 19 to filter job manager stdout on Titan before …
Browse files Browse the repository at this point in the history
…comparing results
  • Loading branch information
pnorbert committed Nov 17, 2016
1 parent c9171f7 commit 26ccf1f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 30 deletions.
28 changes: 15 additions & 13 deletions tests/suite/programs/examples/scalars/scalars_read_C.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
Expand Down
30 changes: 17 additions & 13 deletions tests/suite/programs/examples/scalars/scalars_read_F.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -74,29 +76,31 @@ 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)
call MPI_Barrier (comm, ierr);
call adios_read_finalize_method (method, ierr);
call MPI_Finalize (ierr);

CLOSE(UNIT=1)

end program

4 changes: 2 additions & 2 deletions tests/suite/tests/01_scalars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions tests/suite/tests/19_query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ...)
Expand Down

0 comments on commit 26ccf1f

Please sign in to comment.