2.0.5 (revision 1824)
OpenMP Pragma And Region Instrumentor
pomp2_lib.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Score-P software (http://www.score-p.org)
3  *
4  * Copyright (c) 2009-2013,
5  * RWTH Aachen University, Germany
6  *
7  * Copyright (c) 2009-2013,
8  * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
9  *
10  * Copyright (c) 2009-2013,
11  * Technische Universitaet Dresden, Germany
12  *
13  * Copyright (c) 2009-2013,
14  * University of Oregon, Eugene, USA
15  *
16  * Copyright (c) 2009-2013, 2019,
17  * Forschungszentrum Juelich GmbH, Germany
18  *
19  * Copyright (c) 2009-2013,
20  * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
21  *
22  * Copyright (c) 2009-2013,
23  * Technische Universitaet Muenchen, Germany
24  *
25  * This software may be modified and distributed under the terms of
26  * a BSD-style license. See the COPYING file in the package base
27  * directory for details.
28  *
29  */
30 /****************************************************************************
31 ** SCALASCA http://www.scalasca.org/ **
32 ** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
33 *****************************************************************************
34 ** Copyright (c) 1998-2009 **
35 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
36 ** **
37 ** See the file COPYRIGHT in the package base directory for details **
38 ****************************************************************************/
39 #ifndef POMP2_LIB_H
40 #define POMP2_LIB_H
41 
42 #ifdef _OPENMP
43 #include <omp.h>
44 #endif
45 
46 #include <stddef.h>
47 #include <stdint.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
60 /* Avoid warnings from Orcale Studio Compiler if nowait clauses are added
61  * to reduction loops. Opari always inserts a barrier after such loops, so
62  * the nowait is save.*/
63 #if defined( __SUNPRO_C )
64 #pragma error_messages (off, E_NOWAIT_REDUCTION_USE)
65 #endif
66 
70 #ifndef __opari2_region_handle
71 typedef void* OPARI2_Region_handle;
72 #define __opari2_region_handle
73 #endif
74 
75 typedef OPARI2_Region_handle POMP2_Region_handle;
76 typedef int64_t POMP2_Task_handle;
77 
87 extern size_t
88 POMP2_Get_num_regions( void );
89 
96 extern void
97 POMP2_Init_regions( void );
98 
103 extern const char*
105 
110 extern POMP2_Task_handle
112 
118 extern void
119 POMP2_Assign_handle( POMP2_Region_handle* pomp2_handle,
120  const char ctc_string[] );
121 
122 #ifdef _OPENMP
123 
128 extern void
129 POMP2_Atomic_enter( POMP2_Region_handle* pomp2_handle,
130  const char ctc_string[] );
131 
135 extern void
136 POMP2_Atomic_exit( POMP2_Region_handle* pomp2_handle );
137 
150 extern void
151 POMP2_Barrier_enter( POMP2_Region_handle* pomp2_handle,
152  POMP2_Task_handle* pomp2_old_task,
153  const char ctc_string[] );
154 
166 extern void
167 POMP2_Barrier_exit( POMP2_Region_handle* pomp2_handle,
168  POMP2_Task_handle pomp2_old_task );
169 
170 
182 extern void
183 POMP2_Implicit_barrier_enter( POMP2_Region_handle* pomp2_handle,
184  POMP2_Task_handle* pomp2_old_task );
185 
186 
198 extern void
199 POMP2_Implicit_barrier_exit( POMP2_Region_handle* pomp2_handle,
200  POMP2_Task_handle pomp2_old_task );
201 
202 
208 extern void
209 POMP2_Flush_enter( POMP2_Region_handle* pomp2_handle,
210  const char ctc_string[] );
211 
215 extern void
216 POMP2_Flush_exit( POMP2_Region_handle* pomp2_handle );
217 
221 extern void
222 POMP2_Critical_begin( POMP2_Region_handle* pomp2_handle );
223 
227 extern void
228 POMP2_Critical_end( POMP2_Region_handle* pomp2_handle );
229 
234 extern void
235 POMP2_Critical_enter( POMP2_Region_handle* pomp2_handle,
236  const char ctc_string[] );
237 
241 extern void
242 POMP2_Critical_exit( POMP2_Region_handle* pomp2_handle );
243 
248 extern void
249 POMP2_For_enter( POMP2_Region_handle* pomp2_handle,
250  const char ctc_string[] );
251 
255 extern void
256 POMP2_For_exit( POMP2_Region_handle* pomp2_handle );
257 
262 extern void
263 POMP2_Master_begin( POMP2_Region_handle* pomp2_handle,
264  const char ctc_string[] );
265 
269 extern void
270 POMP2_Master_end( POMP2_Region_handle* pomp2_handle );
271 
281 extern void
282 POMP2_Parallel_begin( POMP2_Region_handle* pomp2_handle );
283 
288 extern void
289 POMP2_Parallel_end( POMP2_Region_handle* pomp2_handle );
290 
305 extern void
306 POMP2_Parallel_fork( POMP2_Region_handle* pomp2_handle,
307  int if_clause,
308  int num_threads,
309  POMP2_Task_handle* pomp2_old_task,
310  const char ctc_string[] );
311 
323 extern void
324 POMP2_Parallel_join( POMP2_Region_handle* pomp2_handle,
325  POMP2_Task_handle pomp2_old_task );
326 
327 
332 extern void
333 POMP2_Section_begin( POMP2_Region_handle* pomp2_handle,
334  const char ctc_string[] );
335 
339 extern void
340 POMP2_Section_end( POMP2_Region_handle* pomp2_handle );
341 
346 extern void
347 POMP2_Sections_enter( POMP2_Region_handle* pomp2_handle,
348  const char ctc_string[] );
349 
353 extern void
354 POMP2_Sections_exit( POMP2_Region_handle* pomp2_handle );
355 
359 extern void
360 POMP2_Single_begin( POMP2_Region_handle* pomp2_handle );
361 
365 extern void
366 POMP2_Single_end( POMP2_Region_handle* pomp2_handle );
367 
373 extern void
374 POMP2_Single_enter( POMP2_Region_handle* pomp2_handle,
375  const char ctc_string[] );
376 
380 extern void
381 POMP2_Single_exit( POMP2_Region_handle* pomp2_handle );
382 
388 extern void
389 POMP2_Workshare_enter( POMP2_Region_handle* pomp2_handle,
390  const char ctc_string[] );
391 
395 extern void
396 POMP2_Workshare_exit( POMP2_Region_handle* pomp2_handle );
397 
401 extern void
402 POMP2_Ordered_begin( POMP2_Region_handle* pomp2_handle );
403 
407 extern void
408 POMP2_Ordered_end( POMP2_Region_handle* pomp2_handle );
409 
414 extern void
415 POMP2_Ordered_enter( POMP2_Region_handle* pomp2_handle,
416  const char ctc_string[] );
417 
421 extern void
422 POMP2_Ordered_exit( POMP2_Region_handle* pomp2_handle );
423 
439 extern void
440 POMP2_Task_create_begin( POMP2_Region_handle* pomp2_handle,
441  POMP2_Task_handle* pomp2_new_task,
442  POMP2_Task_handle* pomp2_old_task,
443  int pomp2_if,
444  const char ctc_string[] );
445 
455 extern void
456 POMP2_Task_create_end( POMP2_Region_handle* pomp2_handle,
457  POMP2_Task_handle pomp2_old_task );
458 
464 extern void
465 POMP2_Task_begin( POMP2_Region_handle* pomp2_handle,
466  POMP2_Task_handle pomp2_task );
467 
472 extern void
473 POMP2_Task_end( POMP2_Region_handle* pomp2_handle );
474 
492 extern void
493 POMP2_Untied_task_create_begin( POMP2_Region_handle* pomp2_handle,
494  POMP2_Task_handle* pomp2_new_task,
495  POMP2_Task_handle* pomp2_old_task,
496  int pomp2_if,
497  const char ctc_string[] );
498 
510 extern void
511 POMP2_Untied_task_create_end( POMP2_Region_handle* pomp2_handle,
512  POMP2_Task_handle pomp2_old_task );
513 
520 void
521 POMP2_Untied_task_begin( POMP2_Region_handle* pomp2_handle,
522  POMP2_Task_handle pomp2_task );
523 
528 extern void
529 POMP2_Untied_task_end( POMP2_Region_handle* pomp2_handle );
530 
545 extern void
546 POMP2_Taskwait_begin( POMP2_Region_handle* pomp2_handle,
547  POMP2_Task_handle* pomp2_old_task,
548  const char ctc_string[] );
549 
562 extern void
563 POMP2_Taskwait_end( POMP2_Region_handle* pomp2_handle,
564  POMP2_Task_handle pomp2_old_task );
565 
573 extern int
574 POMP2_Lib_get_max_threads( void );
575 
578 extern void
579 POMP2_Init_lock( omp_lock_t* s );
580 
583 extern void
584 POMP2_Destroy_lock( omp_lock_t* s );
585 
588 extern void
589 POMP2_Set_lock( omp_lock_t* s );
590 
593 extern void
594 POMP2_Unset_lock( omp_lock_t* s );
595 
599 extern int
600 POMP2_Test_lock( omp_lock_t* s );
601 
604 extern void
605 POMP2_Init_nest_lock( omp_nest_lock_t* s );
606 
609 extern void
610 POMP2_Destroy_nest_lock( omp_nest_lock_t* s );
611 
614 extern void
615 POMP2_Set_nest_lock( omp_nest_lock_t* s );
616 
619 extern void
620 POMP2_Unset_nest_lock( omp_nest_lock_t* s );
621 
625 extern int
626 POMP2_Test_nest_lock( omp_nest_lock_t* s );
627 
628 #endif /* _OPENMP */
629 
630 #ifdef __cplusplus
631 }
632 #endif
633 
634 #endif
void POMP2_Init_regions(void)
size_t POMP2_Get_num_regions(void)
void * OPARI2_Region_handle
Definition: pomp2_lib.h:71
const char * POMP2_Get_opari2_version(void)
POMP2_Task_handle POMP2_Get_new_task_handle(void)
void POMP2_Assign_handle(POMP2_Region_handle *pomp2_handle, const char ctc_string[])