-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a plugin for outputting with JSON format
- Loading branch information
1 parent
6b8af0d
commit 0e3b247
Showing
33 changed files
with
2,660 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ Benoit Martin - CEA ([email protected]) | |
* CMake maintainer (Oct. 2024 - ...) | ||
* Deisa plugin refactoring | ||
|
||
François-Xavier Mordant - CEA ([email protected]) | ||
* Fixed CMake issues, internal API enhancement | ||
* Bug fix, JSON plugin | ||
|
||
Tomasz Paluszkiewicz - PSNC ([email protected]) | ||
The scientific/academic work is financed from financial resources for science | ||
in the years 2016 - 2018 granted for the realization of the international | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#============================================================================= | ||
# Copyright (C) 2023-2024 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. | ||
#============================================================================= | ||
|
||
# duration in seconds | ||
duration: 0.75 | ||
# global [height, width] (excluding boundary conditions or ghosts) | ||
datasize: [60, 12] | ||
# degree of parallelism | ||
parallelism: { height: 2, width: 2 } | ||
|
||
# only the following config is passed to PDI | ||
pdi: | ||
metadata: # type of small values for which PDI keeps a copy | ||
iter: int # current iteration id | ||
dsize: { size: 2, type: array, subtype: int } # local data size including ghosts/boundary | ||
psize: { size: 2, type: array, subtype: int } # number of processes in each dimension | ||
pcoord: { size: 2, type: array, subtype: int } # coordinate of the process | ||
mpi_rank: int | ||
mpi_size: int | ||
data: # type of values for which PDI does not keep a copy | ||
main_field: { size: [ '$dsize[0]', '$dsize[1]' ], type: array, subtype: double } | ||
|
||
#! [example_config_json_plugin] | ||
plugins: | ||
json: | ||
- pcoord: params_pcoord_proc_${mpi_rank}.json | ||
- file : params1.json | ||
write : [dsize, psize] | ||
when: ${mpi_rank}=0 | ||
- file : params2.json | ||
when: ${mpi_rank}=0 | ||
write : [mpi_rank, mpi_size, dsize, psize, pcoord] | ||
- file : main_field_proc_${mpi_rank}_iter_${iter}.json | ||
write : [main_field] | ||
when: $iter % 100 = 0 | ||
|
||
|
||
#! [example_config_json_plugin] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Multiple people have contributed to PDI Json plugin. To show our appreciation | ||
for their public spirit, we list here in alphabetical order a condensed list of | ||
their contributions. | ||
|
||
|
||
François-Xavier Mordant - CEA ([email protected]) | ||
* Design and initial implementation | ||
* Plugin documentation | ||
* Apr. 2023 - Oct. 2023 | ||
|
||
Yushan Wang - CEA ([email protected]) | ||
* Plugin documentation and implementation | ||
* Maintainer (Oct. 2024 - ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#============================================================================= | ||
# Copyright (C) 2023-2024 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 name of CEA nor the names of its contributors may be used to | ||
# endorse or promote products derived from this software without specific | ||
# prior written permission. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
#============================================================================= | ||
|
||
cmake_minimum_required(VERSION 3.16...3.29) | ||
project(pdi_json_plugin LANGUAGES C CXX) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") | ||
|
||
# Includes | ||
include(CTest) | ||
include(GNUInstallDirs) | ||
|
||
# PDI | ||
find_package(PDI REQUIRED COMPONENTS plugins) | ||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../vendor/json" nlohmann_json) | ||
|
||
# The plugin | ||
add_library(pdi_json_plugin MODULE json.cxx) | ||
target_link_libraries(pdi_json_plugin PUBLIC PDI::PDI_plugins nlohmann_json) | ||
|
||
# Installation | ||
set(INSTALL_PDIPLUGINDIR "${PDI_DEFAULT_PLUGINDIR}" CACHE PATH "PDI plugins (${PDI_DEFAULT_PLUGINDIR})") | ||
install(TARGETS pdi_json_plugin | ||
LIBRARY DESTINATION "${INSTALL_PDIPLUGINDIR}" | ||
) | ||
|
||
# Tests | ||
if("${BUILD_TESTING}") | ||
add_subdirectory(tests/) | ||
endif() |
Oops, something went wrong.