Message-ID: <FF9DB805FC41CC4E95825A50F6806302B48FC97F@challenger.uhd.campus>
Date: 2015-10-03T15:41:38Z
From: Hodgess, Erin
Subject: Running Rmpi with a Fortran program
Hello!
I'm experimenting with using MPI with Fortran rather than C. However, mpiexec does not appear to be working.
Here are my various input files (note: these are VERY simple-minded until I get things running)
Fortran:
subroutine hellosub(size)
include '/usr/local/bin/include/mpif.h'
integer rank,size,ierror,tag,status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierror)
call MPI_FINALIZE(ierror)
end
Compilation statement:
mpif90 -shared -o hellosub.so hellosub.o
(no errors)
R code: (e4.in)
source("rmpi.test.R)
library(Rmpi)
dyn.load("hellousub.so")
rmpi.test(1)
rmpi.test.R
rmpi.test <-function(size) {
dyn.load("hellosub.so")
xplanet <- .Fortran("hellosub",size=as.integer(1))$size
cat("There are ", xplanet," planets in our universe\n")
}
Final run:
mpiexec -np 4 R CMD BATCH e4.in e4.in
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 606 RUNNING AT Es-MacBook-Air.local
= EXIT CODE: 1
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
This is run on a MacBook Air, with R Version 3.2.2. The OS on the Mac is Yosemite, Version 10.10.5
The mpif90 compiler is version 5.1.0.
Is it possible/plausible that R doesn't like the Fortran version of the MPI, please?
Thanks for any help!
Sincerely,
Erin
[[alternative HTML version deleted]]