0

I have written an Rmpi code in which I wish the master to share the burden of work equally with the slaves. So function work_by_master does mpi.bcast.cmd to work_by_slaves which both inturn call work_to_be_done_per_process before doing send-receive to exchange the result.

I was constantly getting an error:

Error in mpi.probe(source, tag, comm, status) : ignoring SIGPIPE signal
Calls: work_by_master -> mpi.recv.Robj -> mpi.probe -> .Call

I struggled hard to understand what the error is and finally after investing a LOT of time, indirectly realized that perhaps the error comes from the fact that the slaves cannot call a user-defined function in a nested way. When I incorporated work_to_be_done_per_process within work_by_slaves and let only the master call work_to_be_done_per_process, the error was resolved.

I also duplicated the function work_to_be_done_per_process into work_to_be_done_per_process_by_slaves and work_to_be_done_per_process_by_master and let the slaves and the master call them respectively. Even this did not solve the problem. Hence only my above conclusion seems to be the reason.

Is it true? Has anyone else also faced this problem that slave cannot call a user-defined function from inside it? Is there a way to correctly do it.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
Aditi
  • 59
  • 4
  • 1
    You have not selected an answer as the correct one (as you have not done for any of your questions). If we help you through stackoverflow, please tick the answer you thought was the right answer. In this way the community knows that the question has been answered, and the answerer gets some reputation. – Paul Hiemstra Feb 29 '12 at 08:09

1 Answers1

2

In my experience with parallel processing in R, each core that is used in the cluster get's a separate R environment. All those environments are initialized as you would start a normal R session. So any used defined functions which are not loaded by default when starting an R session, are not available. Loading them into the worker nodes should fix this problem. In a recent blog post, I showed how to do this for SNOW clusters, maybe it is of some use to you.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149