Modify

Opened 9 years ago

Last modified 8 years ago

#2399 reopened Bugs

Python boost.mpi.Request.test() crashes

Reported by: dwchiang@… Owned by: Douglas Gregor
Milestone: Boost 1.37.0 Component: mpi
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc:

Description

With the addition of the request_with_value type, the wrapper for request::test() was broken (can't convert optional<status> to Python type). A fix:

const object request_test(request &req)                                         
{                                                                               
  ::boost::optional<status> stat = req.test();                                  
  if (stat)                                                                     
    return object(*stat);                                                       
  else                                                                          
    return object();                                                            
}                                                                               
                  

and change the wrapper for Request to use &request_test instead of &cl::test.

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Matthias Troyer

This seems to be very close to what is actually implemented? Can you check whether this problem really exists?

comment:2 Changed 8 years ago by anonymous

Resolution: invalid
Status: newclosed

I'm closing this since I cannot see that the version in 1.36 is really different from what is proposed here. Earlier versions might have that problem but not 1.36 or higher. If the problem really exists please submit a test case.

comment:3 Changed 8 years ago by anonymous

Resolution: invalid
Status: closedreopened

Sure, it's just:

import mpi

if mpi.rank == 0:

request = mpi.world.isend(value="foo", dest=1) print request.test()

$ mpirun -np 2 python bug.py Traceback (most recent call last):

File "bug.py", line 5, in <module>

print request.test()

TypeError?: No to_python (by-value) converter found for C++ type: boost::optional<boost::mpi::status>

comment:4 Changed 8 years ago by anonymous

Sorry, I forgot to say, I just verified this in 1.39.0. The appropriate wrapper is there for request_with_value, but the same thing needs to be done for request .

comment:5 Changed 8 years ago by Matthias Troyer

Now I understand the issue. I've implemented your proposed fix on the trunk. an you please check whether it works?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain Douglas Gregor.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.