Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bool is not considered a is_mpi_logical_datatype #157

Closed
LXYan2333 opened this issue Mar 25, 2024 · 1 comment · Fixed by #163
Closed

bool is not considered a is_mpi_logical_datatype #157

LXYan2333 opened this issue Mar 25, 2024 · 1 comment · Fixed by #163
Assignees

Comments

@LXYan2333
Copy link
Contributor

Problem

when I write code to reduce a bool:

bool my_result = false;
bool reduced_result = boost::mpi::all_reduce(comm, my_result, logical_and<>());

I found that the std::logical_and<bool> is not considered a boost::mpi::is_mpi_op:

static_assert(boost::mpi::is_mpi_op<std::logical_and<bool>, bool>()); // Static assertion failed

further read the code I found that

static_assert(boost::mpi::is_mpi_datatype<bool>()); // OK
static_assert(boost::mpi::is_mpi_logical_datatype<bool>()); // Static assertion failed

this caused the boost::mpi to use a all_reduce_impl with (tiny) overhead.

@LXYan2333
Copy link
Contributor Author

LXYan2333 commented Mar 25, 2024

Expected behaviour

for bool and std::logical_and, the MPI_C_BOOL and MPI_LAND should be used in reduction, instead of using a all_reduce_impl that creats a new user_op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants