Skip to content

Commit 70ba4e9

Browse files
authored
Merge pull request #440 from therault/fixes/tls_in_comm_thread
Fixes/tls in comm thread
2 parents 38945c8 + 8fbfb62 commit 70ba4e9

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

parsec/remote_dep_mpi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,11 @@ remote_dep_mpi_initialize_execution_stream(parsec_context_t *context)
451451
memcpy(&parsec_comm_es, context->virtual_processes[0]->execution_streams[0],
452452
sizeof(parsec_execution_stream_t));
453453
parsec_comm_es.next_task = (parsec_task_t*)0xdeadbeef; /* should not be NULL, but it should also never be used */
454-
parsec_set_my_execution_stream(&parsec_comm_es);
454+
if(1 < context->nb_nodes) {
455+
/* if nb_nodes==1, the parsec comm engine does not run with its own thread, so don't change the thread
456+
* execution stream to parsec_comm_es. */
457+
parsec_set_my_execution_stream(&parsec_comm_es);
458+
}
455459
}
456460

457461
void* remote_dep_dequeue_main(parsec_context_t* context)

parsec/scheduling.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ __parsec_schedule(parsec_execution_stream_t* es,
286286
int32_t distance)
287287
{
288288
int ret;
289-
parsec_task_t *task = tasks_ring;
290289

291290
#if defined(PARSEC_DEBUG_PARANOID) || defined(PARSEC_DEBUG_NOISIER)
292291
{
@@ -317,9 +316,12 @@ __parsec_schedule(parsec_execution_stream_t* es,
317316
#endif /* defined(PARSEC_DEBUG_PARANOID) || defined(PARSEC_DEBUG_NOISIER) */
318317

319318
#if defined(PARSEC_PAPI_SDE)
320-
int len = 0;
321-
_LIST_ITEM_ITERATOR(task, &task->super, item, {len++; });
322-
PARSEC_PAPI_SDE_COUNTER_ADD(PARSEC_PAPI_SDE_TASKS_ENABLED, len);
319+
{
320+
int len = 0;
321+
parsec_task_t *task = tasks_ring;
322+
_LIST_ITEM_ITERATOR(task, &task->super, item, {len++; });
323+
PARSEC_PAPI_SDE_COUNTER_ADD(PARSEC_PAPI_SDE_TASKS_ENABLED, len);
324+
}
323325
#endif /* defined(PARSEC_PAPI_SDE) */
324326

325327
ret = parsec_current_scheduler->module.schedule(es, tasks_ring, distance);

0 commit comments

Comments
 (0)