We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b4d361 commit 2f7f8d0Copy full SHA for 2f7f8d0
distributed/comm/mpi.py
@@ -102,6 +102,7 @@ class AsyncMPISend:
102
def __init__(self, msg, target, tag):
103
self._request = _mpi_comm.isend(msg, dest=target, tag=tag)
104
self._lock = threading.Lock()
105
+ self._sleep_time = 0.001
106
if log_msg_time:
107
self._start = time.time()
108
if log_msg:
@@ -121,7 +122,8 @@ def __await__(self):
121
122
seconds = time.time() - self._start
123
logger.debug(f"AsyncMPISend milliseconds={seconds*1000:.3f}")
124
return True
- yield from asyncio.sleep(_polling_time).__await__()
125
+ yield from asyncio.sleep(self._sleep_time).__await__()
126
+ self._sleep_time *= 2 # Backoff.
127
128
def cancel(self):
129
with self._lock:
0 commit comments