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<http://www.mpi-forum.org/docs/mpi-11-html/node150.html#node150>and
>> MPI_Wtick<http://www.mpi-forum.org/docs/mpi-11-html/node150.html#node150>)
>> 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<http://www.mpi-forum.org/docs/mpi-11-html/node148.html#node148>;
>> 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