[Mpi-forum] how to get MPI::Exception behavior from C bindings?

Jeff Hammond jhammond at alcf.anl.gov
Tue Nov 1 17:14:39 CDT 2011


I didn't write that code so I'm not sure but I imagine one can figure
it out from http://code.google.com/p/m-a-d-n-e-s-s/source/browse/local/trunk/src/lib/world/worldthread.cc.

I confess that I know almost nothing about C++ exceptions.  I just
looked at MADNESS and tried to figure out how I could convert it
(backwards) to using the C bindings.

Jeff

On Tue, Nov 1, 2011 at 5:09 PM, Bronis R. de Supinski <bronis at llnl.gov> wrote:
>
> What do they set as the error handler? It is not clear
> to me that this code actually does anything...
>
> On Tue, 1 Nov 2011, Jeff Hammond wrote:
>
>> Can someone explain how one can migrate (backwards) from the C++ to
>> the C bindings if they currently use MPI::Exception in a try-catch
>> block like this:
>>
>> ===================================
>>       try {
>>           ((ThreadBase*)(self))->run();
>>       }
>>       catch (const MPI::Exception& e) {
>>           error("caught an MPI exception");
>>       }
>> ===================================
>>
>> This is taken from MADNESS, btw.
>>
>> I think it is only fair for those who want to kill the C++ bindings to
>> provide a clear description of how this will not break existing codes
>> that use C++ bindings.  Clearly, many things, e.g. MPI::BYTE ->
>> MPI_BYTE, are trivial, but I see error handling as being fundamentally
>> nontrivial.
>>
>> Thanks,
>>
>> Jeff
>>
>> --
>> Jeff Hammond
>> Argonne Leadership Computing Facility
>> University of Chicago Computation Institute
>> jhammond at alcf.anl.gov / (630) 252-5381
>> http://www.linkedin.com/in/jeffhammond
>> https://wiki.alcf.anl.gov/index.php/User:Jhammond
>> _______________________________________________
>> mpi-forum mailing list
>> mpi-forum at lists.mpi-forum.org
>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
>>
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
>



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/index.php/User:Jhammond




More information about the mpi-forum mailing list