[Dart-dev] DART/branches Revision: 12639
dart at ucar.edu
dart at ucar.edu
Wed Jun 6 16:11:25 MDT 2018
hendric at ucar.edu
2018-06-06 16:11:25 -0600 (Wed, 06 Jun 2018)
286
merging closest_member_tool back onto the rma_trunk.
closest_member_tool now is able to run in paralell
for models that do not fit into memory for a single
node, and gives output to a single text file to make
scripting easier when using the closest member for
future model advances.
Index: DART/branches/rma_trunk
===================================================================
--- DART/branches/rma_trunk 2018-06-06 21:36:43 UTC (rev 12638)
+++ DART/branches/rma_trunk 2018-06-06 22:11:25 UTC (rev 12639)
Property changes on: DART/branches/rma_trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -12,6 +12,7 ##
/DART/branches/rma_cf_conventions:9727-10086
/DART/branches/rma_cice:10649-10852
/DART/branches/rma_clm:8905-9126
+/DART/branches/rma_closest_member_tool:12576-12617
/DART/branches/rma_diag:9623-9737
/DART/branches/rma_fix_clm_restarts:9634-11919
/DART/branches/rma_fixed_filenames:10702-10895
Modified: DART/branches/rma_trunk/assimilation_code/modules/utilities/mpi_utilities_mod.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/modules/utilities/mpi_utilities_mod.f90 2018-06-06 21:36:43 UTC (rev 12638)
+++ DART/branches/rma_trunk/assimilation_code/modules/utilities/mpi_utilities_mod.f90 2018-06-06 22:11:25 UTC (rev 12639)
@@ -107,7 +107,7 @@
broadcast_send, broadcast_recv, shell_execute, sleep_seconds, &
sum_across_tasks, get_dart_mpi_comm, datasize, send_minmax_to, &
get_from_fwd, get_from_mean, broadcast_minmax, broadcast_flag, &
- start_mpi_timer, read_mpi_timer, &
+ start_mpi_timer, read_mpi_timer, send_sum_to, &
all_reduce_min_max ! deprecated, replace by broadcast_minmax
! version controlled file description for error handling, do not edit
@@ -1492,7 +1492,6 @@
end subroutine sum_across_tasks_real
-
!-----------------------------------------------------------------------------
! pipe-related utilities
!-----------------------------------------------------------------------------
@@ -1885,6 +1884,27 @@
!-----------------------------------------------------------------------------
!-----------------------------------------------------------------------------
+! Collect sum across tasks for a given array.
+subroutine send_sum_to(local_val, task, global_val)
+
+real(r8), intent(in) :: local_val(:) !> min max on each task
+integer, intent(in) :: task !> task to collect on
+real(r8), intent(out) :: global_val(:) !> only concerned with this on task collecting result
+
+integer :: errcode
+
+if ( .not. module_initialized ) then
+ write(errstring, *) 'initialize_mpi_utilities() must be called first'
+ call error_handler(E_ERR,'send_sum_to', errstring, source, revision, revdate)
+endif
+
+! collect values on a single given task
+call mpi_reduce(local_val(:), global_val(:), size(global_val), datasize, MPI_SUM, task, get_dart_mpi_comm(), errcode)
+
+end subroutine send_sum_to
+
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
! Collect min and max on task.
subroutine send_minmax_to(minmax, task, global_val)
Modified: DART/branches/rma_trunk/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 2018-06-06 21:36:43 UTC (rev 12638)
+++ DART/branches/rma_trunk/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 2018-06-06 22:11:25 UTC (rev 12639)
@@ -49,12 +49,12 @@
! !!SYSTEM_BLOCK_EDIT START COMMENTED_OUT
! ! interface block for getting return code back from system() routine
! interface
-! function system(string)
+! function system(string)
! character(len=*) :: string
-! integer :: system
+! integer :: system
! end function system
! end interface
-! ! end block
+! ! end block
! !!SYSTEM_BLOCK_EDIT END COMMENTED_OUT
@@ -76,7 +76,7 @@
broadcast_send, broadcast_recv, shell_execute, sleep_seconds, &
sum_across_tasks, send_minmax_to, datasize, &
get_from_fwd, get_from_mean, broadcast_minmax, broadcast_flag, &
- start_mpi_timer, read_mpi_timer, &
+ start_mpi_timer, read_mpi_timer, send_sum_to, &
all_reduce_min_max ! deprecated, replace with broadcast_minmax
! version controlled file description for error handling, do not edit
@@ -603,8 +603,25 @@
end function get_dart_mpi_comm
+!-----------------------------------------------------------------------------
+!-----------------------------------------------------------------------------
More information about the Dart-dev
mailing list