소스 검색

Avoid making simgrid spin on data requests, we can wake workers on data transfer termination.

Samuel Thibault 12 년 전
부모
커밋
87ebda3263
4개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 0
      src/core/simgrid.c
  2. 2 0
      src/core/workers.c
  3. 1 7
      src/datawizard/progress.c
  4. 6 1
      src/drivers/driver_common/driver_common.c

+ 3 - 0
src/core/simgrid.c

@@ -323,6 +323,9 @@ static int transfer_execute(int argc STARPU_ATTRIBUTE_UNUSED, char *argv[] STARP
 	_STARPU_PTHREAD_COND_BROADCAST(transfer->cond);
 	_STARPU_PTHREAD_MUTEX_UNLOCK(transfer->mutex);
 
+	/* The workers which started this request may be sleeping out of tasks, wake it  */
+	_starpu_wake_all_blocked_workers_on_node(transfer->run_node);
+
 	/* Wake transfers waiting for my termination */
 	/* Note: due to possible preemption inside process_create, the array
 	 * may grow while doing this */

+ 2 - 0
src/core/workers.c

@@ -945,8 +945,10 @@ unsigned _starpu_worker_can_block(unsigned memnode STARPU_ATTRIBUTE_UNUSED)
 #else
 	unsigned can_block = 1;
 
+#ifndef STARPU_SIMGRID
 	if (!_starpu_check_that_no_data_request_exists(memnode))
 		can_block = 0;
+#endif
 
 	if (!_starpu_machine_is_running())
 		can_block = 0;

+ 1 - 7
src/datawizard/progress.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2012  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2012-2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -25,12 +25,6 @@
 
 void _starpu_datawizard_progress(uint32_t memory_node, unsigned may_alloc)
 {
-#ifdef STARPU_SIMGRID
-#if STARPU_DEVEL
-#warning FIXME
-#endif
-	MSG_process_sleep(0.000010);
-#endif
 	/* in case some other driver requested data */
 	_starpu_handle_pending_node_data_requests(memory_node);
 	_starpu_handle_node_data_requests(memory_node, may_alloc);

+ 6 - 1
src/drivers/driver_common/driver_common.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012  Université de Bordeaux 1
+ * Copyright (C) 2010-2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
@@ -174,6 +174,11 @@ struct starpu_task *_starpu_get_worker_task(struct _starpu_worker *args, int wor
 
 		if (_starpu_worker_can_block(memnode))
 			_STARPU_PTHREAD_COND_WAIT(&args->sched_cond, &args->sched_mutex);
+#ifdef STARPU_SIMGRID
+		else
+			/* XXX: has to busy-loop for progression hooks  */
+			MSG_process_sleep(0.000010);
+#endif
 
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&args->sched_mutex);