Fixed mpi reduce for serpent-style plots

This commit is contained in:
Nick Horelik 2013-05-06 16:54:54 -07:00
parent 334b10077e
commit cbc428f104
3 changed files with 14 additions and 6 deletions

View file

@ -54,7 +54,7 @@ contains
end if
! Finish reaction rate plots
if (master .and. rxn_plots) call finalize_rxn_plots()
if (rxn_plots) call finalize_rxn_plots()
! deallocate arrays
call free_memory()

View file

@ -572,7 +572,7 @@ contains
! Check flag to enable rxn plot scoring
call lower_case(rxn_plots_)
if (rxn_plots_ == 'true' .or. rxn_plots == '1') then
if (rxn_plots_ == 'true' .or. rxn_plots_ == '1') then
rxn_plots = .true.
end if

View file

@ -107,10 +107,18 @@ contains
if (.not. pl % type == PLOT_TYPE_RXNRATE) cycle
#ifdef MPI
call MPI_REDUCE(MPI_IN_PLACE, pl % fisswgt, size(pl % fisswgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
call MPI_REDUCE(MPI_IN_PLACE, pl % fluxwgt, size(pl % fluxwgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
if (master) then
call MPI_REDUCE(MPI_IN_PLACE, pl % fisswgt, size(pl % fisswgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
call MPI_REDUCE(MPI_IN_PLACE, pl % fluxwgt, size(pl % fluxwgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
else
call MPI_REDUCE(pl % fisswgt, pl % fisswgt, size(pl % fisswgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
call MPI_REDUCE(pl % fluxwgt, pl % fluxwgt, size(pl % fluxwgt), &
MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
cycle
end if
#endif
pl % fisswgt = pl % fisswgt / maxval(pl % fisswgt)