瀏覽代碼

Use sg_actor_ref/unref

Samuel Thibault 6 年之前
父節點
當前提交
058c4da022
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 1 1
      configure.ac
  2. 8 0
      src/common/thread.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 sg_actor_self sg_host_get_properties simgrid_get_clock])
+	AC_CHECK_FUNCS([sg_actor_sleep_for sg_actor_self sg_actor_ref sg_host_get_properties simgrid_get_clock])
 	AC_CHECK_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])
 
 	# Oldies for compatibility with older simgrid

+ 8 - 0
src/common/thread.c

@@ -89,7 +89,11 @@ int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_
 	_STARPU_CALLOC(tsd, MAX_TSD+1, sizeof(void*));
 	*thread = MSG_process_create_with_arguments(name, _starpu_simgrid_thread_start, tsd, host, 2, _args);
 #if SIMGRID_VERSION >= 31500 && SIMGRID_VERSION != 31559
+#  ifdef HAVE_SG_ACTOR_REF
+	sg_actor_ref(*thread);
+#  else
 	MSG_process_ref(*thread);
+#  endif
 #endif
 	return 0;
 }
@@ -104,7 +108,11 @@ int starpu_pthread_join(starpu_pthread_t thread STARPU_ATTRIBUTE_UNUSED, void **
 #if SIMGRID_VERSION >= 31400
 	MSG_process_join(thread, 1000000);
 #if SIMGRID_VERSION >= 31500 && SIMGRID_VERSION != 31559
+#  ifdef HAVE_SG_ACTOR_REF
+	sg_actor_unref(thread);
+#  else
 	MSG_process_unref(thread);
+#  endif
 #endif
 #else
 	starpu_sleep(1);