Преглед изворни кода

port r19169 from hp-lookahead: graph drop function visible (& can be used) in global space

Samuel Thibault пре 8 година
родитељ
комит
9cbba76446
2 измењених фајлова са 10 додато и 2 уклоњено
  1. 7 2
      src/common/graph.c
  2. 3 0
      src/common/graph.h

+ 7 - 2
src/common/graph.c

@@ -63,12 +63,11 @@ void _starpu_graph_wrlock(void)
 }
 
 void _starpu_graph_drop_node(struct _starpu_graph_node *node);
-void _starpu_graph_wrunlock(void)
+void _starpu_graph_drop_dropped_nodes(void)
 {
 	struct _starpu_graph_node *node, *next;
 	struct _starpu_graph_node_multilist_dropped dropping;
 
-	STARPU_PTHREAD_RWLOCK_UNLOCK(&graph_lock);
 	STARPU_PTHREAD_MUTEX_LOCK(&dropped_lock);
 	/* Pick up the list of dropped nodes */
 	_starpu_graph_node_multilist_move_dropped(&dropped, &dropping);
@@ -89,6 +88,12 @@ void _starpu_graph_wrunlock(void)
 	}
 }
 
+void _starpu_graph_wrunlock(void)
+{
+	STARPU_PTHREAD_RWLOCK_UNLOCK(&graph_lock);
+	_starpu_graph_drop_dropped_nodes();
+}
+
 void _starpu_graph_rdlock(void)
 {
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&graph_lock);

+ 3 - 0
src/common/graph.h

@@ -78,6 +78,9 @@ void _starpu_graph_add_job_dep(struct _starpu_job *job, struct _starpu_job *prev
 /* Remove a job from the graph */
 void _starpu_graph_drop_job(struct _starpu_job *job);
 
+/* Really drop the nodes from the graph now */
+void _starpu_graph_drop_dropped_nodes(void);
+
 /* This make StarPU compute for each task the depth, i.e. the length of the longest path to a task without outgoing dependencies. */
 /* This does not take job duration into account, just the number */
 void _starpu_graph_compute_depths(void);