From bb056d597e259a2c2d61a3470619ab5ff283a6b7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 15 Oct 2018 10:52:27 -0500 Subject: [PATCH] Remove MPI intracomm from Fortran side --- CMakeLists.txt | 4 ---- src/hdf5_interface.F90 | 3 --- src/initialize.F90 | 30 +----------------------------- src/message_passing.F90 | 20 +++----------------- 4 files changed, 4 insertions(+), 53 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84f21427ae..c16d726629 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ option(profile "Compile with profiling flags" OFF) option(debug "Compile with debug flags" OFF) option(optimize "Turn on all compiler optimization flags" OFF) option(coverage "Compile with coverage analysis flags" OFF) -option(mpif08 "Use Fortran 2008 MPI interface" OFF) option(dagmc "Enable support for DAGMC (CAD) geometry" OFF) # Maximum number of nested coordinates levels @@ -474,9 +473,6 @@ if (HDF5_IS_PARALLEL) endif() if (MPI_ENABLED) target_compile_definitions(libopenmc PUBLIC -DOPENMC_MPI) - if (mpif08) - target_compile_definitions(libopenmc PRIVATE -DOPENMC_MPIF08) - endif() endif() # Set git SHA1 hash as a compile definition diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 8872a84f6a..7856abb507 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -13,9 +13,6 @@ module hdf5_interface use, intrinsic :: ISO_C_BINDING use error, only: fatal_error -#ifdef PHDF5 - use message_passing, only: mpi_intracomm, MPI_INFO_NULL -#endif use string, only: to_c_string, to_f_string implicit none diff --git a/src/initialize.F90 b/src/initialize.F90 index 697fc12354..3d805c97d5 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -49,45 +49,17 @@ contains ! setting up timers, etc. !=============================================================================== - function openmc_init_f(intracomm) result(err) bind(C) - integer, intent(in), optional :: intracomm ! MPI intracommunicator + function openmc_init_f() result(err) bind(C) integer(C_INT) :: err #ifdef _OPENMP character(MAX_WORD_LEN) :: envvar #endif - ! Copy the communicator to a new variable. This is done to avoid changing - ! the signature of this subroutine. If MPI is being used but no communicator - ! was passed, assume MPI_COMM_WORLD. -#ifdef OPENMC_MPI -#ifdef OPENMC_MPIF08 - type(MPI_Comm), intent(in) :: comm ! MPI intracommunicator - if (present(intracomm)) then - comm % MPI_VAL = intracomm - else - comm = MPI_COMM_WORLD - end if -#else - integer :: comm - if (present(intracomm)) then - comm = intracomm - else - comm = MPI_COMM_WORLD - end if -#endif -#endif - ! Start total and initialization timer call time_total%start() call time_initialize%start() -#ifdef OPENMC_MPI - ! Indicate that MPI is turned on - mpi_enabled = .true. - mpi_intracomm = intracomm -#endif - #ifdef _OPENMP ! Change schedule of main parallel-do loop if OMP_SCHEDULE is set call get_environment_variable("OMP_SCHEDULE", envvar) diff --git a/src/message_passing.F90 b/src/message_passing.F90 index 05219f0f89..37d2034475 100644 --- a/src/message_passing.F90 +++ b/src/message_passing.F90 @@ -2,26 +2,12 @@ module message_passing use, intrinsic :: ISO_C_BINDING -#ifdef OPENMC_MPI -#ifdef OPENMC_MPIF08 - use mpi_f08 -#else - use mpi -#endif -#endif - - ! The defaults set here for the number of processors, rank, and master and - ! mpi_enabled flag are for when MPI is not being used at all, i.e. a serial - ! run. In this case, these variables are still used at times. + ! The defaults set here for the number of processors, rank, and master and are + ! for when MPI is not being used at all, i.e. a serial run. In this case, these + ! variables are still used at times. integer(C_INT), bind(C, name='openmc_n_procs') :: n_procs = 1 ! number of processes integer(C_INT), bind(C, name='openmc_rank') :: rank = 0 ! rank of process logical(C_BOOL), bind(C, name='openmc_master') :: master = .true. ! master process? - logical :: mpi_enabled = .false. ! is MPI in use and initialized? -#ifdef OPENMC_MPIF08 - type(MPI_Comm) :: mpi_intracomm ! MPI intra-communicator -#else - integer :: mpi_intracomm ! MPI intra-communicator -#endif end module message_passing