Orphaned Task

Occurs when a task-begin annotation is executed that is not within an active parallel site.

Problem type: Orphaned task

ID

Code Location

Description

1

Task start

Represents the location and associated call stack when the task began execution.

Example

void main()
{
    ANNOTATE_TASK_BEGIN(name_task1); // Begin task
    ANNOTATE_TASK_END();
}

This example does not execute a ANNOTATE_SITE_BEGIN(sitename)/ANNOTATE_SITE_END() annotation pair required to wrap the execution of a task ANNOTATE_TASK_BEGIN(taskname)/ANNOTATE_TASK_END() annotation pair.

Possible Correction Strategies

Always execute an ANNOTATE_SITE_BEGIN(sitename) annotation before executing an ANNOTATE_TASK_BEGIN(taskname) annotation. You may need to add an ANNOTATE_SITE_BEGIN(sitename) /ANNOTATE_SITE_END() annotation pair in the same function, or in some calling function.

An orphaned task is effectively ignored by the Suitability and Correctness tool analysis, so you should fix the orphaned task code and run the Suitability and Correctness tools again.

For more information about annotating tasks, see the discussion of task annotations in About Annotations and Annotating Parallel Sites and Tasks.

For more complete information about compiler optimizations, see our Optimization Notice.