environment.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2014-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #include <starpu.h>
  17. #include "../helper.h"
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. /*
  21. * Check OpenMP environment variables are properly parsed.
  22. */
  23. #if !defined(STARPU_OPENMP)
  24. int main(void)
  25. {
  26. return STARPU_TEST_SKIPPED;
  27. }
  28. #else
  29. int
  30. main (void)
  31. {
  32. setenv("OMP_DYNAMIC","false", 1);
  33. setenv("OMP_NESTED","false", 1);
  34. setenv("OMP_SCHEDULE","auto", 1);
  35. setenv("OMP_STACKSIZE","2M", 1);
  36. setenv("OMP_WAIT_POLICY","passive", 1);
  37. setenv("OMP_THREAD_LIMIT","0", 1);
  38. setenv("OMP_MAX_ACTIVE_LEVELS","4", 1);
  39. setenv("OMP_CANCELLATION","false", 1);
  40. setenv("OMP_DEFAULT_DEVICE","0", 1);
  41. setenv("OMP_MAX_TASK_PRIORITY", "20", 1);
  42. setenv("OMP_PROC_BIND","spread, spread, close", 1);
  43. setenv("OMP_NUM_THREADS","4, 16, 2", 1);
  44. setenv("OMP_PLACES","{1,2,3,4},{5,6,7,8}", 1);
  45. setenv("OMP_DISPLAY_ENV","verbose", 1);
  46. int ret = starpu_omp_init();
  47. if (ret == -EINVAL) return STARPU_TEST_SKIPPED;
  48. STARPU_CHECK_RETURN_VALUE(ret, "starpu_omp_init");
  49. starpu_omp_shutdown();
  50. return 0;
  51. }
  52. #endif