Skip to content

Commit ecd9b7f

Browse files
authored
Merge pull request #23 from Wendi-L/master
Update wrapper demos for MUI v2.0
2 parents b2ebbb4 + cecf8de commit ecd9b7f

32 files changed

Lines changed: 82 additions & 207 deletions

File tree

10-wrappers/10-0-C/10-0-0-simple/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ include_directories(${MPI_INCLUDE_PATH})
1313
find_package(MUI QUIET)
1414

1515
if(MUI_BASE_DIR)
16-
set(MUI_C_LIB_DIR "${MUI_LIB_DIR}")
17-
set(MUI_C_INCLUDE_DIR "${MUI_INCLUDE_DIR}/wrappers/C")
18-
elseif(MUI_BASE_C_DIR)
19-
set(MUI_C_LIB_DIR "${MUI_BASE_C_DIR}/lib")
20-
set(MUI_C_INCLUDE_DIR "${MUI_BASE_C_DIR}/include/wrappers/C")
16+
set(MUI_C_LIB_DIR "${MUI_BASE_DIR}/lib")
17+
set(MUI_C_INCLUDE_DIR "${MUI_BASE_DIR}/include/wrappers/C")
2118
endif()
2219

2320
find_library(MUI_C_WRAPPER_LIB NAMES MUI_C_wrapper PATHS ${MUI_C_LIB_DIR})

10-wrappers/10-0-C/10-0-0-simple/run_case.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -n "$1" ]; then
1313
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2
1414
else
1515
# Run cmake with the provided path as the MUI base directory
16-
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DCMAKE_PREFIX_PATH=$1
16+
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_BASE_DIR=$1
1717
fi
1818
else
1919
# Run cmake with the default MUI directory

10-wrappers/10-0-C/10-0-1-multiple-interfaces/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ include_directories(${MPI_INCLUDE_PATH})
1313
find_package(MUI QUIET)
1414

1515
if(MUI_BASE_DIR)
16-
set(MUI_C_LIB_DIR "${MUI_LIB_DIR}")
17-
set(MUI_C_INCLUDE_DIR "${MUI_INCLUDE_DIR}/wrappers/C")
18-
elseif(MUI_BASE_C_DIR)
19-
set(MUI_C_LIB_DIR "${MUI_BASE_C_DIR}/lib")
20-
set(MUI_C_INCLUDE_DIR "${MUI_BASE_C_DIR}/include/wrappers/C")
16+
set(MUI_C_LIB_DIR "${MUI_BASE_DIR}/lib")
17+
set(MUI_C_INCLUDE_DIR "${MUI_BASE_DIR}/include/wrappers/C")
2118
endif()
2219

2320
find_library(MUI_C_WRAPPER_LIB NAMES MUI_C_wrapper PATHS ${MUI_C_LIB_DIR})

10-wrappers/10-0-C/10-0-1-multiple-interfaces/run_case.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -n "$1" ]; then
1313
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2
1414
else
1515
# Run cmake with the provided path as the MUI base directory
16-
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DCMAKE_PREFIX_PATH=$1
16+
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_BASE_DIR=$1
1717
fi
1818
else
1919
# Run cmake with the default MUI directory

10-wrappers/10-0-C/10-0-2-smart-send-dual-times/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_LINK_FLAGS}")
1515
find_package(MUI QUIET)
1616

1717
if(MUI_BASE_DIR)
18-
set(MUI_C_LIB_DIR "${MUI_LIB_DIR}")
19-
set(MUI_C_INCLUDE_DIR "${MUI_INCLUDE_DIR}/wrappers/C")
20-
elseif(MUI_BASE_C_DIR)
21-
set(MUI_C_LIB_DIR "${MUI_BASE_C_DIR}/lib")
22-
set(MUI_C_INCLUDE_DIR "${MUI_BASE_C_DIR}/include/wrappers/C")
18+
set(MUI_C_LIB_DIR "${MUI_BASE_DIR}/lib")
19+
set(MUI_C_INCLUDE_DIR "${MUI_BASE_DIR}/include/wrappers/C")
2320
endif()
2421

2522
find_library(MUI_C_WRAPPER_LIB NAMES MUI_C_wrapper PATHS ${MUI_C_LIB_DIR})

10-wrappers/10-0-C/10-0-2-smart-send-dual-times/run_case.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -n "$1" ]; then
1313
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2
1414
else
1515
# Run cmake with the provided path as the MUI base directory
16-
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DCMAKE_PREFIX_PATH=$1
16+
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_BASE_DIR=$1
1717
fi
1818
else
1919
# Run cmake with the default MUI directory

10-wrappers/10-0-C/10-0-3-pseudo-diffusion/3D-pseudo-diffusion-coarse.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ int main(int argc, char **argv) {
7777
/// Create rbf matrix folder
7878
char makedirMString[32];
7979
sprintf(makedirMString, "rbfCoarseMatrix%d", mui_ranks);
80-
mkdir(makedirMString, 0777);
8180

8281
/// Define the name of MUI domain
8382
char *domain = (char*) malloc(strlen("coarseDomain") + 1);
@@ -124,7 +123,7 @@ int main(int argc, char **argv) {
124123
int conservative = 1;
125124
double cutoff = 1e-9;
126125
int smoothFunc = 0;
127-
int writeMatrix = 1;
126+
int generateMatrix = 1;
128127
double cgSolveTol = 1e-6;
129128
int cgMaxIter = 500;
130129
int preconditioner= 1;
@@ -248,7 +247,7 @@ int main(int argc, char **argv) {
248247

249248
/// Define spatial and temporal samplers
250249
mui_sampler_rbf_2d *spatial_sampler2d = mui_create_sampler_rbf_2d(rSampler, point2d, point_count, basisFunc, conservative,
251-
smoothFunc, writeMatrix, fileAddress, cutoff, cgSolveTol, cgMaxIter, pouSize, preconditioner, MUI_COMM_WORLD);
250+
smoothFunc, generateMatrix, fileAddress, cutoff, cgSolveTol, cgMaxIter, pouSize, preconditioner, MUI_COMM_WORLD);
252251
mui_temporal_sampler_exact_2d *temporal_sampler2d = mui_create_temporal_sampler_exact_2d(8e-1);
253252

254253
/// Commit ZERO step of MUI

10-wrappers/10-0-C/10-0-3-pseudo-diffusion/3D-pseudo-diffusion-fine.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ int main(int argc, char ** argv) {
7676

7777
/// Create rbf matrix folder
7878
std::string makedirMString = "rbfFineMatrix" + std::to_string(rank);
79-
mkdir(makedirMString.c_str(), 0777);
8079

8180
/// Define the name of MUI domain
8281
std::string domain = "fineDomain";
@@ -103,7 +102,7 @@ int main(int argc, char ** argv) {
103102
bool conservative = true;
104103
double cutoff = 1e-9;
105104
bool smoothFunc = false;
106-
bool writeMatrix = true;
105+
bool generateMatrix = true;
107106
double cgSolveTol = 1e-6;
108107
int cgMaxIter = 500;
109108
int preconditioner= 1;
@@ -279,7 +278,7 @@ int main(int argc, char ** argv) {
279278

280279
/// Define spatial and temporal samplers
281280
mui::sampler_rbf2d<double> spatial_sampler(rSampler, point2dvec,
282-
basisFunc, conservative, smoothFunc, writeMatrix, fileAddress,
281+
basisFunc, conservative, smoothFunc, generateMatrix, fileAddress,
283282
cutoff, cgSolveTol, cgMaxIter, pouSize, preconditioner, world);
284283
mui::temporal_sampler_exact2d temporal_sampler;
285284

10-wrappers/10-0-C/10-0-3-pseudo-diffusion/CMakeLists.txt

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,19 @@ set(CMAKE_CXX_STANDARD 11)
1010
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1111
set(CMAKE_CXX_EXTENSIONS OFF)
1212

13-
set(MUI_C_CPP_SEPERATE_PATH 0)
14-
1513
find_package(MPI REQUIRED)
1614
include_directories(${MPI_INCLUDE_PATH})
1715

1816
find_package(MUI REQUIRED)
1917

20-
if(DEFINED MUI_C_CPP_SEPERATE_PATH AND ${MUI_C_CPP_SEPERATE_PATH} EQUAL 1)
21-
if(MUI_BASE_DIR)
22-
include_directories(${MUI_INCLUDE_DIR})
23-
elseif(MUI_BASE_C_DIR)
24-
set(MUI_C_LIB_DIR "${MUI_BASE_C_DIR}/lib")
25-
set(MUI_C_INCLUDE_DIR "${MUI_BASE_C_DIR}/include/wrappers/C")
26-
include_directories(${MUI_BASE_C_DIR})
27-
endif()
28-
else()
29-
if(MUI_BASE_DIR)
30-
set(MUI_C_LIB_DIR "${MUI_LIB_DIR}")
31-
set(MUI_C_INCLUDE_DIR "${MUI_INCLUDE_DIR}/wrappers/C")
32-
include_directories(${MUI_INCLUDE_DIR})
33-
elseif(MUI_BASE_C_DIR)
34-
set(MUI_C_LIB_DIR "${MUI_BASE_C_DIR}/lib")
35-
set(MUI_C_INCLUDE_DIR "${MUI_BASE_C_DIR}/include/wrappers/C")
36-
include_directories(${MUI_BASE_C_DIR})
37-
endif()
18+
if(MUI_BASE_DIR)
19+
set(MUI_C_LIB_DIR "${MUI_BASE_DIR}/lib")
20+
set(MUI_C_INCLUDE_DIR "${MUI_BASE_DIR}/include/wrappers/C")
21+
set(MUI_INCLUDE_DIR "${MUI_BASE_DIR}/include")
22+
include_directories(${MUI_INCLUDE_DIR})
3823
endif()
3924

25+
4026
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
4127
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_LINK_FLAGS}")
4228

10-wrappers/10-0-C/10-0-3-pseudo-diffusion/run_case.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ if [ -n "$1" ]; then
1111
if [ -n "$2" ]; then
1212
if [ -n "$3" ]; then
1313
# Run cmake with the provided path as the MUI include and lib directories
14-
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2 -DCMAKE_PREFIX_PATH=$3 $4
14+
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2 -DCMAKE_PREFIX_PATH=$3
1515
else
1616
# Run cmake with the provided path as the MUI include and lib directories
1717
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_C_INCLUDE_DIR=$1 -DMUI_C_LIB_DIR=$2
1818
fi
1919
else
2020
# Run cmake with the provided path as the MUI base directory
21-
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DCMAKE_PREFIX_PATH=$1
21+
cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=../ .. -DMUI_BASE_DIR=$1 -DCMAKE_PREFIX_PATH=$1/share/MUI-2.0/cmake
2222
fi
2323
else
2424
# Run cmake with the default MUI directory

0 commit comments

Comments
 (0)