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

Fix error when mpi::wait_all is called with data of type std::vector #84

Merged
merged 1 commit into from
Jun 11, 2019

Conversation

vincentchabannes
Copy link
Contributor

Hi boost developers.
After to have upgraded my boost version to 1.69 and I have this error :

communicator.hpp:1914: static optional<boost::mpi::status> boost::mpi::request::handle_dynamic_primitive_array_irecv(boost::mpi::request *, boost::mpi::request::request_action) [T = int, A = std::allocator<int>]: Assertion `_check_result == MPI_SUCCESS' failed.

The issue can be reproduce with this code :

mpi::communicator comm;
int rank = comm.rank();
std::vector<int> data;
std::vector< mpi::request> reqs;
if ( rank == 0 )
{
    for ( int i=0;i<10;++i )
        data.push_back( i );
    reqs.push_back( comm.isend(1, 0, data) );
}
else if ( rank == 1 )
{
    reqs.push_back( comm.irecv(0, 0, data) );
}
mpi::wait_all( reqs.begin(), reqs.end() );

if ( rank == 1 )
{
     for ( int i=0;i<data.size();++i )
         std::cout << data[i] << "\n";
}

It seems that the bug appears from Bugfix/vectors mix 62 #66 .

My fix is just to replace MPI_PACKED by get_mpi_datatype() (only with test() method, it was good with wait() method)

@aminiussi
Copy link
Member

Ok, I need to add a test for that one.
Thanks!

@aminiussi aminiussi changed the base branch from develop to bugfix/wait_all_vector June 11, 2019 16:41
@aminiussi aminiussi merged commit 9905311 into boostorg:bugfix/wait_all_vector Jun 11, 2019
@aminiussi
Copy link
Member

@vincentchabannes Also, I'm assuming you are ok with the license ?

@aminiussi
Copy link
Member

@vincentchabannes also, just as a performance issue, sending a vector is two communication process, as vector are not assumed to have a known size (depending on your configuration, it can rely on MPI_Probes which can speed things up).

@aminiussi aminiussi mentioned this pull request Jun 11, 2019
@vincentchabannes
Copy link
Contributor Author

thanks @aminiussi.
And ok with the license.

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

Successfully merging this pull request may close these issues.

None yet

2 participants