I'm an mpi newbie. I'm trying to parallelize my code with mpi (need to run some experiments faster). It should work like this: master sends an array of strings to the slaves, they do some job and send status_ready back to the master. When all slaves are ready, master goes into a loop and iterativelly sends a vector of doubles to the slaves, slaves process this vector and send their results (2 vectors) back to the master. When all tje messages are received, master will process it and the loop iterates (master sends the results to the slaves, etc.) It should work like this
// master - init
sendVectorWithStrings2Slaves();
// slaves
doSomeStuff();
sendReady();
// master
receiveStatuses();
// master - when all slaves are ready
while(some condition)
{
// master
sendVector2Slaves()
//slaves
receiveVector();
process();
sendTwoVectorsBack2Master();
// master
receiveAllVectors();
checkThatAllMessagesReceived();
processResults();
}
stopSlaves();
can anyone help me with mpi?