This is an archive of the discontinued LLVM Phabricator instance.

[openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows
ClosedPublic

Authored by mstorsjo on Nov 9 2022, 2:29 PM.

Details

Summary

The hidden helper task is only enabled on Linux (kmp_runtime.cpp
initializes kmp_enable_hidden_helper to TRUE for linux but to
FALSE for any other OS), and the
kmp_stg_parse_use_hidden_helper
function always makes it disabled on non-Linux OSes too.

Mark tests that rely on the hidden helper tasks as requiring Linux.

Set the initial value of __kmp_hidden_helper_threads_num accordingly
in a testcase that needs to know it.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 9 2022, 2:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2022, 2:29 PM
mstorsjo requested review of this revision.Nov 9 2022, 2:29 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: sstefan1. · View Herald Transcript

@jlpeyton Does this look like the right way to go?

A few suggestions

openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
2

For these tests affinity.cpp and gtid.cpp, it seems appropriate to create a new Linux-only feature inside openmp/runtime/test/lit.cfg called hidden-helper (or something like it) and use that instead. It would fit best at around line 110 near where the affinity and some other features are added.

openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
53–57

It's probably better to disable hidden helper threads since they aren't participating in this test.

You can modify the run line to
RUN: %libomp-compile && env LIBOMP_USE_HIDDEN_HELPER_TASK=0 LIBOMP_NUM_HIDDEN_HELPER_THREADS=0 %libomp-run

And also set static int __kmp_hidden_helper_threads_num = 0.

mstorsjo updated this revision to Diff 475930.Nov 16 2022, 3:03 PM

Updated according to suggestions.

mstorsjo marked 2 inline comments as done.Nov 16 2022, 3:04 PM

Thanks for the suggestions!

openmp/runtime/test/tasking/hidden_helper_task/affinity.cpp
2

Sure, done.

openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
53–57

Ah, thanks! Yes that's probably better here. (I guess one could remove the whole logic for counting hidden helper threads here too, but I kept it and just set it to zero for now.)

jlpeyton accepted this revision.Nov 17 2022, 9:26 AM

Thanks for the fixes! LGTM.

This revision is now accepted and ready to land.Nov 17 2022, 9:26 AM
This revision was automatically updated to reflect the committed changes.
mstorsjo marked 2 inline comments as done.