Skip to content

Commit

Permalink
Merge pull request #366 from matt-frey/fix-reduction
Browse files Browse the repository at this point in the history
Fix MPI reduction
  • Loading branch information
matt-frey committed Apr 18, 2022
2 parents 39c51e6 + 6e5dde3 commit d4c919d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_dataset_1d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ program test_mpi_netcdf_dataset_2d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_dataset_2d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ program test_mpi_netcdf_dataset_2d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_dataset_3d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ program test_mpi_netcdf_dataset_3d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_read_attributes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ program test_mpi_netcdf_read_attributes
call delete_netcdf_file(ncfname='nctest.nc')

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_read_dataset_1d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ program test_mpi_netcdf_read_dataset_1d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_read_dataset_2d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ program test_mpi_netcdf_read_dataset_2d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/netcdf/test_mpi_netcdf_read_dataset_3d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ program test_mpi_netcdf_read_dataset_3d
passed = (passed .and. (ncerr == 0))

if (mpi_rank == mpi_master) then
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(MPI_IN_PLACE, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
else
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LOR, mpi_master, comm_world, mpi_err)
call MPI_Reduce(passed, passed, 1, MPI_LOGICAL, MPI_LAND, mpi_master, comm_world, mpi_err)
endif

if (mpi_rank == mpi_master) then
Expand Down

0 comments on commit d4c919d

Please sign in to comment.