Thanks.
Yes, I meant in the question that I was looking for something creative, both 
fast responding and not using 100% CPU all the time.
I guess I’m not the first one to face this question. Have anyone done anything 
“better” than the simple solution?
--------------------------------
Jacob M. Katz | jacob.k...@intel.com<mailto:jacob.k...@intel.com> | Work: 
+972-4-865-5726 | iNet: (8)-465-5726

From: users-boun...@open-mpi.org [mailto:users-boun...@open-mpi.org] On Behalf 
Of Richard Treumann
Sent: Friday, December 04, 2009 22:03
To: Open MPI Users
Subject: Re: [OMPI users] Mimicking timeout for MPI_Wait


If you are hoping for a return on timeout, almost zero CPU use while waiting 
and fast response you will need to be pretty creative. Here is a simple 
solution that may be OK if you do not need both fast response and low CPU load.

flag = false;
for ( ; ! is_time_up(); )
MPI_Test( ........ &flag, ......);
if (flag) break;
usleep(..)
}

Make the sleep short or leave it out and you hog CPU, make it long and your lag 
time for detecting a message that arrives after you enter the loop will average 
1/2 the sleep plus a bit.



Dick Treumann - MPI Team
IBM Systems & Technology Group
Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
Tele (845) 433-7846 Fax (845) 433-8363


users-boun...@open-mpi.org wrote on 12/04/2009 01:38:05 PM:

> [image removed]
>
> Re: [OMPI users] Mimicking timeout for MPI_Wait
>
> Jeff Squyres
>
> to:
>
> Open MPI Users
>
> 12/04/2009 01:38 PM
>
> Sent by:
>
> users-boun...@open-mpi.org
>
> Please respond to Open MPI Users
>
> On Dec 3, 2009, at 3:31 AM, Katz, Jacob wrote:
>
> > I wonder if there is a BKM (efficient and portable) to mimic a
> timeout with a call to MPI_Wait, i.e. to interrupt it once a given
> time period has passed if it hasn’t returned by then yet.
>
> Pardon my ignorance, but what does BKM stand for?
>
> Open MPI does not currently implement a timeout-capable MPI_WAIT.
> Such functionality probably could be implemented (e.g., in the MPIX
> "experimental" namespace), especially since Open MPI polls for
> progress -- it could check a timer every so often while polling --
> but no one has done so.
>
> --
> Jeff Squyres
> jsquy...@cisco.com
>
>
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Reply via email to