Skip to content

Commit 2c4c41f

Browse files
Nightly Botcwsmith
authored andcommitted
Merging develop into master
2 parents 566c1f0 + 6def87f commit 2c4c41f

File tree

4 files changed

+42
-31
lines changed

4 files changed

+42
-31
lines changed

cmake/FindParmetis.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ if(NOT EXISTS "${PARMETIS_INCLUDE_DIR}")
1212
message(FATAL_ERROR "parmetis include dir not found")
1313
endif()
1414

15+
find_path(METIS_INCLUDE_DIR metis.h PATHS "${PARMETIS_PREFIX}/include")
16+
if(NOT EXISTS "${METIS_INCLUDE_DIR}")
17+
message(FATAL_ERROR "metis include dir not found")
18+
endif()
19+
20+
1521
find_library(PARMETIS_LIBRARY parmetis PATHS "${PARMETIS_PREFIX}/lib")
1622
if(NOT EXISTS "${PARMETIS_LIBRARY}")
1723
message(FATAL_ERROR "parmetis library not found")
@@ -23,7 +29,7 @@ if(NOT EXISTS "${METIS_LIBRARY}")
2329
endif()
2430

2531
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY})
26-
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} )
32+
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${METIS_INCLUDE_DIR})
2733

2834
include(FindPackageHandleStandardArgs)
2935
# handle the QUIETLY and REQUIRED arguments and set PARMETIS_FOUND to TRUE

gmi_sim/gmi_sim.cc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <gmi.h>
1515
#include <SimModel.h>
1616
#include <vector>
17+
#include <set>
1718

1819
#include "gmi_sim_config.h"
1920

@@ -182,8 +183,7 @@ static gmi_set* region_faces(pGRegion region)
182183
return s;
183184
}
184185

185-
/* getting the region adj to an edge. This version
186-
* does not support non-manifold models
186+
/* getting the region adj to an edge.
187187
*/
188188
// NOTE: the corresponding functionality does not exist
189189
// in gmi_base!
@@ -192,22 +192,23 @@ static gmi_set* edge_regions(pGEdge e)
192192
{
193193
pPList list = GE_faces((pGEdge)e);
194194

195-
// do the first one outside of the loop
196-
gmi_set* regions_set = face_regions((pGFace)PList_item(list, 0));
197-
if (regions_set->n > 1)
198-
gmi_fail("no support for non-manifold surfaces!\n");
199-
pGRegion r = (pGRegion)regions_set->e[0];
200-
201-
// do the rest inside of the loop
202-
for (int i = 1; i < PList_size(list); i++) {
203-
regions_set = face_regions((pGFace)PList_item(list, i));
204-
if (regions_set->n > 1)
205-
gmi_fail("no support for non-manifold surfaces!\n");
206-
if (r != (pGRegion)regions_set->e[0])
207-
gmi_fail("no support for non-manifold surfaces!\n");
195+
std::set<pGRegion> rgns;
196+
gmi_set* regions_set;
197+
for (int i = 0; i < PList_size(list); i++) {
198+
regions_set = face_regions((pGFace)PList_item(list, i));
199+
for (int j = 0; j < regions_set->n; j++) {
200+
rgns.insert( (pGRegion) regions_set->e[j] );
201+
}
208202
}
209-
PList_delete(list);
210-
return regions_set;
203+
204+
int count = 0;
205+
gmi_set* s = gmi_make_set(rgns.size());
206+
for (std::set<pGRegion>::iterator it=rgns.begin(); it!=rgns.end(); ++it) {
207+
s->e[count] = (gmi_ent*)*it;
208+
count++;
209+
}
210+
211+
return s;
211212
}
212213

213214
static gmi_set* adjacent(gmi_model* m, gmi_ent* e, int dim)

phasta/CMakeLists.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,25 @@ if(NOT ENABLE_SIMMETRIX # no simmetrix
4747
set(SOURCES ${SOURCES} phGrowthCurves_empty.cc)
4848
endif()
4949

50+
# Package headers
51+
set(HEADERS
52+
chef.h
53+
phInput.h
54+
phstream.h
55+
phiotimer.h
56+
phastaChef.h
57+
)
58+
59+
# Add the ph library
60+
add_library(ph ${SOURCES})
5061

5162
#determine which timer to use based on the target system and compiler
5263
if(CMAKE_SYSTEM_NAME MATCHES BlueGeneQ*)
5364
add_definitions(-DUSE_PCU_TIME)
65+
target_compile_definitions(ph INTERFACE -DUSE_PCU_TIME)
5466
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel)
5567
add_definitions(-DHAVE_INTEL_RDTSC)
68+
target_compile_definitions(ph INTERFACE -DHAVE_INTEL_RDTSC)
5669
else()
5770
#from https://github.com/abduld/libwb/issues/5
5871
include(CheckFunctionExists)
@@ -63,23 +76,13 @@ else()
6376
endif(NOT HAVE_CLOCK_GETTIME)
6477
if( HAVE_CLOCK_GETTIME OR LIBRT_LIBRARIES )
6578
add_definitions(-DHAVE_CLOCK_GETTIME)
79+
target_compile_definitions(ph INTERFACE -DHAVE_CLOCK_GETTIME)
6680
else()
6781
add_definitions(-DUSE_PCU_TIME)
82+
target_compile_definitions(ph INTERFACE -DUSE_PCU_TIME)
6883
endif()
6984
endif()
7085

71-
# Package headers
72-
set(HEADERS
73-
chef.h
74-
phInput.h
75-
phstream.h
76-
phiotimer.h
77-
phastaChef.h
78-
)
79-
80-
# Add the ph library
81-
add_library(ph ${SOURCES})
82-
8386
# Include directories
8487
target_include_directories(ph INTERFACE
8588
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

test/measureAnisoStats.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ void getStats(
219219

220220
std::stringstream ss, sse, ssq, ssm, ssl;
221221
ss << outputPrefix << "/" << "linear_tables";
222-
const char* pathName = ss.str().c_str();
222+
const std::string& tmp = ss.str();
223+
const char* pathName = tmp.c_str();
223224
safe_mkdir(pathName);
224225

225226
ssq << pathName << "/linearQTable_" << PCU_Comm_Self() << ".dat";

0 commit comments

Comments
 (0)