Opened 8 years ago
Last modified 6 years ago
#151 assigned Defect
Improper use of MPI_IN_PLACE — at Initial Version
Reported by: | adingwell | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | FLEXPART 10 |
Component: | FP coding/compilation | Version: | FLEXPART 10.0 |
Keywords: | mpi, buffer, parallel | Cc: |
Description
In mpi_mod.f90 and FLEXPART_MPI.f90 there are calls to MPI_REDUCE which use MPI_IN_PLACE.
The non-root calls to MPI_RECEIVE currently use the same buffer for send and receive; this is will produce errors when running with Intel-MPI.
The correct way of doing this is to set RECBUF (second argument) to 0, in non-root calls where MPI_IN_PLACE was assigned by the root.
E.g. in FLEXPART_MPI.f90, this block:
if (lroot) then call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) else if (mp_partgroup_pid.ge.0) then ! Skip for readwind process call MPI_Reduce(tot_blc_count, tot_blc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) call MPI_Reduce(tot_inc_count, tot_inc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) end if end if
should be replaced with this:
if (lroot) then call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) else if (mp_partgroup_pid.ge.0) then ! Skip for readwind process call MPI_Reduce(tot_blc_count, 0, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) call MPI_Reduce(tot_blc_count, 0, 1, mp_pp, MPI_SUM, id_root, & & mp_comm_used, mp_ierr) end if end if
(Corresponding changes should also be made in mpi_mod.f90)
Note: See
TracTickets for help on using
tickets.