Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
uncommented parallelization
Browse files Browse the repository at this point in the history
  • Loading branch information
cwishard committed Oct 14, 2022
1 parent a65eed8 commit 13cf14b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")

# Set some options the user may choose
# Uncomment the below if you want the user to choose a parallelization library
#OPTION(USE_MPI "Use the MPI library for parallelization" OFF)
#OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF)
OPTION(USE_MPI "Use the MPI library for parallelization" OFF)
OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF)

# This INCLUDE statement executes code that sets the compile flags for DEBUG,
# RELEASE, and TESTING. You should review this file and make sure the flags
Expand Down
15 changes: 15 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ ADD_EXECUTABLE(${FOOEXE} ${FOO_src})
TARGET_LINK_LIBRARIES(${FOOEXE} ${NETCDF_LIBRARIES}
${NETCDFFORTRAN_LIBRARIES})

# Uncomment if you have parallization
IF(USE_OPENMP)
SET_TARGET_PROPERTIES(${FOOEXE} PROPERTIES
COMPILE_FLAGS "${OpenMP_Fortran_FLAGS}"
LINK_FLAGS "${OpenMP_Fortran_FLAGS}")
ELSEIF(USE_MPI)
SET_TARGET_PROPERTIES(${FOOEXE} PROPERTIES
COMPILE_FLAGS "${MPI_Fortran_COMPILE_FLAGS}"
LINK_FLAGS "${MPI_Fortran_LINK_FLAGS}")
INCLUDE_DIRECTORIES(${MPI_Fortran_INCLUDE_PATH})
TARGET_LINK_LIBRARIES(${FOOEXE} ${MPI_Fortran_LIBRARIES})
ENDIF(USE_OPENMP)



#####################################
# Tell how to install this executable
#####################################
Expand Down

0 comments on commit 13cf14b

Please sign in to comment.