Skip to content

Commit

Permalink
Update mpi tests for %? precision behavior (#22803)
Browse files Browse the repository at this point in the history
Fix a failing test: `users/npadmana/mpi/test_mpi` due to change in
precision behavior from `%t` format specifier to `%?`.

Updates the `.good` file for the relevant test and updates `%?` to show
`.0` for whole number reals.

- [X] updated test passing with mpi-gasnet config
- [x] local paratest

[ trivial - not reviewed ]
  • Loading branch information
jeremiah-corrado authored Jul 24, 2023
2 parents 5044eca + fb42e78 commit a7983ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions runtime/src/qio/qio_formatted.c
Original file line number Diff line number Diff line change
Expand Up @@ -5071,6 +5071,7 @@ qioerr qio_conv_parse(c_string fmt,
style_out->pad_char = ' ';
style_out->realfmt = 0;
style_out->string_format = QIO_STRING_FORMAT_WORD;
style_out->showpointzero = 1;

if (precision != WIDTH_NOT_SET || width != WIDTH_NOT_SET ) {
QIO_GET_CONSTANT_ERROR(err, EINVAL, "'%?' does not support width or precision arguments");
Expand Down
32 changes: 16 additions & 16 deletions test/users/npadmana/mpi/test_mpi.good
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ RING : Rank 0 recieved 3 from the left, and 1 from the right
RING : Rank 1 recieved 0 from the left, and 2 from the right
RING : Rank 2 recieved 1 from the left, and 3 from the right
RING : Rank 3 recieved 2 from the left, and 0 from the right
SCATTER1 : Rank 0 :0.000000e+00 1.000000e+00 2.000000e+00 3.000000e+00
SCATTER1 : Rank 1 :4.000000e+00 5.000000e+00 6.000000e+00 7.000000e+00
SCATTER1 : Rank 2 :8.000000e+00 9.000000e+00 1.000000e+01 1.100000e+01
SCATTER1 : Rank 3 :1.200000e+01 1.300000e+01 1.400000e+01 1.500000e+01
SCATTER2 : Rank 0 :1.000000e+00 2.000000e+00 3.000000e+00 4.000000e+00
SCATTER2 : Rank 1 :5.000000e+00 6.000000e+00 7.000000e+00 8.000000e+00
SCATTER2 : Rank 2 :9.000000e+00 1.000000e+01 1.100000e+01 1.200000e+01
SCATTER2 : Rank 3 :1.300000e+01 1.400000e+01 1.500000e+01 1.600000e+01
SCATTER3 : Rank 0 :1.000000e+00 5.000000e+00 9.000000e+00 1.300000e+01
SCATTER3 : Rank 1 :2.000000e+00 6.000000e+00 1.000000e+01 1.400000e+01
SCATTER3 : Rank 2 :3.000000e+00 7.000000e+00 1.100000e+01 1.500000e+01
SCATTER3 : Rank 3 :4.000000e+00 8.000000e+00 1.200000e+01 1.600000e+01
SCATTER4 : Rank 0 :6.000000e+00 7.000000e+00 1.300000e+01 1.400000e+01
SCATTER4 : Rank 1 :6.000000e+00 7.000000e+00 1.300000e+01 1.400000e+01
SCATTER4 : Rank 2 :6.000000e+00 7.000000e+00 1.300000e+01 1.400000e+01
SCATTER4 : Rank 3 :6.000000e+00 7.000000e+00 1.300000e+01 1.400000e+01
SCATTER1 : Rank 0 :0.0 1.0 2.0 3.0
SCATTER1 : Rank 1 :4.0 5.0 6.0 7.0
SCATTER1 : Rank 2 :8.0 9.0 10.0 11.0
SCATTER1 : Rank 3 :12.0 13.0 14.0 15.0
SCATTER2 : Rank 0 :1.0 2.0 3.0 4.0
SCATTER2 : Rank 1 :5.0 6.0 7.0 8.0
SCATTER2 : Rank 2 :9.0 10.0 11.0 12.0
SCATTER2 : Rank 3 :13.0 14.0 15.0 16.0
SCATTER3 : Rank 0 :1.0 5.0 9.0 13.0
SCATTER3 : Rank 1 :2.0 6.0 10.0 14.0
SCATTER3 : Rank 2 :3.0 7.0 11.0 15.0
SCATTER3 : Rank 3 :4.0 8.0 12.0 16.0
SCATTER4 : Rank 0 :6.0 7.0 13.0 14.0
SCATTER4 : Rank 1 :6.0 7.0 13.0 14.0
SCATTER4 : Rank 2 :6.0 7.0 13.0 14.0
SCATTER4 : Rank 3 :6.0 7.0 13.0 14.0
TYPE : Rank : 0 : (x = 3.0, y = -3.0, z = 3.0, vel = 0.25, n = 3, typ = 1)
TYPE : Rank : 1 : (x = 3.0, y = -3.0, z = 3.0, vel = 0.25, n = 3, typ = 1)
TYPE : Rank : 2 : (x = 3.0, y = -3.0, z = 3.0, vel = 0.25, n = 3, typ = 1)
Expand Down

0 comments on commit a7983ee

Please sign in to comment.