octave-maintainers
[Top][All Lists]
Advanced

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

MPI: the example of R


From: Andy Jacobson
Subject: MPI: the example of R
Date: 03 Mar 2003 13:47:10 -0500

Howdy,

        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
        function:


SEXP mpi_initialize(){
        int flag;
        MPI_Initialized(&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);
                comm[0]=MPI_COMM_WORLD;

                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
        http://www.stats.uwo.ca/faculty/yu/Rmpi/ 


        Cheers,

                Andy
-- 
Andy Jacobson

address@hidden

Program in Atmospheric and Oceanic Sciences
Sayre Hall, Forrestal Campus
Princeton University
PO Box CN710 Princeton, NJ 08544-0710 USA

Tel: 609/258-5260  Fax: 609/258-2850



reply via email to

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