Skip to content

Commit

Permalink
Merge remote-tracking branch 'scorec/master' into cws/formPatches
Browse files Browse the repository at this point in the history
  • Loading branch information
cwsmith committed Nov 8, 2024
2 parents 1beea4c + ad94723 commit ad96878
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_comment_trigger_self_hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cmake/FindSimModSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
21 changes: 13 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions src/Omega_h_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Omega_h_memory.hpp>
#else
#include <Omega_h_shared_alloc.hpp>
#include <memory> //shared_ptr
#include <string>
#endif

Expand Down Expand Up @@ -136,7 +137,7 @@ class HostRead {
#if defined(OMEGA_H_USE_KOKKOS)
typename Kokkos::View<const T*, Kokkos::HostSpace> mirror_;
#elif defined(OMEGA_H_USE_CUDA)
std::shared_ptr<T> mirror_;
std::shared_ptr<T[]> mirror_;
#endif
public:
using value_type = T;
Expand All @@ -155,7 +156,7 @@ class HostWrite {
#ifdef OMEGA_H_USE_KOKKOS
typename View<T*>::HostMirror mirror_;
#elif defined(OMEGA_H_USE_CUDA)
std::shared_ptr<T> mirror_;
std::shared_ptr<T[]> mirror_;
#endif
public:
using value_type = T;
Expand Down
30 changes: 22 additions & 8 deletions src/Omega_h_meshsim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -673,24 +681,30 @@ 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);
pMesh m = M_load(mesh_fname.c_str(), g, p);
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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ad96878

Please sign in to comment.