浏览代码

use sg_host_speed when available instead of MSG_host_get_speed

Samuel Thibault 7 年之前
父节点
当前提交
edcdf9c0c5
共有 3 个文件被更改,包括 11 次插入6 次删除
  1. 3 2
      configure.ac
  2. 4 2
      src/core/simgrid.c
  3. 4 2
      src/drivers/opencl/driver_opencl.c

+ 3 - 2
configure.ac

@@ -1,7 +1,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2011-2017                                Inria
-# Copyright (C) 2009-2017                                Université de Bordeaux
+# Copyright (C) 2009-2018                                Université de Bordeaux
 # Copyright (C) 2010-2018                                CNRS
 # Copyright (C) 2013                                     Thibaut Lambert
 # Copyright (C) 2011                                     Télécom-SudParis
@@ -166,7 +166,8 @@ if test x$enable_simgrid = xyes ; then
 	AC_CHECK_HEADERS([simgrid/host.h], [AC_DEFINE([STARPU_HAVE_SIMGRID_HOST_H], [1], [Define to 1 if you have host.h in simgrid/.])])
 	AC_CHECK_HEADERS([xbt/synchro.h], [AC_DEFINE([STARPU_HAVE_XBT_SYNCHRO_H], [1], [Define to 1 if you have synchro.h in xbt/.])])
 	AC_CHECK_TYPES([smx_actor_t], [AC_DEFINE([STARPU_HAVE_SMX_ACTOR_T], [1], [Define to 1 if you have the smx_actor_t type.])], [], [[#include <simgrid/simix.h>]])
-   	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_zone_get_by_name MSG_environment_get_routing_root MSG_zone_get_hosts MSG_host_get_speed MSG_process_self_name])
+	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_zone_get_by_name MSG_environment_get_routing_root MSG_zone_get_hosts MSG_host_get_speed MSG_process_self_name])
+	AC_CHECK_FUNCS([sg_host_speed])
 	AC_CHECK_FUNCS([xbt_mutex_try_acquire smpi_process_set_user_data sg_link_name sg_host_route sg_host_self simcall_process_create])
 	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_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])

+ 4 - 2
src/core/simgrid.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013,2015-2017                      CNRS
  * Copyright (C) 2016-2017                                Inria
- * Copyright (C) 2012-2017                                Université de Bordeaux
+ * Copyright (C) 2012-2018                                Université de Bordeaux
  *
  * 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
@@ -557,7 +557,9 @@ void _starpu_simgrid_submit_job(int workerid, struct _starpu_job *j, struct star
 	}
 
 	simgrid_task = MSG_task_create(_starpu_job_get_task_name(j),
-#ifdef HAVE_MSG_HOST_GET_SPEED
+#ifdef HAVE_SG_HOST_SPEED
+			length/1000000.0*sg_host_speed(MSG_host_self()),
+#elif defined HAVE_MSG_HOST_GET_SPEED
 			length/1000000.0*MSG_host_get_speed(MSG_host_self()),
 #else
 			length/1000000.0*MSG_get_host_speed(MSG_host_self()),

+ 4 - 2
src/drivers/opencl/driver_opencl.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012,2015,2017                      Inria
- * Copyright (C) 2010-2017                                Université de Bordeaux
+ * Copyright (C) 2010-2018                                Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2017                                CNRS
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -955,7 +955,9 @@ static int _starpu_opencl_start_job(struct _starpu_job *j, struct _starpu_worker
 #endif
 			struct starpu_profiling_task_info *profiling_info = task->profiling_info;
 			STARPU_ASSERT_MSG(profiling_info->used_cycles, "Application kernel must call starpu_opencl_collect_stats to collect simulated time");
-#ifdef HAVE_MSG_HOST_GET_SPEED
+#ifdef HAVE_SG_HOST_SPEED
+			length = ((double) profiling_info->used_cycles)/sg_host_speed(MSG_host_self());
+#elif defined HAVE_MSG_HOST_GET_SPEED
 			length = ((double) profiling_info->used_cycles)/MSG_host_get_speed(MSG_host_self());
 #else
 			length = ((double) profiling_info->used_cycles)/MSG_get_host_speed(MSG_host_self());