Browse Source

Use S4U's sg_actor_self when available

Samuel Thibault 6 years ago
parent
commit
430398684e
2 changed files with 6 additions and 2 deletions
  1. 1 1
      configure.ac
  2. 5 1
      src/common/fxt.c

+ 1 - 1
configure.ac

@@ -185,7 +185,7 @@ if test x$enable_simgrid = xyes ; then
 	AC_CHECK_FUNCS([MSG_process_attach MSG_zone_get_hosts MSG_process_self_name MSG_process_userdata_init])
 	AC_CHECK_FUNCS([xbt_mutex_try_acquire smpi_process_set_user_data sg_zone_get_by_name sg_link_name sg_host_route sg_host_self sg_host_speed simcall_process_create sg_config_continue_after_help])
 	AC_CHECK_FUNCS([xbt_barrier_init], [AC_DEFINE([STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT], [1], [Define to 1 if you have the `xbt_barrier_init' function.])])
-	AC_CHECK_FUNCS([sg_actor_sleep_for])
+	AC_CHECK_FUNCS([sg_actor_sleep_for sg_actor_self])
 	AC_CHECK_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])
 
 	# Oldies for compatibility with older simgrid

+ 5 - 1
src/common/fxt.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2013,2015                           Inria
- * Copyright (C) 2008-2018                                Université de Bordeaux
+ * Copyright (C) 2008-2019                                Université de Bordeaux
  * Copyright (C) 2010-2018                                CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -69,7 +69,11 @@ long _starpu_gettid(void)
 	 * Don't use the TSD, this is getting called before we would have the
 	 * time to allocate it.  */
 #ifdef STARPU_SIMGRID
+#  ifdef HAVE_SG_ACTOR_SELF
+	return (uintptr_t) sg_actor_self();
+#  else
 	return (uintptr_t) MSG_process_self();
+#  endif
 #else
 #if defined(__linux__)
 	return syscall(SYS_gettid);