Commits

Craig Rasmussen committed 0062bae Merge

Merging with Jeff's commits, no files merged.

Comments (0)

Files changed (5)

ompi/config/ompi_setup_mpi_fortran.m4

                        [$OMPI_FORTRAN_HAVE_ASYNCHRONOUS],
                        [For ompi/mpi/fortran/use-mpi-f08/blah.F90 and blah.h and ompi_info: whether the compiler supports the "asynchronous" keyword or not])
 
+    # For ompi/include/mpif-config.h, define whether ASYNCHRONOUS
+    # works the way MPI-3.0 needs it to or no.  For the moment (Oct
+    # 2012), no compiler does this yet.  So just use the value as to
+    # whether the compiler even *has* the ASYNCHRONOUS keyword or not.
+    AS_IF([test "$OMPI_FORTRAN_HAVE_ASYNCHRONOUS" = "1"],
+          [OMPI_FORTRAN_ASYNC_PROTECTS_NONBLOCKING=.TRUE.],
+          [OMPI_FORTRAN_ASYNC_PROTECTS_NONBLOCKING=.FALSE.])
+    AC_SUBST([OMPI_FORTRAN_ASYNC_PROTECTS_NONBLOCKING])
+
     # For configure-fortran-output.h, various files in
     # ompi/mpi/fortran/use-mpi-f08/*.F90 and *.h files (and ompi_info)
     AC_SUBST([OMPI_FORTRAN_HAVE_PROCEDURE])

ompi/include/mpif-config.h.in

       parameter (MPI_MAX_INFO_VAL=@OPAL_MAX_INFO_VAL@-1)
       parameter (MPI_MAX_PORT_NAME=@OPAL_MAX_PORT_NAME@-1)
       parameter (MPI_MAX_DATAREP_STRING=@OPAL_MAX_DATAREP_STRING@-1)
+!
+!     Are we building subarray support?
+!
+      logical MPI_SUBARRAYS_SUPPORTED
+      parameter (MPI_SUBARRAYS_SUPPORTED=@OMPI_FORTRAN_SUBARRAYS_SUPPORTED@)
+!
+!     Does ASYNCHRONOUS work the way MPI-3.0 needs it to?
+!
+      logical MPI_ASYNC_PROTECTS_NONBLOCKING
+      parameter (MPI_ASYNC_PROTECTS_NONBLOCKING=@OMPI_FORTRAN_ASYNC_PROTECTS_NONBLOCKING@)
+

ompi/include/mpif-values.pl

 
 #----------------------------------------------------------------------------
 
+# Handles that are of type INTEGER
+
 my $handles;
 
 $handles->{MPI_COMM_WORLD} = 0;
 
 #----------------------------------------------------------------------------
 
+# IO handles that are of type INTEGER
+
 my $io_handles;
 
 $io_handles->{MPI_FILE_NULL} = 0;
 
 #----------------------------------------------------------------------------
 
-## New constants (Fortran only) introduced in MPI-3
-#
-my $logical_constants;
-
-$logical_constants->{MPI_SUBARRAYS_SUPPORTED} = ".FALSE.";
-$logical_constants->{MPI_ASYNC_PROTECTS_NONBLOCKING} = ".FALSE.";
+# Constants that are of type INTEGER
 
 my $constants;
 
 
 #----------------------------------------------------------------------------
 
+# IO constants that are of type INTEGER
+
 my $io_constants;
 
 $io_constants->{MPI_SEEK_SET} = 600;
 
 ';
 
-sub write_fortran_constants {
-    my ($header, $file) = @_;
-
-    foreach my $key (sort(keys(%{$constants}))) {
-        $header .= "        integer $key\n";
-    }
-    $header .= "\n";
-    foreach my $key (sort(keys(%{$constants}))) {
-        $header .= "        parameter ($key=$constants->{$key})\n";
-    }
-
-    $header .= "\n";
-    foreach my $key (sort(keys(%{$logical_constants}))) {
-        $header .= "        logical $key\n";
-    }
-    $header .= "\n";
-    foreach my $key (sort(keys(%{$logical_constants}))) {
-        $header .= "        parameter ($key=$logical_constants->{$key})\n";
-    }
-
-    write_file($file, $header);
-}
-
 sub write_fortran_file {
     my ($header, $vals, $file) = @_;
 
     write_file($file, $header);
 }
 
-write_fortran_constants($header,
-                   "$topdir/ompi/include/mpif-constants.h");
 write_fortran_file($header, $handles, 
                    "$topdir/ompi/include/mpif-handles.h");
+write_fortran_file($header, $constants, 
+                   "$topdir/ompi/include/mpif-constants.h");
 write_fortran_file($header, $io_handles, 
                    "$topdir/ompi/include/mpif-io-handles.h");
 write_fortran_file($header, $io_constants, 

ompi/mpi/fortran/base/f08-interfaces.pl

         my $i = $vals->{$key};
         my $entity = (defined($i->{function})) ? "function" : "subroutine";
 
-        print Dumper($i);
+#        print Dumper($i);
 
         $header .= "interface  $key\n";
         my $name = $key . "_f08";

ompi/mpi/fortran/tests/src/test_comm_spawn.f90

 !
 !=====================================================================
 
-Use  ::  MPI_F08
-Implicit None
-
-Integer             ::  maxprocs(2) = [1, 1]
-Integer             ::  root        = 0
-Integer             ::  errcodes(2), err
-
-Character(len=32)   ::  cmd
-Character(len=32)   ::  cmds(2)
-Character(len=32)   ::  argv(3)
-Character(len=32)   ::  argvs(2,3)
-
-Type(MPI_COMM)      ::  intercomm
-Type(MPI_INFO)      ::  info(2)
-
-Interface
-  integer function check_argv(argv, len) &
-     BIND(C, name="check_argv")
-     use, intrinsic :: ISO_C_BINDING, only : C_CHAR, C_INT
-     implicit none
-     character(kind=C_CHAR), dimension(*), intent(in) :: argv
-     integer(C_INT), value, intent(in) :: len
-  end function check_argv
-
-  integer function check_argvs(count, argvs, len) &
-     BIND(C, name="check_argvs")
-     use, intrinsic :: ISO_C_BINDING, only : C_CHAR, C_INT
-     implicit none
-     character(kind=C_CHAR), dimension(*), intent(in) :: argvs
-     integer(C_INT), value, intent(in) :: count, len
-  end function check_argvs
-End Interface
-
+  Use  ::  MPI_F08
+  Implicit None
+  
+  Integer             ::  maxprocs(2) = [1, 1]
+  Integer             ::  root        = 0
+  Integer             ::  errcodes(2), err
+  
+  Character(len=32)   ::  cmd
+  Character(len=32)   ::  cmds(2)
+  Character(len=32)   ::  argv(3)
+  Character(len=32)   ::  argvs(2,3)
+  
+  Type(MPI_COMM)      ::  intercomm
+  Type(MPI_INFO)      ::  info(2)
+  
+  Interface
+     integer function check_argv(argv, len) &
+          BIND(C, name="check_argv")
+       use, intrinsic :: ISO_C_BINDING, only : C_CHAR, C_INT
+       implicit none
+       character(kind=C_CHAR), dimension(*), intent(in) :: argv
+       integer(C_INT), value, intent(in) :: len
+     end function check_argv
+     
+     integer function check_argvs(count, argvs, len) &
+          BIND(C, name="check_argvs")
+       use, intrinsic :: ISO_C_BINDING, only : C_CHAR, C_INT
+       implicit none
+       character(kind=C_CHAR), dimension(*), intent(in) :: argvs
+       integer(C_INT), value, intent(in) :: count, len
+     end function check_argvs
+  End Interface
+  
 !---------------------------------------------------------------------
 
-cmd = "test_init_finalize"
-
-argv(1) = "cmd1_arg1"
-argv(2) = "cmd1_arg2"
-argv(3) = " "
-
-err = check_argv(argv, len(argv))
-if (err /= 0) stop "check_argv failure"
-
-cmds(1) = "test_init_finalize"
-cmds(2) = "test_proc_name"
-
-argvs(1,1) = "cmd1_arg1"
-argvs(1,2) = "cmd1_arg2"
-argvs(1,3) = " "
-
-argvs(2,1) = "cmd2_arg1"
-argvs(2,2) = "cmd2_arg2"
-argvs(2,3) = " "
-
-err = check_argvs(2, argvs, len(argvs))
-if (err /= 0) stop "check_argvs failure"
-
-Call MPI_Init
-
-info(1) = MPI_INFO_NULL
-info(2) = MPI_INFO_NULL
-
-Call MPI_Comm_spawn(cmd, argv, maxprocs(1), info(1), root, MPI_COMM_WORLD, &
-                    intercomm, errcodes, err)
-if (err /= 0) stop "MPI_Comm_spawn failure"
-
-Call MPI_Comm_spawn_multiple(2, cmds, argvs, maxprocs, info, root, MPI_COMM_WORLD, &
-                    intercomm, errcodes, err)
-if (err /= 0) stop "MPI_Comm_spawn failure"
-
-Call MPI_Finalize
-
+  cmd = "test_init_finalize"
+  
+  argv(1) = "cmd1_arg1"
+  argv(2) = "cmd1_arg2"
+  argv(3) = " "
+  
+  err = check_argv(argv, len(argv))
+  if (err /= 0) stop "check_argv failure"
+  
+  cmds(1) = "test_init_finalize"
+  cmds(2) = "test_proc_name"
+  
+  argvs(1,1) = "cmd1_arg1"
+  argvs(1,2) = "cmd1_arg2"
+  argvs(1,3) = " "
+  
+  argvs(2,1) = "cmd2_arg1"
+  argvs(2,2) = "cmd2_arg2"
+  argvs(2,3) = " "
+  
+  err = check_argvs(2, argvs, len(argvs))
+  if (err /= 0) stop "check_argvs failure"
+  
+  Call MPI_Init
+  
+  info(1) = MPI_INFO_NULL
+  info(2) = MPI_INFO_NULL
+  
+  Call MPI_Comm_spawn(cmd, argv, maxprocs(1), info(1), root, MPI_COMM_WORLD, &
+       intercomm, errcodes, err)
+  if (err /= 0) stop "MPI_Comm_spawn failure"
+  
+  Call MPI_Comm_spawn_multiple(2, cmds, argvs, maxprocs, info, root, MPI_COMM_WORLD, &
+       intercomm, errcodes, err)
+  if (err /= 0) stop "MPI_Comm_spawn failure"
+  
+  Call MPI_Finalize
+  
 End Program test_comm_spawn