diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 51055e631..0481cd7e8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -44,6 +44,15 @@ jobs: run: | echo "CXX=mpicxx" >> $GITHUB_ENV + - name: print info + run: | + version= + echo "Compiler: ${{matrix.compiler}}" + ${{matrix.compiler}} --version + echo "MPI: ${{matrix.mpi}}" + echo "Kokkos: ${{matrix.kokkos}}" + echo "Memory Pool: ${{matrix.mempool}}" + - name: Configure Kokkos if: ${{ matrix.kokkos == 'on' }} shell: bash diff --git a/.github/workflows/pr_comment_trigger_self_hosted.yml b/.github/workflows/pr_comment_trigger_self_hosted.yml index ccefc5f45..da0b5a76c 100644 --- a/.github/workflows/pr_comment_trigger_self_hosted.yml +++ b/.github/workflows/pr_comment_trigger_self_hosted.yml @@ -74,6 +74,7 @@ jobs: -DBUILD_TESTING=on \ -DOmega_h_USE_MPI=on \ -DOmega_h_USE_SimModSuite=on \ + -DOmega_h_USE_SimDiscrete=on \ -DSIM_MPI=mpich4.1.1 \ -DOmega_h_USE_Kokkos=on \ -DOmega_h_CUDA_ARCH="80" \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 350e3d5d0..24a847784 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.18.0...${CMAKE_VERSION}) -project(Omega_h VERSION 10.8.5 LANGUAGES CXX) +project(Omega_h VERSION 10.8.6 LANGUAGES CXX) set(Omega_h_USE_STK_DEFAULT OFF) option(Omega_h_USE_STK "Whether to build the STK interface" ${Omega_h_USE_STK_DEFAULT}) @@ -29,6 +29,7 @@ bob_option(Omega_h_USE_Kokkos "Use Kokkos as a backend" OFF) bob_input(Kokkos_PREFIX "" PATH "Path to Kokkos install") bob_option(Omega_h_USE_CUDA_AWARE_MPI "Assume MPI is CUDA-aware, make use of that" OFF) bob_option(Omega_h_USE_SimModSuite "Enable reading Simmetrix MeshSim meshes" OFF) +bob_option(Omega_h_USE_SimDiscrete "Enable reading and creating Simmetrix Discrete models" OFF) bob_input(Omega_h_VALGRIND "" STRING "Valgrind plus arguments for testing") bob_option(Omega_h_EXAMPLES "Compile examples" OFF) @@ -161,6 +162,7 @@ set(Omega_h_KEY_BOOLS Omega_h_USE_EGADS Omega_h_USE_SEACASExodus Omega_h_USE_SimModSuite + Omega_h_USE_SimDiscrete Omega_h_USE_DOLFIN Omega_h_USE_dwarf Omega_h_CHECK_BOUNDS diff --git a/cmake/FindSimModSuite.cmake b/cmake/FindSimModSuite.cmake index 4c73f6132..777c4597b 100644 --- a/cmake/FindSimModSuite.cmake +++ b/cmake/FindSimModSuite.cmake @@ -154,8 +154,7 @@ if (SIM_ACIS) SpaACIS) endif() -option(SIM_DISCRETE "Use Simmetrix discrete modeling" ON) -if (SIM_DISCRETE) +if (Omega_h_USE_SimDiscrete) set(SIM_CAD_LIB_NAMES SimDiscrete ${SIM_CAD_LIB_NAMES}) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d08c8912b..45e671b66 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -197,6 +197,9 @@ add_library(Omega_h::omega_h ALIAS omega_h) set_property(TARGET omega_h PROPERTY CXX_STANDARD "17") set_property(TARGET omega_h PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET omega_h PROPERTY CXX_EXTENSIONS OFF) +if (Omega_h_USE_CUDA) + set_property(TARGET omega_h PROPERTY CUDA_ARCHITECTURES ${Omega_h_CUDA_ARCH}) +endif() bob_library_includes(omega_h) @@ -433,15 +436,17 @@ if(BUILD_TESTING) ${d3dMesh}/d3d-coreMesh-numbered-gold.osh ${d3dMesh}/d3d-coreMesh-numbered.osh) - osh_add_exe(mixed_writeMesh) - set(TEST_EXES ${TEST_EXES} mixed_writeMesh) - test_func(run_mixed_writeMesh 1 ./mixed_writeMesh - ${CMAKE_SOURCE_DIR}/meshes) + if(Omega_h_USE_SimDiscrete) + osh_add_exe(mixed_writeMesh) + set(TEST_EXES ${TEST_EXES} mixed_writeMesh) + test_func(run_mixed_writeMesh 1 ./mixed_writeMesh + ${CMAKE_SOURCE_DIR}/meshes) - osh_add_exe(mixed_test) - set(TEST_EXES ${TEST_EXES} mixed_test) - test_func(run_mixed_test 1 ./mixed_test - ${CMAKE_SOURCE_DIR}/meshes) + osh_add_exe(mixed_test) + set(TEST_EXES ${TEST_EXES} mixed_test) + test_func(run_mixed_test 1 ./mixed_test + ${CMAKE_SOURCE_DIR}/meshes) + endif() osh_add_exe(periodic_test) endif() diff --git a/src/Omega_h_array.hpp b/src/Omega_h_array.hpp index 30a94407e..e688a41af 100644 --- a/src/Omega_h_array.hpp +++ b/src/Omega_h_array.hpp @@ -10,6 +10,7 @@ #include #else #include +#include //shared_ptr #include #endif @@ -136,7 +137,7 @@ class HostRead { #if defined(OMEGA_H_USE_KOKKOS) typename Kokkos::View mirror_; #elif defined(OMEGA_H_USE_CUDA) - std::shared_ptr mirror_; + std::shared_ptr mirror_; #endif public: using value_type = T; @@ -155,7 +156,7 @@ class HostWrite { #ifdef OMEGA_H_USE_KOKKOS typename View::HostMirror mirror_; #elif defined(OMEGA_H_USE_CUDA) - std::shared_ptr mirror_; + std::shared_ptr mirror_; #endif public: using value_type = T; diff --git a/src/Omega_h_meshsim.cpp b/src/Omega_h_meshsim.cpp index 50df67a86..a745fa2a5 100644 --- a/src/Omega_h_meshsim.cpp +++ b/src/Omega_h_meshsim.cpp @@ -7,9 +7,11 @@ #include "Omega_h_mixedMesh.hpp" #include "Omega_h_adj.hpp" -#include "SimModel.h" +#include "MeshSim.h" // required to load GeomSim models in '.smd' files #include "SimUtil.h" -#include "SimDiscrete.h" +#ifdef OMEGA_H_USE_SIMDISCRETE +#include "SimDiscrete.h" // required to load discrete models in '.smd' files +#endif namespace { int classId(pEntity e) { @@ -636,9 +638,11 @@ void read_internal(pMesh m, Mesh* mesh, pMeshNex numbering, SimMeshInfo info) { MixedMesh readMixedImpl(filesystem::path const& mesh_fname, filesystem::path const& mdl_fname, CommPtr comm) { - SimModel_start(); + MS_init(); Sim_readLicenseFile(NULL); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_start(0); +#endif pNativeModel nm = NULL; pProgress p = NULL; pGModel g = GM_load(mdl_fname.c_str(), nm, p); @@ -649,16 +653,20 @@ MixedMesh readMixedImpl(filesystem::path const& mesh_fname, meshsim::readMixed_internal(m, &mesh, simMeshInfo); M_release(m); GM_release(g); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_stop(0); - SimModel_stop(); +#endif + MS_exit(); return mesh; } Mesh readImpl(filesystem::path const& mesh_fname, filesystem::path const& mdl_fname, filesystem::path const& numbering_fname, CommPtr comm) { - SimModel_start(); + MS_init(); Sim_readLicenseFile(NULL); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_start(0); +#endif pNativeModel nm = NULL; pProgress p = NULL; pGModel g = GM_load(mdl_fname.c_str(), nm, p); @@ -673,15 +681,19 @@ Mesh readImpl(filesystem::path const& mesh_fname, filesystem::path const& mdl_fn if(hasNumbering) MeshNex_delete(numbering); M_release(m); GM_release(g); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_stop(0); - SimModel_stop(); +#endif + MS_exit(); return mesh; } bool isMixed(filesystem::path const& mesh_fname, filesystem::path const& mdl_fname) { - SimModel_start(); + MS_init(); Sim_readLicenseFile(NULL); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_start(0); +#endif pNativeModel nm = NULL; pProgress p = NULL; pGModel g = GM_load(mdl_fname.c_str(), nm, p); @@ -689,8 +701,10 @@ bool isMixed(filesystem::path const& mesh_fname, filesystem::path const& mdl_fna auto simMeshInfo = getSimMeshInfo(m); M_release(m); GM_release(g); +#ifdef OMEGA_H_USE_SIMDISCRETE SimDiscrete_stop(0); - SimModel_stop(); +#endif + MS_exit(); bool isMixed = (!simMeshInfo.is_simplex && !simMeshInfo.is_hypercube); return isMixed; } diff --git a/src/shape_test.cpp b/src/shape_test.cpp index a02993151..bed34bbdd 100644 --- a/src/shape_test.cpp +++ b/src/shape_test.cpp @@ -23,7 +23,7 @@ void check_point(const Omega_h::Matrix<2,3> & coords) { int main(int argc, char** argv) { - Omega_h::Matrix<2,3> coords{{0.0},{1,0},{0.5,1}} ; + Omega_h::Matrix<2,3> coords{{0,0},{1,0},{0.5,1}} ; check_verts(coords); check_point(coords);