20#define CFDMAX_SIZE 1120
25 int i, grainsize,
count, tmp_count, num_off;
26 int *tmp, *tids, *tidsArray;
28 tidsArray = (
int *)malloc(
sizeof(
int) *
CFDMAX_SIZE);
31 for (grainsize = 1; grainsize < 48; ++grainsize) {
32 fprintf(stderr,
"Grainsize %d\n", grainsize);
33 count = tmp_count = num_off = 0;
39 #pragma omp parallel shared(tids)
42 #pragma omp taskloop grainsize(grainsize)
44 tids[
i] = omp_get_thread_num();
50 fprintf(stderr,
" Iteration %d not touched!\n",
i);
56 if (tids[
i] != tids[
i + 1]) {
61 tmp = (
int *)malloc(
sizeof(
int) * (
count + 1));
65 if (tmp_count >
count) {
66 printf(
"--------------------\nTestinternal Error: List too "
67 "small!!!\n--------------------\n");
70 if (tids[
i] != tids[
i + 1]) {
84 if (tmp[
i] % multiple1 != 0 && tmp[
i] % multiple2 != 0) {
90 fprintf(stderr,
" The number of bad chunks is %d\n", num_off);
93 fprintf(stderr,
" Everything ok\n");
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t count
int test_omp_taskloop_grainsize()