LLVM OpenMP 20.0.0git
omp_nteams_api_env2.c
Go to the documentation of this file.
1// RUN: %libomp-compile && env OMP_NUM_TEAMS=5 OMP_TEAMS_THREAD_LIMIT=7 %libomp-run
2
3#include <stdio.h>
4#include <stdlib.h>
5#include <omp.h>
6
7int main(int argc, char** argv)
8{
9 int iset, iget;
10 iset = 4; // should override OMP_NUM_TEAMS=5
11 omp_set_num_teams(iset);
12 iget = omp_get_max_teams();
13 if (iset != iget) {
14 fprintf(stderr, "error: nteams-var set to %d, getter returned %d\n", iset, iget);
15 exit(1);
16 }
17 iset = 6; // should override OMP_TEAMS_THREAD_LIMIT=7
18 omp_set_teams_thread_limit(iset);
19 iget = omp_get_teams_thread_limit();
20 if (iset != iget) {
21 fprintf(stderr, "error: teams-thread-limit-var set to %d, getter returned %d\n", iset, iget);
22 exit(1);
23 }
24 printf("passed\n");
25 return 0;
26}
int main()
Definition: test-touch.c:21