LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: XMATX_at_[hidden]
Date: 2007-09-29 14:36:18


Hello,

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.

In C i used to write something like this:
if (MPI_Recv(static_cast<void*> (&tmp), 1, MPI_INT,
                0, tag, world, &status))
                //abort programm or do something

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?

Thanks for help
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066