Skip to content
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
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Notable changes include:
couple damaged to undamaged material.
* planeStrain has been removed as an option in FSISPH as part of unifying deviatoric evolution with other
hydros.
* LEOS (Livermore Equation Of State) package now available in Spheral. Requires access to the LEOS
package itself, which most folks outside LLNL will not necessarily have.

* Build changes / improvements:
* Native Spack environments are now being used.
Expand Down
15 changes: 9 additions & 6 deletions cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ else()
add_subdirectory(${chai_DIR})
endif()

list(APPEND SPHERAL_BLT_DEPENDS chai camp RAJA umpire)
list(APPEND SPHERAL_FP_TPLS RAJA umpire)
list(APPEND SPHERAL_FP_DIRS ${raja_DIR} ${umpire_DIR})
set_property(GLOBAL PROPERTY SPHERAL_FP_TPLS ${SPHERAL_FP_TPLS})
set_property(GLOBAL PROPERTY SPHERAL_FP_DIRS ${SPHERAL_FP_DIRS})

message("-----------------------------------------------------------------------------")
# Use find_package to get Sundials
if (ENABLE_SUNDIALS)
Expand All @@ -173,15 +179,12 @@ if (ENABLE_SUNDIALS)
endif()
endif()

list(APPEND SPHERAL_BLT_DEPENDS chai camp RAJA umpire)
list(APPEND SPHERAL_FP_TPLS RAJA umpire)
list(APPEND SPHERAL_FP_DIRS ${raja_DIR} ${umpire_DIR})
set_property(GLOBAL PROPERTY SPHERAL_FP_TPLS ${SPHERAL_FP_TPLS})
set_property(GLOBAL PROPERTY SPHERAL_FP_DIRS ${SPHERAL_FP_DIRS})

message("-----------------------------------------------------------------------------")
# TPLs that must be imported
list(APPEND SPHERAL_EXTERN_LIBS boost eigen qhull silo hdf5 polytope)
if (ENABLE_LEOS)
list(APPEND SPHERAL_EXTERN_LIBS leos)
endif()

blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS aneos IF ENABLE_ANEOS)
blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS opensubdiv IF ENABLE_OPENSUBDIV)
Expand Down
7 changes: 7 additions & 0 deletions cmake/tpl/leos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(leos_libs libleos_C.a libleos.a liblip-cpp.a libyaml-cpp.a libleospact.a)
# If we ever support debug TPL builds we'll need the following since the name of the libarary changes
# if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# list(APPEND leos_libs libyaml-cppd.a)
# else()
# list(APPEND leos_libs libyaml-cpp.a)
# endif()
618 changes: 618 additions & 0 deletions scripts/spack/packages/leos/package.py

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions scripts/spack/packages/leos/patches/leos-8.2.0-CRAY.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff -u -b -r a/interfaces/fortran/LEOS_types_F.F90 b/interfaces/fortran/LEOS_types_F.F90
--- a/interfaces/fortran/LEOS_types_F.F90 2019-07-03 13:36:54.000000000 -0700
+++ b/interfaces/fortran/LEOS_types_F.F90 2019-10-03 14:29:04.386600979 -0700
@@ -111,11 +111,6 @@
TYPE(C_ptr) :: vp = C_NULL_ptr
END TYPE LEOS_map_ss_C

- TYPE LEOS_map_sm
- CHARACTER, POINTER :: key(:)
- INTEGER(KIND(LEOS_metadataDatatype_t)) :: mtype
- END TYPE LEOS_map_sm
-
TYPE LEOS_map_sm_C
TYPE(C_ptr) :: kp = C_NULL_ptr
INTEGER(C_int) :: mtype
@@ -197,6 +192,11 @@
END ENUM
INTEGER(KIND(LEOS_METADATA_UNKNOWN_TYPE)) :: LEOS_metadataDatatype_t

+ TYPE LEOS_map_sm
+ CHARACTER, POINTER :: key(:)
+ INTEGER(KIND(LEOS_metadataDatatype_t)) :: mtype
+ END TYPE LEOS_map_sm
+
ENUM, BIND(C)
ENUMERATOR :: LEOS_QUIET, LEOS_BASIC, LEOS_MEDIUM, LEOS_VERBOSE
END ENUM
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
diff --git a/LIP/cpp_source/Implementation/LIP_MemoryManager.cpp b/LIP/cpp_source/Implementation/LIP_MemoryManager.cpp
index 6fef6c3..7a237a3 100644
--- a/LIP/cpp_source/Implementation/LIP_MemoryManager.cpp
+++ b/LIP/cpp_source/Implementation/LIP_MemoryManager.cpp
@@ -36,6 +36,8 @@

#endif // UMPIRE_ENABLE_IPC_SHARED_MEMORY

+using LIP_Umpire_Exception = umpire::out_of_memory_error::exception;
+
#endif // LIP_USE_UMPIRE

#include "LIP_MemoryManager.hxx"
@@ -164,7 +166,7 @@ void* MemoryManager::allocate(std::size_t nbytes, MemoryType_t mem_type,
#else
ptr = alloc.allocate(nbytes);
#endif
- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {
// Just return the nullptr.
// TODO: Throw exception instead?
std::cout << "Umpire exception at allocation: " << e.what() << std::endl;
@@ -219,7 +221,7 @@ void MemoryManager::deallocate(void *ptr, MemoryType_t mem_type)
auto alloc = getUmpireAllocator(mem_type);
alloc.deallocate(ptr);

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {
// Just catch the exception. No way to handle this.
// TODO: Throw exception instead?
// throw e;
@@ -272,9 +274,9 @@ void MemoryManager::real_copy(void *dest, void *src,
try {
auto &rm = umpire::ResourceManager::getInstance();
rm.copy(dest, src, nbytes);
- } catch (umpire::util::Exception e) {
+ } catch (LIP_Umpire_Exception& e) {

- std::string message(ERR_COPY_FAILED_S + " " + e.message() );
+ std::string message(ERR_COPY_FAILED_S + " " + e.what() );
status.setStatus(Status::SL_ERROR, __func__, ERR_COPY_FAILED, message);

}
@@ -326,7 +328,7 @@ bool MemoryManager::isMemoryOnCPU( MemoryType_t const mem_type )
*/
return( platform == umpire::Platform::host);

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {

// TODO: Is there a better way to handle this? May cause crash soon after call.
// TODO: Throw exception instead?
@@ -367,7 +369,7 @@ bool MemoryManager::isMemoryOnGPU( MemoryType_t const mem_type )
return( platform == umpire::Platform::cuda);
#endif

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {

// TODO: Is there a better way to handle this? May cause crash soon after call.
// TODO: Throw exception instead?
@@ -455,7 +457,7 @@ bool MemoryManager::isSharedMemory(MemoryType_t const mem_type)

is_shared = isSharedAllocator(alloc);

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {

// TODO: Is there a better way to handle this? May cause crash soon after call.
// TODO: Throw exception instead?
@@ -506,7 +508,7 @@ bool MemoryManager::isMemoryOwner(MemoryType_t const mem_type )

isOwner = isMemoryOwner(alloc);

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {
// Just catch the exception. No way to handle this.
// leave isOwner = true
// TODO: Throw exception instead?
@@ -578,7 +580,7 @@ void MemoryManager::syncSharedMemoryProcs(MemoryType_t const mem_type)
umpire::get_communicator_for_allocator( alloc, base_comm_);


- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {
// Just catch the exception. No way to handle this.
// TODO: Throw exception instead?
// throw e;
@@ -740,7 +742,7 @@ bool MemoryManager::initializeUmpireIDMemory(MemoryType_t mem_type)

status = initializeUmpireIDMemory(alloc);

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {

status = false;
// TODO: Throw exception instead?
@@ -785,7 +787,7 @@ bool MemoryManager::initializeUmpireIDMemory(umpire::Allocator &alloc)
}
}

- } catch (umpire::util::Exception &e) {
+ } catch (LIP_Umpire_Exception &e) {

status = false;
// TODO: Throw exception instead?
41 changes: 41 additions & 0 deletions scripts/spack/packages/leos/patches/leos-8.4.1-umpire-import.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff -u -b -r a/cmake/TPL_Setup/SetupUmpire.cmake b/cmake/TPL_Setup/SetupUmpire.cmake
--- a/cmake/TPL_Setup/SetupUmpire.cmake
+++ b/cmake/TPL_Setup/SetupUmpire.cmake
@@ -16,9 +16,14 @@ else()
# Look for directory with umpire-config.cmake
set ( BASE_UMPIRE_DIR ${UMPIRE_DIR} )

+ message(STATUS "Passed in UMPIRE_DIR: ${UMPIRE_DIR}")
+ message(STATUS "Updated BASE_UMPIRE_DIR: ${BASE_UMPIRE_DIR}")
+
# Check for directory holding umpire-config.cmake
if ( IS_DIRECTORY ${BASE_UMPIRE_DIR}/lib/cmake/umpire)
set (UMPIRE_DIR ${BASE_UMPIRE_DIR}/lib/cmake/umpire)
+ elseif ( IS_DIRECTORY ${BASE_UMPIRE_DIR}/lib64/cmake/umpire)
+ set (UMPIRE_DIR ${BASE_UMPIRE_DIR}/lib64/cmake/umpire)
elseif(IS_DIRECTORY ${BASE_UMPIRE_DIR}/share/umpire/cmake)
set (UMPIRE_DIR ${BASE_UMPIRE_DIR}/share/umpire/cmake)
elseif(NOT EXISTS ${UMPIRE_DIR}/umpire-config.cmake)
@@ -26,6 +31,9 @@ else()
endif()
endif()

+message(STATUS "Modified UMPIRE_DIR: ${UMPIRE_DIR}")
+
+
if ( DEFINED camp_DIR )

string(FIND ${camp_DIR} "lib/cmake/camp" NEW_CAMP_CONFIG_LOC)
@@ -65,7 +73,11 @@ else()
endif()

#set(UMPIRE_MIN_VERSION "5.0")
-find_package(UMPIRE ${UMPIRE_MIN_VERSION} REQUIRED)
+find_package(UMPIRE ${UMPIRE_MIN_VERSION} REQUIRED NO_DEFAULT_PATH
+ PATHS ${UMPIRE_DIR}/share/umpire/cmake
+ ${UMPIRE_DIR}/lib/cmake/umpire
+ ${UMPIRE_DIR}/lib64/cmake/umpire
+ ${UMPIRE_DIR})

if (UMPIRE_FOUND)

13 changes: 13 additions & 0 deletions scripts/spack/packages/spheral/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage):
version('develop', branch='develop', submodules=True)
version('1.0', tag='FSISPH-v1.0', submodules=True)

# -------------------------------------------------------------------------
# Is LEOS available in a standard place?
# -------------------------------------------------------------------------
from spack.pkg.spheral.leos import Leos
LEOSpresent = os.path.exists(Leos.fileLoc)

# -------------------------------------------------------------------------
# VARIANTS
# -------------------------------------------------------------------------
Expand All @@ -35,6 +41,7 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage):
variant('opensubdiv', default=True, description='Enable use of opensubdiv to do refinement.')
variant('network', default=True, description='Disable to build Spheral from a local buildcache.')
variant('sundials', default=True, when="+mpi", description='Build Sundials package.')
variant('leos', default=LEOSpresent, when="+mpi", description='Build LEOS package.')

# -------------------------------------------------------------------------
# Depends
Expand Down Expand Up @@ -76,6 +83,8 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage):

depends_on('sundials@7.0.0 ~shared cxxstd=17', type='build', when='+sundials')

depends_on("leos@8.4.2", type="build", when="+leos")

# Forward MPI Variants
mpi_tpl_list = ["hdf5", "conduit", "axom", "adiak~shared"]
for ctpl in mpi_tpl_list:
Expand Down Expand Up @@ -245,6 +254,10 @@ def initconfig_package_entries(self):
entries.append(cmake_cache_path('sundials_DIR', spec['sundials'].prefix))
entries.append(cmake_cache_option('ENABLE_SUNDIALS', True))

if spec.satisfies("+leos"):
entries.append(cmake_cache_path('leos_DIR', spec['leos'].prefix))
entries.append(cmake_cache_option('ENABLE_LEOS', True))

return entries

def cmake_args(self):
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ if (SPHERAL_ENABLE_SVPH)
list(APPEND _packages SVPH)
endif()

if (ENABLE_SUNDIALS AND ENABLE_MPI)
if (ENABLE_SUNDIALS)
list(APPEND _packages Solvers)
endif()

if (ENABLE_LEOS)
list(APPEND _packages LEOS)
endif()

if(NOT ENABLE_CXXONLY)
list(APPEND _packages
SimulationControl
Expand Down
17 changes: 17 additions & 0 deletions src/LEOS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include_directories(.)
set(LEOS_inst
LEOS
)

set(LEOS_sources
LEOS_bundle.cc
)

instantiate(LEOS_inst LEOS_sources)

set(LEOS_headers
LEOS.hh
LEOS_bundle.hh
)

spheral_add_obj_library(LEOS SPHERAL_OBJ_LIBS)
Loading