ソースを参照

Only recent versions of simgrid support setting xbt_cfg_set_string before starting simgrid

Samuel Thibault 8 年 前
コミット
247ed5b742
共有2 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 3 1
      src/core/simgrid.c
  2. 1 1
      tests/datawizard/simgrid-locality.c

+ 3 - 1
src/core/simgrid.c

@@ -267,8 +267,10 @@ void _starpu_simgrid_init(int *argc, char ***argv)
 #ifdef HAVE_MSG_PROCESS_ATTACH
 	if (!simgrid_started)
 	{
-		_STARPU_DISP("Warning: In simgrid mode, the file containing the main() function of this application should to be compiled with starpu.h or starpu_simgrid_wrap.h included, to properly rename it into starpu_main to avoid having to use contexts/factory:thread which reduces performance\n");
+		_STARPU_DISP("Warning: In simgrid mode, the file containing the main() function of this application should to be compiled with starpu.h or starpu_simgrid_wrap.h included, to properly rename it into starpu_main to avoid having to use --cfg=contexts/factory:thread which reduces performance\n");
+#if SIMGRID_VERSION_MAJOR > 3 || (SIMGRID_VERSION_MAJOR == 3 && SIMGRID_VERSION_MINOR >= 14)
 		xbt_cfg_set_string("contexts/factory", "thread");
+#endif
 		/* We didn't catch application's main. */
 		/* Start maestro as a separate thread */
 		SIMIX_set_maestro(maestro, NULL);

+ 1 - 1
tests/datawizard/simgrid-locality.c

@@ -1,7 +1,7 @@
 /* Check that defining a main makes starpu use MSG_process_attach. */
 #include "locality.c"
 #include <config.h>
-#ifdef HAVE_MSG_PROCESS_ATTACH
+#if defined(HAVE_MSG_PROCESS_ATTACH) && SIMGRID_VERSION_MAJOR > 3 || (SIMGRID_VERSION_MAJOR == 3 && SIMGRID_VERSION_MINOR >= 14)
 #undef main
 int main(int argc, char *argv[]) {
 	return starpu_main(argc, argv);