Skip to content

Commit

Permalink
Allow rearranging data with a collective without any compile-time flags
Browse files Browse the repository at this point in the history
Removing ifdefs around MPI_ALLTOALLW() call so that users can
use the collective (PIO_REARR_COMM_TYPE=coll in env_run.xml)
without specifying any additional compiler flags. Without this
fix users need to specify "-D_USE_ALLTOALLW" to use the collective
option. Thanks Pat for catching this issue.

This runtime option was initially added in commit #83195da
  • Loading branch information
jayeshkrishna committed Jan 20, 2016
1 parent 83195da commit 1e0d159
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pio/box_rearrange.F90.in
Original file line number Diff line number Diff line change
Expand Up @@ -280,22 +280,18 @@ subroutine box_rearrange_comp2io_{TYPE} (IOsystem, ioDesc, s1, src, niodof, &
endif
end do

#ifdef _USE_ALLTOALLW
if (pio_option == COLLECTIVE) then

call MPI_ALLTOALLW(src, a2a_sendcounts, a2a_displs, a2a_sendtypes, &
dest, a2a_recvcounts, a2a_displs, a2a_recvtypes, &
IOsystem%union_comm, ierror )
call CheckMPIReturn('box_rearrange', ierror)
else
#endif
call pio_swapm( nprocs, myrank, &
src, ndof, a2a_sendcounts, a2a_displs, a2a_sendtypes, &
dest, niodof, a2a_recvcounts, a2a_displs, a2a_recvtypes, &
IOsystem%union_comm, pio_hs, pio_isend, pio_maxreq )
#ifdef _USE_ALLTOALLW
endif
#endif
call dealloc_check(a2a_sendcounts)
call dealloc_check(a2a_displs)
call dealloc_check(a2a_sendtypes)
Expand Down Expand Up @@ -567,21 +563,17 @@ subroutine box_rearrange_io2comp_{TYPE} (IOsystem,ioDesc,s1, iobuf,s2, compbuf,
end do
endif

#ifdef _USE_ALLTOALLW
if (pio_option == COLLECTIVE) then
call MPI_ALLTOALLW(iobuf, a2a_sendcounts, a2a_displs, a2a_sendtypes, &
compbuf, a2a_recvcounts, a2a_displs, a2a_recvtypes, &
IOsystem%union_comm, ierror )
call CheckMPIReturn(subName, ierror)
else
#endif
call pio_swapm( nprocs, myrank, &
iobuf, niodof, a2a_sendcounts, a2a_displs, a2a_sendtypes, &
compbuf, ndof, a2a_recvcounts, a2a_displs, a2a_recvtypes, &
IOsystem%union_comm, pio_hs, pio_isend, pio_maxreq )
#ifdef _USE_ALLTOALLW
endif
#endif
call dealloc_check(a2a_sendcounts)
call dealloc_check(a2a_displs)
call dealloc_check(a2a_sendtypes)
Expand Down

0 comments on commit 1e0d159

Please sign in to comment.