From b89aef7377b960c4ae9962404e0ef11468b10670 Mon Sep 17 00:00:00 2001 From: Nuno Miguel Nobre Date: Fri, 26 Jun 2020 12:08:41 +0100 Subject: [PATCH 1/3] DF behaviour: Allow zero-horizon windows/views --- libworkstream_df/reuse.c | 3 +++ libworkstream_df/wstream_df.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/libworkstream_df/reuse.c b/libworkstream_df/reuse.c index de43c4f3c..36bbb5189 100644 --- a/libworkstream_df/reuse.c +++ b/libworkstream_df/reuse.c @@ -141,6 +141,9 @@ void __built_in_wstream_df_prepare_data(void* v) wstream_df_view_p out_view = v; int force_reuse = 0; + if (!out_view->horizon) + return; + /* View of a direct consumer of the task to be executed */ wstream_df_view_p consumer_view = out_view->consumer_view; diff --git a/libworkstream_df/wstream_df.c b/libworkstream_df/wstream_df.c index 9d9b6706b..fa965fde4 100644 --- a/libworkstream_df/wstream_df.c +++ b/libworkstream_df/wstream_df.c @@ -352,6 +352,8 @@ void update_numa_nodes_of_views(wstream_df_thread_p cthread, wstream_df_frame_p static inline void tdecrease_n (void *data, size_t n, bool is_write) { + if (!n) + return; wstream_df_frame_p fp = (wstream_df_frame_p) data; wstream_df_thread_p cthread = current_thread; @@ -718,6 +720,13 @@ wstream_df_resolve_dependences (void *v, void *s, bool is_read_view_p) wstream_df_frame_p fp = view->owner; int defer_further = 0; + if (!view->horizon) + { + if (!is_read_view_p) + tdecrease_n (fp, 1, 0); + return; + } + if(is_read_view_p) check_add_view_to_chain(&fp->input_view_chain, view); else From 46ab21738616be387d63e13af0c9a63009276125 Mon Sep 17 00:00:00 2001 From: Nuno Miguel Nobre Date: Tue, 30 Jun 2020 18:51:51 +0100 Subject: [PATCH 2/3] DF behaviour: Allow zero-horizon win/view arrays --- libworkstream_df/wstream_df.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libworkstream_df/wstream_df.c b/libworkstream_df/wstream_df.c index fa965fde4..f61cd7680 100644 --- a/libworkstream_df/wstream_df.c +++ b/libworkstream_df/wstream_df.c @@ -1460,8 +1460,6 @@ wstream_df_resolve_n_dependences (size_t n, void *v, void *s, bool is_read_view_ view->burst = dummy_view->burst; view->horizon = dummy_view->horizon; - assert(view->horizon != 0); - view->owner = dummy_view->owner; if(!dummy_view->reuse_associated_view) { From 568425238c35a535339733b939c9d69ac89cda46 Mon Sep 17 00:00:00 2001 From: Richard Neill Date: Wed, 1 Jul 2020 11:43:59 +0100 Subject: [PATCH 3/3] Tracing: move forward resolve-dependency state transition to include appending of view --- libworkstream_df/wstream_df.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libworkstream_df/wstream_df.c b/libworkstream_df/wstream_df.c index f61cd7680..7a7197222 100644 --- a/libworkstream_df/wstream_df.c +++ b/libworkstream_df/wstream_df.c @@ -727,13 +727,13 @@ wstream_df_resolve_dependences (void *v, void *s, bool is_read_view_p) return; } + trace_state_change(current_thread, WORKER_STATE_RT_RESDEP); + if(is_read_view_p) check_add_view_to_chain(&fp->input_view_chain, view); else check_add_view_to_chain(&fp->output_view_chain, view); - trace_state_change(current_thread, WORKER_STATE_RT_RESDEP); - pthread_mutex_lock (&stream->stream_lock); if (is_read_view_p == true)