Skip to content

Commit

Permalink
Fix ADIOS Trait for bool
Browse files Browse the repository at this point in the history
For default I/O and checkpointing via ADIOS, simulations using
our in situ radiation plugin with selected particles (by stride
or gamma) did not compile since ADIOS' C API does not define a
`bool` type for `radiationFlag`.

This adds a trait assuming it can be casted to one byte.
  • Loading branch information
ax3l committed Jan 25, 2017
1 parent 51050a5 commit b73e982
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/picongpu/include/traits/PICToAdios.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ namespace picongpu

namespace traits
{
template<>
struct PICToAdios<bool>
{
ADIOS_DATATYPES type;

PICToAdios() :
type(adios_unsigned_byte) {}

PMACC_STATIC_ASSERT_MSG(
sizeof(bool) == 1,
ADIOS_Plugin__Can_not_find_a_one_byte_representation_of_bool
);
};

template<>
struct PICToAdios<int32_t>
{
Expand Down

0 comments on commit b73e982

Please sign in to comment.