Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #438, add three PDI deactivation option through CMake #543

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e237f38
Add PDI deactivation option through CMake
JAuriac Jan 30, 2025
219c858
Fix #438, cleaning and refactoring, following pull request template
JAuriac Jan 30, 2025
daf9f6b
Fix #438, cleaning
JAuriac Jan 30, 2025
b791820
Modify return status, fonctions to inline, and library call through n…
JAuriac Feb 3, 2025
f05ca4b
Move target example, and trim CMakeLists
JAuriac Feb 3, 2025
3f472e2
Done no-pdi with local paraconf; To do unit test
JAuriac Feb 4, 2025
3eacd3d
Done C unit test; To do CPP unit test
JAuriac Feb 5, 2025
81519f8
Done CPP unit test; To do Add PDI-config.cmake and check for conflict…
JAuriac Feb 6, 2025
f19d48f
Done C unit test; To do CPP unit test
JAuriac Feb 5, 2025
a9881fc
Revert manually back to commit a64d85f
JAuriac Feb 6, 2025
e2ec738
Add draft of find_package using a cmake option of CMAKE_MODULE_PATH p…
JAuriac Feb 6, 2025
a69ed44
Fix #438, Fix indent
JAuriac Feb 7, 2025
7e36d56
Fix #438, Fix indent 2
JAuriac Feb 7, 2025
39ce491
Fix #438, Fix indent 3
JAuriac Feb 7, 2025
bd561a2
Fix #438, Fix indent 4
JAuriac Feb 7, 2025
6803f74
Fix #438, Fix indent 5
JAuriac Feb 7, 2025
e016405
Fix #438, Fix indent 6
JAuriac Feb 7, 2025
41ce2b8
Update tutorial submodule repository
JAuriac Feb 12, 2025
53e4b51
Update tutorial submodule repository 2
JAuriac Feb 12, 2025
f53e676
Complete find_package option for no-pdi, update documentation, to do …
JAuriac Feb 20, 2025
e9c57d2
PR feedback fixes 1
JAuriac Feb 26, 2025
ae82166
PR feedback fixes 2 - pages breaking CI
JAuriac Feb 26, 2025
75fc3b9
PR feedback fixes 3 - pages breaking CI (tutorial version)
JAuriac Mar 4, 2025
26d508d
Update submodule to 7334107bf2e3215e508bdff23d401db8d109857b
JAuriac Mar 5, 2025
00c3534
PR feedback fixes 4 and draft for PDIConfig.cmake
JAuriac Mar 6, 2025
58b67c3
PR feedback fixes 5 - Replace FindPDI.cmake by PDIConfig.cmake
JAuriac Mar 7, 2025
192408c
Add tests cases for both of no-pdi alternatives
JAuriac Mar 7, 2025
761aae6
PR feedback fixes 6
JAuriac Mar 7, 2025
8c092a4
PR feedback fixes 7
JAuriac Mar 7, 2025
b3ab6c0
Temporary safety commit
JAuriac Mar 11, 2025
396e093
PR feedback fixes 8
JAuriac Mar 17, 2025
8ea8067
PR feedback fixes 9
JAuriac Mar 17, 2025
341bc8f
PR feedback fixes 10
JAuriac Mar 17, 2025
58913e4
PR feedback fixes 11
JAuriac Mar 17, 2025
e3152ba
PR feedback fixes 12
JAuriac Mar 17, 2025
856d272
PR feedback fixes 13
JAuriac Mar 18, 2025
0a04fcb
PR feedback fixes 14
JAuriac Mar 19, 2025
efd9d5d
PR feedback fixes 15
JAuriac Mar 19, 2025
0857f73
PR feedback fixes 16
JAuriac Mar 19, 2025
8e8f54c
PR feedback fixes 17 - Fix no-pdi test and CI
JAuriac Mar 25, 2025
aed54a7
PR feedback fixes 18 - Fix no-pdi test and CI 2
JAuriac Mar 28, 2025
fe4e53c
PR feedback fixes 19 - Fix no-pdi test and CI 3
JAuriac Mar 28, 2025
01dafb3
PR feedback fixes 20 - Fix no-pdi test and CI 4
JAuriac Mar 28, 2025
0840c30
PR feedback fixes 21 - Fix no-pdi test and CI 5
JAuriac Mar 28, 2025
abb21ca
PR feedback fixes 22 - Fix no-pdi test and CI 6
JAuriac Mar 28, 2025
bda1941
PR feedback fixes 23 - Fix no-pdi test and CI 7
JAuriac Mar 28, 2025
ae1856d
PR feedback fixes 24 - Fix no-pdi test and CI 8
JAuriac Mar 28, 2025
dc7d5d2
PR feedback fixes 25 - Fix no-pdi test and CI 9
JAuriac Mar 28, 2025
55e8055
PR feedback fixes 26 - Fix no-pdi test and CI 10
JAuriac Mar 28, 2025
972fe8c
PR feedback fixes 27
JAuriac Apr 3, 2025
24f1795
PR feedback fixes 28
JAuriac Apr 3, 2025
5975c61
PR feedback fixes 29
JAuriac Apr 3, 2025
d8c0dfd
PR feedback fixes 30
JAuriac Apr 3, 2025
38218f5
PR feedback fixes 31
JAuriac Apr 3, 2025
060f78b
PR feedback fixes 32
JAuriac Apr 3, 2025
246359e
PR feedback fixes 33
JAuriac Apr 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Before merging your code, please check the following:

* [ ] you have added a line describing your changes to the Changelog;
* [ ] you have added unit tests for any new or improved feature;
* [ ] In case you updated dependencies, you have checked pdi/docs/CheckList.md
* [ ] in case you updated dependencies, you have checked pdi/docs/CheckList.md;
* [ ] in case you added a new member to pdi.h, add the equivalent empty member to no-pdi/include/pdi.h
* you have checked your code format:
- [ ] you have checked that you respect all conventions specified in CONTRIBUTING.md;
- [ ] you have checked that the indentation and formatting conforms to the `.clang-format`;
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ each sub-project (including PDI itself) is located in the dedicated sub-project
AUTHORS file.


Julian Auriac - CEA ([email protected])
* No-PDI contributor

Julien Bigot - CEA ([email protected])
* Maintainer (Dec. 2014 - ...)
* Design and initial implementation
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Users can also write data in other format thanks to taking JSON as input for
the dedicated tools.
[#440](https://gitlab.maisondelasimulation.fr/pdidev/pdi/-/issues/440)
* Add "no-pdi", including the header no-pdi/include/pdi.h, which allows to
disable PDI effects while keeping code syntax unchanged.
[#438](https://github.com/pdidev/pdi/issues/438)

### Changed

Expand Down
32 changes: 29 additions & 3 deletions bin/build_and_run_all_tests
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ cd "${TEST_DIR}"
cd "$(mktemp -d pdibuild.XXXXX)"
TEST_DIR="${PWD}"

cd "${SRCDIR}"
TEST_DIR_NO_PDI="${TEST_DIR_NO_PDI:-${PWD}}"
cd "${TEST_DIR_NO_PDI}"
cd "$(mktemp -d pdibuild.XXXXX)"
TEST_DIR_NO_PDI="${PWD}"

cd "${SRCDIR}"
cd "$(dirname "$0")/.."
SRCDIR="${PWD}"
Expand Down Expand Up @@ -105,8 +111,28 @@ fi



# Configure, build & test
# # Configure, build & test

# cmake -DDIST_PROFILE=Devel ${CMAKE_FLAGS} "${SRCDIR}"
# make ${MAKEFLAGS}
# ctest --output-on-failure --timeout 90 ${CTEST_FLAGS} ${EXCLUDED_PDI_TESTS:+-E $EXCLUDED_PDI_TESTS} ${MAKEFLAGS} || true



# # Configure, build & test for no-pdi

# cd "${TEST_DIR_NO_PDI}"
# NO_PDI_TESTS="test_07_main_C test_07_main_CXX"
# cmake -DDISABLE_PDI=ON -DDIST_PROFILE=Devel ${CMAKE_FLAGS} "${SRCDIR}"
# make ${MAKEFLAGS}
# ctest --output-on-failure --timeout 90 ${CTEST_FLAGS} -R ${NO_PDI_TESTS} ${MAKEFLAGS}





cmake -DDIST_PROFILE=Devel ${CMAKE_FLAGS} "${SRCDIR}"
cd "${TEST_DIR_NO_PDI}"
NO_PDI_TESTS="test_07_main_C test_07_main_CXX"
cmake -DBUILD_BENCHMARKING=OFF -DDISABLE_PDI=ON -DDIST_PROFILE=Devel ${CMAKE_FLAGS} "${SRCDIR}"
make ${MAKEFLAGS}
ctest --output-on-failure --timeout 90 ${CTEST_FLAGS} ${EXCLUDED_PDI_TESTS:+-E $EXCLUDED_PDI_TESTS}
ctest --output-on-failure --timeout 90 ${CTEST_FLAGS} -R ${NO_PDI_TESTS} ${MAKEFLAGS}
9 changes: 8 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ endif()
# Includes
include(CTest)
find_package(MPI REQUIRED COMPONENTS ${MPI_COMPONENTS})
find_package(PDI REQUIRED COMPONENTS ${PDI_COMPONENTS})
option(EXAMPLES_WITHOUT_PDI "Disable PDI" OFF)

if(EXAMPLES_WITHOUT_PDI)
message(WARNING "PDI is disabled.")
include(${CMAKE_CURRENT_LIST_DIR}/../no-pdi/cmake/no-pdi.cmake)
else()
find_package(PDI REQUIRED COMPONENTS ${PDI_COMPONENTS})
endif()
find_library(LIB_M m DOC "The math library")

# Default standard in the project is C11
Expand Down
37 changes: 37 additions & 0 deletions no-pdi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#=============================================================================
# Copyright (C) 2025 Commissariat a l'energie atomique et aux energies alternatives (CEA)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the names of CEA, nor the names of the contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#=============================================================================

cmake_minimum_required(VERSION 3.16...3.29)
project(PDI LANGUAGES C CXX)

# Set the CMAKE_PREFIX_PATH to include the directory containing PDIConfig.cmake
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Include PDI
include(cmake/PDIConfig.cmake)
36 changes: 36 additions & 0 deletions no-pdi/cmake/PDIConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#=============================================================================
# Copyright (C) 2025 Commissariat a l'energie atomique et aux energies alternatives (CEA)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the names of CEA, nor the names of the contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#=============================================================================

add_library(PDI_C INTERFACE)
add_library(PDI::pdi ALIAS PDI_C)
add_library(PDI::PDI_C ALIAS PDI_C)

set_target_properties(PDI_C PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/../include"
)
30 changes: 30 additions & 0 deletions no-pdi/cmake/PDIConfigVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#=============================================================================
# Copyright (C) 2025 Commissariat a l'energie atomique et aux energies alternatives (CEA)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the names of CEA, nor the names of the contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#=============================================================================

set(PDI_VERSION "1.8.3")
Loading
Loading