Have a look at the Error Handling section of the MPI-1.1 standard:
http://www.mpi-forum.org/docs/
Brian
On Sep 30, 2007, at 6:05 AM, XMATX_at_[hidden] wrote:
> Thank you very much for all of your answers.
> Perhaps it is a bit stupid question but it would really help me
> if you could explain shortly what it is to reset the errorhandler?
> Do you mean if i want to write my own exceptions?
>
> Thanks a lot
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: General LAM/MPI mailing list <lam_at_[hidden]>
>> Gesendet: 30.09.07 06:05:54
>> An: General LAM/MPI mailing list <lam_at_[hidden]>
>> Betreff: Re: LAM: Question using MPI with C++
>
>
>>
>> On Sep 29, 2007, at 12:36 PM, XMATX_at_[hidden] wrote:
>>
>>> i'm still very new to MPI. I want to use it within my C++ code.
>>> I'm wondering why for example the Send(..) or Recv(..) routines in
>>> C do have an bool return value
>>> and in C++ are void.
>>>
>>> Now how should i do this in C++?
>>>
>>> Perhaps something like that?
>>> try
>>> {
>>> MPI::COMM_WORLD.Recv(&n, 1, MPI::INT, MPI::ANY_SOURCE,
>>> MPI::ANY_TAG, status);
>>> }
>>> catch(MPI::Exception e)
>>> {
>>> ...//do something
>>> }
>>>
>>> is this the usual way or do i forget something?
>>
>> By default (for both C and C++), errors on MPI communication will
>> case MPI to abort. So unless you're resetting the error handler on
>> the communicator in use, there's no need to check error conditions at
>> all. However, if you are (or plan to) reset the error handler,
>> the C+
>> + bindings throw exceptions on errors. So your example would be
>> correct.
>>
>> There is nothing that says you should use the C++ MPI bindings if you
>> are writing C++ code. A high percentage of the C++ codes I deal with
>> use the C bindings to MPI. If you are more comfortable with the C
>> bindings to MPI, by all means use them. There are few advantages to
>> using the C++ bindings, and there can be a number of disadvantages.
>>
>>
>> Hope this helps,
>>
>> Brian
>>
>> _______________________________________________
>> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>>
>
>
> _____________________________________________________________________
> Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
>
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
|