Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2b683ab
Add Catalyst Plugin as a submodule.
francois-kitware Nov 8, 2024
e80f299
Update Changelog.
francois-kitware Nov 8, 2024
68c6b4e
Remove folder.
francois-kitware Jan 28, 2025
ba60b07
Add plugin catalyst from https://gitlab.kitware.com/keu-public/pdi-ca…
francois-kitware Jan 28, 2025
4732d2b
Add francois as author.
francois-kitware Jan 31, 2025
a662abc
Build catalyst plugin with BUILD_UNSTABLE option only.
francois-kitware Jan 31, 2025
f2ca845
Update copyright
francois-kitware Jan 31, 2025
43b7b7e
fix bug of cell_points_size
jmorice91 Jul 30, 2025
18445fb
PDI_data remove
jmorice91 Aug 26, 2025
86c681d
remove unecessary line
jmorice91 Sep 15, 2025
c5a5a67
adding example for the tutorial
jmorice91 Sep 15, 2025
34537f4
change data name for ghosts
jmorice91 Sep 15, 2025
b93fd16
Remove example of the tututorial, fix bug of Catalyst_DIR, clean the …
jmorice91 Nov 19, 2025
26e668d
remove comment for pressure plot
jmorice91 Nov 19, 2025
1dd559a
Fix #482, fix suggestion
jmorice91 Nov 21, 2025
09f94a1
remove clang-format and gitignore
jmorice91 Nov 24, 2025
5589a61
improve the method to take account the integer type
jmorice91 Dec 2, 2025
3cbb8bb
add copyright header
jmorice91 Dec 3, 2025
0472fd9
change format to snake_case
jmorice91 Dec 5, 2025
1cc0640
filename in snake case
jmorice91 Dec 5, 2025
62b9aad
small changes
jmorice91 Feb 18, 2026
528662a
adding example with catalyst
jmorice91 Apr 14, 2026
1ed529a
Update catalyst plugin core
jmorice91 Apr 14, 2026
55da19c
update catalyst test
jmorice91 Apr 14, 2026
9f55394
adding test with the ghost
jmorice91 Apr 14, 2026
abb7862
fix authors list
jmorice91 Apr 24, 2026
188db01
update readme
jmorice91 Apr 24, 2026
f6eaebe
fix Config_error
jmorice91 Apr 28, 2026
77545ba
adding python support
jmorice91 May 4, 2026
51f29ee
fix indent
jmorice91 May 4, 2026
89a55d1
remove parent_tree in struct for ghost layers
jmorice91 May 4, 2026
dbe7731
Add runtest_dir
jmorice91 May 17, 2026
efbb775
remove submodule
jmorice91 May 21, 2026
73e396c
catalyst output generated in test
jmorice91 May 21, 2026
542d8a6
runtest-dir for catalyst example
jmorice91 May 21, 2026
b7c6633
fix indent
jmorice91 May 21, 2026
09073ba
clean CMakeFiles
jmorice91 May 22, 2026
848e775
force no build of documentation in case of mini
jmorice91 May 22, 2026
eed03ef
Add Readme to documentation
jmorice91 May 22, 2026
a859d18
remove catalyst example in python for mpich
jmorice91 May 23, 2026
122ecd2
adding patch for mpi_comm
jmorice91 Jun 1, 2026
f1f5a6e
adding mpi_cxx
jmorice91 Jun 9, 2026
74b4a03
adding mpi_cxx in the list of linking librairies
jmorice91 Jun 9, 2026
e520247
add dependency of mpi plugin
jmorice91 Jun 15, 2026
b32c617
adding example with a communicator
jmorice91 Jun 16, 2026
4233806
doxygen_wrapper
jmorice91 Jun 16, 2026
df247ba
add build documentation
jmorice91 Jun 16, 2026
a460c8f
forcing building documentation
jmorice91 Jun 16, 2026
8303bb6
fix bug on string
jmorice91 Jun 16, 2026
7c39728
fix dependencies on mpi
jmorice91 Jun 16, 2026
aa81851
remove dependency on mpi plugin
jmorice91 Jun 16, 2026
c6af01a
undo dependency
jmorice91 Jun 16, 2026
511078a
undo dependency
jmorice91 Jun 16, 2026
340b3dd
undo dependency
jmorice91 Jun 16, 2026
ee8fffe
try empty set
jmorice91 Jun 16, 2026
cf4fc95
change logger level
jmorice91 Jun 16, 2026
7023c8c
fix indent
jmorice91 Jun 17, 2026
5a53aa9
remove comment + add event in case of communicator
jmorice91 Jun 25, 2026
2f7b593
remove runtest_dir
jmorice91 Jun 25, 2026
fb202b9
take account minimal version of cmake needed by catalyst
jmorice91 Jun 26, 2026
b2e0899
take account minimal version of cmake needed by catalyst
jmorice91 Jun 26, 2026
1081af5
adding run_testdir for ghost
jmorice91 Jun 29, 2026
54f1ee7
adding runtest_dir for other tests
jmorice91 Jun 29, 2026
6a311f5
add runtest-dir
jmorice91 Jul 20, 2026
6405fe2
add review comment
jmorice91 Jul 20, 2026
9299c28
add size of for conduit_index_t comparison
jmorice91 Jul 21, 2026
8c09f06
remove unnecessary line in the pipeline
jmorice91 Jul 23, 2026
5052912
change name of file
jmorice91 Jul 23, 2026
13057e0
change directory name
jmorice91 Jul 23, 2026
5135456
change directory name for tests
jmorice91 Jul 23, 2026
426d8e9
fix testname
jmorice91 Jul 23, 2026
daa390b
fix free issue
jmorice91 Jul 23, 2026
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: 3 additions & 0 deletions AUTHORS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional authors (Jacques/Yushan)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional authors (Jacques/Yushan)

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Benoit Martin - CEA (bmartin@cea.fr)
* support for const data in `PDI_share`, `PDI_expose` and `PDI_multi_expose`
* Initial implementation of the cmake test

François Mazen - Kitware (francois.mazen@kitware.com)
* Catalyst plugin creation

François-Xavier Mordant - CEA (francois-xavier.mordant@cea.fr)
* Fixed CMake issues, internal API enhancement
* Bug fix, JSON plugin
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to
* Update the error messages for invalid SYSTEM dependencies of NetCDF and HDF5,
and document the cmake option to override 'NetCDF_FIND_STRATEGIES' as
requested in [#500](https://github.com/pdidev/pdi/issues/500)
* Add Catalyst plugin from Kitware [#496](https://github.com/pdidev/pdi/pull/496)

#### Changed

Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#=============================================================================
# Copyright (C) 2015-2026 Commissariat a l'energie atomique et aux energies alternatives (CEA)
# Copyright (C) 2024-2025 Kitware SAS
#
# All rights reserved.
#
Expand Down Expand Up @@ -34,8 +35,6 @@
cmake_minimum_required(VERSION 3.22...4.2)
project(PDI_DIST LANGUAGES C CXX)



### Build options

## Global options
Expand Down Expand Up @@ -77,6 +76,7 @@ option(BUILD_TRACE_PLUGIN "Build Trace plugin" ON)
option(BUILD_USER_CODE_PLUGIN "Build User-code plugin" ON)
option(BUILD_JSON_PLUGIN "Build JSON plugin" OFF)
option(ENABLE_BENCHMARKING "Activate benchmarks in the test suite" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be an unwanted removal

option(BUILD_CATALYST_PLUGIN "Build Catalyst plugin" "${BUILD_UNSTABLE}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(gone with a rebase)

Suggested change
option(BUILD_CATALYST_PLUGIN "Build Catalyst plugin" "${BUILD_UNSTABLE}")
option(ENABLE_BENCHMARKING "Activate benchmarks in the test suite" OFF)
option(BUILD_CATALYST_PLUGIN "Build Catalyst plugin" "${BUILD_UNSTABLE}")




Expand Down Expand Up @@ -554,3 +554,10 @@ sbuild_add_module(PDI_API_TESTS
INSTALL_COMMAND ""
SUBSTEPS test
)

sbuild_add_module(CATALYST_PLUGIN
ENABLE_BUILD_FLAG BUILD_CATALYST_PLUGIN
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/plugins/catalyst"
DEPENDS PDI
SUBSTEPS test
)
11 changes: 10 additions & 1 deletion bin/build_and_run_all_tests
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fi
if [[ "x${PDI_SYSTEM}" =~ ^x(ubuntu|debian) && "x${PDI_MPI}" = "xmpich" ]]
then
# Workaround: mpi4py in debuntu is packaged for openmpi only
EXCLUDED_PDI_TESTS="${EXCLUDED_PDI_TESTS:+$EXCLUDED_PDI_TESTS|}PDI_example_trace_P|PDI_example_decl_hdf5_P"
EXCLUDED_PDI_TESTS="${EXCLUDED_PDI_TESTS:+$EXCLUDED_PDI_TESTS|}PDI_example_trace_P|PDI_example_decl_hdf5_P|PDI_example_catalyst_P"
fi

if [[ "x${PDI_SYSTEM}" =~ ^x(ubuntu|debian) && "x${PDI_LIBS}" = "xprovided" ]]
Expand All @@ -95,6 +95,15 @@ then
CMAKE_FLAGS="${CMAKE_FLAGS} -DUSE_spdlog=SYSTEM"
fi

if [[ "x${PDI_SYSTEM}" =~ ^x(ubuntu|debian) ]] && [ -d /opt/catalyst/lib ];
then
# Workaround: catalyst need a minimal version of cmake when catalyst is compiled the directory contains the library of catalyst
CMAKE_FLAGS="${CMAKE_FLAGS} -DBUILD_CATALYST_PLUGIN=ON"
else
CMAKE_FLAGS="${CMAKE_FLAGS} -DBUILD_CATALYST_PLUGIN=OFF"
fi


# And now for the actual tests

printf "\n\n\n\e[1;36m *** Configure, build & test the whole pdi distribution\e[m\n\n"
Expand Down
32 changes: 30 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ option(BUILD_PYCALL_PLUGIN "Build Pycall plug-in" OFF)
option(BUILD_PYTHON "Build with Python support" OFF)
option(BUILD_JSON_PLUGIN "Build JSON plug-in" OFF)
option(DISABLE_PDI "Disable the use of both PDI and Paraconf in the project" OFF)
option(BUILD_CATALYST_PLUGIN "Build Catalyst plug-in" OFF)

if("${BUILD_FORTRAN}")
enable_language(Fortran)
Expand Down Expand Up @@ -91,11 +92,9 @@ end module
endif()
endif()


add_executable(PDI_example_C example.c)
target_link_libraries(PDI_example_C PRIVATE PDI::PDI_C paraconf::paraconf MPI::MPI_C m)


if("${BUILD_FORTRAN}")
add_executable(PDI_example_F example.F90)
target_link_libraries(PDI_example_F PRIVATE PDI::PDI_f90 paraconf::paraconf_f90 MPI_with_mod m)
Expand Down Expand Up @@ -161,3 +160,32 @@ add_test(NAME PDI_example_trace_P COMMAND "${MPIEXEC}" "${MPIEXEC_NUMPROC_FLAG}"
set_property(TEST PDI_example_trace_P PROPERTY TIMEOUT 15)
set_property(TEST PDI_example_trace_P PROPERTY PROCESSORS 3)
endif("${BUILD_PYTHON}")

if("${BUILD_CATALYST_PLUGIN}")
find_package(catalyst REQUIRED)
## These examples are only valid with MPI, check if catalyst is compiling with MPI
if("${CATALYST_USE_MPI}")
set(RUNTEST_DIR_CATALYST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/runtest-dir-catalyst")

## set directory to find the catalyst python script
set(CATALYST_SCRIPT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
## configure the yaml file with the previous directory
configure_file(catalyst_serial.yml.in ${CMAKE_BINARY_DIR}/catalyst_serial.yml) ## keep serial for personal testing
configure_file(catalyst.yml.in ${CMAKE_BINARY_DIR}/catalyst.yml)

add_test(NAME PDI_example_catalyst_C_serial COMMAND "${RUNTEST_DIR_CATALYST}" "${MPIEXEC}" "${MPIEXEC_NUMPROC_FLAG}" 1 ${MPIEXEC_PREFLAGS} "$<TARGET_FILE:PDI_example_C>" ${MPIEXEC_POSTFLAGS} "${CMAKE_BINARY_DIR}/catalyst_serial.yml")
set_property(TEST PDI_example_catalyst_C_serial PROPERTY TIMEOUT 15)
set_property(TEST PDI_example_catalyst_C_serial PROPERTY PROCESSORS 1)

add_test(NAME PDI_example_catalyst_C COMMAND "${RUNTEST_DIR_CATALYST}" "${MPIEXEC}" "${MPIEXEC_NUMPROC_FLAG}" 3 ${MPIEXEC_PREFLAGS} "$<TARGET_FILE:PDI_example_C>" ${MPIEXEC_POSTFLAGS} "${CMAKE_BINARY_DIR}/catalyst.yml")
set_property(TEST PDI_example_catalyst_C PROPERTY TIMEOUT 15)
set_property(TEST PDI_example_catalyst_C PROPERTY PROCESSORS 3)

if("${BUILD_PYTHON}" AND "${CATALYST_USE_PYTHON}")
add_test(NAME PDI_example_catalyst_P COMMAND "${RUNTEST_DIR_CATALYST}" "${MPIEXEC}" "${MPIEXEC_NUMPROC_FLAG}" 1 ${MPIEXEC_PREFLAGS} "$<TARGET_FILE:PDI::pdirun>" "${Python3_EXECUTABLE}" ${MPIEXEC_POSTFLAGS} "${CMAKE_CURRENT_SOURCE_DIR}/example.py" "${CMAKE_BINARY_DIR}/catalyst_serial.yml")
set_property(TEST PDI_example_catalyst_P PROPERTY TIMEOUT 15)
set_property(TEST PDI_example_catalyst_P PROPERTY PROCESSORS 1)
endif("${BUILD_PYTHON}" AND "${CATALYST_USE_PYTHON}")

endif("${CATALYST_USE_MPI}")
endif("${BUILD_CATALYST_PLUGIN}")
56 changes: 56 additions & 0 deletions example/catalyst.yml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# duration in seconds
duration: 1.75
# global [height, width] (excluding boundary conditions or ghosts)
datasize: [60, 12]
# degree of parallelism
parallelism: { height: 3, width: 1 }

# 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
data: # type of values for which PDI does not keep a copy
main_field: { size: [ '$dsize[0]', '$dsize[1]' ], type: array, subtype: double }

plugins:
mpi:
catalyst:
scripts:
script1: "@CATALYST_SCRIPT_FOLDER@/catalyst_pipeline_with_rendering.py"
on_event: "newiter"
execute:
state:
timestep: '$iter'
time: '1.0*$iter'
multiblock: 0
channels:
grid:
type: "mesh"
data:
coordsets:
my_coords:
type: "uniform"
dims: { i: '1+$dsize[1]', j: '1+$dsize[0]' }
origin:
x: '1.0*$pcoord[1]*($dsize[1]-2.0)-1.0'
y: '1.0*$pcoord[0]*($dsize[0]-2.0)-1.0'
spacing: { dx: 1.0, dy: 1.0 }
topologies:
my_mesh:
type: "uniform"
coordset: "my_coords"
# elements:
# dims: {offsets: [] strides: []}
fields:
temperature:
association: "element"
topology: "my_mesh"
volume_dependent: "false"
values:
PDI_data_array: "main_field"
size: '$dsize[0]*$dsize[1]'
ghost_layers:
my_mesh: { association: "element", start: ['1', '1'], size: ['$dsize[1]-2', '$dsize[0]-2'] }
131 changes: 131 additions & 0 deletions example/catalyst_pipeline_with_rendering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# script-version: 2.0
from paraview.simple import *
from paraview import catalyst
import time

# registrationName must match the channel name used in the
# 'CatalystAdaptor'.
producer = TrivialProducer(registrationName="grid")

# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------

# ######## render view temperature

# Create a new 'Render View'
renderView1 = CreateView('RenderView')
# renderView1.Set(
# ViewSize=[800, 600],
# InteractionMode='2D',
# CenterOfRotation=[20.0, 3.0, 0.0],
# CameraPosition=[20.0, 30.0, 408.7],
# CameraFocalPoint=[20.0, 30.0, 0.0],
# CameraFocalDisk=1.0,
# CameraParallelScale=32.0,
# )

renderView1.ViewSize=[800, 600]
renderView1.InteractionMode='2D'
renderView1.CenterOfRotation=[20.0, 3.0, 0.0]
renderView1.CameraPosition=[20.0, 30.0, 408.7]
renderView1.CameraFocalPoint=[20.0, 30.0, 0.0]
renderView1.CameraFocalDisk=1.0,
renderView1.CameraParallelScale=32.0


# get color transfer function/color map for 'temperature'
temperatureLUT = GetColorTransferFunction('temperature')
## RGB: first line: min value, last line: max value
# temperatureLUT.Set(
# RGBPoints=GenerateRGBPoints(
# range_min=0.0,
# range_max=200.0,
# ),
# ScalarRangeInitialized=1.0,
# )


temperatureLUT.RGBPoints=[0.0, 0.231373, 0.298039, 0.752941,
500000.0, 0.865003, 0.865003, 0.865003,
1000000, 0.705882, 0.0156863, 0.14902]

temperatureLUT.ScalarRangeInitialized=1.0



# show data from grid
## wgridDisplay = Show(producer, renderView1, 'UnstructuredGridRepresentation')
gridDisplay = Show(producer, renderView1, 'StructuredGridRepresentation')

gridDisplay.Representation = 'Surface With Edges'
gridDisplay.ColorArrayName = ['CELLS', 'temperature']
gridDisplay.LookupTable = temperatureLUT

# get color legend/bar for temperatureLUT in view renderView1
temperatureLUTColorBar = GetScalarBar(temperatureLUT, renderView1)
temperatureLUTColorBar.Title = 'temperature'

# set color bar visibility
temperatureLUTColorBar.Visibility = 1

# show color legend
gridDisplay.SetScalarBarVisibility(renderView1, True)

# # ----------------------------------------------------------------
# # setup extractors
# # ----------------------------------------------------------------

SetActiveView(renderView1)
# create extractor
pNG2= CreateExtractor('PNG', renderView1, registrationName='PNG2')
# trace defaults for the extractor.
pNG2.Trigger = 'TimeStep'

# init the 'PNG' selected for 'Writer'
pNG2.Writer.FileName = 'temperature_screenshot_{timestep:06d}.png'
pNG2.Writer.ImageResolution=[800, 600]
pNG2.Writer.Format = 'PNG'

# # ----------------------------------------------------------------
# # setup extractor for saving the solution in VTK file
# # ----------------------------------------------------------------

extractor_vtk_file = None

mesh_grid = producer.GetClientSideObject().GetOutputDataObject(0)
if mesh_grid.IsA('vtkUnstructuredGrid'):
extractor_vtk_file = CreateExtractor('VTU', producer, registrationName='VTU')
elif mesh_grid.IsA('vtkMultiBlockDataSet'):
extractor_vtk_file = CreateExtractor('VTM', producer, registrationName='VTM')
elif mesh_grid.IsA('vtkPartitionedDataSet'):
extractor_vtk_file = CreateExtractor('VTPD', producer, registrationName='VTPD')
else:
raise RuntimeError("Unsupported data type: %s. Check that the adaptor is providing channel named %s",
mesh_grid.GetClassName(), "grid")


# ------------------------------------------------------------------------------
# Catalyst options
options = catalyst.Options()
## 0: no client, generate the png images and vtk files.
## 1: interactive
options.EnableCatalystLive = 0


# Greeting to ensure that ctest knows this script is being imported
print("#############################################################")
print("executing catalyst_pipeline")
print("#############################################################")
def catalyst_execute(info):
global producer
producer.UpdatePipeline()
print("-----------------------------------")
print("executing (cycle={}, time={})".format(info.cycle, info.time))
print("bounds:", producer.GetDataInformation().GetBounds())
print("temperature-range:", producer.CellData["temperature"].GetRange(0))
# In a real simulation sleep is not needed. We use it here to slow down the
# "simulation" and make sure ParaView client can catch up with the produced
# results instead of having all of them flashing at once.
if options.EnableCatalystLive:
time.sleep(0.1)
58 changes: 58 additions & 0 deletions example/catalyst_serial.yml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# duration in seconds
duration: 2.75

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.75 instead of 1.75 like other tests, is this on purpose ? Is the delay not long enough ?

# global [height, width] (excluding boundary conditions or ghosts)
datasize: [60, 12]
# degree of parallelism
parallelism: { height: 1 , width: 1 }

# 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
data: # type of values for which PDI does not keep a copy
main_field: { size: [ '$dsize[0]', '$dsize[1]' ], type: array, subtype: double }

logging: debug
plugins:
mpi:
catalyst:
scripts:
script1: "@CATALYST_SCRIPT_FOLDER@/catalyst_pipeline_with_rendering.py"
on_event: "newiter"
execute:
state:
timestep: $iter
time: 1.0*$iter
multiblock: 0
channels:
grid:
type: "mesh"
data:
coordsets:
my_coords:
type: "uniform"
dims: { i: '1+$dsize[1]', j: '1+$dsize[0]' }
origin:
x: 1.0*$pcoord[1]*($dsize[1]-2.0)-1.0
y: 1.0*$pcoord[0]*($dsize[0]-2.0)-1.0
spacing: { dx: 1.0, dy: 1.0 }
topologies:
my_mesh:
type: "uniform"
coordset: "my_coords"
fields:
temperature:
association: "element"
topology: "my_mesh"
volume_dependent: "false"
values:
PDI_data_array: "main_field"
size: $dsize[0]*$dsize[1]
ghost_layers:
my_mesh:
association: "element"
start: ['1', '1']
size: ['$dsize[1]-2', '$dsize[0]-2']
Loading