[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPI: the example of R

From: J.D. Cole
Subject: Re: MPI: the example of R
Date: Mon, 03 Mar 2003 15:11:15 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

How about this,
I am currently working on a more generalized interface for parallel computation in Octave. Along the way I have implemented a dynamically linked library, which I coined PIL (Parallel Interface Library) which allows anyone to implement their favorite parallel library (be it MPI or PVM) as a PIL external to Octave. Which parallel library to use is specified on the command line with the --parallel path/to/library.pil (This concept was mentioned before here:http://www.octave.org/mailing-lists/octave-maintainers/2003/75 ). With the addition of a small class in the main Octave source, MPI_Init can get its needed arguments. (As can any other parallel implementation.)

I have separated my PIL code from my other work and attached it to the message.


Andy Jacobson wrote:


       The folks over at R (http://www.r-project.org) have put
       together an MPI package that doesn't require any changes to
       the R executable.  Everything is done with dynamically-loaded
       code.  For instance, the MPI_Init call is in this external

SEXP mpi_initialize(){
        int flag;
        if (flag)
                return AsInt(1);
        else {  
          fprintf(stdout,"About to call MPI_Init()");fflush(stdout);
                MPI_Init((void *)0,(void *)0);
          fprintf(stdout,"About to call MPI_Errhandler_set()");fflush(stdout);
                MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
          fprintf(stdout,"About to call MPI_Errhandler_set()");fflush(stdout);
                MPI_Errhandler_set(MPI_COMM_SELF, MPI_ERRORS_RETURN);
comm=(MPI_Comm *)Calloc(COMM_MAXSIZE, MPI_Comm); status=(MPI_Status *)Calloc(1, MPI_Status); datatype=(MPI_Datatype *)Calloc(1, MPI_Datatype); info=(MPI_Info *)Calloc(1, MPI_Info);

                return AsInt(1);

       So while we octavites are concerned with adhering to the
       letter of the MPI standard, the author here has instead chosen
       to get on with business by explicitly passing NULL pointers to
       MPI_Init.  Note that disclaimers in the code suggest that this
       "Rmpi" package is only likely to have full functionality with
       LAM/MPI.  The implication is that LAM may not check or use
these args (recall that this is implementation dependent).
       Information on Rmpi is at



Attachment: PIL-pil_pre_release.tar.gz
Description: GNU Zip compressed data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]