Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a timeout mecanism in MPI?

Everything is the title. My team and I are currently working on a project and we are using MPI. In one place, we are doing a MPI_send resquesting for a resource with a timeout. If the resource is available, we return 1 and if not and the timeout ended, we return 0. We tried using the signals like SIGALRM, but it doesn't work because every new request cancel the old ones by setting a new alarm.

Thanks for your answer !!

like image 457
Dimitri Avatar asked Nov 30 '10 11:11

Dimitri


2 Answers

You should investigate the non-blocking point-to-point communication primitives such as MPI_Isend, MPI_Irecv and MPI_Iprobe. You can then implement the timeout yourself, and use MPI_Cancel if you wish.

like image 195
Edric Avatar answered Oct 23 '22 17:10

Edric


There is no standard way to accomplish this.

Implementing the send/recv pair with non-blocking calls (e.g. MPI_Isend, MPI_Irecv) and using MPI_Test and MPI_Cancel is one possible solution.

Depending on the nature of the nature of the resource, and the number of times in the program this functionality is required, you might also consider implementing the MPI_ISend as a "persistent request" object. There is more information here: Persistent Communications.

The advantage of a persistent request is that the request can be formed, and then only executed if the resource is actually available....assuming that the resource can be checked independently of the actual MPI_* call. The persistent communication request can be re-used many times throughout the program, without needing to reform the entire MPI_Send/MPI_Recv call.

like image 2
Stan Graves Avatar answered Oct 23 '22 15:10

Stan Graves