OpenMP-Validation-and-Verification / OpenMP_VV

OpenMP Offloading Validation & Verification Suite; Official repository. We have migrated from bitbucket!! For documentation, results, publication and presentations, please check out our website ->
https://crpl.cis.udel.edu/ompvvsollve/
Other
54 stars 19 forks source link

Moving omp_get_max_teams outside teams. #794

Closed spophale closed 8 months ago

spophale commented 8 months ago

Closes #792

tob2 commented 8 months ago

Can you additionally change the following?

_I get num_teams == 4 == OMPVV_NUM_TEAMS_HOST, which is the expected result. But sollvevv prints an error. → Thus, the condition should not be an assert/expected good value condition but an error condition.

Namely: <= should be changed to > — That's for the check at the very bottom of the file for the omp teams – and not for the check directly after your change.

@@ -42,2 +43,2 @@ int main() {
-       OMPVV_ERROR_IF(num_teams <= OMPVV_NUM_TEAMS_HOST, "The number of teams was not overriden by the num_teams clause");     
-       OMPVV_TEST_AND_SET(errors, num_teams <= OMPVV_NUM_TEAMS_HOST);
+       OMPVV_ERROR_IF(num_teams > OMPVV_NUM_TEAMS_HOST, "The number of teams was not overriden by the num_teams clause");      
+       OMPVV_TEST_AND_SET(errors, num_teams > OMPVV_NUM_TEAMS_HOST);

Thanks for this pull request and all your previous patch reviews!

spophale commented 8 months ago

@tob2 On further inspection, I think the error conditions should be:

OMPVV_ERROR_IF(num_teams != OMPVV_NUM_TEAMS_HOST, "The number of teams was not overriden by the num_teams clause");     
OMPVV_TEST_AND_SET(errors, num_teams != OMPVV_NUM_TEAMS_HOST);

Since both the upper and lower bounds for num_teams will evaluate to OMPVV_NUM_TEAMS_HOST.

tob2 commented 8 months ago

@tob2 On further inspection, I think the error conditions should be: [...]

I concur that the stricter condition is fine as well – and, hence, can/should be used.

Can you change this as well? _(And, possibly, duplicate the bottom part of the test without the num_teams clause as additional test? For that one, the condition would then be indeed OMPVV_ERROR_IF(num_teams > 8, …)_

_In 5.1, the wording is makes clear that the used num_teams(OMPVV_NUM_TEAMS_HOST) sets also the lower bound:_

If the num_teams clause is present, lower-bound is the specified lower bound and upper-bound is the specified upper bound on the number of teams requested. If a lower bound is not specified, the lower bound is set to the specified upper bound. The number of teams created is implementation defined, but it will be greater than or equal to the lower bound and less than or equal to the upper bound.

For completeness: In 5.0, > would be the correct condition as 5.0 only allows to set an upper bounds (but this is a 5.1 test case):

The number of teams created is implementation defined, but is less than or equal to the value specified in the num_teams clause.