Skip to content

Commit 56343f3

Browse files
Nightly Botcwsmith
authored andcommitted
Merging develop into master
2 parents 17ad033 + f4b020c commit 56343f3

File tree

205 files changed

+1410
-793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+1410
-793
lines changed

.github/workflows/cmake.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- { name: GNU, CC: gcc-10, CXX: g++-10 }
1616
- { name: LLVM, CC: clang, CXX: clang++ }
1717
build_type: [Debug, Release]
18+
no_mpi: [OFF, ON]
1819

1920
steps:
2021
- uses: actions/checkout@v4
@@ -30,7 +31,7 @@ jobs:
3031
env:
3132
MPICH_CXX: ${{matrix.compiler.CXX}}
3233
MPICH_CC: ${{matrix.compiler.CC}}
33-
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_VERBOSE_MAKEFILE=ON -DMESHES=${{github.workspace}}/pumi-meshes -DIS_TESTING=ON -DSCOREC_CXX_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
34+
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_VERBOSE_MAKEFILE=ON -DMESHES=${{github.workspace}}/pumi-meshes -DIS_TESTING=ON -DSCOREC_CXX_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install -DSCOREC_NO_MPI=${{matrix.no_mpi}}
3435

3536
- name: Build
3637
env:
@@ -54,3 +55,20 @@ jobs:
5455
run: |
5556
cmake -S ${{github.workspace}}/doc -B ${{github.workspace}}/buildExample -DCMAKE_CXX_COMPILER=mpicxx -DSCOREC_PREFIX=${{github.workspace}}/build/install
5657
cmake --build ${{github.workspace}}/buildExample
58+
59+
- name: Build MPI-NoMPI Example
60+
# Test if a SCOREC_NO_MPI build works with MPI applications.
61+
if: >-
62+
matrix.compiler.name == 'GNU' && matrix.build_type == 'Release' &&
63+
matrix.no_mpi == 'ON'
64+
env:
65+
MPICH_CXX: ${{matrix.compiler.CXX}}
66+
MPICH_CC: ${{matrix.compiler.CC}}
67+
run: >
68+
cmake -S ${{github.workspace}}/example/mpi-nompi
69+
-B ${{github.workspace}}/example/mpi-nompi/build
70+
-DCMAKE_CXX_COMPILER=mpicxx
71+
-DSCOREC_PREFIX=${{github.workspace}}/build/install ;
72+
cmake --build ${{github.workspace}}/example/mpi-nompi/build ;
73+
ctest --test-dir ${{github.workspace}}/example/mpi-nompi/build
74+
--output-on-failure
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Doxygen GitHub Pages Deploy Action
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install dependencies
21+
run: |
22+
sudo apt update
23+
sudo apt install gcc-10 g++-10 mpich doxygen
24+
25+
- name: Configure CMake
26+
env:
27+
MPICH_CXX: g++-10
28+
MPICH_CC: gcc-10
29+
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_VERBOSE_MAKEFILE=ON -DMESHES=${{github.workspace}}/pumi-meshes -DIS_TESTING=ON -DSCOREC_CXX_WARNINGS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install -DSCOREC_NO_MPI=ON
30+
31+
- name: Generate Doc
32+
run: doxygen ${{github.workspace}}/build/Doxyfile
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: ./doc/html
38+
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

CMakeLists.txt

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif()
66
# This is the top level CMake file for the SCOREC build
77
cmake_minimum_required(VERSION 3.8)
88

9-
project(SCOREC VERSION 3.0.3 LANGUAGES CXX C)
9+
project(SCOREC VERSION 4.0.0 LANGUAGES CXX C)
1010

1111
include(cmake/bob.cmake)
1212
include(cmake/xsdk.cmake)
@@ -22,11 +22,27 @@ endif()
2222

2323
option(ENABLE_CGNS "Enable the CGNS reader: requires c++14 extensions" OFF)
2424
message(STATUS "ENABLE_CGNS: ${ENABLE_CGNS}")
25-
if(NOT ENABLE_CGNS)
25+
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
26+
set(PUMI_USE_OMEGA_H_VERSION "10.0.0" CACHE STRING "Specify the Omega_h version PUMI should use")
27+
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")
28+
if(NOT ENABLE_CGNS AND NOT ENABLE_OMEGA_H)
29+
message(STATUS "enabling cxx11")
2630
bob_set_cxx_standard(11)
27-
else()
31+
elseif(ENABLE_CGNS)
2832
message(STATUS "enabling cxx14")
2933
bob_set_cxx_standard(14)
34+
elseif(ENABLE_OMEGA_H)
35+
message(STATUS "enabling cxx17")
36+
bob_set_cxx_standard(17)
37+
endif()
38+
39+
#
40+
# option related to MPI
41+
#
42+
option(SCOREC_NO_MPI "Disable MPI support. When enabled only serial execution is supported." OFF)
43+
message(STATUS "SCOREC_NO_MPI: ${SCOREC_NO_MPI}")
44+
if(SCOREC_NO_MPI AND ENABLE_CGNS)
45+
message(FATAL_ERROR "SCOREC_NO_MPI is incompatible with CGNS.")
3046
endif()
3147

3248
# Set some default compiler flags that should always be used
@@ -114,9 +130,6 @@ option(ENABLE_SIMMETRIX "Build with Simmetrix support" OFF)
114130
message(STATUS "ENABLE_SIMMETRIX: ${ENABLE_SIMMETRIX}")
115131
option(ENABLE_CAPSTONE "Build with Capstone support" OFF)
116132
message(STATUS "ENABLE_CAPSTONE: ${ENABLE_CAPSTONE}")
117-
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
118-
option(PUMI_USE_OMEGA_H_VERSION "Specify the Omega_h version PUMI should use" 10.0.0)
119-
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")
120133

121134
if(ENABLE_SIMMETRIX)
122135
add_definitions(-DHAVE_SIMMETRIX)
@@ -133,7 +146,10 @@ endif()
133146

134147
macro(scorec_export_library target)
135148
bob_export_target(${target})
136-
install(FILES ${HEADERS} DESTINATION include)
149+
install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
150+
target_include_directories(${target} INTERFACE
151+
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
152+
)
137153
endmacro(scorec_export_library)
138154

139155
if(ENABLE_SIMMETRIX)
@@ -146,6 +162,8 @@ if(ENABLE_CAPSTONE)
146162
endif()
147163

148164
if(ENABLE_OMEGA_H)
165+
bob_cxx17_flags()
166+
bob_set_cxx_standard(17)
149167
# find the omega_h library
150168
set(SCOREC_USE_Omega_h_DEFAULT ${ENABLE_OMEGA_H})
151169
set(Omega_h_REQUIRED_VERSION ${PUMI_USE_OMEGA_H_VERSION})
@@ -162,6 +180,10 @@ if(ENABLE_CGNS)
162180
add_definitions(-DHAVE_CGNS)
163181
endif()
164182

183+
configure_file(SCOREC_config.h.in SCOREC_config.h)
184+
install(FILES "${CMAKE_BINARY_DIR}/SCOREC_config.h" DESTINATION include)
185+
include_directories(PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>")
186+
165187
# Include the SCOREC project packages
166188
add_subdirectory(lion)
167189
add_subdirectory(pcu)

SCOREC_config.h.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef SCOREC_CONFIG_H
2+
#define SCOREC_CONFIG_H
3+
4+
#cmakedefine SCOREC_NO_MPI
5+
6+
#endif // SCOREC_CONFIG_H
7+

apf/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ add_library(apf ${SOURCES})
9393
# Include directories
9494
target_include_directories(apf PUBLIC
9595
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
96-
$<INSTALL_INTERFACE:include>
9796
)
9897

9998
# Link this library to these others

apf/apfCGNS.cc

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,9 @@ CellElementReturn WriteElements(const CGNS &cgns, apf::Mesh *m, apf::GlobalNumbe
545545
cgp_error_exit();
546546

547547
std::vector<int> allNumbersForThisType(m->getPCU()->Peers(), 0);
548-
MPI_Allgather(&numbersByElementType[o], 1, MPI_INT, allNumbersForThisType.data(), 1,
549-
MPI_INT, m->getPCU()->GetMPIComm());
548+
m->getPCU()->Allgather(
549+
&numbersByElementType[o], allNumbersForThisType.data(), 1
550+
);
550551

551552
cgsize_t num = 0;
552553
for (int i = 0; i < m->getPCU()->Self(); i++)
@@ -656,8 +657,7 @@ void AddBocosToMainBase(const CGNS &cgns, const CellElementReturn &cellResults,
656657
}
657658

658659
std::vector<int> allNumbersForThisType(m->getPCU()->Peers(), 0);
659-
MPI_Allgather(&number, 1, MPI_INT, allNumbersForThisType.data(), 1,
660-
MPI_INT, m->getPCU()->GetMPIComm());
660+
m->getPCU()->Allgather(&number, allNumbersForThisType.data(), 1);
661661

662662
cgsize_t num = 0;
663663
for (int i = 0; i < m->getPCU()->Self(); i++)
@@ -684,19 +684,16 @@ void AddBocosToMainBase(const CGNS &cgns, const CellElementReturn &cellResults,
684684
}
685685
}
686686
std::vector<int> cacheStarts(m->getPCU()->Peers(), 0);
687-
MPI_Allgather(&cacheStart, 1, MPI_INT, cacheStarts.data(), 1,
688-
MPI_INT, m->getPCU()->GetMPIComm());
687+
m->getPCU()->Allgather(&cacheStart, cacheStarts.data(), 1);
689688
std::vector<int> cacheEnds(m->getPCU()->Peers(), 0);
690-
MPI_Allgather(&cacheEnd, 1, MPI_INT, cacheEnds.data(), 1,
691-
MPI_INT, m->getPCU()->GetMPIComm());
689+
m->getPCU()->Allgather(&cacheEnd, cacheEnds.data(), 1);
692690
return std::make_pair(cacheStarts, cacheEnds);
693691
};
694692

695693
const auto globalElementList = [&m](const std::vector<cgsize_t> &bcList, std::vector<cgsize_t> &allElements) {
696694
std::vector<int> sizes(m->getPCU()->Peers(), 0); // important initialiser
697695
const int l = bcList.size();
698-
MPI_Allgather(&l, 1, MPI_INT, sizes.data(), 1,
699-
MPI_INT, m->getPCU()->GetMPIComm());
696+
m->getPCU()->Allgather(&l, sizes.data(), 1);
700697

701698
int totalLength = 0;
702699
for (const auto &i : sizes)
@@ -708,9 +705,15 @@ void AddBocosToMainBase(const CGNS &cgns, const CellElementReturn &cellResults,
708705
displacement[i] = displacement[i - 1] + sizes[i - 1];
709706

710707
allElements.resize(totalLength);
708+
#ifndef SCOREC_NO_MPI
709+
PCU_Comm comm;
710+
m->getPCU()->DupComm(&comm);
711711
MPI_Allgatherv(bcList.data(), bcList.size(), MPI_INT, allElements.data(),
712-
sizes.data(), displacement.data(), MPI_INT,
713-
m->getPCU()->GetMPIComm());
712+
sizes.data(), displacement.data(), MPI_INT, comm);
713+
MPI_Comm_free(&comm);
714+
#else
715+
std::copy(bcList.begin(), bcList.end(), allElements.begin());
716+
#endif
714717
};
715718

716719
const auto doVertexBC = [&](const auto &iter) {
@@ -1046,7 +1049,8 @@ void WriteCGNS(const char *prefix, apf::Mesh *m, const apf::CGNSBCMap &cgnsBCMap
10461049
sizes[2] = 0; // nodes are unsorted, as defined by api
10471050

10481051
// Copy communicator
1049-
auto communicator = m->getPCU()->GetMPIComm();
1052+
PCU_Comm communicator;
1053+
m->getPCU()->DupComm(&communicator);
10501054
cgp_mpi_comm(communicator);
10511055
//
10521056
cgp_pio_mode(CGP_INDEPENDENT);
@@ -1134,6 +1138,9 @@ void WriteCGNS(const char *prefix, apf::Mesh *m, const apf::CGNSBCMap &cgnsBCMap
11341138
destroyGlobalNumbering(gcn);
11351139
//
11361140
cgp_close(cgns.index);
1141+
#ifndef SCOREC_NO_MPI
1142+
MPI_Comm_free(&communicator);
1143+
#endif
11371144
}
11381145
} // namespace
11391146

apf_cap/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ include(GNUInstallDirs)
3939

4040
target_include_directories(apf_cap PUBLIC
4141
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
42-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
4342
)
4443

4544
scorec_export_library(apf_cap)

apf_sim/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ target_link_libraries(apf_sim PUBLIC ${SIMMODSUITE_LIBS})
1919
target_include_directories(gmi_sim PUBLIC ${SIMMODSUITE_INCLUDE_DIR})
2020
target_include_directories(apf_sim PUBLIC
2121
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
22-
$<INSTALL_INTERFACE:include>
2322
)
2423

2524
option(ENABLE_FIELDSIM "Enable use of FieldSim from Simmetrix SimModSuite" FALSE)

can/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ add_library(can INTERFACE)
1111
# Include directories
1212
target_include_directories(can INTERFACE
1313
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
14-
$<INSTALL_INTERFACE:include>
1514
)
1615

1716
scorec_export_library(can)

cdash/nightly.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ find_program(CTEST_GIT_COMMAND NAMES git)
4343
set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
4444

4545
function(setup_repo)
46+
if(EXISTS "${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}")
47+
cleanup_merge(develop master)
48+
endif()
4649
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}")
4750
message("Running \"git clone ${REPO_URL_BASE}.git ${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}\"")
4851
execute_process(COMMAND "${CTEST_GIT_COMMAND}" clone ${REPO_URL_BASE}.git
@@ -89,6 +92,18 @@ function(git_exec CMD ACTION)
8992
endif()
9093
endfunction(git_exec)
9194

95+
function(remove_branch_if_exists BRANCH_NAME)
96+
message("Attempting to delete ${BRANCH_NAME} if it exists")
97+
execute_process(COMMAND "${CTEST_GIT_COMMAND}" branch --list ${BRANCH_NAME}
98+
WORKING_DIRECTORY"${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}"
99+
RESULT_VARIABLE BRANCH_RET)
100+
message("git branch --list returned: ${BRANCH_RET})!")
101+
if(BRANCH_RET)
102+
message("${BRANCH_NAME} exists. Attempting to delete it.")
103+
git_exec("branch -D ${BRANCH_NAME}" "Deleted ${BRANCH_NAME}.")
104+
endif()
105+
endfunction()
106+
92107
function(create_branch BRANCH_NAME TRACKING_NAME)
93108
git_exec("branch --track ${BRANCH_NAME} ${TRACKING_NAME}"
94109
"Creating branch ${BRANCH_NAME}")
@@ -224,6 +239,7 @@ function(start_merge FIRST_BRANCH SECOND_BRANCH NEXT_ACTION)
224239
update_branch(${FIRST_BRANCH})
225240
update_branch(${SECOND_BRANCH})
226241
set(NEW_BRANCH "${SECOND_BRANCH}-into-${FIRST_BRANCH}")
242+
remove_branch_if_exists(${NEW_BRANCH})
227243
create_branch(${NEW_BRANCH} origin/${FIRST_BRANCH})
228244
checkout_branch(${NEW_BRANCH})
229245
message("Running \"git merge --no-ff --no-commit ${SECOND_BRANCH}\"")

0 commit comments

Comments
 (0)