--- Ven 20/11/09, Riccardo Corradini <riccardocorrad...@yahoo.it> ha scritto:

Da: Riccardo Corradini <riccardocorrad...@yahoo.it>
Oggetto: Re: [OctDev] Contribution to Octave-forge with a simple  
Open-MPIPackage
A: "Jaroslav Hajek" <high...@gmail.com>
Data: Venerdì 20 novembre 2009, 14:45

Okay Jaroslav,
let's choose convenience, since we all want to improve what was done in past.
Bests
Riccardo

--- Ven 20/11/09, Jaroslav Hajek <high...@gmail.com> ha scritto:

Da: Jaroslav Hajek <high...@gmail.com>
Oggetto: Re: [OctDev] Contribution to Octave-forge with a simple  
Open-MPIPackage
A: "Michael Creel" <michael.cr...@uab.es>
Cc: "Riccardo Corradini" <riccardocorrad...@yahoo.it>, "Søren Hauberg" 
<so...@hauberg.org>, octave-dev@lists.sourceforge.net
Data: Venerdì 20 novembre 2009, 13:57



On Fri, Nov 20, 2009 at 1:44 PM, Michael Creel <michael.cr...@uab.es> wrote:

Hi all,

In another message, Jaroslav made the comment

1. info is the first output argument in all functions. I think it
should be the second one, so that it can be easily ignored if wanted.
In particular, the check in examples


if not(MPI_Initialized)
   info = MPI_Init();
end

makes
no sense (unless I'm missing something) because it's the info output
from MPI_Initialized that is tested and that is always zero.

This follows the MPI standard, which says:



All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value;
C routines as the value of the function and Fortran routines in the last
argument.  Before the value is returned, the current MPI error handler is
called.  By default, this error handler aborts the MPI job.  The error handler
may be changed with MPI_Errhandler_set; the predefined error handler
MPI_ERRORS_RETURN may be used to cause error values to be returned.
Note that MPI does not guarentee that an MPI program can continue past
an error.

MPI_SUCCESS   No error; MPI routine completed successfully.
Following the standard is a big plus, in my opinion. That way, knowledge about 
MPI previously gained from C or Fortran will be useful when using MPI with 
Octave. 
Yes, my approach still follows the standard, it's just more convenient to use. 
The standard says nothing about how external bindings should behave.

 MPITB work this way, too. I have yet to try it, but I believe that I could use 
Riccardo's stuff as a drop-in replacement for functions from MPITB. Both 
packages respect the standard. This level of compatibility should help to make 
both Riccardo's stuff and MPITB stronger, and will favor its use for large 
scale research.



Michael

If MPITB does the same, the same arguments apply for MPITB. Why not improve the 
design?
In C, the error code is the (single) return value; that makes it possible to 
easily ignore it if you simply resort to the default error handler (which 
aborts program). Octave has no output arguments but instead multiple return 
values, and the closest approximation is to always return info as the last 
argument, so that it can be safely ignored in the calls.


Riccardo, what's your opinion? Do you prefer MPITB compatibility or convenience?

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)

Prague, Czech Republic
url: www.highegg.matfyz.cz






      


      
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to