[Dart-dev] DART/branches Revision: 12630

dart at ucar.edu dart at ucar.edu
Tue Jun 5 14:21:49 MDT 2018


nancy at ucar.edu
2018-06-05 14:21:49 -0600 (Tue, 05 Jun 2018)
304
remove never-used routines transpose_array() and
distribute_array().  very early on there was a question
about whether this was going to be done in the mpi routines
or in the ensemble manager.  these functions were always
done in the ensemble manager and apparently haven't been
needed, so remove them.




Modified: DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90	2018-06-05 20:20:19 UTC (rev 12629)
+++ DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90	2018-06-05 20:21:49 UTC (rev 12630)
@@ -108,7 +108,7 @@
 integer :: head_task = 0         ! def 0, but N-1 if reverse_task_layout true
 logical :: print4status = .true. ! minimal messages for async4 handshake
 
-character(len = 256) :: errstring, errstring1
+character(len = 256) :: errstring
 
 ! for broadcasts, pack small messages into larger ones.  remember that the
 ! byte size will be this count * 8 because we only communicate r8s.  (unless
@@ -740,28 +740,8 @@
 end subroutine receive_from
 
 
-
 !-----------------------------------------------------------------------------
 ! TODO: do i need to overload this for both integer and real?
-!       do i need to handle 1D, 2D, 3D inputs?
-
-subroutine transpose_array
-
-! not implemented here yet.  will have arguments -- several of them.
-
-if ( .not. module_initialized ) then
-   write(errstring, *) 'initialize_mpi_utilities() must be called first'
-   call error_handler(E_ERR,'transpose_array', errstring, source, revision, revdate)
-endif
-
-write(errstring, *) 'not implemented yet'
-call error_handler(E_ERR,'transpose_array', errstring, source, revision, revdate)
-
-end subroutine transpose_array
-
-
-!-----------------------------------------------------------------------------
-! TODO: do i need to overload this for both integer and real?
 !       do i need to handle 2D inputs?
 
 subroutine array_broadcast(array, root)
@@ -849,123 +829,6 @@
 
 
 !-----------------------------------------------------------------------------
-! TODO: do i need to overload this for both integer and real?
-!       do i need to handle 2D inputs?
-
-subroutine array_distribute(srcarray, root, dstarray, dstcount, how, which)
- real(r8), intent(in) :: srcarray(:)
- integer, intent(in) :: root
- real(r8), intent(out) :: dstarray(:)
- integer, intent(out) :: dstcount
- integer, intent(in) :: how
- integer, intent(out) :: which(:)
-
-! 'srcarray' on the root task will be distributed across all the tasks
-! into 'dstarray'.  dstarray must be large enough to hold each task's share
-! of the data.  The actual number of values returned on each task will be
-! passed back in the 'count' argument.  'how' is a flag to select how to
-! distribute the data (round-robin, contiguous chunks, etc).  'which' is an
-! integer index array which lists which of the original values were selected
-! and put into 'dstarray'.
-
-real(r8), allocatable :: localchunk(:)
-integer :: srccount, leftover
-integer :: i, tag, errcode
-logical :: iamroot
-integer :: status(MPI_STATUS_SIZE)
-
-if ( .not. module_initialized ) then
-   write(errstring, *) 'initialize_mpi_utilities() must be called first'
-   call error_handler(E_ERR,'array_distribute', errstring, source, revision, revdate)
-endif
-
-! simple idiotproofing
-if ((root < 0) .or. (root >= total_tasks)) then
-   write(errstring, '(a,i8,a,i8)') "root task id ", root, &
-                                   "must be >= 0 and < ", total_tasks
-   call error_handler(E_ERR,'array_broadcast', errstring, source, revision, revdate)
-endif
-
-iamroot = (root == myrank)
-tag = 1
-
-srccount = size(srcarray)
-
-! TODO: right now this code does contig chunks only
-! TODO: it should select on the 'how' argument
-dstcount = srccount / total_tasks
-leftover = srccount - (dstcount * total_tasks)
-if (myrank == total_tasks-1) dstcount = dstcount + leftover
-
-
-! idiotproofing, continued...
-if (size(dstarray) < dstcount) then
-   write(errstring, '(a,i8,a,i8)') "size of dstarray is", size(dstarray), & 
-                      " but must be >= ", dstcount
-   call error_handler(E_ERR,'array_broadcast', errstring, source, revision, revdate)
-endif


More information about the Dart-dev mailing list