[Dart-dev] DART/branches Revision: 12262

dart at ucar.edu dart at ucar.edu
Wed Jan 3 13:18:52 MST 2018


nancy at ucar.edu
2018-01-03 13:18:52 -0700 (Wed, 03 Jan 2018)
336
version of the mpi utilities that work with the nag compiler.
they have different interfaces to system(), sleep() and exit()
so for now i can't make them the same as the other versions
without invoking the preprocessor for some small conditional
code sections.  i'm committing these under different names so
we don't lose the changes.




Copied: DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.nag.f90 (from rev 12261, DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.f90)
===================================================================
--- DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.nag.f90	                        (rev 0)
+++ DART/branches/recam/assimilation_code/modules/utilities/mpi_utilities_mod.nag.f90	2018-01-03 20:18:52 UTC (rev 12262)
@@ -0,0 +1,2084 @@
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+!
+! $Id$
+
+
+!> A collection of interfaces to the MPI (Message Passing Interface)
+!> multi-processor communication library routines.
+!>
+!> All MPI routines are called from here.  There is a companion
+!> file which has the same module name and entry points but all
+!> routines are stubs.  This allows a single-task version of the
+!> code to be compiled without the MPI libraries.
+!>
+
+module mpi_utilities_mod
+
+use types_mod, only :  i8, r8, digits12
+use utilities_mod, only : register_module, error_handler, & 
+                          E_ERR, E_WARN, E_MSG, E_DBG, get_unit, close_file, &
+                          set_output, set_tasknum, initialize_utilities,     &
+                          finalize_utilities,                                &
+                          nmlfileunit, do_output, do_nml_file, do_nml_term,  &
+                          find_namelist_in_file, check_namelist_read
+
+use time_manager_mod, only : time_type, get_time, set_time
+
+! BUILD TIP 1
+! Many MPI installations have an MPI module; if one is present, use it.
+! ('use mpi')
+! If not, there will be an MPI include file which defines the parameters.
+! ('include mpif.h')
+! Use one but not both.   The 'use' line must be before the 'implicit none' 
+! and 'private' lines, 'include' must come after.  Go figure.
+! For more help on compiling a module which uses MPI see the 
+! $DART/developer_tests/mpi_utilities/tests/README
+
+use mpi
+
+! the NAG compiler needs these special definitions enabled
+! but we don't preprocess this file (why?) so you have to
+! 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)
+   !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
+!#endif
+
+implicit none
+private
+
+!include "mpif.h"
+
+
+! BUILD TIP 2
+! Some compilers require an interface block for the system() function;
+! some fail if you define one.  If you get an error at link time (something
+! like 'undefined symbol _system_') try running the fixsystem script in
+! 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_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
+interface sum_across_tasks
+   module procedure sum_across_tasks_int4
+   module procedure sum_across_tasks_int8
+   module procedure sum_across_tasks_real
+end interface
+
+!   ---- private data for mpi_utilities ----
+


More information about the Dart-dev mailing list