|
if(source == MPI_ANY_SOURCE) { |
|
// Very tricky to set. |
|
// If less and user sends more MPI_Send it will block the program. |
|
// TODO: Find a better solution for MPI_ANY_SOURCE |
|
worker_count = 2; |
|
} else { |
|
worker_count = job_list[source].worker_count; |
|
} |
Not a good implementation. Will only support 2 nodes (1 compute and 1 replica). Should be more generic.
One way of making it generic it to do one PMPI_Irecv with MPI_ANY_SOURCE and spawn a new thread to PMPI_Wait for this request to complete. Once its complete this thread can check for number of nodes in this job ("n") using status.MPI_SOURCE and rank2job array and do "n - 1" PMPI_Irecv and exit. Rest will be taken care in MPI_Wait implementation.
EntangledMPI/src/mpi/init.c
Lines 1090 to 1097 in 11bf509
Not a good implementation. Will only support 2 nodes (1 compute and 1 replica). Should be more generic.
One way of making it generic it to do one
PMPI_IrecvwithMPI_ANY_SOURCEand spawn a new thread toPMPI_Waitfor this request to complete. Once its complete this thread can check for number of nodes in this job ("n") usingstatus.MPI_SOURCEandrank2jobarray and do "n - 1"PMPI_Irecvand exit. Rest will be taken care inMPI_Waitimplementation.