Procházet zdrojové kódy

Fix MPI simgrid timings

Samuel Thibault před 10 roky
rodič
revize
296e54c0d8
2 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. 10 0
      mpi/src/starpu_mpi.c
  2. 3 0
      mpi/src/starpu_mpi_comm.c

+ 10 - 0
mpi/src/starpu_mpi.c

@@ -66,7 +66,9 @@ static starpu_pthread_cond_t cond_progression;
 /* Condition to wake up waiting for all current MPI requests to finish */
 static starpu_pthread_cond_t cond_finished;
 static starpu_pthread_mutex_t mutex;
+#ifndef STARPU_SIMGRID
 static starpu_pthread_t progress_thread;
+#endif
 static int running = 0;
 
 #ifdef STARPU_SIMGRID
@@ -1308,6 +1310,9 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 		STARPU_PTHREAD_MUTEX_UNLOCK(&detached_requests_mutex);
 #endif /* STARPU_MPI_ACTIVITY */
 
+#ifdef STARPU_SIMGRID
+		MSG_process_sleep(0.000010);
+#endif
 		if (block)
 		{
 			_STARPU_MPI_DEBUG(3, "NO MORE REQUESTS TO HANDLE\n");
@@ -1645,7 +1650,12 @@ int starpu_mpi_shutdown(void)
 	STARPU_PTHREAD_COND_BROADCAST(&cond_progression);
 	STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
 
+#ifndef STARPU_SIMGRID
 	starpu_pthread_join(progress_thread, &value);
+#else
+	/* FIXME: should rather properly wait for _starpu_mpi_progress_thread_func to finish */
+	MSG_process_sleep(1);
+#endif
 
 #ifdef STARPU_MPI_ACTIVITY
 	starpu_progression_hook_deregister(hookid);

+ 3 - 0
mpi/src/starpu_mpi_comm.c

@@ -129,6 +129,9 @@ int _starpu_mpi_comm_test_recv(MPI_Status *status, struct _starpu_mpi_envelope *
 		if (_comm->posted)
 		{
 			/* test whether an envelope has arrived. */
+#ifdef STARPU_SIMGRID
+			MSG_process_sleep(0.000010);
+#endif
 			res = MPI_Test(&_comm->request, &flag, status);
 			STARPU_ASSERT(res == MPI_SUCCESS);
 			if (flag)