Skip to content
Open
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c552fb4
first step to compile
Yushan-Wang Feb 12, 2026
b39862f
Merge branch 'main' into add-a-timer-report
Yushan-Wang Mar 9, 2026
d0f3540
add a timer class
Yushan-Wang Mar 12, 2026
925f489
add timer for pdi init and finalize
Yushan-Wang Mar 12, 2026
f64e41f
add timer option in cmake
Yushan-Wang Mar 12, 2026
2771711
add timer for hdf5
Yushan-Wang Mar 12, 2026
01c5e3f
add timer for netcdf
Yushan-Wang Mar 12, 2026
b532a08
add timer for json
Yushan-Wang Mar 12, 2026
e6be2ed
add timer for serialize
Yushan-Wang Mar 12, 2026
a72d07d
add timer for user_code
Yushan-Wang Mar 12, 2026
a4eda90
Merge branch 'main' into add-a-timer-report
Yushan-Wang Mar 12, 2026
fdbfc18
revert non-relevant change
Yushan-Wang Mar 12, 2026
bef38f9
revert non-relevant change
Yushan-Wang Mar 12, 2026
b7f00e2
revert non-relevant change
Yushan-Wang Mar 12, 2026
194aeec
revert non-relevant change
Yushan-Wang Mar 12, 2026
0e08740
fix indent
Yushan-Wang Mar 12, 2026
9d19822
output cleanup
Yushan-Wang Mar 13, 2026
5f843fe
add example yaml for timing multiple plugins.
Yushan-Wang Mar 13, 2026
cfc462d
add timer for pycall
Yushan-Wang Mar 13, 2026
e851c0c
indent
Yushan-Wang Mar 13, 2026
141647e
fix copyright date
Yushan-Wang Mar 13, 2026
a7fc397
update changelog
Yushan-Wang Mar 13, 2026
ee0508b
make timer inside the context
Yushan-Wang Mar 20, 2026
28e3bbc
update mock
Yushan-Wang Mar 20, 2026
261c89e
fix indent
Yushan-Wang Mar 20, 2026
f69fc66
indent
Yushan-Wang Mar 20, 2026
89f658c
remove old calls
Yushan-Wang Mar 20, 2026
e2c23d1
reactive unit tests
Yushan-Wang Mar 20, 2026
b82a3fb
Remove Apple-specific link options from CMakeLists
Yushan-Wang Mar 31, 2026
a543aa5
Remove Apple-specific link options from CMakeLists
Yushan-Wang Mar 31, 2026
12ac8da
update changelog
Yushan-Wang Mar 31, 2026
f0f13dd
update copyright end date
Yushan-Wang Mar 31, 2026
b89a412
Merge branch 'add-a-timer-report' of https://github.com/Yushan-Wang/p…
Yushan-Wang Mar 31, 2026
8875860
Add optional yaml config member to enable timer, and add an integrati…
JAuriac Apr 1, 2026
04d73e3
rename example.yml to timer.yml
Yushan-Wang Apr 2, 2026
f3b62fa
code cleanup based on review notes
Yushan-Wang Apr 2, 2026
a6d2617
code cleanup [skip ci]
Yushan-Wang Apr 3, 2026
6b8b829
Modify HDF5 configuration in CMakeLists.txt
Yushan-Wang Apr 3, 2026
1717266
variable rename
Yushan-Wang Apr 3, 2026
fe20d6d
Merge branch 'add-a-timer-report' of https://github.com/Yushan-Wang/p…
Yushan-Wang Apr 3, 2026
11da4ee
better check for calling timer
Yushan-Wang Apr 3, 2026
5fe23ae
Merge branch 'main' into add-a-timer-report
Yushan-Wang Apr 17, 2026
63f0ca7
implement timer as plugin
Yushan-Wang Apr 21, 2026
50918db
Merge branch 'main' into add-a-timer-report
Yushan-Wang Apr 23, 2026
5085017
implement timer as a plugin
Yushan-Wang May 11, 2026
6378e6d
update
Yushan-Wang May 11, 2026
0c9c4c7
remove unchanged files
Yushan-Wang May 11, 2026
23094af
[skip ci]
Yushan-Wang May 11, 2026
699a076
[skip ci]
Yushan-Wang May 11, 2026
19cdfd1
update test
Yushan-Wang May 11, 2026
c90aa64
Merge branch 'main' into add-a-timer-report
Yushan-Wang May 11, 2026
52c23ad
indent
Yushan-Wang May 11, 2026
a71a8ec
update readme [skip ci]
Yushan-Wang May 11, 2026
920f9e7
check if both start and stop are provided
Yushan-Wang May 11, 2026
ba661f7
[skip ci]
Yushan-Wang May 11, 2026
2ba83dd
include order
Yushan-Wang May 11, 2026
d7c01e8
[skip ci]
Yushan-Wang May 11, 2026
6ef0b71
code refactor
Yushan-Wang May 12, 2026
b9965e6
update upon review
Yushan-Wang May 12, 2026
371c94a
refactor timer_plugin to use context directly and improve logging
Yushan-Wang May 12, 2026
c7c7c9b
Remove 'timer' flag from timer.yml
Yushan-Wang May 12, 2026
6950225
[skip ci]
Yushan-Wang May 12, 2026
cf64d65
Update timer plugin readme and remove unnecessary indent step
Yushan-Wang May 12, 2026
ab305f9
Apply suggestions from code review
Yushan-Wang May 12, 2026
0606135
[skip ci]
Yushan-Wang May 12, 2026
463bfc4
Merge branch 'add-a-timer-report' of https://github.com/Yushan-Wang/p…
Yushan-Wang May 12, 2026
b17327d
Fix target_compile_features placement for timer_test in CMakeLists.txt
Yushan-Wang May 12, 2026
aebc9f7
Add timer plugin support and update related configurations
Yushan-Wang May 12, 2026
bf5a8cd
Update copyright year in decl_hdf5.cxx
Yushan-Wang May 12, 2026
a04dadb
Update timer test conditions to include NETCDF_PARALLEL requirement
Yushan-Wang May 12, 2026
90a858c
Merge branch 'add-a-timer-report' of https://github.com/Yushan-Wang/p…
Yushan-Wang May 12, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to
### For users

#### Added
* A timer plugin is added to reflect the time consumed by pdi and its plugins.
* Improved messages for specification tree errors, with file & line numbers and
support for file names from Paraconf 1.1,
[#657](https://github.com/pdidev/pdi/issues/657)
Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries rather than static ones"
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(BUILD_TIMER_PLUGIN "Build Timer plugin" ON)
option(ENABLE_BENCHMARKING "Activate benchmarks in the test suite" OFF)



### Default build type

if(NOT DEFINED CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -295,9 +294,9 @@ endif()
## HDF5

if("${BUILD_DECL_HDF5_PLUGIN}" OR "${BUILD_DECL_NETCDF_PLUGIN}")

set(HDF5_CMAKE_CACHE_ARGS)
Comment thread
Yushan-Wang marked this conversation as resolved.

if("${BUILD_HDF5_PARALLEL}")
set(HDF5_PREFER_PARALLEL ON)
list(APPEND HDF5_CMAKE_CACHE_ARGS "-DHDF5_ENABLE_PARALLEL:BOOL=ON")
Expand Down Expand Up @@ -536,3 +535,10 @@ sbuild_add_module(PDI_API_TESTS
INSTALL_COMMAND ""
SUBSTEPS test
)

sbuild_add_module(TIMER_PLUGIN
ENABLE_BUILD_FLAG BUILD_TIMER_PLUGIN
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/plugins/timer"
DEPENDS PDI
# SUBSTEPS indent test
Comment thread
Yushan-Wang marked this conversation as resolved.
Outdated
)
66 changes: 66 additions & 0 deletions example/timer.yml
Comment thread
Yushan-Wang marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# duration in seconds
duration: 0.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 }
timer: true
Comment thread
Yushan-Wang marked this conversation as resolved.
Outdated
plugins:
trace: debug
timer:
- timer_h5: "decl_hdf5"
- timer_nc:
start: "decl_netcdf_start_timer"
stop: "decl_netcdf_stop_timer"
- timer_python: [pycall, user_code]
- timer_json: {start: "json_start_timer", stop: "json_stop_timer"}
- timer_pdi: "pdi"
mpi:
decl_hdf5:
file: data.h5
communicator: $MPI_COMM_WORLD # the MPI communicator used for HDF5 parallel synchronized write
datasets: # type of the datasets to create in file
data:
type: array
subtype: double
size: [10, '$psize[0]*($dsize[0]-2)', '$psize[1]*($dsize[1]-2)']
write:
main_field: # the name of the data to write
dataset: data
mpio: COLLECTIVE # or INDEPENDENT
when: '$iter<10' # do only write the first 10 iterations (0...9)
memory_selection: # exclude ghosts from the data in memory
size: ['$dsize[0]-2', '$dsize[1]-2']
start: [1, 1]
dataset_selection: # only write into a single slice in time
size: [1, '$dsize[0]-2', '$dsize[1]-2']
start: [$iter, '($dsize[0]-2)*$pcoord[0]', '($dsize[1]-2)*$pcoord[1]']
decl_netcdf:
file: data.nc
communicator: $MPI_COMM_WORLD # the MPI communicator used for HDF5 parallel synchronized write
variables: # type of the datasets to create in file
v_data:
type: array
subtype: double
size: [10, '$psize[0]*$dsize[0]', '$psize[1]*$dsize[1]']
write:
main_field: # the name of the data to write
variable: v_data
when: '$iter<10' # do only write the first 10 iterations (0...9)
variable_selection: # only write into a single slice in time
subsize: [1, '$dsize[0]', '$dsize[1]']
start: [$iter, '$dsize[0]*$pcoord[0]', '$dsize[1]*$pcoord[1]']
json:
file: data_${pcoord[0]}_${pcoord[1]}.json
when: '$iter<10'
write: [main_field]
1 change: 1 addition & 0 deletions pdi/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ set(DOXYGEN_INPUT
"${PDI_SOURCE_DIR}/../plugins/decl_hdf5/README.md"
"${PDI_SOURCE_DIR}/../plugins/decl_netcdf/README.md"
"${PDI_SOURCE_DIR}/../plugins/mpi/README.md"
"${PDI_SOURCE_DIR}/../plugins/timer/README.md"
"${PDI_SOURCE_DIR}/../plugins/trace/README.md"
"${PDI_SOURCE_DIR}/../plugins/user_code/README.md"
"${PDI_SOURCE_DIR}/../plugins/pycall/README.md"
Expand Down
1 change: 1 addition & 0 deletions pdi/docs/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
|\subpage JSON_plugin "JSON plugin" |Export data in JSON format. |
|\subpage serialize_plugin "Serialize plugin" |Serializes and deserializes shared data. |
|\subpage set_value_plugin "Set Value plugin" |Set values to data and metadata from yaml file. |
|\subpage timer_plugin "Timer plugin" |Measure the time spent by PDI and its plugins. |
|\subpage trace_plugin "Trace plugin" |Generate a trace of what happens in %PDI data store. |
|\subpage user_code_plugin "user-code plugin" |Call your function on event or when data becomes available. |

Expand Down
2 changes: 2 additions & 0 deletions pdi/src/pdi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ try {
g_transaction.clear();
g_transaction_data.clear();
Global_context::init(conf);
Global_context::context().event("pdi_start_timer");
return PDI_OK;
} catch (const Error& e) {
return g_error_context.return_err(e);
Expand All @@ -205,6 +206,7 @@ try {
Paraconf_wrapper fw;
g_transaction.clear();
g_transaction_data.clear();
Global_context::context().event("pdi_stop_timer");
Global_context::finalize();
return PDI_OK;
} catch (const Error& e) {
Expand Down
4 changes: 3 additions & 1 deletion plugins/decl_hdf5/decl_hdf5.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2015-2019 Commissariat a l'energie atomique et aux energies alternatives (CEA)
* Copyright (C) 2015-2026 Commissariat a l'energie atomique et aux energies alternatives (CEA)
* Copyright (C) 2021 Institute of Bioorganic Chemistry Polish Academy of Science (PSNC)
* All rights reserved.
*
Expand Down Expand Up @@ -114,10 +114,12 @@ class decl_hdf5_plugin: public Plugin

void data(const std::string& name, Ref ref)
{
context().event("decl_hdf5_start_timer");
Hdf5_error_handler _;
for (auto&& op: m_data[name]) {
op.execute(context());
}
context().event("decl_hdf5_stop_timer");
}

void event(const std::string& event)
Expand Down
4 changes: 4 additions & 0 deletions plugins/decl_netcdf/dnc_file_context.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Dnc_variable* Dnc_file_context::variable(const std::string& desc_name, const std

void Dnc_file_context::execute(const std::string& desc_name, PDI::Ref ref)
{
m_ctx.event("decl_netcdf_start_timer");
if (m_when.to_long(m_ctx)) {
std::list<Dnc_variable> variables_holder; // memory for Variables created from descriptor

Expand Down Expand Up @@ -276,10 +277,12 @@ void Dnc_file_context::execute(const std::string& desc_name, PDI::Ref ref)
nc_file.get_sizeof_variable(size_it->first, dataset_name, ref);
}
}
m_ctx.event("decl_netcdf_stop_timer");
}

void Dnc_file_context::execute()
{
m_ctx.event("decl_netcdf_start_timer");
if (m_when.to_long(m_ctx)) {
std::list<Dnc_variable> variables_holder;
std::vector<Dnc_variable*> variables_to_get;
Expand Down Expand Up @@ -354,6 +357,7 @@ void Dnc_file_context::execute()
i++;
}
}
m_ctx.event("decl_netcdf_stop_timer");
}

} // namespace decl_netcdf
4 changes: 3 additions & 1 deletion plugins/decl_netcdf/dnc_file_context.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2024 Commissariat a l'energie atomique et aux energies alternatives (CEA)
* Copyright (C) 2024-2026 Commissariat a l'energie atomique et aux energies alternatives (CEA)
* Copyright (C) 2020 Institute of Bioorganic Chemistry Polish Academy of Science (PSNC)
* All rights reserved.
*
Expand Down Expand Up @@ -109,6 +109,8 @@ class Dnc_file_context
* \param other Dnc_file_context to move
*/
Dnc_file_context(Dnc_file_context&& other) noexcept;

static std::string pretty_name() { return "Decl'NetCDF"; }
};

} // namespace decl_netcdf
Expand Down
3 changes: 3 additions & 0 deletions plugins/json/json.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class json_plugin: public PDI::Plugin

~json_plugin() { context().logger().info("Closing plugin"); }

static std::string pretty_name() { return "JSON"; }

private:
/** Read the configuration file
Expand Down Expand Up @@ -328,6 +329,7 @@ class json_plugin: public PDI::Plugin
*/
void write_data(const std::string& data_name, Ref_r&& reference)
{
context().event("json_start_timer");
Logger& logger = context().logger();

for (const auto& [condition, fpath]: m_data_to_path_map[data_name]) {
Expand Down Expand Up @@ -374,6 +376,7 @@ class json_plugin: public PDI::Plugin
}
logger.debug("Done ! {} ", data_name);
}
context().event("json_stop_timer");
}
};

Expand Down
2 changes: 2 additions & 0 deletions plugins/pycall/pycall.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ class Trigger
alias.expose(ctx, pyscope);
}
try {
ctx.event("pycall_start_timer");
pybind11::exec(m_code, pyscope);
ctx.event("pycall_stop_timer");
} catch (const std::exception& e) {
ctx.logger().error("while calling python, caught exception: {}", e.what());
} catch (...) {
Expand Down
2 changes: 2 additions & 0 deletions plugins/serialize/serialize.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ struct serialize_plugin: PDI::Plugin {
*/
void share_serialized(const std::string& desc_name, PDI::Ref ref)
{
context().event("serialize_start_timer");
std::string serialized_name = m_desc_to_serialize[desc_name];
context().logger().debug("Serializing `{}` as `{}`", desc_name, serialized_name);
PDI::Datatype_sptr serialized_type = serialize_type(ref.type());
Expand Down Expand Up @@ -333,6 +334,7 @@ struct serialize_plugin: PDI::Plugin {
);
m_serialized_remove_callback.emplace_back(serialized_name, remove_callback, PDI_IN);
}
context().event("serialize_stop_timer");
}

void release_serialized(const std::string& desc_name, PDI::Ref ref)
Expand Down
48 changes: 48 additions & 0 deletions plugins/timer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#=============================================================================
# Copyright (C) 2026 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.22...4.2)
project(pdi_timer_plugin LANGUAGES C CXX)

# Includes
include(CTest)
include(GNUInstallDirs)

# PDI
find_package(PDI REQUIRED COMPONENTS plugins)

# The plugin
add_library(pdi_timer_plugin MODULE timer.cxx)
target_link_libraries(pdi_timer_plugin PUBLIC PDI::PDI_plugins )

# Installation
set(INSTALL_PDIPLUGINDIR "${PDI_DEFAULT_PLUGINDIR}" CACHE PATH "PDI plugins (${PDI_DEFAULT_PLUGINDIR})")
install(TARGETS pdi_timer_plugin
LIBRARY DESTINATION "${INSTALL_PDIPLUGINDIR}"
)

# Tests
if("${BUILD_TESTING}")
add_subdirectory(tests/)
endif()
28 changes: 28 additions & 0 deletions plugins/timer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Timer plugin {#timer_plugin}

The timer plugin allows measuring time spent by PDI and its plugins.

## Configuration {#timer_configuration}

Simple plugin build:
```yaml
plugins:
timer:
- timer_A: {start: "decl_hdf5_start_timer", stop: "decl_hdf5_stop_timer"}
- timer_B: "decl_hdf5"
- timer_C: [toto, titi]
- timer_D:
start: "begin_timing"
stop: "end_timing"
```

The timer plugin configuration contains a list of timer names (e.g. `- timer_A`, `- timer_B`, etc). Each timer will record the time spent between the `start` and `stop` events.

`timer_A` uses a map-styled definition where both keys `start` and `stop` are mandatory.

`timer_B` uses a scalar-styled definition where only the prefix of the timer events is provided. The prefix can be wither a user-defined name, or the name of the PDI plugins, such as `decl_hdf5`, `decl_netcdf`, `pycall`, etc. If the prefix is the PDI plugin, internal events named with `prefix_start_timer` and `prefix_stop_timer` will be emitted inside the plugin (except `set_value`). In the above example, `timer_B` is equivalent to `timer_A`.
Comment thread
Yushan-Wang marked this conversation as resolved.
Outdated

`timer_C` uses a list-styled definition where a list of prefix is provided. If the name is not one of the PDI plugins' name, then it is the user's responsibility to emit the `prefix_start_timer` and `prefix_stop_timer` events. In this example, `timer_C` will recored the time spent between `toto_start_timer`, `toto_stop_timer`, and between `titi_start_timer`, `titi_stop_timer`.
Comment thread
Yushan-Wang marked this conversation as resolved.
Outdated

It is also possible to have different names for start and stop events such as `timer_D`.

47 changes: 47 additions & 0 deletions plugins/timer/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#=============================================================================
# Copyright (C) 2026 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 LIABLEq 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.22...4.2)

set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY TEST_INCLUDE_FILE "${CMAKE_CURRENT_BINARY_DIR}/TestPath.cmake")

file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/TestPath.cmake"
CONTENT "
set(PDI_PLUGIN_PATH \"\$ENV{PDI_PLUGIN_PATH}\")\n
if(\"x\${PDI_PLUGIN_PATH}x\" STREQUAL xx)\n
set(ENV{PDI_PLUGIN_PATH} \"\$<TARGET_FILE_DIR:pdi_timer_plugin>\")\n
else()\n
set(ENV{PDI_PLUGIN_PATH} \"\$<TARGET_FILE_DIR:pdi_timer_plugin>:\${PDI_PLUGIN_PATH}\")\n
endif()
"
)

find_package(MPI REQUIRED)

# 3. Set the C++ standard (using the variable from your matrix)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Comment thread
Yushan-Wang marked this conversation as resolved.
Outdated

add_executable(timer_test timer_test.cxx )
target_link_libraries(timer_test PDI::PDI_C MPI::MPI_CXX)
Loading