瀏覽代碼

- Minor header cleanup
- Describe the use of a few internal functions

Cédric Augonnet 14 年之前
父節點
當前提交
98293dd3f2
共有 4 個文件被更改,包括 11 次插入18 次删除
  1. 2 2
      examples/heat/dw_sparse_cg.c
  2. 1 8
      src/core/topology.h
  3. 3 0
      src/core/workers.c
  4. 5 8
      src/core/workers.h

+ 2 - 2
examples/heat/dw_sparse_cg.c

@@ -326,7 +326,7 @@ void iteration_cg(void *problem)
 void conjugate_gradient(float *nzvalA, float *vecb, float *vecx, uint32_t nnz,
 			unsigned nrow, uint32_t *colind, uint32_t *rowptr)
 {
-	/* first declare all the data structures to the runtime */
+	/* first register all the data structures to StarPU */
 
 	starpu_data_handle ds_matrixA;
 	starpu_data_handle ds_vecx, ds_vecb;
@@ -355,7 +355,7 @@ void conjugate_gradient(float *nzvalA, float *vecb, float *vecx, uint32_t nnz,
 
 	printf("nrow = %d \n", nrow);
 
-	/* and declare them as well */
+	/* and register them as well */
 	starpu_vector_data_register(&ds_vecr, 0, (uintptr_t)ptr_vecr, nrow, sizeof(float));
 	starpu_vector_data_register(&ds_vecd, 0, (uintptr_t)ptr_vecd, nrow, sizeof(float));
 	starpu_vector_data_register(&ds_vecq, 0, (uintptr_t)ptr_vecq, nrow, sizeof(float));

+ 1 - 8
src/core/topology.h

@@ -17,18 +17,11 @@
 #ifndef __TOPOLOGY_H__
 #define __TOPOLOGY_H__
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <pthread.h>
+#include <starpu.h>
 #include <common/config.h>
 #include <common/list.h>
 #include <common/fxt.h>
 
-#include <starpu.h>
-
 /* TODO actually move this struct into this header */
 struct starpu_machine_config_s;
 

+ 3 - 0
src/core/workers.c

@@ -609,11 +609,14 @@ void starpu_worker_get_name(int id, char *dst, size_t maxlen)
 	snprintf(dst, maxlen, "%s", name);
 }
 
+/* Retrieve the status which indicates what the worker is currently doing. */
 starpu_worker_status _starpu_worker_get_status(int workerid)
 {
 	return config.workers[workerid].status;
 }
 
+/* Change the status of the worker which indicates what the worker is currently
+ * doing (eg. executing a callback). */
 void _starpu_worker_set_status(int workerid, starpu_worker_status status)
 {
 	config.workers[workerid].status = status;

+ 5 - 8
src/core/workers.h

@@ -17,11 +17,7 @@
 #ifndef __WORKERS_H__
 #define __WORKERS_H__
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
+#include <starpu.h>
 #include <common/config.h>
 #include <pthread.h>
 #include <common/timing.h>
@@ -32,7 +28,6 @@
 #include <core/topology.h>
 #include <core/errorcheck.h>
 
-#include <starpu.h>
 
 #ifdef STARPU_HAVE_HWLOC
 #include <hwloc.h>
@@ -131,6 +126,10 @@ struct starpu_machine_config_s {
 	unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
 	
 	struct starpu_worker_s workers[STARPU_NMAXWORKERS];
+
+	/* This bitmask indicates which kinds of worker are available. For
+	 * instance it is possible to test if there is a CUDA worker with
+	 * the result of (worker_mask & STARPU_CUDA). */
 	uint32_t worker_mask;
 
 	/* in case the user gives an explicit configuration, this is only valid
@@ -141,8 +140,6 @@ struct starpu_machine_config_s {
 	unsigned running;
 };
 
-void _starpu_display_general_stats(void);
-
 unsigned _starpu_machine_is_running(void);
 
 inline uint32_t _starpu_worker_exists(uint32_t task_mask);