2.0.4 (revision 1809)
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,
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 
113 extern void
114 POMP2_Assign_handle( POMP2_Region_handle* pomp2_handle,
115  const char ctc_string[] );
116 
117 #ifdef _OPENMP
118 
123 extern void
124 POMP2_Atomic_enter( POMP2_Region_handle* pomp2_handle,
125  const char ctc_string[] );
126 
130 extern void
131 POMP2_Atomic_exit( POMP2_Region_handle* pomp2_handle );
132 
145 extern void
146 POMP2_Barrier_enter( POMP2_Region_handle* pomp2_handle,
147  POMP2_Task_handle* pomp2_old_task,
148  const char ctc_string[] );
149 
161 extern void
162 POMP2_Barrier_exit( POMP2_Region_handle* pomp2_handle,
163  POMP2_Task_handle pomp2_old_task );
164 
165 
177 extern void
178 POMP2_Implicit_barrier_enter( POMP2_Region_handle* pomp2_handle,
179  POMP2_Task_handle* pomp2_old_task );
180 
181 
193 extern void
194 POMP2_Implicit_barrier_exit( POMP2_Region_handle* pomp2_handle,
195  POMP2_Task_handle pomp2_old_task );
196 
197 
203 extern void
204 POMP2_Flush_enter( POMP2_Region_handle* pomp2_handle,
205  const char ctc_string[] );
206 
210 extern void
211 POMP2_Flush_exit( POMP2_Region_handle* pomp2_handle );
212 
216 extern void
217 POMP2_Critical_begin( POMP2_Region_handle* pomp2_handle );
218 
222 extern void
223 POMP2_Critical_end( POMP2_Region_handle* pomp2_handle );
224 
229 extern void
230 POMP2_Critical_enter( POMP2_Region_handle* pomp2_handle,
231  const char ctc_string[] );
232 
236 extern void
237 POMP2_Critical_exit( POMP2_Region_handle* pomp2_handle );
238 
243 extern void
244 POMP2_For_enter( POMP2_Region_handle* pomp2_handle,
245  const char ctc_string[] );
246 
250 extern void
251 POMP2_For_exit( POMP2_Region_handle* pomp2_handle );
252 
257 extern void
258 POMP2_Master_begin( POMP2_Region_handle* pomp2_handle,
259  const char ctc_string[] );
260 
264 extern void
265 POMP2_Master_end( POMP2_Region_handle* pomp2_handle );
266 
276 extern void
277 POMP2_Parallel_begin( POMP2_Region_handle* pomp2_handle );
278 
283 extern void
284 POMP2_Parallel_end( POMP2_Region_handle* pomp2_handle );
285 
300 extern void
301 POMP2_Parallel_fork( POMP2_Region_handle* pomp2_handle,
302  int if_clause,
303  int num_threads,
304  POMP2_Task_handle* pomp2_old_task,
305  const char ctc_string[] );
306 
318 extern void
319 POMP2_Parallel_join( POMP2_Region_handle* pomp2_handle,
320  POMP2_Task_handle pomp2_old_task );
321 
322 
327 extern void
328 POMP2_Section_begin( POMP2_Region_handle* pomp2_handle,
329  const char ctc_string[] );
330 
334 extern void
335 POMP2_Section_end( POMP2_Region_handle* pomp2_handle );
336 
341 extern void
342 POMP2_Sections_enter( POMP2_Region_handle* pomp2_handle,
343  const char ctc_string[] );
344 
348 extern void
349 POMP2_Sections_exit( POMP2_Region_handle* pomp2_handle );
350 
354 extern void
355 POMP2_Single_begin( POMP2_Region_handle* pomp2_handle );
356 
360 extern void
361 POMP2_Single_end( POMP2_Region_handle* pomp2_handle );
362 
368 extern void
369 POMP2_Single_enter( POMP2_Region_handle* pomp2_handle,
370  const char ctc_string[] );
371 
375 extern void
376 POMP2_Single_exit( POMP2_Region_handle* pomp2_handle );
377 
383 extern void
384 POMP2_Workshare_enter( POMP2_Region_handle* pomp2_handle,
385  const char ctc_string[] );
386 
390 extern void
391 POMP2_Workshare_exit( POMP2_Region_handle* pomp2_handle );
392 
396 extern void
397 POMP2_Ordered_begin( POMP2_Region_handle* pomp2_handle );
398 
402 extern void
403 POMP2_Ordered_end( POMP2_Region_handle* pomp2_handle );
404 
409 extern void
410 POMP2_Ordered_enter( POMP2_Region_handle* pomp2_handle,
411  const char ctc_string[] );
412 
416 extern void
417 POMP2_Ordered_exit( POMP2_Region_handle* pomp2_handle );
418 
434 extern void
435 POMP2_Task_create_begin( POMP2_Region_handle* pomp2_handle,
436  POMP2_Task_handle* pomp2_new_task,
437  POMP2_Task_handle* pomp2_old_task,
438  int pomp2_if,
439  const char ctc_string[] );
440 
450 extern void
451 POMP2_Task_create_end( POMP2_Region_handle* pomp2_handle,
452  POMP2_Task_handle pomp2_old_task );
453 
459 extern void
460 POMP2_Task_begin( POMP2_Region_handle* pomp2_handle,
461  POMP2_Task_handle pomp2_task );
462 
467 extern void
468 POMP2_Task_end( POMP2_Region_handle* pomp2_handle );
469 
487 extern void
488 POMP2_Untied_task_create_begin( POMP2_Region_handle* pomp2_handle,
489  POMP2_Task_handle* pomp2_new_task,
490  POMP2_Task_handle* pomp2_old_task,
491  int pomp2_if,
492  const char ctc_string[] );
493 
505 extern void
506 POMP2_Untied_task_create_end( POMP2_Region_handle* pomp2_handle,
507  POMP2_Task_handle pomp2_old_task );
508 
515 void
516 POMP2_Untied_task_begin( POMP2_Region_handle* pomp2_handle,
517  POMP2_Task_handle pomp2_task );
518 
523 extern void
524 POMP2_Untied_task_end( POMP2_Region_handle* pomp2_handle );
525 
540 extern void
541 POMP2_Taskwait_begin( POMP2_Region_handle* pomp2_handle,
542  POMP2_Task_handle* pomp2_old_task,
543  const char ctc_string[] );
544 
557 extern void
558 POMP2_Taskwait_end( POMP2_Region_handle* pomp2_handle,
559  POMP2_Task_handle pomp2_old_task );
560 
568 extern int
569 POMP2_Lib_get_max_threads( void );
570 
573 extern void
574 POMP2_Init_lock( omp_lock_t* s );
575 
578 extern void
579 POMP2_Destroy_lock( omp_lock_t* s );
580 
583 extern void
584 POMP2_Set_lock( omp_lock_t* s );
585 
588 extern void
589 POMP2_Unset_lock( omp_lock_t* s );
590 
594 extern int
595 POMP2_Test_lock( omp_lock_t* s );
596 
599 extern void
600 POMP2_Init_nest_lock( omp_nest_lock_t* s );
601 
604 extern void
605 POMP2_Destroy_nest_lock( omp_nest_lock_t* s );
606 
609 extern void
610 POMP2_Set_nest_lock( omp_nest_lock_t* s );
611 
614 extern void
615 POMP2_Unset_nest_lock( omp_nest_lock_t* s );
616 
620 extern int
621 POMP2_Test_nest_lock( omp_nest_lock_t* s );
622 
623 #endif /* _OPENMP */
624 
625 #ifdef __cplusplus
626 }
627 #endif
628 
629 #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)