浏览代码

Move the redirection of the application's main into starpu_simgrid_wrap.h

Samuel Thibault 10 年之前
父节点
当前提交
5a7ec26d01
共有 4 个文件被更改,包括 33 次插入9 次删除
  1. 2 1
      Makefile.am
  2. 2 2
      doc/doxygen/chapters/21simgrid.doxy
  3. 1 6
      include/starpu.h
  4. 28 0
      include/starpu_simgrid_wrap.h

+ 2 - 1
Makefile.am

@@ -84,7 +84,8 @@ versinclude_HEADERS = 				\
 	include/starpu_stdlib.h			\
 	include/starpu_stdlib.h			\
 	include/starpu_thread.h			\
 	include/starpu_thread.h			\
 	include/starpu_thread_util.h		\
 	include/starpu_thread_util.h		\
-	include/starpu_tree.h
+	include/starpu_tree.h			\
+	include/starpu_simgrid_wrap.h
 
 
 nodist_versinclude_HEADERS = 			\
 nodist_versinclude_HEADERS = 			\
 	include/starpu_config.h
 	include/starpu_config.h

+ 2 - 2
doc/doxygen/chapters/21simgrid.doxy

@@ -22,9 +22,9 @@ get the simulated time, it has to use starpu_timing_now() which returns the
 virtual timestamp in us.
 virtual timestamp in us.
 
 
 For some technical reason, the application's .c file which contains main() has
 For some technical reason, the application's .c file which contains main() has
-to be recompiled with starpu.h, which in the simgrid case will # define main()
+to be recompiled with starpu_simgrid_wrap.h, which in the simgrid case will # define main()
 into starpu_main(), and it is libstarpu which will provide the real main() and
 into starpu_main(), and it is libstarpu which will provide the real main() and
-call the application's main().
+will call the application's main().
 
 
 To be able to test with crazy data sizes, one may want to only allocate
 To be able to test with crazy data sizes, one may want to only allocate
 application data if STARPU_SIMGRID is not defined.  Passing a NULL pointer to
 application data if STARPU_SIMGRID is not defined.  Passing a NULL pointer to

+ 1 - 6
include/starpu.h

@@ -66,18 +66,13 @@ typedef UINT_PTR uintptr_t;
 #include <starpu_fxt.h>
 #include <starpu_fxt.h>
 #include <starpu_driver.h>
 #include <starpu_driver.h>
 #include <starpu_tree.h>
 #include <starpu_tree.h>
+#include <starpu_simgrid_wrap.h>
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C"
 extern "C"
 {
 {
 #endif
 #endif
 
 
-#ifdef STARPU_SIMGRID
-#ifndef main
-#define main starpu_main
-#endif
-#endif
-
 struct starpu_conf
 struct starpu_conf
 {
 {
 	int magic;
 	int magic;

+ 28 - 0
include/starpu_simgrid_wrap.h

@@ -0,0 +1,28 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2014  Université de Bordeaux 1
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#ifndef __STARPU_SIMGRID_WRAP_H__
+#define __STARPU_SIMGRID_WRAP_H__
+
+#include <starpu_config.h>
+
+#ifdef STARPU_SIMGRID
+#ifndef main
+#define main starpu_main
+#endif
+#endif
+
+#endif /* __STARPU_SIMGRID_WRAP_H__ */