From e7a5e0602c6bd53116d3add5bc743d4e8310dc18 Mon Sep 17 00:00:00 2001 From: Thomas Herault Date: Wed, 2 Nov 2022 11:53:09 -0400 Subject: [PATCH 1/2] Fix a warning of unused variable. --- parsec/scheduling.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parsec/scheduling.c b/parsec/scheduling.c index 2e5dfcc39..5cc18ba24 100644 --- a/parsec/scheduling.c +++ b/parsec/scheduling.c @@ -286,7 +286,6 @@ __parsec_schedule(parsec_execution_stream_t* es, int32_t distance) { int ret; - parsec_task_t *task = tasks_ring; #if defined(PARSEC_DEBUG_PARANOID) || defined(PARSEC_DEBUG_NOISIER) { @@ -317,9 +316,12 @@ __parsec_schedule(parsec_execution_stream_t* es, #endif /* defined(PARSEC_DEBUG_PARANOID) || defined(PARSEC_DEBUG_NOISIER) */ #if defined(PARSEC_PAPI_SDE) - int len = 0; - _LIST_ITEM_ITERATOR(task, &task->super, item, {len++; }); - PARSEC_PAPI_SDE_COUNTER_ADD(PARSEC_PAPI_SDE_TASKS_ENABLED, len); + { + int len = 0; + parsec_task_t *task = tasks_ring; + _LIST_ITEM_ITERATOR(task, &task->super, item, {len++; }); + PARSEC_PAPI_SDE_COUNTER_ADD(PARSEC_PAPI_SDE_TASKS_ENABLED, len); + } #endif /* defined(PARSEC_PAPI_SDE) */ ret = parsec_current_scheduler->module.schedule(es, tasks_ring, distance); From 8fbfb62f7159f87305f923a41df855c51e105c9c Mon Sep 17 00:00:00 2001 From: Thomas Herault Date: Wed, 2 Nov 2022 11:58:22 -0400 Subject: [PATCH 2/2] If parsec_context->nb_nodes==1, __parsec_context_wait calls remote_dep_mpi_on directly from the main thread. In this case, we should not change the TLS of the calling thread to point to the comm engine pseudo-execution stream --- parsec/remote_dep_mpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsec/remote_dep_mpi.c b/parsec/remote_dep_mpi.c index 0a768d79c..7041653b8 100644 --- a/parsec/remote_dep_mpi.c +++ b/parsec/remote_dep_mpi.c @@ -451,7 +451,11 @@ remote_dep_mpi_initialize_execution_stream(parsec_context_t *context) memcpy(&parsec_comm_es, context->virtual_processes[0]->execution_streams[0], sizeof(parsec_execution_stream_t)); parsec_comm_es.next_task = (parsec_task_t*)0xdeadbeef; /* should not be NULL, but it should also never be used */ - parsec_set_my_execution_stream(&parsec_comm_es); + if(1 < context->nb_nodes) { + /* if nb_nodes==1, the parsec comm engine does not run with its own thread, so don't change the thread + * execution stream to parsec_comm_es. */ + parsec_set_my_execution_stream(&parsec_comm_es); + } } void* remote_dep_dequeue_main(parsec_context_t* context)