sending bitset with MPI
Asked Answered
P

1

0

What is an efficient way to send/receive bits from bitset class without conversion. Is it possible to use MPI_BYTE?

If so, what to define as container for the array that is going to hold the bits? If this is not possible, which conversion is more efficient, conversion to ulong or to strings?

Palmore answered 6/4, 2017 at 18:54 Comment(6)
How large is the bitset? Any chance it fits into an unsigned long long? How efficient do you really need it to be?Aluminiferous
I have a template and do not want to make it problem dependent,Palmore
Since there is no well defined way to access the underlying data, you can basically chose: 1) Efficient but limited to a size of 64, 2) Efficient but really dangerous and totally not portable, 3) Inefficient but general, 4) Reimplement std::bitset.Aluminiferous
option 3 does not sound bad, I think sending MPI_BYTE should somehow work, do you agree? I agree with you on uint_64Palmore
Convert to array of "bool" and sending it by MPI_BYTE works on cluster ...Palmore
Feel free to post that as an answer to your question.Aluminiferous
P
0

Convert it to array of "bool" and send by MPI_BYTE, this method works on cluster.

Palmore answered 22/5, 2017 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.