Closed andrewkallai closed 1 year ago
Changes are required to capture the different error conditions.
I think the test could be extended by explicitly setting the ICV via omp_set_num_teams
and then checking again whether that value is not exceeded.
In terms of an implementation, the maximal number of teams can be different between 'target teams' + host fallback (== device(omp_get_initial_device())') and/or 'if(0)' and/or device execution. _In case of GCC, '3' is the default on the host but with host fallback ('if(0)' or device(omp_initialdevice)), it is 0. Thus, you could add another check with 'omp teams' besides 'omp target teams if(offload).
tests/5.1/env_var/test_omp_num_teams_env_2.c sets the environmental directly, tests/5.1/runtime_calls/test_teams_region_routines.c sets the ICV through omp_set_num_teams routine, and PR728 is a test specifically for the omp_set_num_teams routine. I don't see a reason to extend this test file as it is suppossed to check the ICV for host and device environments regardless, and is suppossed to pass if someone explicitely sets the ICV before execution.
tests/5.1/env_var/test_omp_num_teams_env_2.c sets the environmental directly, tests/5.1/runtime_calls/test_teams_region_routines.c sets the ICV through omp_set_num_teams routine, and PR728 is a test specifically for the omp_set_num_teams routine. I don't see a reason to extend this test file as it is suppossed to check the ICV for host and device environments regardless, and is suppossed to pass if someone explicitely sets the ICV before execution.
We may not need to add omp_set_num_teams
or set the environment variable OMP_NUM_TEAMS
in this test, but as @tob2 mentioned, one copy of the nteams-var
ICV exists per device, and thus different devices can have different values. However, the current test uses the same nteams-var
ICV value of the host for both the host and device tests. Therefore, this benchmark will need to be extended to use device-specific values of the teams-var
ICV for each subtest.
PLEASE REFER TO CLOSED PR729 FOR RELEVANT DISCUSSION COMMENTS frontier clang 18.0.0 ld.lld: error: undefined symbol: omp_get_max_teams |>>> referenced by /tmp/test_target_get_max_teams.c.o.amdgcn-amd-amdhsa.gfx90a-b5ea00.o:(omp_offloading_72_118bc122_test_get_max_teams_l32) |>>> referenced by /tmp/test_target_get_max_teams.c.o.amdgcn-amd-amdhsa.gfx90a-b5ea00.o:(omp_offloading_72_118bc122_test_get_max_teams_l32) clang: error: ld.lld command failed with exit code 1 (use -v to see invocation) /sw/frontier/ums/ums012/llvm/18.0.0-20230828/bin/clang-linker-wrapper: error: 'clang' failed clang: error: linker command failed with exit code 1 (use -v to see invocation) summit gcc 13.2.1 PASS nvc 22.11 line 61: warning: statement is unreachable [code_is_unreachable] return errors; Remark: individual warnings can be suppressed with "--diag_suppress"
NVC++-S-1073-Procedures called in a OpenMP target region must have 'omp declare target' information - omp_get_max_teams (/autofs/nccs-svm1_home1/andrewka/sollve_vv/tests/5.1/teams/test_target_get_max_teams.c: 34)
NVC++/power Linux 22.11-0: compilation completed with severe errors