Browse Source

export virtual thread id and time to simgrid traces

Samuel Thibault 12 years ago
parent
commit
3dcd6e33db
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/common/fxt.c

+ 12 - 0
src/common/fxt.c

@@ -44,8 +44,19 @@ static int _starpu_written = 0;
 
 static int _starpu_id;
 
+#ifdef STARPU_SIMGRID
+/* Give virtual time to FxT */
+uint64_t fut_getstamp(void)
+{
+	return starpu_timing_now()*1000.;
+}
+#endif
+
 long _starpu_gettid(void)
 {
+#ifdef STARPU_SIMGRID
+	return (uintptr_t) MSG_process_self();
+#else
 #if defined(__linux__)
 	return syscall(SYS_gettid);
 #elif defined(__FreeBSD__)
@@ -57,6 +68,7 @@ long _starpu_gettid(void)
 #else
 	return (long) pthread_self();
 #endif
+#endif
 }
 
 static void _starpu_profile_set_tracefile(void *last, ...)