Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seacas parallel netcdf detect #7368

Merged
merged 6 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion cmake/tribits/common_tpls/FindTPLNetcdf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ IF (Netcdf_ALLOW_PREFIND)
"True if netcdf enables netcdf-4")
set(TPL_Netcdf_Enables_PNetcdf ${NetCDF_NEEDS_PNetCDF} CACHE BOOL
"True if netcdf enables pnetcdf")
set(TPL_Netcdf_PARALLEL ${NetCDF_PARALLEL} CACHE BOOL
set(TPL_Netcdf_PARALLEL ${NetCDF_PARALLEL} CACHE INTERNAL
"True if netcdf compiled with parallel enabled")
set(TPL_Netcdf_LIBRARY_DIRS ${_hdf5_LIBRARY_SEARCH_DIRS} CACHE PATH
"${DOCSTR} library files")
Expand Down Expand Up @@ -103,3 +103,30 @@ TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( Netcdf
# variables TPL_Netcdf_INCLUDE_DIRS and TPL_Netcdf_LIBRARIES and then print
# them out (and set some other standard variables as well). This is the final
# "hook" into the TriBITS TPL system.

# If the `find_package(NetCDF)` is not run, then this may not be set
# Need to determine how this is set in the library that is being used...

if ("${TPL_Netcdf_PARALLEL}" STREQUAL "")
ASSERT_DEFINED(TPL_Netcdf_INCLUDE_DIRS)
find_path(meta_path
NAMES "netcdf_meta.h"
HINTS ${TPL_Netcdf_INCLUDE_DIRS}
NO_DEFAULT_PATH)

if (meta_path)
# Search meta for NC_HAS_PARALLEL setting...
# Note that there is both NC_HAS_PARALLEL and NC_HAS_PARALLEL4, only want first...
file(STRINGS "${meta_path}/netcdf_meta.h" netcdf_par_string REGEX "NC_HAS_PARALLEL ")
string(REGEX MATCH "[01]" netcdf_par_val "${netcdf_par_string}")
if (netcdf_par_val EQUAL 1)
set(TPL_Netcdf_PARALLEL True CACHE INTERNAL
"True if netcdf compiled with parallel enabled")
endif()
endif()
if ("${TPL_Netcdf_PARALLEL}" STREQUAL "")
set(TPL_Netcdf_PARALLEL False CACHE INTERNAL
"True if netcdf compiled with parallel enabled")
endif()
endif()
message(STATUS "TPL_Netcdf_PARALLEL is ${TPL_Netcdf_PARALLEL}")
2 changes: 1 addition & 1 deletion packages/seacas/applications/epu/pepu.C
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// concatenates EXODUS/GENESIS output from parallel processors to a single file

#include <exodusII.h>
#ifdef PARALLEL_AWARE_EXODUS
#ifdef SEACAS_HAVE_MPI
#ifndef DISABLE_PARALLEL_EPU
#define ENABLE_PARALLEL_EPU 1
#endif
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/exodus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES(

FILE(GLOB SOURCES src/ex_*.c)

if (${TPL_Netcdf_PARALLEL})
if (TPL_Netcdf_PARALLEL)
SET(PARALLEL_AWARE_EXODUS ON)
endif()

Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ IF (${PROJECT_NAME}_ENABLE_Pamgen)
SET(SEACAS_HAVE_PAMGEN ON)
ENDIF()

IF (${TPL_ENABLE_MPI})
IF (TPL_ENABLE_MPI)
SET(SEACAS_HAVE_MPI ON)
ENDIF()

IF (TPL_ENABLE_DataWarp)
SET(SEACAS_HAVE_DATAWARP ON)
ENDIF()

IF (${TPL_ENABLE_CGNS})
IF (TPL_ENABLE_CGNS)
SET(SEACAS_HAVE_CGNS ON)
ENDIF()

Expand Down
6 changes: 0 additions & 6 deletions packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33")
#include <SEACASIoss_config.h>
#endif

#if defined(PARALLEL_AWARE_EXODUS)
#ifndef SEACAS_HAVE_MPI
#define SEACAS_HAVE_MPI
#endif
#endif

#if defined(IOSS_THREADSAFE)
#include <mutex>
#endif
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})
APPEND_GLOB(HEADERS ${DIR}/*.h)
APPEND_GLOB(SOURCES ${DIR}/*.C)

IF (NOT TPL_ENABLE_MPI)
IF (NOT TPL_Netcdf_PARALLEL)
LIST(REMOVE_ITEM SOURCES ${DIR}/Ioex_ParallelDatabaseIO.C ${DIR}/Ioex_DecompositionData.C)
LIST(REMOVE_ITEM HEADERS ${DIR}/Ioex_ParallelDatabaseIO.h ${DIR}/Ioex_DecompositionData.h)
ENDIF()
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ IF (SEACASIoss_ENABLE_THREADSAFE)
)

SET(IOSHELL_ARG --in_type generated 10x10x10+shell:xXyYzZ+sideset:xXyY+times:2+variables:element,2,nodal,3,sideset,4)
IF ($(TPL_ENABLE_MPI))
IF (TPL_ENABLE_MPI)
gsjaardema marked this conversation as resolved.
Show resolved Hide resolved
TRIBITS_ADD_ADVANCED_TEST(
io_shell_ts
TEST_0 NOEXEPREFIX NOEXESUFFIX EXEC io_shell_ts ARGS ${IOSHELL_ARG} gen-shell-ts.g
Expand Down Expand Up @@ -374,7 +374,7 @@ TRIBITS_ADD_ADVANCED_TEST(unstructured_cgns_to_exodus
XHOSTTYPE Windows
)

IF ($(TPL_ENABLE_MPI))
IF (TPL_ENABLE_MPI)
TRIBITS_ADD_ADVANCED_TEST(structured_cgns_to_unstructured
TEST_0 EXEC struc_to_unstruc ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test/sparc1.cgns exodus_struc.e
NOEXEPREFIX NOEXESUFFIX
Expand Down