Browse Source

Fix use of sg_host_self

Samuel Thibault 5 years ago
parent
commit
131efa4c4c
2 changed files with 9 additions and 1 deletions
  1. 4 0
      src/core/simgrid.c
  2. 5 1
      src/drivers/opencl/driver_opencl.c

+ 4 - 0
src/core/simgrid.c

@@ -616,7 +616,11 @@ void _starpu_simgrid_submit_job(int workerid, struct _starpu_job *j, struct star
 
 	simgrid_task = MSG_task_create(_starpu_job_get_task_name(j),
 #if defined(HAVE_SG_HOST_SPEED) || defined(sg_host_speed)
+#  if defined(HAVE_SG_HOST_SELF) || defined(sg_host_self)
 			length/1000000.0*sg_host_speed(sg_host_self()),
+#  else
+			length/1000000.0*sg_host_speed(MSG_host_self()),
+#  endif
 #elif defined HAVE_MSG_HOST_GET_SPEED || defined(MSG_host_get_speed)
 			length/1000000.0*MSG_host_get_speed(MSG_host_self()),
 #else

+ 5 - 1
src/drivers/opencl/driver_opencl.c

@@ -966,7 +966,11 @@ static int _starpu_opencl_start_job(struct _starpu_job *j, struct _starpu_worker
 			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");
 #if defined(HAVE_SG_HOST_SPEED) || defined(sg_host_speed)
+#  if defined(HAVE_SG_HOST_SELF) || defined(sg_host_self)
 			length = ((double) profiling_info->used_cycles)/sg_host_speed(sg_host_self());
+#  else
+			length = ((double) profiling_info->used_cycles)/sg_host_speed(MSG_host_self());
+#  endif
 #elif defined HAVE_MSG_HOST_GET_SPEED || defined(MSG_host_get_speed)
 			length = ((double) profiling_info->used_cycles)/MSG_host_get_speed(MSG_host_self());
 #else
@@ -974,7 +978,7 @@ static int _starpu_opencl_start_job(struct _starpu_job *j, struct _starpu_worker
 #endif
 			/* And give the simulated time to simgrid */
 			simulate = 1;
-		#endif
+#endif
 		}
 		else if (cl->flags & STARPU_CODELET_SIMGRID_EXECUTE_AND_INJECT && !async)
 			{