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.