[Dart-dev] DART/branches Revision: 12263
dart at ucar.edu
dart at ucar.edu
Wed Jan 3 13:25:49 MST 2018
nancy at ucar.edu
2018-01-03 13:25:48 -0700 (Wed, 03 Jan 2018)
258
commit updates to the standard mpi utils that isolate
the call to system() for ease in switching between
the nag and non-nag versions, and commit minor updates
to the nag versions. these only differ in about 10 lines;
i'd love to consolidate them somehow.
Modified: DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90 2018-01-03 20:18:52 UTC (rev 12262)
+++ DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90 2018-01-03 20:25:48 UTC (rev 12263)
@@ -43,20 +43,7 @@
! edit this by hand for NAG.
!#ifdef __NAG__
- !use F90_unix_proc, only : sleep, system, exit
- !! block for NAG compiler
- ! PURE SUBROUTINE SLEEP(SECONDS,SECLEFT)
- ! INTEGER,INTENT(IN) :: SECONDS
- ! INTEGER,OPTIONAL,INTENT(OUT) :: SECLEFT
- !
- ! SUBROUTINE SYSTEM(STRING,STATUS,ERRNO)
- ! CHARACTER*(*),INTENT(IN) :: STRING
- ! INTEGER,OPTIONAL,INTENT(OUT) :: STATUS,ERRNO
- !
- !!also used in exit_all outside this module
- ! SUBROUTINE EXIT(STATUS)
- ! INTEGER,OPTIONAL :: STATUS
- !! end block
+! use F90_unix_proc, only : sleep, system, exit
!#endif
implicit none
@@ -72,16 +59,16 @@
! this directory. It is a sed script that comments in and out the interface
! block below. Please leave the BLOCK comment lines unchanged.
- !!SYSTEM_BLOCK_EDIT START COMMENTED_IN
- ! interface block for getting return code back from system() routine
- interface
- function system(string)
- character(len=*) :: string
- integer :: system
- end function system
- end interface
- ! end block
- !!SYSTEM_BLOCK_EDIT END COMMENTED_IN
+! !!SYSTEM_BLOCK_EDIT START COMMENTED_OUT
+! ! interface block for getting return code back from system() routine
+! interface
+! function system(string)
+! character(len=*) :: string
+! integer :: system
+! end function system
+! end interface
+! ! end block
+! !!SYSTEM_BLOCK_EDIT END COMMENTED_OUT
! allow global sum to be computed for integers, r4, and r8s
@@ -1383,7 +1370,8 @@
!-----------------------------------------------------------------------------
! overloaded global reduce routines
-! The external32 representations of the datatypes returned by MPI_TYPE_CREATE_F90_REAL/COMPLEX/INTEGER are given by the following rules.
+! The external32 representations of the datatypes returned by
+! MPI_TYPE_CREATE_F90_REAL/COMPLEX/INTEGER are given by the following rules.
! For MPI_TYPE_CREATE_F90_REAL:
!
! if (p > 33) or (r > 4931) then external32 representation
@@ -1539,12 +1527,12 @@
if (async4_verbose) then
write(*,*) 'checking master task host'
- rc = system('echo master task running on host `hostname`'//' '//char(0))
+ call do_system('echo master task running on host `hostname`', rc)
if (rc /= 0) write(*, *) 'system command returned nonzero rc, ', rc
endif
if (async4_verbose .or. print4status) write(*,*) 'MPI job telling script to advance model'
- rc = system('echo advance > '//trim(non_pipe)//' '//char(0))
+ call do_system('echo advance > '//trim(non_pipe), rc)
if (async4_verbose .and. rc /= 0) write(*, *) 'system command returned nonzero rc, ', rc
endif
@@ -1553,16 +1541,16 @@
if (async4_verbose) then
write(*,*) 'checking master task host'
- rc = system('echo master task running on host `hostname`'//' '//char(0))
+ call do_system('echo master task running on host `hostname`', rc)
if (rc /= 0) write(*, *) 'system command returned nonzero rc, ', rc
endif
if (async4_verbose .or. print4status) write(*,*) 'MPI job telling script to advance model'
- rc = system('echo advance > '//trim(filter_to_model)//' '//char(0))
+ call do_system('echo advance > '//trim(filter_to_model), rc)
if (async4_verbose .and. rc /= 0) write(*, *) 'system command returned nonzero rc, ', rc
if (async4_verbose) write(*,*) 'MPI job now waiting to read from lock file'
- rc = system('cat < '//trim(model_to_filter)//'> /dev/null '//char(0))
+ call do_system('cat < '//trim(model_to_filter)//'> /dev/null', rc)
if (async4_verbose .and. rc /= 0) write(*, *) 'system command returned nonzero rc, ', rc
else
@@ -1574,24 +1562,24 @@
if (async4_verbose) then
More information about the Dart-dev
mailing list