瀏覽代碼

pthread: always use the starpu_pthread API

Nathalie Furmento 12 年之前
父節點
當前提交
cbdb2605b3
共有 6 個文件被更改,包括 3 次插入29 次删除
  1. 1 9
      include/starpu_perfmodel.h
  2. 1 3
      include/starpu_sched_ctx.h
  3. 1 7
      include/starpu_scheduler.h
  4. 0 2
      include/starpu_thread.h
  5. 0 4
      src/core/sched_ctx.h
  6. 0 4
      src/core/workers.h

+ 1 - 9
include/starpu_perfmodel.h

@@ -24,10 +24,6 @@
 
 #include <starpu_util.h>
 
-#if ! defined(_MSC_VER)
-#  include <pthread.h>
-#endif
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -189,11 +185,7 @@ struct starpu_perfmodel
 	unsigned is_loaded;
 	unsigned benchmarking;
 
-#if defined(_MSC_VER) || defined(STARPU_SIMGRID)
-	void *model_rwlock;
-#else
-	pthread_rwlock_t model_rwlock;
-#endif
+	starpu_pthread_rwlock_t model_rwlock;
 };
 
 enum starpu_perf_archtype starpu_worker_get_perf_archtype(int workerid);

+ 1 - 3
include/starpu_sched_ctx.h

@@ -62,9 +62,7 @@ void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id);
 
 struct starpu_worker_collection* starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id);
 
-#if !defined(_MSC_VER) && !defined(STARPU_SIMGRID)
-pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);
-#endif
+starpu_pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);
 
 void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
 

+ 1 - 7
include/starpu_scheduler.h

@@ -20,10 +20,6 @@
 
 #include <starpu.h>
 
-#if ! defined(_MSC_VER)
-#  include <pthread.h>
-#endif
-
 #ifdef STARPU_HAVE_HWLOC
 #include <hwloc.h>
 #endif
@@ -125,9 +121,7 @@ associated mutex) should be used to block (and to wake up) a worker. Note that
 multiple workers may use the same condition variable. For instance, in the case
 of a scheduling strategy with a single task queue, the same condition variable
 would be used to block and wake up all workers.   */
-#if !defined(_MSC_VER) && !defined(STARPU_SIMGRID)
-void starpu_worker_get_sched_condition(int workerid, pthread_mutex_t **sched_mutex, pthread_cond_t **sched_cond);
-#endif
+void starpu_worker_get_sched_condition(int workerid, starpu_pthread_mutex_t **sched_mutex, starpu_pthread_cond_t **sched_cond);
 
 /* Check if the worker specified by workerid can execute the codelet. */
 int starpu_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl);

+ 0 - 2
include/starpu_thread.h

@@ -18,8 +18,6 @@
 #ifndef __STARPU_THREAD_H__
 #define __STARPU_THREAD_H__
 
-#include <starpu.h>
-
 #ifdef STARPU_SIMGRID
 #include <xbt/synchro_core.h>
 #include <msg/msg.h>

+ 0 - 4
src/core/sched_ctx.h

@@ -146,8 +146,4 @@ unsigned _starpu_worker_belongs_to_a_sched_ctx(int workerid, unsigned sched_ctx_
 void _starpu_sched_ctx_call_poped_task_cb(int workerid, struct starpu_task *task, size_t data_size, uint32_t footprint);
 #endif //STARPU_USE_SCHED_CTX_HYPERVISOR
 
-#if defined(_MSC_VER) || defined(STARPU_SIMGRID)
-starpu_pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);
-#endif
-
 #endif // __SCHED_CONTEXT_H__

+ 0 - 4
src/core/workers.h

@@ -243,8 +243,4 @@ int starpu_worker_get_nids_by_type(enum starpu_archtype type, int *workerids, in
    the list might not be updated */
 int starpu_worker_get_nids_ctx_free_by_type(enum starpu_archtype type, int *workerids, int maxsize);
 
-#if defined(_MSC_VER) || defined(STARPU_SIMGRID)
-void starpu_worker_get_sched_condition(int workerid, starpu_pthread_mutex_t **sched_mutex, starpu_pthread_cond_t **sched_cond);
-#endif
-
 #endif // __WORKERS_H__