Browse Source

simgrid: adding environment variable to take into account task submission costs in simgrid mode

Luka Stanisic 8 years ago
parent
commit
7437946cf8

+ 4 - 1
ChangeLog

@@ -2,7 +2,7 @@
 #
 # Copyright (C) 2009-2016  Université de Bordeaux
 # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
-# Copyright (C) 2014 INRIA
+# Copyright (C) 2014, 2016 INRIA
 #
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -26,6 +26,9 @@ 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.
 
 Changes:
   * Vastly improve simgrid simulation time.

+ 4 - 3
doc/doxygen/chapters/470_simgrid.doxy

@@ -2,7 +2,7 @@
  * This file is part of the StarPU Handbook.
  * Copyright (C) 2009--2011  Universit@'e de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
- * Copyright (C) 2011, 2012 INRIA
+ * Copyright (C) 2011, 2012, 2016 INRIA
  * See the file version.doxy for copying conditions.
  */
 
@@ -139,8 +139,9 @@ 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 and
-\ref STARPU_SIMGRID_CUDA_QUEUE_COST environment variables.
+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.
 
 \section SimulationMPIApplications MPI Applications
 

+ 11 - 2
doc/doxygen/chapters/501_environment_variables.doxy

@@ -2,7 +2,7 @@
  * This file is part of the StarPU Handbook.
  * Copyright (C) 2009--2011  Universit@'e de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
- * Copyright (C) 2011, 2012 INRIA
+ * Copyright (C) 2011, 2012, 2016 INRIA
  * See the file version.doxy for copying conditions.
  */
 
@@ -531,7 +531,7 @@ taken into account in simgrid mode.
 <dd>
 \anchor STARPU_PCI_FLAT
 \addindex __env__STARPU_PCI_FLAT
-When unset or set to to 0, the platform file created for simgrid will
+When unset or set to 0, the platform file created for simgrid will
 contain PCI bandwidths and routes.
 </dd>
 
@@ -551,6 +551,15 @@ MiB. The default is 1, thus allowing 64GiB virtual memory when Linux's
 <c>sysctl vm.max_map_count</c> value is the default 65535.
 </dd>
 
+<dt>STARPU_SIMGRID_TASK_SUBMIT_COST</dt>
+<dd>
+\anchor STARPU_SIMGRID_TASK_SUBMIT_COST
+\addindex __env__STARPU_SIMGRID_TASK_SUBMIT_COST
+When set to 1 (which is the default), task submission costs are taken into
+account in simgrid mode. This provides more accurate simgrid predictions,
+especially for the beginning of the execution.
+</dd>
+
 </dl>
 
 \section MiscellaneousAndDebug Miscellaneous And Debug

+ 2 - 0
src/core/simgrid.h

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012-2016  Université de Bordeaux
+ * Copyright (C) 2016  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -60,6 +61,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)
 
 #endif
 

+ 3 - 1
src/core/task.c

@@ -36,6 +36,7 @@
 #include <core/sched_ctx.h>
 #include <time.h>
 #include <signal.h>
+#include <core/simgrid.h>
 #ifdef STARPU_HAVE_WINDOWS
 #include <windows.h>
 #endif
@@ -681,7 +682,8 @@ int starpu_task_submit(struct starpu_task *task)
 
 	ret = _starpu_submit_job(j);
 #ifdef STARPU_SIMGRID
-	MSG_process_sleep(0.000001);
+	if (_starpu_simgrid_task_submit_cost())
+		MSG_process_sleep(0.000001);
 #endif
 
 	if (is_sync)