[rocprofiler-systems] Overhaul skip condition of implicit_task and add ROCPD validation test (#1589)
- Add rocpd validation check and fix implicit_task check - SWDEV-562896
This commit is contained in:
@@ -1242,14 +1242,28 @@ tool_tracing_callback(rocprofiler_callback_tracing_record_t record,
|
||||
};
|
||||
|
||||
#if(ROCPROFILER_VERSION >= 600)
|
||||
static bool is_first_implicit_task = false;
|
||||
if(!is_first_implicit_task && record.operation == ROCPROFILER_OMPT_ID_implicit_task)
|
||||
// Skip implicit_task associated with an "initial-task-begin" occurrence
|
||||
// as it is generated by our tool.
|
||||
// Occurs after our tool initializes OMPT but before the first OpenMP
|
||||
// region (user code) begins.
|
||||
// Note: Can occur multiple times (Ex: MPI+OpenMP hybrid)
|
||||
if(record.kind == ROCPROFILER_CALLBACK_TRACING_OMPT &&
|
||||
record.operation == ROCPROFILER_OMPT_ID_implicit_task)
|
||||
{
|
||||
// We do not capture implicit task with flags = 1 on main thread
|
||||
// For now, this is identified as the first implicit task call
|
||||
is_first_implicit_task = true;
|
||||
return;
|
||||
auto* payload_data =
|
||||
static_cast<rocprofiler_callback_tracing_ompt_data_t*>(record.payload);
|
||||
int flag = payload_data->args.implicit_task.flags;
|
||||
if(flag & ompt_task_initial) return;
|
||||
}
|
||||
// TODO: Once ompt_callback_thread_begin is supported, we need to skip
|
||||
// every occurrence of an "initial-thread-begin" for similar reasons.
|
||||
// This callback is identified with thread_type == ompt_thread_initial.
|
||||
|
||||
// Note: If the finalization issue is resolved, the corresponding ends of these
|
||||
// callbacks (which should be discarded) can be identified with:
|
||||
// - implicit_task: (flag & ompt_task_initial) && endpoint == ompt_scope_end
|
||||
// - thread_end: The thread_data ptr from the thread_begin callback generated
|
||||
// by the "initial-thread-begin" needs to match the thread_end's thread_data ptr
|
||||
#endif
|
||||
|
||||
auto ts = rocprofiler_timestamp_t{};
|
||||
|
||||
@@ -68,6 +68,24 @@
|
||||
"end",
|
||||
"name"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "regions",
|
||||
"required_columns": [
|
||||
"tid",
|
||||
"start",
|
||||
"end",
|
||||
"name"
|
||||
],
|
||||
"validation_queries": [
|
||||
{
|
||||
"comparison": "equals",
|
||||
"description": "Verify entries have non-zero start times",
|
||||
"error_message": "Found entries with zero start times in table",
|
||||
"expected_result": 0,
|
||||
"query": "SELECT COUNT(*) as count FROM regions WHERE start = 0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user