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