Browse Source

simgrid: adding another environment variable STARPU_SIMGRID_FETCHING_INPUT_COST, to simulate the time to perform a fetching input

Luka Stanisic 8 years ago
parent
commit
e310fc7224

+ 4 - 3
ChangeLog

@@ -31,9 +31,10 @@ New features:
 Small features:
   * Scheduling contexts may now be associated a user data pointer at creation
     time, that can later be recalled through starpu_sched_ctx_get_user_data().
-  * Add STARPU_SIMGRID_TASK_SUBMIT_COST to simulate the cost of task submission
-    in simgrid mode. This provides more accurate simgrid predictions, especially
-    for the beginning of the execution.
+  * Add STARPU_SIMGRID_TASK_SUBMIT_COST and STARPU_SIMGRID_FETCHING_INPUT_COST
+    to simulate the cost of task submission and data fetching in simgrid mode.
+    This provides more accurate simgrid predictions, especially for the
+    beginning of the execution and regarding data transfers.
   * New configure option --enable-mpi-pedantic-isend (disabled by
     default) to acquire data in STARPU_RW (instead of STARPU_R) before
     performing MPI_Isend call

+ 2 - 2
doc/doxygen/chapters/470_simgrid.doxy

@@ -141,8 +141,8 @@ be extended as well), change the available GPU memory size, PCI memory bandwidth
 The simulation can be tweaked, to be able to tune it between a very accurate
 simulation and a very simple simulation (which is thus close to scheduling
 theory results), see the \ref STARPU_SIMGRID_CUDA_MALLOC_COST,
-\ref STARPU_SIMGRID_CUDA_QUEUE_COST and \ref STARPU_SIMGRID_TASK_SUBMIT_COST
-environment variables.
+\ref STARPU_SIMGRID_CUDA_QUEUE_COST, \ref STARPU_SIMGRID_TASK_SUBMIT_COST
+and \ref STARPU_SIMGRID_FETCHING_INPUT_COST environment variables.
 
 \section SimulationMPIApplications MPI Applications
 

+ 9 - 0
doc/doxygen/chapters/501_environment_variables.doxy

@@ -629,6 +629,15 @@ account in simgrid mode. This provides more accurate simgrid predictions,
 especially for the beginning of the execution.
 </dd>
 
+<dt>STARPU_SIMGRID_FETCHING_INPUT_COST</dt>
+<dd>
+\anchor STARPU_SIMGRID_FETCHING_INPUT_COST
+\addindex __env__STARPU_SIMGRID_FETCHING_INPUT_COST
+When set to 1 (which is the default), fetching input costs are taken into
+account in simgrid mode. This provides more accurate simgrid predictions,
+especially regarding data transfers.
+</dd>
+
 </dl>
 
 \section MiscellaneousAndDebug Miscellaneous And Debug

+ 1 - 0
src/core/simgrid.h

@@ -66,6 +66,7 @@ starpu_pthread_queue_t _starpu_simgrid_task_queue[STARPU_NMAXWORKERS];
 #define _starpu_simgrid_cuda_malloc_cost() starpu_get_env_number_default("STARPU_SIMGRID_CUDA_MALLOC_COST", 1)
 #define _starpu_simgrid_queue_malloc_cost() starpu_get_env_number_default("STARPU_SIMGRID_QUEUE_MALLOC_COST", 1)
 #define _starpu_simgrid_task_submit_cost() starpu_get_env_number_default("STARPU_SIMGRID_TASK_SUBMIT_COST", 1)
+#define _starpu_simgrid_fetching_input_cost() starpu_get_env_number_default("STARPU_SIMGRID_FETCHING_INPUT_COST", 1)
 
 /* Called at initialization to count how many GPUs are interfering with each
  * bus */

+ 8 - 0
src/datawizard/coherency.c

@@ -1012,6 +1012,10 @@ int _starpu_fetch_task_input(struct starpu_task *task, struct _starpu_job *j, in
 		{
 			ret = _starpu_fetch_data_on_node(handle, node, local_replicate, mode, 0, 0, 1,
 					_starpu_fetch_task_input_cb, worker, 0, "_starpu_src_common_worker_internal_work");
+#ifdef STARPU_SIMGRID
+			if (_starpu_simgrid_fetching_input_cost())
+				MSG_process_sleep(0.000001);
+#endif
 			if (STARPU_UNLIKELY(ret))
 			{
 				/* Ooops, not enough memory, make worker wait for these for now, and the synchronous call will finish by forcing eviction*/
@@ -1022,6 +1026,10 @@ int _starpu_fetch_task_input(struct starpu_task *task, struct _starpu_job *j, in
 		else
 		{
 			ret = fetch_data(handle, node, local_replicate, mode, 0);
+#ifdef STARPU_SIMGRID
+			if (_starpu_simgrid_fetching_input_cost())
+				MSG_process_sleep(0.000001);
+#endif
 			if (STARPU_UNLIKELY(ret))
 				goto enomem;
 		}