Browse Source

Do not hardcode the maximum number of workers

Cédric Augonnet 15 years ago
parent
commit
ed2ca95098
2 changed files with 3 additions and 5 deletions
  1. 1 2
      src/core/policies/random_policy.c
  2. 2 3
      src/datawizard/memory_nodes.h

+ 1 - 2
src/core/policies/random_policy.c

@@ -16,9 +16,8 @@
 
 #include <core/policies/random_policy.h>
 
-/* XXX 32 is set randomly */
 static unsigned nworkers;
-static struct starpu_jobq_s *queue_array[32];
+static struct starpu_jobq_s *queue_array[STARPU_NMAXWORKERS];
 
 static starpu_job_t random_pop_task(struct starpu_jobq_s *q)
 {

+ 2 - 3
src/datawizard/memory_nodes.h

@@ -41,11 +41,10 @@ typedef struct {
 	starpu_node_kind nodes[STARPU_MAXNODES];
 
 	/* the list of queues that are attached to a given node */
-	// XXX 32 is set randomly !
 	// TODO move this 2 lists outside starpu_mem_node_descr
 	pthread_rwlock_t attached_queues_rwlock;
-	struct starpu_jobq_s *attached_queues_per_node[STARPU_MAXNODES][32];
-	struct starpu_jobq_s *attached_queues_all[STARPU_MAXNODES*32];
+	struct starpu_jobq_s *attached_queues_per_node[STARPU_MAXNODES][STARPU_NMAXWORKERS];
+	struct starpu_jobq_s *attached_queues_all[STARPU_MAXNODES*STARPU_NMAXWORKERS];
 	/* the number of queues attached to each node */
 	unsigned total_queues_count;
 	unsigned queues_count[STARPU_MAXNODES];