diff --git a/test/smoke/omp_places/Makefile b/test/smoke/omp_places/Makefile index 356b57be4..e8ea81896 100644 --- a/test/smoke/omp_places/Makefile +++ b/test/smoke/omp_places/Makefile @@ -13,6 +13,8 @@ CC = $(OMP_BIN) $(VERBOSE) #-ccc-print-phases #"-\#\#\#"i +UNSUPPORTED = ISVIRT_RUNTIME + RUNENV += OMP_AFFINITY_FORMAT="Thread num: %n Affinity: %A" OMP_DISPLAY_AFFINITY=TRUE RUNENV1 += $(RUNENV) OMP_PLACES="{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}" RUNENV2 += $(RUNENV) OMP_PLACES="{0:4},{4:4},{8:4},{12:4}" diff --git a/test/smoke/teams_notarget_get_team_num/teams_notarget_get_team_num.c b/test/smoke/teams_notarget_get_team_num/teams_notarget_get_team_num.c index 190e9a88b..4f31def4f 100644 --- a/test/smoke/teams_notarget_get_team_num/teams_notarget_get_team_num.c +++ b/test/smoke/teams_notarget_get_team_num/teams_notarget_get_team_num.c @@ -9,11 +9,22 @@ int main() { int team_id; int team_counts[TOTAL_TEAMS]; int *a = (int *)malloc(n*sizeof(int)); + int nteams = 0; - for (int i = 0; i < TOTAL_TEAMS; i++) - team_counts[i] = 0; + // Check requested teams + #pragma omp teams num_teams(TOTAL_TEAMS) + nteams = omp_get_num_teams(); - #pragma omp teams distribute num_teams(TOTAL_TEAMS) private(team_id) + if (nteams == 0){ + printf("Error: Cannot determine number of teams.\n"); + return 1; + } else if (nteams != TOTAL_TEAMS) + printf("Warning: Requested Teams was %d, but %d was used.\n", TOTAL_TEAMS, nteams); + + for (int i = 0; i < nteams; i++) + team_counts[i] = 0; + + #pragma omp teams distribute num_teams(nteams) private(team_id) for(int i = 0; i < n; i++) { team_id = omp_get_team_num(); a[i] = i; @@ -28,8 +39,8 @@ int main() { } } - for (int i = 0; i < TOTAL_TEAMS; i++) { - if (team_counts[i] != N/TOTAL_TEAMS) { + for (int i = 0; i < nteams; i++) { + if (team_counts[i] != N/nteams) { printf("Team id : %d is not shared with equal work. It is shared" " with %d iterations\n", i, team_counts[i]); err++;