Oasis3-MCT
|
OASIS reproducible sum method from P. Worley. More...
Functions/Subroutines | |
subroutine, public | oasis_reprosum_setopts (repro_sum_use_ddpdd_in, repro_sum_rel_diff_max_in, repro_sum_recompute_in, repro_sum_master, repro_sum_logunit) |
Set runtime options. More... | |
subroutine, public | oasis_reprosum_calc (arr, arr_gsum, nsummands, dsummands, nflds, ddpdd_sum, arr_gbl_max, arr_gbl_max_out, arr_max_levels, arr_max_levels_out, gbl_max_nsummands, gbl_max_nsummands_out, gbl_count, repro_sum_validate, repro_sum_stats, rel_diff, commid) |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on a fixed point algorithm. An alternative is to use an "almost
always reproducible" floating point algorithm. More... | |
subroutine | oasis_reprosum_int (arr, arr_gsum, nsummands, dsummands, nflds, arr_max_shift, arr_gmax_exp, max_levels, max_level, validate, recompute, omp_nthreads, mpi_comm) |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on a fixed point algorithm. The accuracy of the fixed point algorithm is controlled by the number of "levels" of integer expansion, the maximum value of which is specified by max_level. More... | |
logical function, public | oasis_reprosum_tolexceeded (name, nflds, master, logunit, rel_diff) |
Test whether distributed sum exceeds tolerance and print out a warning message. More... | |
subroutine | oasis_reprosum_ddpdd (arr, arr_gsum, nsummands, dsummands, nflds, mpi_comm) |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on He and Ding's implementation of the double-double algorithm. More... | |
subroutine, private | ddpdd (dda, ddb, len, itype) |
subroutine, private | split_indices (total, num_pieces, ibeg, iend) |
Variables | |
logical, public | oasis_reprosum_recompute = .false. |
real(r8), public | oasis_reprosum_reldiffmax = -1.0_r8 |
logical | repro_sum_use_ddpdd = .false. |
logical | detailed_timing = .false. |
OASIS reproducible sum method from P. Worley.
|
private |
Definition at line 1354 of file mod_oasis_reprosum.F90.
subroutine, public mod_oasis_reprosum::oasis_reprosum_calc | ( | real(r8), dimension(dsummands,nflds), intent(in) | arr, |
real(r8), dimension(nflds), intent(out) | arr_gsum, | ||
integer, intent(in) | nsummands, | ||
integer, intent(in) | dsummands, | ||
integer, intent(in) | nflds, | ||
logical, intent(in), optional | ddpdd_sum, | ||
real(r8), dimension(nflds), intent(in), optional | arr_gbl_max, | ||
real(r8), dimension(nflds), intent(out), optional | arr_gbl_max_out, | ||
integer, dimension(nflds), intent(in), optional | arr_max_levels, | ||
integer, dimension(nflds), intent(out), optional | arr_max_levels_out, | ||
integer, intent(in), optional | gbl_max_nsummands, | ||
integer, intent(out), optional | gbl_max_nsummands_out, | ||
integer, intent(in), optional | gbl_count, | ||
logical, intent(in), optional | repro_sum_validate, | ||
integer, dimension(5), intent(inout), optional | repro_sum_stats, | ||
real(r8), dimension(2,nflds), intent(out), optional | rel_diff, | ||
integer, intent(in), optional | commid | ||
) |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on a fixed point algorithm. An alternative is to use an "almost always reproducible" floating point algorithm.
[in] | nsummands | number of local summands |
[in] | dsummands | declared first dimension |
[in] | nflds | number of fields |
[in] | arr | input array |
[out] | arr_gsum | global means |
[in] | ddpdd_sum | use ddpdd algorithm instead of fixed precision algorithm |
[in] | arr_gbl_max | upper bound on max(abs(arr)) |
[out] | arr_gbl_max_out | calculated upper bound on max(abs(arr)) |
[in] | arr_max_levels | maximum number of levels of integer expansion to use |
[out] | arr_max_levels_out | output of number of levels of integer expansion to used |
[in] | gbl_max_nsummands | maximum of nsummand over all processes |
[out] | gbl_max_nsummands_out | calculated maximum nsummands over all processes |
[in] | gbl_count | was total number of summands; now is ignored; use gbl_max_nsummands instead |
[in] | repro_sum_validate | flag enabling/disabling testing that gmax and max_levels are accurate/sufficient. Default is enabled. |
[in,out] | repro_sum_stats | increment running totals for (1) one-reduction repro_sum (2) two-reduction repro_sum (3) both types in one call (4) nonrepro_sum (5) global max nsummands reduction |
[out] | rel_diff | relative and absolute differences between fixed and floating point sums |
[in] | commid | MPI communicator |
Definition at line 267 of file mod_oasis_reprosum.F90.
|
private |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on He and Ding's implementation of the double-double algorithm.
[in] | nsummands | number of local summands |
[in] | dsummands | declared first dimension |
[in] | nflds | number of fields |
[in] | arr | input array |
[in] | mpi_comm | MPI subcommunicator |
[out] | arr_gsum | global sums |
Definition at line 1281 of file mod_oasis_reprosum.F90.
|
private |
Compute the global sum of each field in "arr" using the indicated communicator with a reproducible yet scalable implementation based on a fixed point algorithm. The accuracy of the fixed point algorithm is controlled by the number of "levels" of integer expansion, the maximum value of which is specified by max_level.
[in] | nsummands | number of local summands |
[in] | dsummands | declared first dimension |
[in] | nflds | number of fields |
[in] | arr_max_shift | maximum safe exponent for value < 1 (so that sum does not overflow) |
[in] | arr_gmax_exp | exponents of global maxima |
[in] | max_levels | maximum number of levels of integer expansion |
[in] | max_level | maximum value in max_levels |
[in] | omp_nthreads | number of OpenMP threads |
[in] | mpi_comm | MPI subcommunicator |
[in] | arr | input array |
[in] | validate | flag indicating that accuracy of solution generated from arr_gmax_exp and max_levels should be tested |
[out] | recompute | flag indicating that either the upper bounds are inaccurate, or max_levels and arr_gmax_exp do not generate accurate enough sums |
[out] | arr_gsum | global means |
Definition at line 751 of file mod_oasis_reprosum.F90.
subroutine, public mod_oasis_reprosum::oasis_reprosum_setopts | ( | logical, intent(in), optional | repro_sum_use_ddpdd_in, |
real(r8), intent(in), optional | repro_sum_rel_diff_max_in, | ||
logical, intent(in), optional | repro_sum_recompute_in, | ||
logical, intent(in), optional | repro_sum_master, | ||
integer, intent(in), optional | repro_sum_logunit | ||
) |
Set runtime options.
[in] | repro_sum_use_ddpdd_in | Use DDPDD algorithm instead of fixed precision algorithm |
[in] | repro_sum_rel_diff_max_in | maximum permissible difference between reproducible and nonreproducible sums |
[in] | repro_sum_recompute_in | recompute using different algorithm when difference between reproducible and nonreproducible sums is too great |
[in] | repro_sum_master | flag indicating whether this process should output log messages |
[in] | repro_sum_logunit | unit number for log messages |
Definition at line 105 of file mod_oasis_reprosum.F90.
logical function, public mod_oasis_reprosum::oasis_reprosum_tolexceeded | ( | character(len=*), intent(in) | name, |
integer, intent(in) | nflds, | ||
logical, intent(in) | master, | ||
integer, intent(in), optional | logunit, | ||
real(r8), dimension(2,nflds), intent(in) | rel_diff | ||
) |
Test whether distributed sum exceeds tolerance and print out a warning message.
[in] | name | distributed sum identifier |
[in] | nflds | number of fields |
[in] | master | process that will write warning messages? |
[in] | logunit | unit warning messages written to |
[in] | rel_diff | relative and absolute differences between fixed and floating point sums |
Definition at line 1195 of file mod_oasis_reprosum.F90.
|
private |
Definition at line 1394 of file mod_oasis_reprosum.F90.
|
private |
Definition at line 89 of file mod_oasis_reprosum.F90.
logical, public mod_oasis_reprosum::oasis_reprosum_recompute = .false. |
Definition at line 73 of file mod_oasis_reprosum.F90.
real(r8), public mod_oasis_reprosum::oasis_reprosum_reldiffmax = -1.0_r8 |
Definition at line 75 of file mod_oasis_reprosum.F90.
|
private |
Definition at line 88 of file mod_oasis_reprosum.F90.