From c439c3dc5d533c74ca7df25759009eb89d81af9a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 14 Jan 2014 20:34:29 -0500 Subject: [PATCH] Change OPENMP macro to _OPENMP which is automatically defined when compiling with OpenMP. --- src/Makefile | 6 +++--- src/eigenvalue.F90 | 4 ++-- src/global.F90 | 6 +++--- src/initialize.F90 | 6 +++--- src/input_xml.F90 | 2 +- src/output.F90 | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Makefile b/src/Makefile index 03c370e07..00abca489 100644 --- a/src/Makefile +++ b/src/Makefile @@ -181,17 +181,17 @@ endif ifeq ($(OPENMP),yes) ifeq ($(COMPILER),intel) - F90FLAGS += -openmp -DOPENMP + F90FLAGS += -openmp LDFLAGS += -openmp endif ifeq ($(COMPILER),gnu) - F90FLAGS += -fopenmp -DOPENMP + F90FLAGS += -fopenmp LDFLAGS += -fopenmp endif ifeq ($(COMPILER),ibm) - F90FLAGS += -qsmp=omp -WF,-DOPENMP + F90FLAGS += -qsmp=omp LDFLAGS += -qsmp=omp endif endif diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index f5375bf3a..4047f815f 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -166,7 +166,7 @@ contains subroutine finalize_generation() -#ifdef OPENMP +#ifdef _OPENMP ! Join the fission bank from each thread into one global fission bank call join_bank_from_threads() #endif @@ -821,7 +821,7 @@ contains end subroutine replay_batch_history -#ifdef OPENMP +#ifdef _OPENMP !=============================================================================== ! JOIN_BANK_FROM_THREADS !=============================================================================== diff --git a/src/global.F90 b/src/global.F90 index 637ea315e..c3dbf0aa2 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -158,7 +158,7 @@ module global ! Source and fission bank type(Bank), allocatable, target :: source_bank(:) type(Bank), allocatable, target :: fission_bank(:) -#ifdef OPENMP +#ifdef _OPENMP type(Bank), allocatable, target :: master_fission_bank(:) #endif integer(8) :: n_bank ! # of sites in fission bank @@ -205,7 +205,7 @@ module global integer :: MPI_BANK ! MPI datatype for fission bank integer :: MPI_TALLYRESULT ! MPI datatype for TallyResult -#ifdef OPENMP +#ifdef _OPENMP integer :: n_threads = NONE ! number of OpenMP threads integer :: thread_id ! ID of a given thread #endif @@ -438,7 +438,7 @@ contains !$omp parallel if (allocated(fission_bank)) deallocate(fission_bank) !$omp end parallel -#ifdef OPENMP +#ifdef _OPENMP if (allocated(master_fission_bank)) deallocate(master_fission_bank) #endif if (allocated(source_bank)) deallocate(source_bank) diff --git a/src/initialize.F90 b/src/initialize.F90 index b75fa20ef..9f495e4ac 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -26,7 +26,7 @@ module initialize use mpi #endif -#ifdef OPENMP +#ifdef _OPENMP use omp_lib #endif @@ -372,7 +372,7 @@ contains ! Read number of threads i = i + 1 -#ifdef OPENMP +#ifdef _OPENMP ! Read and set number of OpenMP threads n_threads = str_to_int(argv(i)) if (n_threads < 1) then @@ -830,7 +830,7 @@ contains call fatal_error() end if -#ifdef OPENMP +#ifdef _OPENMP ! If OpenMP is being used, each thread needs its own private fission ! bank. Since the private fission banks need to be combined at the end of a ! generation, there is also a 'master_fission_bank' that is used to collect diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 3ce3c9d0d..ae4e4b1b2 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -228,7 +228,7 @@ contains ! Number of OpenMP threads if (check_for_node(doc, "threads")) then -#ifdef OPENMP +#ifdef _OPENMP if (n_threads == NONE) then call get_node_value(doc, "threads", n_threads) if (n_threads < 1) then diff --git a/src/output.F90 b/src/output.F90 index 677c35396..3e31ad718 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -31,7 +31,7 @@ contains subroutine title() -#ifdef OPENMP +#ifdef _OPENMP use omp_lib #endif @@ -69,7 +69,7 @@ contains trim(to_str(n_procs)) #endif -#ifdef OPENMP +#ifdef _OPENMP ! Write number of OpenMP threads write(UNIT=OUTPUT_UNIT, FMT='(6X,"OpenMP Threads:",1X,A)') & trim(to_str(omp_get_max_threads()))