-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple pdi example and remove pdi from other examples
- Loading branch information
1 parent
2d751a7
commit 11e99ef
Showing
5 changed files
with
75 additions
and
72 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
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,73 @@ | ||
// Copyright (C) The DDC development team, see COPYRIGHT.md file | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include <string> | ||
|
||
#include <ddc/ddc.hpp> | ||
#include <ddc/pdi.hpp> | ||
|
||
#include <Kokkos_Core.hpp> | ||
#include <paraconf.h> | ||
#include <pdi.h> | ||
|
||
struct DDimX | ||
{ | ||
}; | ||
|
||
struct DDimY | ||
{ | ||
}; | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
Kokkos::ScopeGuard const kokkos_scope(argc, argv); | ||
ddc::ScopeGuard const ddc_scope(argc, argv); | ||
|
||
std::string const pdi_cfg = R"PDI_CFG( | ||
metadata: | ||
pdi_chunk_label_rank: size_t | ||
pdi_chunk_label_extents: | ||
type: array | ||
subtype: size_t | ||
size: $pdi_chunk_label_rank | ||
data: | ||
pdi_chunk_label: | ||
type: array | ||
subtype: int | ||
size: [ '$pdi_chunk_label_extents[0]', '$pdi_chunk_label_extents[1]' ] | ||
plugins: | ||
decl_hdf5: | ||
- file: 'output.h5' | ||
on_event: some_event | ||
collision_policy: replace_and_warn | ||
write: | ||
- pdi_chunk_label_rank | ||
- pdi_chunk_label_extents | ||
- pdi_chunk_label | ||
)PDI_CFG"; | ||
|
||
PC_tree_t pdi_conf = PC_parse_string(pdi_cfg.c_str()); | ||
PDI_init(pdi_conf); | ||
|
||
{ | ||
ddc::DiscreteDomain<DDimX, DDimY> const | ||
ddom_xy(ddc::DiscreteElement<DDimX, DDimY>(7, 11), | ||
ddc::DiscreteVector<DDimX, DDimY>(3, 5)); | ||
|
||
ddc::Chunk | ||
chunk("ddc_chunk_label", | ||
ddom_xy, | ||
ddc::HostAllocator<int>()); | ||
|
||
ddc::parallel_fill(chunk, 3); | ||
|
||
ddc::PdiEvent("some_event") | ||
.with("pdi_chunk_label", chunk.span_cview()); | ||
} | ||
|
||
PDI_finalize(); | ||
PC_tree_destroy(&pdi_conf); | ||
} |
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