Skip to content

Commit efcb637

Browse files
committed
Merge branch 'develop' into extensible_vtk
2 parents 9c332c6 + 83a0307 commit efcb637

File tree

6 files changed

+33
-22
lines changed

6 files changed

+33
-22
lines changed

cmake/FindSimModSuite.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ string(REGEX REPLACE
7474
"${SIM_VERSION}")
7575

7676
set(MIN_VALID_SIM_VERSION 11.0.170826)
77-
set(MAX_VALID_SIM_VERSION 12.0.180811)
77+
set(MAX_VALID_SIM_VERSION 12.0.181124)
7878
if( (SIM_DOT_VERSION VERSION_LESS MIN_VALID_SIM_VERSION) OR
7979
(SIM_DOT_VERSION VERSION_GREATER MAX_VALID_SIM_VERSION) )
8080
MESSAGE(FATAL_ERROR
8181
"invalid Simmetrix version: ${SIM_DOT_VERSION}, \
8282
valid versions are ${MIN_VALID_SIM_VERSION} to ${MAX_VALID_SIM_VERSION}")
8383
endif()
84+
message(STATUS "Building with SimModSuite ${SIM_DOT_VERSION}")
8485

8586
set(SIMMODSUITE_LIBS "")
8687

@@ -138,11 +139,9 @@ set(SIM_CORE_LIB_NAMES
138139

139140
simLibCheck("${SIM_CORE_LIB_NAMES}" TRUE)
140141

141-
if (SIM_PARASOLID OR SIM_ACIS)
142-
if (UNIX AND NOT APPLE)
143-
find_package(Threads REQUIRED)
144-
set(SIMMODSUITE_LIBS ${SIMMODSUITE_LIBS} ${CMAKE_THREAD_LIBS_INIT})
145-
endif()
142+
if (UNIX AND NOT APPLE)
143+
find_package(Threads REQUIRED)
144+
set(SIMMODSUITE_LIBS ${SIMMODSUITE_LIBS} ${CMAKE_THREAD_LIBS_INIT})
146145
endif()
147146

148147
include(FindPackageHandleStandardArgs)

phasta/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set(SOURCES
2323
phiotimer.cc
2424
)
2525

26-
if(ENABLE_SIMMETRIX AND SIMMODSUITE_SimAdvMeshing_FOUND)
26+
if(ENABLE_SIMMETRIX)
2727
if(SIM_DOT_VERSION VERSION_GREATER 12.0.180605)
2828
set(SOURCES ${SOURCES} splitMeshOnGFace_2arg.cpp)
2929
else()
@@ -70,6 +70,11 @@ set(HEADERS
7070
# Add the ph library
7171
add_library(ph ${SOURCES})
7272

73+
# Add the SimAdvMeshing flag
74+
if(SIMMODSUITE_SimAdvMeshing_FOUND) # simmetrix enabled
75+
target_compile_definitions(ph PRIVATE -DHAVE_SIMADVMESHING)
76+
endif()
77+
7378
#determine which timer to use based on the target system and compiler
7479
if(CMAKE_SYSTEM_NAME MATCHES BlueGeneQ*)
7580
add_definitions(-DUSE_PCU_TIME)

phasta/phMeshQuality.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include <SimModel.h>
1616
#include <SimPartitionedMesh.h>
1717
#include <SimMeshTools.h>
18-
//#ifdef HAVE_SIMADVMESHING
19-
#include <SimAdvMeshing.h>
20-
//#endif
18+
#ifdef HAVE_SIMADVMESHING
19+
#include <SimAdvMeshing.h>
20+
#endif
2121
#endif
2222

2323
#include <PCU.h>
@@ -143,7 +143,7 @@ void core_measure_mesh (double x1[], double x2[], double x3[], int numnp,
143143
/* not support other mesh region type */
144144
if (m->getType(e) != apf::Mesh::TET)
145145
continue;
146-
#ifdef HAVE_SIMMETRIX
146+
#ifdef HAVE_SIMADVMESHING
147147
if (EN_isBLEntity(reinterpret_cast<pEntity>(e)))
148148
continue;
149149
#endif
@@ -156,7 +156,7 @@ void core_measure_mesh (double x1[], double x2[], double x3[], int numnp,
156156

157157
// measure mesh face in layered mesh
158158
minfq = 1.0;
159-
#ifdef HAVE_SIMMETRIX
159+
#ifdef HAVE_SIMADVMESHING
160160
if (in.simmetrixMesh == 1) {
161161
// get simmetrix mesh
162162
apf::MeshSIM* apf_msim = dynamic_cast<apf::MeshSIM*>(m);

phasta/phOutput.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,21 @@ static void getCounts(Output& o)
3232

3333
static void checkLoadBalance(Output& o)
3434
{
35-
int sumOwnedNodes = PCU_Add_Int(o.nOwnedNodes);
36-
double vlbratio = o.nOverlapNodes * PCU_Comm_Peers() / (double) sumOwnedNodes;
35+
long sumOwnedNodes = PCU_Add_Long(o.nOwnedNodes);
36+
long sumAllNodes = PCU_Add_Long(o.nOverlapNodes);
37+
double avgNodes = static_cast<double>(sumAllNodes) / PCU_Comm_Peers();
38+
double vlbratio = o.nOverlapNodes / avgNodes;
3739
double vlbratio_max = PCU_Max_Double(vlbratio);
3840
if (!PCU_Comm_Self())
3941
lion_oprint(1,"max vertex load imbalance of partitioned mesh = %f\n", vlbratio_max);
40-
41-
int sumAllNodes = PCU_Add_Int(o.nOverlapNodes);
4242
if (!PCU_Comm_Self())
4343
lion_oprint(1,"ratio of sum of all vertices to sum of owned vertices = %f\n", sumAllNodes / (double) sumOwnedNodes);
4444

4545
int dim = o.mesh->getDimension();
4646
int numElms = o.mesh->count(dim);
47-
int sumElms = PCU_Add_Int(numElms);
48-
double elbratio = numElms * PCU_Comm_Peers() / (double) sumElms;
47+
long sumElms = PCU_Add_Long(numElms);
48+
double avgElms = static_cast<double>(sumElms) / PCU_Comm_Peers();
49+
double elbratio = numElms / avgElms;
4950
double elbratio_max = PCU_Max_Double(elbratio);
5051
if (!PCU_Comm_Self())
5152
lion_oprint(1,"max region (3D) or face (2D) load imbalance of partitioned mesh = %f\n", elbratio_max);

test/measureAnisoStats.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include <gmi_sim.h>
1515
#include <phastaChef.h>
1616
#include <SimPartitionedMesh.h>
17-
#include <SimAdvMeshing.h>
17+
#ifdef HAVE_SIMADVMESHING
18+
#include <SimAdvMeshing.h>
19+
#endif
1820
#endif
1921

2022
#include <stdlib.h>
@@ -58,7 +60,9 @@ int main(int argc, char** argv)
5860
SimModel_start();
5961
Sim_readLicenseFile(0);
6062
SimPartitionedMesh_start(0, 0);
63+
#ifdef HAVE_SIMADVMESHING
6164
SimAdvMeshing_start();
65+
#endif
6266
gmi_sim_start();
6367
gmi_register_sim();
6468
#endif
@@ -77,7 +81,9 @@ int main(int argc, char** argv)
7781

7882
#ifdef HAVE_SIMMETRIX
7983
gmi_sim_stop();
84+
#ifdef HAVE_SIMADVMESHING
8085
SimAdvMeshing_stop();
86+
#endif
8187
SimPartitionedMesh_stop();
8288
SimModel_stop();
8389
Sim_unregisterAllKeys();
@@ -239,7 +245,7 @@ void getStats(
239245
apf::writeVtkFiles(ssm.str().c_str(), m);
240246

241247
// measure the triangular mesh face in the BL mesh
242-
#ifdef HAVE_SIMMETRIX
248+
#ifdef HAVE_SIMADVMESHING
243249
if (ph::mesh_has_ext(meshFile, "sms")) {
244250
// get simmetrix mesh
245251
apf::MeshSIM* apf_msim = dynamic_cast<apf::MeshSIM*>(m);

test/testing.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if(ENABLE_SIMMETRIX AND SIM_PARASOLID AND SIMMODSUITE_SimAdvMeshing_FOUND)
6969
WORKING_DIRECTORY ${MDIR})
7070
endif()
7171

72-
if(ENABLE_SIMMETRIX AND SIM_PARASOLID)
72+
if(ENABLE_SIMMETRIX AND SIM_PARASOLID AND SIMMODSUITE_SimAdvMeshing_FOUND)
7373
if(SIM_DOT_VERSION VERSION_GREATER 12.0.171000)
7474
set(MDIR ${MESHES}/faceExtrusion)
7575
mpi_test(rm_extrusion 1
@@ -113,7 +113,7 @@ if(ENABLE_SIMMETRIX AND SIM_PARASOLID)
113113
WORKING_DIRECTORY ${MDIR})
114114
endif()
115115
endif()
116-
endif(ENABLE_SIMMETRIX AND SIM_PARASOLID)
116+
endif(ENABLE_SIMMETRIX AND SIM_PARASOLID AND SIMMODSUITE_SimAdvMeshing_FOUND)
117117

118118
set(MDIR ${MESHES}/phasta/loopDriver)
119119
if(ENABLE_SIMMETRIX AND PCU_COMPRESS AND SIM_PARASOLID

0 commit comments

Comments
 (0)