diff options
Diffstat (limited to 'final/runtime/test/ompt/worksharing/for')
18 files changed, 232 insertions, 0 deletions
diff --git a/final/runtime/test/ompt/worksharing/for/auto.c b/final/runtime/test/ompt/worksharing/for/auto.c new file mode 100644 index 0000000..17d26f5 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/auto.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base.h +// REQUIRES: ompt +// GCC doesn't call runtime for auto = static schedule +// XFAIL: gcc + +#define SCHEDULE auto +#include "base.h" diff --git a/final/runtime/test/ompt/worksharing/for/auto_serialized.c b/final/runtime/test/ompt/worksharing/for/auto_serialized.c new file mode 100644 index 0000000..f756166 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/auto_serialized.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_serialized.h +// REQUIRES: ompt +// GCC doesn't call runtime for auto = static schedule +// XFAIL: gcc + +#define SCHEDULE auto +#include "base_serialized.h" diff --git a/final/runtime/test/ompt/worksharing/for/auto_split.c b/final/runtime/test/ompt/worksharing/for/auto_split.c new file mode 100644 index 0000000..d82e3fd --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/auto_split.c @@ -0,0 +1,8 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_split.h +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefix=CHECK-LOOP %S/base_split.h +// REQUIRES: ompt +// GCC doesn't call runtime for auto = static schedule +// XFAIL: gcc + +#define SCHEDULE auto +#include "base_split.h" diff --git a/final/runtime/test/ompt/worksharing/for/base.h b/final/runtime/test/ompt/worksharing/for/base.h new file mode 100644 index 0000000..8a496d9 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/base.h @@ -0,0 +1,43 @@ +#include "callback.h" +#include <omp.h> + +int main() +{ + unsigned int i; + + #pragma omp parallel for num_threads(4) schedule(SCHEDULE) + for (i = 0; i < 4; i++) { + } + + // Check if libomp supports the callbacks for this test. + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_begin' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_end' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work' + + + // CHECK: 0: NULL_POINTER=[[NULL:.*$]] + // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}} + + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id=[[IMPLICIT_TASK_ID]], codeptr_ra= + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id=[[IMPLICIT_TASK_ID]], codeptr_ra= + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id=[[IMPLICIT_TASK_ID]], codeptr_ra= + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id=[[IMPLICIT_TASK_ID]], codeptr_ra= + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]] + + return 0; +} diff --git a/final/runtime/test/ompt/worksharing/for/base_serialized.h b/final/runtime/test/ompt/worksharing/for/base_serialized.h new file mode 100644 index 0000000..3376b37 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/base_serialized.h @@ -0,0 +1,28 @@ +#include "callback.h" +#include <omp.h> + +int main() +{ + unsigned int i; + + #pragma omp parallel for num_threads(1) schedule(SCHEDULE) + for (i = 0; i < 1; i++) { + } + + // Check if libomp supports the callbacks for this test. + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_begin' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_end' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work' + + + // CHECK: 0: NULL_POINTER=[[NULL:.*$]] + // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id=[[PARENT_TASK_ID:[0-9]+]], parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=1, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}} + + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=0x{{[0-f]+}} + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end: parallel_id={{[PARALLEL_ID,0]}}, task_id=[[IMPLICIT_TASK_ID]] + + return 0; +} diff --git a/final/runtime/test/ompt/worksharing/for/base_split.h b/final/runtime/test/ompt/worksharing/for/base_split.h new file mode 100644 index 0000000..0f1fed3 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/base_split.h @@ -0,0 +1,66 @@ +#include "callback.h" +#include <omp.h> + +/* With the combined parallel-for construct (base.h), the return-addresses are hard to compare. + With the separate parallel and for-nowait construct, the addresses become more predictable, + but the begin of the for-loop still generates additional code, so the offset of loop-begin + to the label is >4 Byte. +*/ + +int main() +{ + unsigned int i; + + #pragma omp parallel num_threads(4) + { + print_current_address(0); + #pragma omp for schedule(SCHEDULE) nowait + for (i = 0; i < 4; i++) { + print_fuzzy_address(1); + } + print_fuzzy_address(2); + } + print_fuzzy_address(3); + + // Check if libomp supports the callbacks for this test. + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_begin' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_end' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task' + // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work' + + + // CHECK: 0: NULL_POINTER=[[NULL:.*$]] + // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra=[[PARALLEL_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}, invoker={{[0-9]+}} + + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id={{[0-9]+}}, codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]] + + // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, invoker={{[0-9]+}}, codeptr_ra=[[PARALLEL_RETURN_ADDRESS]] + // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[PARALLEL_RETURN_ADDRESS]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}} + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}} + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]] + + // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}} + // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]] + + + // CHECK-LOOP: 0: NULL_POINTER=[[NULL:.*$]] + // CHECK-LOOP: 0: ompt_event_runtime_shutdown + // CHECK-LOOP: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra={{0x[0-f]+}}, invoker={{[0-9]+}} + // CHECK-LOOP: {{^}}[[MASTER_ID]]: ompt_event_loop_begin: parallel_id=[[PARALLEL_ID]], parent_task_id={{[0-9]+}}, codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} + // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]] + // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]] + // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]] + // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]] + + + return 0; +} diff --git a/final/runtime/test/ompt/worksharing/for/dynamic.c b/final/runtime/test/ompt/worksharing/for/dynamic.c new file mode 100644 index 0000000..ca5ae10 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/dynamic.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base.h +// REQUIRES: ompt + +#define SCHEDULE dynamic +#include "base.h" diff --git a/final/runtime/test/ompt/worksharing/for/dynamic_serialized.c b/final/runtime/test/ompt/worksharing/for/dynamic_serialized.c new file mode 100644 index 0000000..0f80929 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/dynamic_serialized.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_serialized.h +// REQUIRES: ompt + +#define SCHEDULE dynamic +#include "base_serialized.h" diff --git a/final/runtime/test/ompt/worksharing/for/dynamic_split.c b/final/runtime/test/ompt/worksharing/for/dynamic_split.c new file mode 100644 index 0000000..cf14971 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/dynamic_split.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_split.h +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefix=CHECK-LOOP %S/base_split.h +// REQUIRES: ompt +// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 + +#define SCHEDULE dynamic +#include "base_split.h" diff --git a/final/runtime/test/ompt/worksharing/for/guided.c b/final/runtime/test/ompt/worksharing/for/guided.c new file mode 100644 index 0000000..01bff4e --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/guided.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base.h +// REQUIRES: ompt + +#define SCHEDULE guided +#include "base.h" diff --git a/final/runtime/test/ompt/worksharing/for/guided_serialized.c b/final/runtime/test/ompt/worksharing/for/guided_serialized.c new file mode 100644 index 0000000..4b5096d --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/guided_serialized.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_serialized.h +// REQUIRES: ompt + +#define SCHEDULE guided +#include "base_serialized.h" diff --git a/final/runtime/test/ompt/worksharing/for/guided_split.c b/final/runtime/test/ompt/worksharing/for/guided_split.c new file mode 100644 index 0000000..7d560c2 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/guided_split.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_split.h +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefix=CHECK-LOOP %S/base_split.h +// REQUIRES: ompt +// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 + +#define SCHEDULE guided +#include "base_split.h" diff --git a/final/runtime/test/ompt/worksharing/for/runtime.c b/final/runtime/test/ompt/worksharing/for/runtime.c new file mode 100644 index 0000000..bcf160f --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/runtime.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base.h +// REQUIRES: ompt + +#define SCHEDULE runtime +#include "base.h" diff --git a/final/runtime/test/ompt/worksharing/for/runtime_serialized.c b/final/runtime/test/ompt/worksharing/for/runtime_serialized.c new file mode 100644 index 0000000..231d67d --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/runtime_serialized.c @@ -0,0 +1,5 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_serialized.h +// REQUIRES: ompt + +#define SCHEDULE runtime +#include "base_serialized.h" diff --git a/final/runtime/test/ompt/worksharing/for/runtime_split.c b/final/runtime/test/ompt/worksharing/for/runtime_split.c new file mode 100644 index 0000000..7a677ed --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/runtime_split.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_split.h +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefix=CHECK-LOOP %S/base_split.h +// REQUIRES: ompt +// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 + +#define SCHEDULE runtime +#include "base_split.h" diff --git a/final/runtime/test/ompt/worksharing/for/static.c b/final/runtime/test/ompt/worksharing/for/static.c new file mode 100644 index 0000000..4d99059 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/static.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base.h +// REQUIRES: ompt +// GCC doesn't call runtime for static schedule +// XFAIL: gcc + +#define SCHEDULE static +#include "base.h" diff --git a/final/runtime/test/ompt/worksharing/for/static_serialized.c b/final/runtime/test/ompt/worksharing/for/static_serialized.c new file mode 100644 index 0000000..4860d49 --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/static_serialized.c @@ -0,0 +1,7 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_serialized.h +// REQUIRES: ompt +// GCC doesn't call runtime for static schedule +// XFAIL: gcc + +#define SCHEDULE static +#include "base_serialized.h" diff --git a/final/runtime/test/ompt/worksharing/for/static_split.c b/final/runtime/test/ompt/worksharing/for/static_split.c new file mode 100644 index 0000000..d8c88dd --- /dev/null +++ b/final/runtime/test/ompt/worksharing/for/static_split.c @@ -0,0 +1,8 @@ +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %S/base_split.h +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefix=CHECK-LOOP %S/base_split.h +// REQUIRES: ompt +// GCC doesn't call runtime for static schedule +// XFAIL: gcc + +#define SCHEDULE static +#include "base_split.h" |