浏览代码

Fix blocking situation when MPI wait for all. ft service requests are still pending (for possible CP discard), while we may want to call mpi_wait_for_all.

Romain LION 4 年之前
父节点
当前提交
adaf5f4a4c
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      mpi/src/mpi/starpu_mpi_mpi.c

+ 6 - 3
mpi/src/mpi/starpu_mpi_mpi.c

@@ -1292,6 +1292,12 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 		/* shall we block ? */
 		unsigned block = _starpu_mpi_req_list_empty(&ready_recv_requests) && _starpu_mpi_req_prio_list_empty(&ready_send_requests) && _starpu_mpi_early_request_count() == 0 && _starpu_mpi_sync_data_count() == 0 && _starpu_mpi_req_list_empty(&detached_requests);
 #ifdef STARPU_USE_MPI_FT
+		if (block)
+		{
+			if (mpi_wait_for_all_running)
+				/* Tell mpi_barrier */
+				STARPU_PTHREAD_COND_SIGNAL(&barrier_cond);
+		}
 		block = block && !starpu_mpi_ft_busy();
 #endif // STARPU_USE_MPI_FT
 		if (block)
@@ -1299,9 +1305,6 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 			_STARPU_MPI_DEBUG(3, "NO MORE REQUESTS TO HANDLE\n");
 			_STARPU_MPI_TRACE_SLEEP_BEGIN();
 
-			if (mpi_wait_for_all_running)
-				/* Tell mpi_barrier */
-				STARPU_PTHREAD_COND_SIGNAL(&barrier_cond);
 			STARPU_PTHREAD_COND_WAIT(&progress_cond, &progress_mutex);
 
 			_STARPU_MPI_TRACE_SLEEP_END();