Install gcc-4.4.0-tdm-1-core-2.tar.gz
[msysgit.git] / mingw / info / libgomp.info
blob374ed8b3f5c2ffe957ad4d9421b5e803bb80fb5d
1 This is libgomp.info, produced by makeinfo version 4.8 from
2 ../../../gcc-4.4.0/libgomp/libgomp.texi.
4    Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
6    Permission is granted to copy, distribute and/or modify this document
7 under the terms of the GNU Free Documentation License, Version 1.2 or
8 any later version published by the Free Software Foundation; with the
9 Invariant Sections being "Funding Free Software", the Front-Cover texts
10 being (a) (see below), and with the Back-Cover Texts being (b) (see
11 below).  A copy of the license is included in the section entitled "GNU
12 Free Documentation License".
14    (a) The FSF's Front-Cover Text is:
16    A GNU Manual
18    (b) The FSF's Back-Cover Text is:
20    You have freedom to copy and modify this GNU Manual, like GNU
21 software.  Copies published by the Free Software Foundation raise
22 funds for GNU development.
24 INFO-DIR-SECTION GNU Libraries
25 START-INFO-DIR-ENTRY
26 * libgomp: (libgomp).                    GNU OpenMP runtime library
27 END-INFO-DIR-ENTRY
29    This manual documents the GNU implementation of the OpenMP API for
30 multi-platform shared-memory parallel programming in C/C++ and Fortran.
32    Published by the Free Software Foundation 51 Franklin Street, Fifth
33 Floor Boston, MA 02110-1301 USA
35    Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
37    Permission is granted to copy, distribute and/or modify this document
38 under the terms of the GNU Free Documentation License, Version 1.2 or
39 any later version published by the Free Software Foundation; with the
40 Invariant Sections being "Funding Free Software", the Front-Cover texts
41 being (a) (see below), and with the Back-Cover Texts being (b) (see
42 below).  A copy of the license is included in the section entitled "GNU
43 Free Documentation License".
45    (a) The FSF's Front-Cover Text is:
47    A GNU Manual
49    (b) The FSF's Back-Cover Text is:
51    You have freedom to copy and modify this GNU Manual, like GNU
52 software.  Copies published by the Free Software Foundation raise
53 funds for GNU development.
55 \x1f
56 File: libgomp.info,  Node: Top,  Next: Enabling OpenMP,  Up: (dir)
58 Introduction
59 ************
61 This manual documents the usage of libgomp, the GNU implementation of
62 the OpenMP (http://www.openmp.org) Application Programming Interface
63 (API) for multi-platform shared-memory parallel programming in C/C++
64 and Fortran.
66 * Menu:
68 * Enabling OpenMP::            How to enable OpenMP for your applications.
69 * Runtime Library Routines::   The OpenMP runtime application programming
70                                interface.
71 * Environment Variables::      Influencing runtime behavior with environment
72                                variables.
73 * The libgomp ABI::            Notes on the external ABI presented by libgomp.
74 * Reporting Bugs::             How to report bugs in GNU OpenMP.
75 * Copying::                    GNU general public license says
76                                how you can copy and share libgomp.
77 * GNU Free Documentation License::
78                                How you can copy and share this manual.
79 * Funding::                    How to help assure continued work for free
80                                software.
81 * Index::                      Index of this documentation.
83 \x1f
84 File: libgomp.info,  Node: Enabling OpenMP,  Next: Runtime Library Routines,  Prev: Top,  Up: Top
86 1 Enabling OpenMP
87 *****************
89 To activate the OpenMP extensions for C/C++ and Fortran, the
90 compile-time flag `-fopenmp' must be specified. This enables the OpenMP
91 directive `#pragma omp' in C/C++ and `!$omp' directives in free form,
92 `c$omp', `*$omp' and `!$omp' directives in fixed form, `!$' conditional
93 compilation sentinels in free form and `c$', `*$' and `!$' sentinels in
94 fixed form, for Fortran. The flag also arranges for automatic linking
95 of the OpenMP runtime library (*Note Runtime Library Routines::).
97    A complete description of all OpenMP directives accepted may be
98 found in the OpenMP Application Program Interface
99 (http://www.openmp.org) manual, version 3.0.
101 \x1f
102 File: libgomp.info,  Node: Runtime Library Routines,  Next: Environment Variables,  Prev: Enabling OpenMP,  Up: Top
104 2 Runtime Library Routines
105 **************************
107 The runtime routines described here are defined by section 3 of the
108 OpenMP specifications in version 3.0. The routines are structured in
109 following three parts:
111    Control threads, processors and the parallel environment.
113 * Menu:
115 * omp_get_active_level::        Number of active parallel regions
116 * omp_get_ancestor_thread_num:: Ancestor thread ID
117 * omp_get_dynamic::             Dynamic teams setting
118 * omp_get_level::               Number of parallel regions
119 * omp_get_max_active_levels::   Maximal number of active regions
120 * omp_get_max_threads::         Maximal number of threads of parallel region
121 * omp_get_nested::              Nested parallel regions
122 * omp_get_num_procs::           Number of processors online
123 * omp_get_num_threads::         Size of the active team
124 * omp_get_schedule::            Obtain the runtime scheduling method
125 * omp_get_team_size::           Number of threads in a team
126 * omp_get_thread_limit::        Maximal number of threads
127 * omp_get_thread_num::          Current thread ID
128 * omp_in_parallel::             Whether a parallel region is active
129 * omp_set_dynamic::             Enable/disable dynamic teams
130 * omp_set_max_active_levels::   Limits the number of active parallel regions
131 * omp_set_nested::              Enable/disable nested parallel regions
132 * omp_set_num_threads::         Set upper team size limit
133 * omp_set_schedule::            Set the runtime scheduling method
135    Initialize, set, test, unset and destroy simple and nested locks.
137 * Menu:
139 * omp_init_lock::            Initialize simple lock
140 * omp_set_lock::             Wait for and set simple lock
141 * omp_test_lock::            Test and set simple lock if available
142 * omp_unset_lock::           Unset simple lock
143 * omp_destroy_lock::         Destroy simple lock
144 * omp_init_nest_lock::       Initialize nested lock
145 * omp_set_nest_lock::        Wait for and set simple lock
146 * omp_test_nest_lock::       Test and set nested lock if available
147 * omp_unset_nest_lock::      Unset nested lock
148 * omp_destroy_nest_lock::    Destroy nested lock
150    Portable, thread-based, wall clock timer.
152 * Menu:
154 * omp_get_wtick::            Get timer precision.
155 * omp_get_wtime::            Elapsed wall clock time.
157 \x1f
158 File: libgomp.info,  Node: omp_get_active_level,  Next: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
160 2.1 `omp_get_active_level' - Number of parallel regions
161 =======================================================
163 _Description_:
164      This function returns the nesting level for the active parallel
165      blocks, which enclose the calling call.
167 _C/C++_
168      _Prototype_:  `int omp_get_active_level();'
170 _Fortran_:
171      _Interface_:  `integer omp_get_active_level()'
173 _See also_:
174      *Note omp_get_level::, *Note omp_get_max_active_levels::, *Note
175      omp_set_max_active_levels::
177 _Reference_:
178      OpenMP specifications v3.0 (http://www.openmp.org/), section
179      3.2.19.
181 \x1f
182 File: libgomp.info,  Node: omp_get_ancestor_thread_num,  Next: omp_get_dynamic,  Prev: omp_get_active_level,  Up: Runtime Library Routines
184 2.2 `omp_get_ancestor_thread_num' - Ancestor thread ID
185 ======================================================
187 _Description_:
188      This function returns the thread identification number for the
189      given nesting level of the current thread. For values of LEVEL
190      outside zero to `omp_get_level' -1 is returned; if LEVEL is
191      `omp_get_level' the result is identical to `omp_get_thread_num'.
193 _C/C++_
194      _Prototype_:  `int omp_get_ancestor_thread_num(int level);'
196 _Fortran_:
197      _Interface_:  `integer omp_ancestor_thread_num(level)'
198                    `integer level'
200 _See also_:
201      *Note omp_get_level::, *Note omp_get_thread_num::, *Note
202      omp_get_team_size::
204 _Reference_:
205      OpenMP specifications v3.0 (http://www.openmp.org/), section
206      3.2.17.
208 \x1f
209 File: libgomp.info,  Node: omp_get_dynamic,  Next: omp_get_level,  Prev: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
211 2.3 `omp_get_dynamic' - Dynamic teams setting
212 =============================================
214 _Description_:
215      This function returns `true' if enabled, `false' otherwise.  Here,
216      `true' and `false' represent their language-specific counterparts.
218      The dynamic team setting may be initialized at startup by the
219      `OMP_DYNAMIC' environment variable or at runtime using
220      `omp_set_dynamic'. If undefined, dynamic adjustment is disabled by
221      default.
223 _C/C++_:
224      _Prototype_:  `int omp_get_dynamic();'
226 _Fortran_:
227      _Interface_:  `logical function omp_get_dynamic()'
229 _See also_:
230      *Note omp_set_dynamic::, *Note OMP_DYNAMIC::
232 _Reference_:
233      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.8.
235 \x1f
236 File: libgomp.info,  Node: omp_get_level,  Next: omp_get_max_active_levels,  Prev: omp_get_dynamic,  Up: Runtime Library Routines
238 2.4 `omp_get_level' - Obtain the current nesting level
239 ======================================================
241 _Description_:
242      This function returns the nesting level for the parallel blocks,
243      which enclose the calling call.
245 _C/C++_
246      _Prototype_:  `int omp_get level();'
248 _Fortran_:
249      _Interface_:  `integer omp_level()'
251 _See also_:
252      *Note omp_get_active_level::
254 _Reference_:
255      OpenMP specifications v3.0 (http://www.openmp.org/), section
256      3.2.16.
258 \x1f
259 File: libgomp.info,  Node: omp_get_max_active_levels,  Next: omp_get_max_threads,  Prev: omp_get_level,  Up: Runtime Library Routines
261 2.5 `omp_set_max_active_levels' - Maximal number of active regions
262 ==================================================================
264 _Description_:
265      This function obtains the maximally allowed number of nested,
266      active parallel regions.
268 _C/C++_
269      _Prototype_:  `int omp_get_max_active_levels();'
271 _Fortran_:
272      _Interface_:  `int omp_get_max_active_levels()'
274 _See also_:
275      *Note omp_set_max_active_levels::, *Note omp_get_active_level::
277 _Reference_:
278      OpenMP specifications v3.0 (http://www.openmp.org/), section
279      3.2.14.
281 \x1f
282 File: libgomp.info,  Node: omp_get_max_threads,  Next: omp_get_nested,  Prev: omp_get_max_active_levels,  Up: Runtime Library Routines
284 2.6 `omp_get_max_threads' - Maximal number of threads of parallel region
285 ========================================================================
287 _Description_:
288      Return the maximal number of threads used for the current parallel
289      region that does not use the clause `num_threads'.
291 _C/C++_:
292      _Prototype_:  `int omp_get_max_threads();'
294 _Fortran_:
295      _Interface_:  `integer function omp_get_max_threads()'
297 _See also_:
298      *Note omp_set_num_threads::, *Note omp_set_dynamic::, *Note
299      omp_get_thread_limit::
301 _Reference_:
302      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.3.
304 \x1f
305 File: libgomp.info,  Node: omp_get_nested,  Next: omp_get_num_procs,  Prev: omp_get_max_threads,  Up: Runtime Library Routines
307 2.7 `omp_get_nested' - Nested parallel regions
308 ==============================================
310 _Description_:
311      This function returns `true' if nested parallel regions are
312      enabled, `false' otherwise. Here, `true' and `false' represent
313      their language-specific counterparts.
315      Nested parallel regions may be initialized at startup by the
316      `OMP_NESTED' environment variable or at runtime using
317      `omp_set_nested'. If undefined, nested parallel regions are
318      disabled by default.
320 _C/C++_:
321      _Prototype_:  `int omp_get_nested();'
323 _Fortran_:
324      _Interface_:  `integer function omp_get_nested()'
326 _See also_:
327      *Note omp_set_nested::, *Note OMP_NESTED::
329 _Reference_:
330      OpenMP specifications v3.0 (http://www.openmp.org/), section
331      3.2.10.
333 \x1f
334 File: libgomp.info,  Node: omp_get_num_procs,  Next: omp_get_num_threads,  Prev: omp_get_nested,  Up: Runtime Library Routines
336 2.8 `omp_get_num_procs' - Number of processors online
337 =====================================================
339 _Description_:
340      Returns the number of processors online.
342 _C/C++_:
343      _Prototype_:  `int omp_get_num_procs();'
345 _Fortran_:
346      _Interface_:  `integer function omp_get_num_procs()'
348 _Reference_:
349      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.5.
351 \x1f
352 File: libgomp.info,  Node: omp_get_num_threads,  Next: omp_get_schedule,  Prev: omp_get_num_procs,  Up: Runtime Library Routines
354 2.9 `omp_get_num_threads' - Size of the active team
355 ===================================================
357 _Description_:
358      The number of threads in the current team. In a sequential section
359      of the program `omp_get_num_threads' returns 1.
361      The default team size may be initialized at startup by the
362      `OMP_NUM_THREADS' environment variable. At runtime, the size of
363      the current team may be set either by the `NUM_THREADS' clause or
364      by `omp_set_num_threads'. If none of the above were used to define
365      a specific value and `OMP_DYNAMIC' is disabled, one thread per CPU
366      online is used.
368 _C/C++_:
369      _Prototype_:  `int omp_get_num_threads();'
371 _Fortran_:
372      _Interface_:  `integer function omp_get_num_threads()'
374 _See also_:
375      *Note omp_get_max_threads::, *Note omp_set_num_threads::, *Note
376      OMP_NUM_THREADS::
378 _Reference_:
379      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.2.
381 \x1f
382 File: libgomp.info,  Node: omp_get_schedule,  Next: omp_get_team_size,  Prev: omp_get_num_threads,  Up: Runtime Library Routines
384 2.10 `omp_get_schedule' - Obtain the runtime scheduling method
385 ==============================================================
387 _Description_:
388      Obtain runtime the scheduling method. The KIND argument will be
389      set to the value `omp_sched_static', `omp_sched_dynamic',
390      `opm_sched_guided' or `auto'. The second argument, MODIFIER, is
391      set to the chunk size.
393 _C/C++_
394      _Prototype_:  `omp_schedule(omp_sched_t * kind, int *modifier);'
396 _Fortran_:
397      _Interface_:  `subroutine omp_schedule(kind, modifier)'
398                    `integer(kind=omp_sched_kind) kind'
399                    `integer modifier'
401 _See also_:
402      *Note omp_set_schedule::, *Note OMP_SCHEDULE::
404 _Reference_:
405      OpenMP specifications v3.0 (http://www.openmp.org/), section
406      3.2.12.
408 \x1f
409 File: libgomp.info,  Node: omp_get_team_size,  Next: omp_get_thread_limit,  Prev: omp_get_schedule,  Up: Runtime Library Routines
411 2.11 `omp_get_team_size' - Number of threads in a team
412 ======================================================
414 _Description_:
415      This function returns the number of threads in a thread team to
416      which either the current thread or its ancestor belongs. For
417      values of LEVEL outside zero to `omp_get_level' -1 is returned; if
418      LEVEL is zero 1 is returned and for `omp_get_level' the result is
419      identical to `omp_get_num_threads'.
421 _C/C++_:
422      _Prototype_:  `int omp_get_time_size(int level);'
424 _Fortran_:
425      _Interface_:  `integer function omp_get_team_size(level)'
426                    `integer level'
428 _See also_:
429      *Note omp_get_num_threads::, *Note omp_get_level::, *Note
430      omp_get_ancestor_thread_num::
432 _Reference_:
433      OpenMP specifications v3.0 (http://www.openmp.org/), section
434      3.2.18.
436 \x1f
437 File: libgomp.info,  Node: omp_get_thread_limit,  Next: omp_get_thread_num,  Prev: omp_get_team_size,  Up: Runtime Library Routines
439 2.12 `omp_get_thread_limit' - Maximal number of threads
440 =======================================================
442 _Description_:
443      Return the maximal number of threads of the program.
445 _C/C++_:
446      _Prototype_:  `int omp_get_thread_limit();'
448 _Fortran_:
449      _Interface_:  `integer function omp_get_thread_limit()'
451 _See also_:
452      *Note omp_get_max_threads::, *Note OMP_THREAD_LIMIT::
454 _Reference_:
455      OpenMP specifications v3.0 (http://www.openmp.org/), section
456      3.2.13.
458 \x1f
459 File: libgomp.info,  Node: omp_get_thread_num,  Next: omp_in_parallel,  Prev: omp_get_thread_limit,  Up: Runtime Library Routines
461 2.13 `omp_get_thread_num' - Current thread ID
462 =============================================
464 _Description_:
465      Unique thread identification number within the current team.  In a
466      sequential parts of the program, `omp_get_thread_num' always
467      returns 0. In parallel regions the return value varies from 0 to
468      `omp_get_num_threads'-1 inclusive. The return value of the master
469      thread of a team is always 0.
471 _C/C++_:
472      _Prototype_:  `int omp_get_thread_num();'
474 _Fortran_:
475      _Interface_:  `integer function omp_get_thread_num()'
477 _See also_:
478      *Note omp_get_num_threads::, *Note omp_get_ancestor_thread_num::
480 _Reference_:
481      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.4.
483 \x1f
484 File: libgomp.info,  Node: omp_in_parallel,  Next: omp_set_dynamic,  Prev: omp_get_thread_num,  Up: Runtime Library Routines
486 2.14 `omp_in_parallel' - Whether a parallel region is active
487 ============================================================
489 _Description_:
490      This function returns `true' if currently running in parallel,
491      `false' otherwise. Here, `true' and `false' represent their
492      language-specific counterparts.
494 _C/C++_:
495      _Prototype_:  `int omp_in_parallel();'
497 _Fortran_:
498      _Interface_:  `logical function omp_in_parallel()'
500 _Reference_:
501      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.6.
503 \x1f
504 File: libgomp.info,  Node: omp_set_dynamic,  Next: omp_set_max_active_levels,  Prev: omp_in_parallel,  Up: Runtime Library Routines
506 2.15 `omp_set_dynamic' - Enable/disable dynamic teams
507 =====================================================
509 _Description_:
510      Enable or disable the dynamic adjustment of the number of threads
511      within a team. The function takes the language-specific equivalent
512      of `true' and `false', where `true' enables dynamic adjustment of
513      team sizes and `false' disables it.
515 _C/C++_:
516      _Prototype_:  `void omp_set_dynamic(int);'
518 _Fortran_:
519      _Interface_:  `subroutine omp_set_dynamic(set)'
520                    `integer, intent(in) :: set'
522 _See also_:
523      *Note OMP_DYNAMIC::, *Note omp_get_dynamic::
525 _Reference_:
526      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.7.
528 \x1f
529 File: libgomp.info,  Node: omp_set_max_active_levels,  Next: omp_set_nested,  Prev: omp_set_dynamic,  Up: Runtime Library Routines
531 2.16 `omp_set_max_active_levels' - Limits the number of active parallel regions
532 ===============================================================================
534 _Description_:
535      This function limits the maximally allowed number of nested,
536      active parallel regions.
538 _C/C++_
539      _Prototype_:  `omp_set_max_active_levels(int max_levels);'
541 _Fortran_:
542      _Interface_:  `omp_max_active_levels(max_levels)'
543                    `integer max_levels'
545 _See also_:
546      *Note omp_get_max_active_levels::, *Note omp_get_active_level::
548 _Reference_:
549      OpenMP specifications v3.0 (http://www.openmp.org/), section
550      3.2.14.
552 \x1f
553 File: libgomp.info,  Node: omp_set_nested,  Next: omp_set_num_threads,  Prev: omp_set_max_active_levels,  Up: Runtime Library Routines
555 2.17 `omp_set_nested' - Enable/disable nested parallel regions
556 ==============================================================
558 _Description_:
559      Enable or disable nested parallel regions, i.e., whether team
560      members are allowed to create new teams. The function takes the
561      language-specific equivalent of `true' and `false', where `true'
562      enables dynamic adjustment of team sizes and `false' disables it.
564 _C/C++_:
565      _Prototype_:  `void omp_set_dynamic(int);'
567 _Fortran_:
568      _Interface_:  `subroutine omp_set_dynamic(set)'
569                    `integer, intent(in) :: set'
571 _See also_:
572      *Note OMP_NESTED::, *Note omp_get_nested::
574 _Reference_:
575      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.9.
577 \x1f
578 File: libgomp.info,  Node: omp_set_num_threads,  Next: omp_set_schedule,  Prev: omp_set_nested,  Up: Runtime Library Routines
580 2.18 `omp_set_num_threads' - Set upper team size limit
581 ======================================================
583 _Description_:
584      Specifies the number of threads used by default in subsequent
585      parallel sections, if those do not specify a `num_threads' clause.
586      The argument of `omp_set_num_threads' shall be a positive integer.
588 _C/C++_:
589      _Prototype_:  `void omp_set_num_threads(int);'
591 _Fortran_:
592      _Interface_:  `subroutine omp_set_num_threads(set)'
593                    `integer, intent(in) :: set'
595 _See also_:
596      *Note OMP_NUM_THREADS::, *Note omp_get_num_threads::, *Note
597      omp_get_max_threads::
599 _Reference_:
600      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.2.1.
602 \x1f
603 File: libgomp.info,  Node: omp_set_schedule,  Next: omp_init_lock,  Prev: omp_set_num_threads,  Up: Runtime Library Routines
605 2.19 `omp_set_schedule' - Set the runtime scheduling method
606 ===========================================================
608 _Description_:
609      Sets the runtime scheduling method. The KIND argument can have the
610      value `omp_sched_static', `omp_sched_dynamic', `opm_sched_guided'
611      or `omp_sched_auto'. Except for `omp_sched_auto', the chunk size
612      is set to the value of MODIFIER if positive or to the default
613      value if zero or negative.  For `omp_sched_auto' the MODIFIER
614      argument is ignored.
616 _C/C++_
617      _Prototype_:  `int omp_schedule(omp_sched_t * kind, int *modifier);'
619 _Fortran_:
620      _Interface_:  `subroutine omp_schedule(kind, modifier)'
621                    `integer(kind=omp_sched_kind) kind'
622                    `integer modifier'
624 _See also_:
625      *Note omp_get_schedule:: *Note OMP_SCHEDULE::
627 _Reference_:
628      OpenMP specifications v3.0 (http://www.openmp.org/), section
629      3.2.11.
631 \x1f
632 File: libgomp.info,  Node: omp_init_lock,  Next: omp_set_lock,  Prev: omp_set_schedule,  Up: Runtime Library Routines
634 2.20 `omp_init_lock' - Initialize simple lock
635 =============================================
637 _Description_:
638      Initialize a simple lock. After initialization, the lock is in an
639      unlocked state.
641 _C/C++_:
642      _Prototype_:  `void omp_init_lock(omp_lock_t *lock);'
644 _Fortran_:
645      _Interface_:  `subroutine omp_init_lock(lock)'
646                    `integer(omp_lock_kind), intent(out) :: lock'
648 _See also_:
649      *Note omp_destroy_lock::
651 _Reference_:
652      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.1.
654 \x1f
655 File: libgomp.info,  Node: omp_set_lock,  Next: omp_test_lock,  Prev: omp_init_lock,  Up: Runtime Library Routines
657 2.21 `omp_set_lock' - Wait for and set simple lock
658 ==================================================
660 _Description_:
661      Before setting a simple lock, the lock variable must be
662      initialized by `omp_init_lock'. The calling thread is blocked
663      until the lock is available. If the lock is already held by the
664      current thread, a deadlock occurs.
666 _C/C++_:
667      _Prototype_:  `void omp_set_lock(omp_lock_t *lock);'
669 _Fortran_:
670      _Interface_:  `subroutine omp_set_lock(lock)'
671                    `integer(omp_lock_kind), intent(out) :: lock'
673 _See also_:
674      *Note omp_init_lock::, *Note omp_test_lock::, *Note
675      omp_unset_lock::
677 _Reference_:
678      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.3.
680 \x1f
681 File: libgomp.info,  Node: omp_test_lock,  Next: omp_unset_lock,  Prev: omp_set_lock,  Up: Runtime Library Routines
683 2.22 `omp_test_lock' - Test and set simple lock if available
684 ============================================================
686 _Description_:
687      Before setting a simple lock, the lock variable must be
688      initialized by `omp_init_lock'. Contrary to `omp_set_lock',
689      `omp_test_lock' does not block if the lock is not available. This
690      function returns `true' upon success, `false' otherwise. Here,
691      `true' and `false' represent their language-specific counterparts.
693 _C/C++_:
694      _Prototype_:  `int omp_test_lock(omp_lock_t *lock);'
696 _Fortran_:
697      _Interface_:  `subroutine omp_test_lock(lock)'
698                    `logical(omp_logical_kind) :: omp_test_lock'
699                    `integer(omp_lock_kind), intent(out) :: lock'
701 _See also_:
702      *Note omp_init_lock::, *Note omp_set_lock::, *Note omp_set_lock::
704 _Reference_:
705      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.5.
707 \x1f
708 File: libgomp.info,  Node: omp_unset_lock,  Next: omp_destroy_lock,  Prev: omp_test_lock,  Up: Runtime Library Routines
710 2.23 `omp_unset_lock' - Unset simple lock
711 =========================================
713 _Description_:
714      A simple lock about to be unset must have been locked by
715      `omp_set_lock' or `omp_test_lock' before. In addition, the lock
716      must be held by the thread calling `omp_unset_lock'. Then, the
717      lock becomes unlocked. If one ore more threads attempted to set
718      the lock before, one of them is chosen to, again, set the lock for
719      itself.
721 _C/C++_:
722      _Prototype_:  `void omp_unset_lock(omp_lock_t *lock);'
724 _Fortran_:
725      _Interface_:  `subroutine omp_unset_lock(lock)'
726                    `integer(omp_lock_kind), intent(out) :: lock'
728 _See also_:
729      *Note omp_set_lock::, *Note omp_test_lock::
731 _Reference_:
732      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.4.
734 \x1f
735 File: libgomp.info,  Node: omp_destroy_lock,  Next: omp_init_nest_lock,  Prev: omp_unset_lock,  Up: Runtime Library Routines
737 2.24 `omp_destroy_lock' - Destroy simple lock
738 =============================================
740 _Description_:
741      Destroy a simple lock. In order to be destroyed, a simple lock
742      must be in the unlocked state.
744 _C/C++_:
745      _Prototype_:  `void omp_destroy_lock(omp_lock_t *);'
747 _Fortran_:
748      _Interface_:  `subroutine omp_destroy_lock(lock)'
749                    `integer(omp_lock_kind), intent(inout) :: lock'
751 _See also_:
752      *Note omp_init_lock::
754 _Reference_:
755      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.2.
757 \x1f
758 File: libgomp.info,  Node: omp_init_nest_lock,  Next: omp_set_nest_lock,  Prev: omp_destroy_lock,  Up: Runtime Library Routines
760 2.25 `omp_init_nest_lock' - Initialize nested lock
761 ==================================================
763 _Description_:
764      Initialize a nested lock. After initialization, the lock is in an
765      unlocked state and the nesting count is set to zero.
767 _C/C++_:
768      _Prototype_:  `void omp_init_nest_lock(omp_nest_lock_t *lock);'
770 _Fortran_:
771      _Interface_:  `subroutine omp_init_nest_lock(lock)'
772                    `integer(omp_nest_lock_kind), intent(out) :: lock'
774 _See also_:
775      *Note omp_destroy_nest_lock::
777 _Reference_:
778      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.1.
780 \x1f
781 File: libgomp.info,  Node: omp_set_nest_lock,  Next: omp_test_nest_lock,  Prev: omp_init_nest_lock,  Up: Runtime Library Routines
783 2.26 `omp_set_nest_lock' - Wait for and set simple lock
784 =======================================================
786 _Description_:
787      Before setting a nested lock, the lock variable must be
788      initialized by `omp_init_nest_lock'. The calling thread is blocked
789      until the lock is available. If the lock is already held by the
790      current thread, the nesting count for the lock in incremented.
792 _C/C++_:
793      _Prototype_:  `void omp_set_nest_lock(omp_nest_lock_t *lock);'
795 _Fortran_:
796      _Interface_:  `subroutine omp_set_nest_lock(lock)'
797                    `integer(omp_nest_lock_kind), intent(out) :: lock'
799 _See also_:
800      *Note omp_init_nest_lock::, *Note omp_unset_nest_lock::
802 _Reference_:
803      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.3.
805 \x1f
806 File: libgomp.info,  Node: omp_test_nest_lock,  Next: omp_unset_nest_lock,  Prev: omp_set_nest_lock,  Up: Runtime Library Routines
808 2.27 `omp_test_nest_lock' - Test and set nested lock if available
809 =================================================================
811 _Description_:
812      Before setting a nested lock, the lock variable must be
813      initialized by `omp_init_nest_lock'. Contrary to
814      `omp_set_nest_lock', `omp_test_nest_lock' does not block if the
815      lock is not available.  If the lock is already held by the current
816      thread, the new nesting count is returned. Otherwise, the return
817      value equals zero.
819 _C/C++_:
820      _Prototype_:  `int omp_test_nest_lock(omp_nest_lock_t *lock);'
822 _Fortran_:
823      _Interface_:  `integer function omp_test_nest_lock(lock)'
824                    `integer(omp_integer_kind) :: omp_test_nest_lock'
825                    `integer(omp_nest_lock_kind), intent(inout) :: lock'
827 _See also_:
828      *Note omp_init_lock::, *Note omp_set_lock::, *Note omp_set_lock::
830 _Reference_:
831      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.5.
833 \x1f
834 File: libgomp.info,  Node: omp_unset_nest_lock,  Next: omp_destroy_nest_lock,  Prev: omp_test_nest_lock,  Up: Runtime Library Routines
836 2.28 `omp_unset_nest_lock' - Unset nested lock
837 ==============================================
839 _Description_:
840      A nested lock about to be unset must have been locked by
841      `omp_set_nested_lock' or `omp_test_nested_lock' before. In
842      addition, the lock must be held by the thread calling
843      `omp_unset_nested_lock'. If the nesting count drops to zero, the
844      lock becomes unlocked. If one ore more threads attempted to set
845      the lock before, one of them is chosen to, again, set the lock for
846      itself.
848 _C/C++_:
849      _Prototype_:  `void omp_unset_nest_lock(omp_nest_lock_t *lock);'
851 _Fortran_:
852      _Interface_:  `subroutine omp_unset_nest_lock(lock)'
853                    `integer(omp_nest_lock_kind), intent(out) :: lock'
855 _See also_:
856      *Note omp_set_nest_lock::
858 _Reference_:
859      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.4.
861 \x1f
862 File: libgomp.info,  Node: omp_destroy_nest_lock,  Next: omp_get_wtick,  Prev: omp_unset_nest_lock,  Up: Runtime Library Routines
864 2.29 `omp_destroy_nest_lock' - Destroy nested lock
865 ==================================================
867 _Description_:
868      Destroy a nested lock. In order to be destroyed, a nested lock
869      must be in the unlocked state and its nesting count must equal
870      zero.
872 _C/C++_:
873      _Prototype_:  `void omp_destroy_nest_lock(omp_nest_lock_t *);'
875 _Fortran_:
876      _Interface_:  `subroutine omp_destroy_nest_lock(lock)'
877                    `integer(omp_nest_lock_kind), intent(inout) :: lock'
879 _See also_:
880      *Note omp_init_lock::
882 _Reference_:
883      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.3.2.
885 \x1f
886 File: libgomp.info,  Node: omp_get_wtick,  Next: omp_get_wtime,  Prev: omp_destroy_nest_lock,  Up: Runtime Library Routines
888 2.30 `omp_get_wtick' - Get timer precision
889 ==========================================
891 _Description_:
892      Gets the timer precision, i.e., the number of seconds between two
893      successive clock ticks.
895 _C/C++_:
896      _Prototype_:  `double omp_get_wtick();'
898 _Fortran_:
899      _Interface_:  `double precision function omp_get_wtick()'
901 _See also_:
902      *Note omp_get_wtime::
904 _Reference_:
905      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.4.2.
907 \x1f
908 File: libgomp.info,  Node: omp_get_wtime,  Prev: omp_get_wtick,  Up: Runtime Library Routines
910 2.31 `omp_get_wtime' - Elapsed wall clock time
911 ==============================================
913 _Description_:
914      Elapsed wall clock time in seconds. The time is measured per
915      thread, no guarantee can bee made that two distinct threads
916      measure the same time.  Time is measured from some "time in the
917      past". On POSIX compliant systems the seconds since the Epoch
918      (00:00:00 UTC, January 1, 1970) are returned.
920 _C/C++_:
921      _Prototype_:  `double omp_get_wtime();'
923 _Fortran_:
924      _Interface_:  `double precision function omp_get_wtime()'
926 _See also_:
927      *Note omp_get_wtick::
929 _Reference_:
930      OpenMP specifications v3.0 (http://www.openmp.org/), section 3.4.1.
932 \x1f
933 File: libgomp.info,  Node: Environment Variables,  Next: The libgomp ABI,  Prev: Runtime Library Routines,  Up: Top
935 3 Environment Variables
936 ***********************
938 The variables `OMP_DYNAMIC', `OMP_MAX_ACTIVE_LEVELS', `OMP_NESTED',
939 `OMP_NUM_THREADS', `OMP_SCHEDULE', `OMP_STACKSIZE',`OMP_THREAD_LIMIT'
940 and `OMP_WAIT_POLICY' are defined by section 4 of the OpenMP
941 specifications in version 3.0, while `GOMP_CPU_AFFINITY' and
942 `GOMP_STACKSIZE' are GNU extensions.
944 * Menu:
946 * OMP_DYNAMIC::           Dynamic adjustment of threads
947 * OMP_MAX_ACTIVE_LEVELS:: Set the maximal number of nested parallel regions
948 * OMP_NESTED::            Nested parallel regions
949 * OMP_NUM_THREADS::       Specifies the number of threads to use
950 * OMP_STACKSIZE::         Set default thread stack size
951 * OMP_SCHEDULE::          How threads are scheduled
952 * OMP_THREAD_LIMIT::      Set the maximal number of threads
953 * OMP_WAIT_POLICY::       How waiting threads are handled
954 * GOMP_CPU_AFFINITY::     Bind threads to specific CPUs
955 * GOMP_STACKSIZE::        Set default thread stack size
957 \x1f
958 File: libgomp.info,  Node: OMP_DYNAMIC,  Next: OMP_MAX_ACTIVE_LEVELS,  Up: Environment Variables
960 3.1 `OMP_DYNAMIC' - Dynamic adjustment of threads
961 =================================================
963 _Description_:
964      Enable or disable the dynamic adjustment of the number of threads
965      within a team. The value of this environment variable shall be
966      `TRUE' or `FALSE'. If undefined, dynamic adjustment is disabled by
967      default.
969 _See also_:
970      *Note omp_set_dynamic::
972 _Reference_:
973      OpenMP specifications v3.0 (http://www.openmp.org/), section 4.3
975 \x1f
976 File: libgomp.info,  Node: OMP_MAX_ACTIVE_LEVELS,  Next: OMP_NESTED,  Prev: OMP_DYNAMIC,  Up: Environment Variables
978 3.2 `OMP_MAX_ACTIVE_LEVELS' - Set the maximal number of nested parallel regions
979 ===============================================================================
981 _Description_:
982      Specifies the initial value for the maximal number of nested
983      parallel regions. The value of this variable shall be positive
984      integer.  If undefined, the number of active levels is unlimited.
986 _See also_:
987      *Note omp_set_max_active_levels::
989 _Reference_:
990      OpenMP specifications v3.0 (http://www.openmp.org/), section 4.7
992 \x1f
993 File: libgomp.info,  Node: OMP_NESTED,  Next: OMP_NUM_THREADS,  Prev: OMP_MAX_ACTIVE_LEVELS,  Up: Environment Variables
995 3.3 `OMP_NESTED' - Nested parallel regions
996 ==========================================
998 _Description_:
999      Enable or disable nested parallel regions, i.e., whether team
1000      members are allowed to create new teams. The value of this
1001      environment variable shall be `TRUE' or `FALSE'. If undefined,
1002      nested parallel regions are disabled by default.
1004 _See also_:
1005      *Note omp_set_nested::
1007 _Reference_:
1008      OpenMP specifications v3.0 (http://www.openmp.org/), section 4.4
1010 \x1f
1011 File: libgomp.info,  Node: OMP_NUM_THREADS,  Next: OMP_STACKSIZE,  Prev: OMP_NESTED,  Up: Environment Variables
1013 3.4 `OMP_NUM_THREADS' - Specifies the number of threads to use
1014 ==============================================================
1016 _Description_:
1017      Specifies the default number of threads to use in parallel
1018      regions. The value of this variable shall be positive integer. If
1019      undefined one thread per CPU online is used.
1021 _See also_:
1022      *Note omp_set_num_threads::
1024 _Reference_:
1025      OpenMP specifications v3.0 (http://www.openmp.org/), section 4.2
1027 \x1f
1028 File: libgomp.info,  Node: OMP_SCHEDULE,  Next: OMP_THREAD_LIMIT,  Prev: OMP_STACKSIZE,  Up: Environment Variables
1030 3.5 `OMP_SCHEDULE' - How threads are scheduled
1031 ==============================================
1033 _Description_:
1034      Allows to specify `schedule type' and `chunk size'.  The value of
1035      the variable shall have the form: `type[,chunk]' where `type' is
1036      one of `static', `dynamic', `guided' or `auto' The optional
1037      `chunk' size shall be a positive integer. If undefined, dynamic
1038      scheduling and a chunk size of 1 is used.
1040 _See also_:
1041      *Note omp_set_schedule::
1043 _Reference_:
1044      OpenMP specifications v3.0 (http://www.openmp.org/), sections
1045      2.5.1 and 4.1
1047 \x1f
1048 File: libgomp.info,  Node: OMP_STACKSIZE,  Next: OMP_SCHEDULE,  Prev: OMP_NUM_THREADS,  Up: Environment Variables
1050 3.6 `OMP_STACKSIZE' - Set default thread stack size
1051 ===================================================
1053 _Description_:
1054      Set the default thread stack size in kilobytes, unless the number
1055      is suffixed by `B', `K', `M' or `G', in which case the size is,
1056      respectively, in bytes, kilobytes, megabytes or gigabytes. This is
1057      different from `pthread_attr_setstacksize' which gets the number
1058      of bytes as an argument. If the stacksize can not be set due to
1059      system constraints, an error is reported and the initial stacksize
1060      is left unchanged. If undefined, the stack size is system
1061      dependent.
1063 _Reference_:
1064      OpenMP specifications v3.0 (http://www.openmp.org/), sections 4.5
1066 \x1f
1067 File: libgomp.info,  Node: OMP_THREAD_LIMIT,  Next: OMP_WAIT_POLICY,  Prev: OMP_SCHEDULE,  Up: Environment Variables
1069 3.7 `OMP_THREAD_LIMIT' - Set the maximal number of threads
1070 ==========================================================
1072 _Description_:
1073      Specifies the number of threads to use for the whole program. The
1074      value of this variable shall be positive integer. If undefined,
1075      the number of threads is not limited.
1077 _See also_:
1078      *Note OMP_NUM_THREADS:: *Note omp_get_thread_limit::
1080 _Reference_:
1081      OpenMP specifications v3.0 (http://www.openmp.org/), section 4.8
1083 \x1f
1084 File: libgomp.info,  Node: OMP_WAIT_POLICY,  Next: GOMP_CPU_AFFINITY,  Prev: OMP_THREAD_LIMIT,  Up: Environment Variables
1086 3.8 `OMP_WAIT_POLICY' - How waiting threads are handled
1087 =======================================================
1089 _Description_:
1090      Specifies whether waiting threads should be active or passive. If
1091      the value is `PASSIVE', waiting threads should not consume CPU
1092      power while waiting; while the value is `ACTIVE' specifies that
1093      they should.
1095 _Reference_:
1096      OpenMP specifications v3.0 (http://www.openmp.org/), sections 4.6
1098 \x1f
1099 File: libgomp.info,  Node: GOMP_CPU_AFFINITY,  Next: GOMP_STACKSIZE,  Prev: OMP_WAIT_POLICY,  Up: Environment Variables
1101 3.9 `GOMP_CPU_AFFINITY' - Bind threads to specific CPUs
1102 =======================================================
1104 _Description_:
1105      Binds threads to specific CPUs. The variable should contain a
1106      space- or comma-separated list of CPUs. This list may contain
1107      different kind of entries: either single CPU numbers in any order,
1108      a range of CPUs (M-N) or a range with some stride (M-N:S). CPU
1109      numbers are zero based. For example, `GOMP_CPU_AFFINITY="0 3 1-2
1110      4-15:2"' will bind the initial thread to CPU 0, the second to CPU
1111      3, the third to CPU 1, the fourth to CPU 2, the fifth to CPU 4,
1112      the sixth through tenth to CPUs 6, 8, 10, 12, and 14 respectively
1113      and then start assigning back from the beginning of the list.
1114      `GOMP_CPU_AFFINITY=0' binds all threads to CPU 0.
1116      There is no GNU OpenMP library routine to determine whether a CPU
1117      affinity specification is in effect. As a workaround,
1118      language-specific library functions, e.g., `getenv' in C or
1119      `GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the
1120      setting of the `GOMP_CPU_AFFINITY' environment variable. A defined
1121      CPU affinity on startup cannot be changed or disabled during the
1122      runtime of the application.
1124      If this environment variable is omitted, the host system will
1125      handle the assignment of threads to CPUs.
1127 \x1f
1128 File: libgomp.info,  Node: GOMP_STACKSIZE,  Prev: GOMP_CPU_AFFINITY,  Up: Environment Variables
1130 3.10 `GOMP_STACKSIZE' - Set default thread stack size
1131 =====================================================
1133 _Description_:
1134      Set the default thread stack size in kilobytes. This is different
1135      from `pthread_attr_setstacksize' which gets the number of bytes as
1136      an argument. If the stacksize can not be set due to system
1137      constraints, an error is reported and the initial stacksize is
1138      left unchanged. If undefined, the stack size is system dependent.
1140 _See also_:
1141      *Note GOMP_STACKSIZE::
1143 _Reference_:
1144      GCC Patches Mailinglist
1145      (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC
1146      Patches Mailinglist
1147      (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html)
1149 \x1f
1150 File: libgomp.info,  Node: The libgomp ABI,  Next: Reporting Bugs,  Prev: Environment Variables,  Up: Top
1152 4 The libgomp ABI
1153 *****************
1155 The following sections present notes on the external ABI as presented
1156 by libgomp. Only maintainers should need them.
1158 * Menu:
1160 * Implementing MASTER construct::
1161 * Implementing CRITICAL construct::
1162 * Implementing ATOMIC construct::
1163 * Implementing FLUSH construct::
1164 * Implementing BARRIER construct::
1165 * Implementing THREADPRIVATE construct::
1166 * Implementing PRIVATE clause::
1167 * Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses::
1168 * Implementing REDUCTION clause::
1169 * Implementing PARALLEL construct::
1170 * Implementing FOR construct::
1171 * Implementing ORDERED construct::
1172 * Implementing SECTIONS construct::
1173 * Implementing SINGLE construct::
1175 \x1f
1176 File: libgomp.info,  Node: Implementing MASTER construct,  Next: Implementing CRITICAL construct,  Up: The libgomp ABI
1178 4.1 Implementing MASTER construct
1179 =================================
1181      if (omp_get_thread_num () == 0)
1182        block
1184    Alternately, we generate two copies of the parallel subfunction and
1185 only include this in the version run by the master thread.  Surely
1186 that's not worthwhile though...
1188 \x1f
1189 File: libgomp.info,  Node: Implementing CRITICAL construct,  Next: Implementing ATOMIC construct,  Prev: Implementing MASTER construct,  Up: The libgomp ABI
1191 4.2 Implementing CRITICAL construct
1192 ===================================
1194 Without a specified name,
1196        void GOMP_critical_start (void);
1197        void GOMP_critical_end (void);
1199    so that we don't get COPY relocations from libgomp to the main
1200 application.
1202    With a specified name, use omp_set_lock and omp_unset_lock with name
1203 being transformed into a variable declared like
1205        omp_lock_t gomp_critical_user_<name> __attribute__((common))
1207    Ideally the ABI would specify that all zero is a valid unlocked
1208 state, and so we wouldn't actually need to initialize this at startup.
1210 \x1f
1211 File: libgomp.info,  Node: Implementing ATOMIC construct,  Next: Implementing FLUSH construct,  Prev: Implementing CRITICAL construct,  Up: The libgomp ABI
1213 4.3 Implementing ATOMIC construct
1214 =================================
1216 The target should implement the `__sync' builtins.
1218    Failing that we could add
1220        void GOMP_atomic_enter (void)
1221        void GOMP_atomic_exit (void)
1223    which reuses the regular lock code, but with yet another lock object
1224 private to the library.
1226 \x1f
1227 File: libgomp.info,  Node: Implementing FLUSH construct,  Next: Implementing BARRIER construct,  Prev: Implementing ATOMIC construct,  Up: The libgomp ABI
1229 4.4 Implementing FLUSH construct
1230 ================================
1232 Expands to the `__sync_synchronize' builtin.
1234 \x1f
1235 File: libgomp.info,  Node: Implementing BARRIER construct,  Next: Implementing THREADPRIVATE construct,  Prev: Implementing FLUSH construct,  Up: The libgomp ABI
1237 4.5 Implementing BARRIER construct
1238 ==================================
1240        void GOMP_barrier (void)
1242 \x1f
1243 File: libgomp.info,  Node: Implementing THREADPRIVATE construct,  Next: Implementing PRIVATE clause,  Prev: Implementing BARRIER construct,  Up: The libgomp ABI
1245 4.6 Implementing THREADPRIVATE construct
1246 ========================================
1248 In _most_ cases we can map this directly to `__thread'.  Except that
1249 OMP allows constructors for C++ objects.  We can either refuse to
1250 support this (how often is it used?) or we can implement something akin
1251 to .ctors.
1253    Even more ideally, this ctor feature is handled by extensions to the
1254 main pthreads library.  Failing that, we can have a set of entry points
1255 to register ctor functions to be called.
1257 \x1f
1258 File: libgomp.info,  Node: Implementing PRIVATE clause,  Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Prev: Implementing THREADPRIVATE construct,  Up: The libgomp ABI
1260 4.7 Implementing PRIVATE clause
1261 ===============================
1263 In association with a PARALLEL, or within the lexical extent of a
1264 PARALLEL block, the variable becomes a local variable in the parallel
1265 subfunction.
1267    In association with FOR or SECTIONS blocks, create a new automatic
1268 variable within the current function.  This preserves the semantic of
1269 new variable creation.
1271 \x1f
1272 File: libgomp.info,  Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Next: Implementing REDUCTION clause,  Prev: Implementing PRIVATE clause,  Up: The libgomp ABI
1274 4.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
1275 ========================================================================
1277 Seems simple enough for PARALLEL blocks.  Create a private struct for
1278 communicating between parent and subfunction.  In the parent, copy in
1279 values for scalar and "small" structs; copy in addresses for others
1280 TREE_ADDRESSABLE types.  In the subfunction, copy the value into the
1281 local variable.
1283    Not clear at all what to do with bare FOR or SECTION blocks.  The
1284 only thing I can figure is that we do something like
1286      #pragma omp for firstprivate(x) lastprivate(y)
1287      for (int i = 0; i < n; ++i)
1288        body;
1290    which becomes
1292      {
1293        int x = x, y;
1295        // for stuff
1297        if (i == n)
1298          y = y;
1299      }
1301    where the "x=x" and "y=y" assignments actually have different uids
1302 for the two variables, i.e. not something you could write directly in
1303 C.  Presumably this only makes sense if the "outer" x and y are global
1304 variables.
1306    COPYPRIVATE would work the same way, except the structure broadcast
1307 would have to happen via SINGLE machinery instead.
1309 \x1f
1310 File: libgomp.info,  Node: Implementing REDUCTION clause,  Next: Implementing PARALLEL construct,  Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Up: The libgomp ABI
1312 4.9 Implementing REDUCTION clause
1313 =================================
1315 The private struct mentioned in the previous section should have a
1316 pointer to an array of the type of the variable, indexed by the
1317 thread's TEAM_ID.  The thread stores its final value into the array,
1318 and after the barrier the master thread iterates over the array to
1319 collect the values.
1321 \x1f
1322 File: libgomp.info,  Node: Implementing PARALLEL construct,  Next: Implementing FOR construct,  Prev: Implementing REDUCTION clause,  Up: The libgomp ABI
1324 4.10 Implementing PARALLEL construct
1325 ====================================
1327        #pragma omp parallel
1328        {
1329          body;
1330        }
1332    becomes
1334        void subfunction (void *data)
1335        {
1336          use data;
1337          body;
1338        }
1340        setup data;
1341        GOMP_parallel_start (subfunction, &data, num_threads);
1342        subfunction (&data);
1343        GOMP_parallel_end ();
1345        void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
1347    The FN argument is the subfunction to be run in parallel.
1349    The DATA argument is a pointer to a structure used to communicate
1350 data in and out of the subfunction, as discussed above with respect to
1351 FIRSTPRIVATE et al.
1353    The NUM_THREADS argument is 1 if an IF clause is present and false,
1354 or the value of the NUM_THREADS clause, if present, or 0.
1356    The function needs to create the appropriate number of threads
1357 and/or launch them from the dock.  It needs to create the team
1358 structure and assign team ids.
1360        void GOMP_parallel_end (void)
1362    Tears down the team and returns us to the previous
1363 `omp_in_parallel()' state.
1365 \x1f
1366 File: libgomp.info,  Node: Implementing FOR construct,  Next: Implementing ORDERED construct,  Prev: Implementing PARALLEL construct,  Up: The libgomp ABI
1368 4.11 Implementing FOR construct
1369 ===============================
1371        #pragma omp parallel for
1372        for (i = lb; i <= ub; i++)
1373          body;
1375    becomes
1377        void subfunction (void *data)
1378        {
1379          long _s0, _e0;
1380          while (GOMP_loop_static_next (&_s0, &_e0))
1381          {
1382            long _e1 = _e0, i;
1383            for (i = _s0; i < _e1; i++)
1384              body;
1385          }
1386          GOMP_loop_end_nowait ();
1387        }
1389        GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0);
1390        subfunction (NULL);
1391        GOMP_parallel_end ();
1393        #pragma omp for schedule(runtime)
1394        for (i = 0; i < n; i++)
1395          body;
1397    becomes
1399        {
1400          long i, _s0, _e0;
1401          if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0))
1402            do {
1403              long _e1 = _e0;
1404              for (i = _s0, i < _e0; i++)
1405                body;
1406            } while (GOMP_loop_runtime_next (&_s0, _&e0));
1407          GOMP_loop_end ();
1408        }
1410    Note that while it looks like there is trickyness to propagating a
1411 non-constant STEP, there isn't really.  We're explicitly allowed to
1412 evaluate it as many times as we want, and any variables involved should
1413 automatically be handled as PRIVATE or SHARED like any other variables.
1414 So the expression should remain evaluable in the subfunction.  We can
1415 also pull it into a local variable if we like, but since its supposed
1416 to remain unchanged, we can also not if we like.
1418    If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be
1419 able to get away with no work-sharing context at all, since we can
1420 simply perform the arithmetic directly in each thread to divide up the
1421 iterations.  Which would mean that we wouldn't need to call any of
1422 these routines.
1424    There are separate routines for handling loops with an ORDERED
1425 clause.  Bookkeeping for that is non-trivial...
1427 \x1f
1428 File: libgomp.info,  Node: Implementing ORDERED construct,  Next: Implementing SECTIONS construct,  Prev: Implementing FOR construct,  Up: The libgomp ABI
1430 4.12 Implementing ORDERED construct
1431 ===================================
1433        void GOMP_ordered_start (void)
1434        void GOMP_ordered_end (void)
1436 \x1f
1437 File: libgomp.info,  Node: Implementing SECTIONS construct,  Next: Implementing SINGLE construct,  Prev: Implementing ORDERED construct,  Up: The libgomp ABI
1439 4.13 Implementing SECTIONS construct
1440 ====================================
1442 A block as
1444        #pragma omp sections
1445        {
1446          #pragma omp section
1447          stmt1;
1448          #pragma omp section
1449          stmt2;
1450          #pragma omp section
1451          stmt3;
1452        }
1454    becomes
1456        for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
1457          switch (i)
1458            {
1459            case 1:
1460              stmt1;
1461              break;
1462            case 2:
1463              stmt2;
1464              break;
1465            case 3:
1466              stmt3;
1467              break;
1468            }
1469        GOMP_barrier ();
1471 \x1f
1472 File: libgomp.info,  Node: Implementing SINGLE construct,  Prev: Implementing SECTIONS construct,  Up: The libgomp ABI
1474 4.14 Implementing SINGLE construct
1475 ==================================
1477 A block like
1479        #pragma omp single
1480        {
1481          body;
1482        }
1484    becomes
1486        if (GOMP_single_start ())
1487          body;
1488        GOMP_barrier ();
1490    while
1492        #pragma omp single copyprivate(x)
1493          body;
1495    becomes
1497        datap = GOMP_single_copy_start ();
1498        if (datap == NULL)
1499          {
1500            body;
1501            data.x = x;
1502            GOMP_single_copy_end (&data);
1503          }
1504        else
1505          x = datap->x;
1506        GOMP_barrier ();
1508 \x1f
1509 File: libgomp.info,  Node: Reporting Bugs,  Next: Copying,  Prev: The libgomp ABI,  Up: Top
1511 5 Reporting Bugs
1512 ****************
1514 Bugs in the GNU OpenMP implementation should be reported via bugzilla
1515 (http://gcc.gnu.org/bugzilla/). In all cases, please add "openmp" to
1516 the keywords field in the bug report.
1518 \x1f
1519 File: libgomp.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Reporting Bugs,  Up: Top
1521 GNU GENERAL PUBLIC LICENSE
1522 **************************
1524                          Version 2, June 1991
1526      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
1527      51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
1529      Everyone is permitted to copy and distribute verbatim copies
1530      of this license document, but changing it is not allowed.
1532 Preamble
1533 ========
1535 The licenses for most software are designed to take away your freedom
1536 to share and change it.  By contrast, the GNU General Public License is
1537 intended to guarantee your freedom to share and change free
1538 software--to make sure the software is free for all its users.  This
1539 General Public License applies to most of the Free Software
1540 Foundation's software and to any other program whose authors commit to
1541 using it.  (Some other Free Software Foundation software is covered by
1542 the GNU Library General Public License instead.)  You can apply it to
1543 your programs, too.
1545    When we speak of free software, we are referring to freedom, not
1546 price.  Our General Public Licenses are designed to make sure that you
1547 have the freedom to distribute copies of free software (and charge for
1548 this service if you wish), that you receive source code or can get it
1549 if you want it, that you can change the software or use pieces of it in
1550 new free programs; and that you know you can do these things.
1552    To protect your rights, we need to make restrictions that forbid
1553 anyone to deny you these rights or to ask you to surrender the rights.
1554 These restrictions translate to certain responsibilities for you if you
1555 distribute copies of the software, or if you modify it.
1557    For example, if you distribute copies of such a program, whether
1558 gratis or for a fee, you must give the recipients all the rights that
1559 you have.  You must make sure that they, too, receive or can get the
1560 source code.  And you must show them these terms so they know their
1561 rights.
1563    We protect your rights with two steps: (1) copyright the software,
1564 and (2) offer you this license which gives you legal permission to copy,
1565 distribute and/or modify the software.
1567    Also, for each author's protection and ours, we want to make certain
1568 that everyone understands that there is no warranty for this free
1569 software.  If the software is modified by someone else and passed on, we
1570 want its recipients to know that what they have is not the original, so
1571 that any problems introduced by others will not reflect on the original
1572 authors' reputations.
1574    Finally, any free program is threatened constantly by software
1575 patents.  We wish to avoid the danger that redistributors of a free
1576 program will individually obtain patent licenses, in effect making the
1577 program proprietary.  To prevent this, we have made it clear that any
1578 patent must be licensed for everyone's free use or not licensed at all.
1580    The precise terms and conditions for copying, distribution and
1581 modification follow.
1583     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1584   0. This License applies to any program or other work which contains a
1585      notice placed by the copyright holder saying it may be distributed
1586      under the terms of this General Public License.  The "Program",
1587      below, refers to any such program or work, and a "work based on
1588      the Program" means either the Program or any derivative work under
1589      copyright law: that is to say, a work containing the Program or a
1590      portion of it, either verbatim or with modifications and/or
1591      translated into another language.  (Hereinafter, translation is
1592      included without limitation in the term "modification".)  Each
1593      licensee is addressed as "you".
1595      Activities other than copying, distribution and modification are
1596      not covered by this License; they are outside its scope.  The act
1597      of running the Program is not restricted, and the output from the
1598      Program is covered only if its contents constitute a work based on
1599      the Program (independent of having been made by running the
1600      Program).  Whether that is true depends on what the Program does.
1602   1. You may copy and distribute verbatim copies of the Program's
1603      source code as you receive it, in any medium, provided that you
1604      conspicuously and appropriately publish on each copy an appropriate
1605      copyright notice and disclaimer of warranty; keep intact all the
1606      notices that refer to this License and to the absence of any
1607      warranty; and give any other recipients of the Program a copy of
1608      this License along with the Program.
1610      You may charge a fee for the physical act of transferring a copy,
1611      and you may at your option offer warranty protection in exchange
1612      for a fee.
1614   2. You may modify your copy or copies of the Program or any portion
1615      of it, thus forming a work based on the Program, and copy and
1616      distribute such modifications or work under the terms of Section 1
1617      above, provided that you also meet all of these conditions:
1619        a. You must cause the modified files to carry prominent notices
1620           stating that you changed the files and the date of any change.
1622        b. You must cause any work that you distribute or publish, that
1623           in whole or in part contains or is derived from the Program
1624           or any part thereof, to be licensed as a whole at no charge
1625           to all third parties under the terms of this License.
1627        c. If the modified program normally reads commands interactively
1628           when run, you must cause it, when started running for such
1629           interactive use in the most ordinary way, to print or display
1630           an announcement including an appropriate copyright notice and
1631           a notice that there is no warranty (or else, saying that you
1632           provide a warranty) and that users may redistribute the
1633           program under these conditions, and telling the user how to
1634           view a copy of this License.  (Exception: if the Program
1635           itself is interactive but does not normally print such an
1636           announcement, your work based on the Program is not required
1637           to print an announcement.)
1639      These requirements apply to the modified work as a whole.  If
1640      identifiable sections of that work are not derived from the
1641      Program, and can be reasonably considered independent and separate
1642      works in themselves, then this License, and its terms, do not
1643      apply to those sections when you distribute them as separate
1644      works.  But when you distribute the same sections as part of a
1645      whole which is a work based on the Program, the distribution of
1646      the whole must be on the terms of this License, whose permissions
1647      for other licensees extend to the entire whole, and thus to each
1648      and every part regardless of who wrote it.
1650      Thus, it is not the intent of this section to claim rights or
1651      contest your rights to work written entirely by you; rather, the
1652      intent is to exercise the right to control the distribution of
1653      derivative or collective works based on the Program.
1655      In addition, mere aggregation of another work not based on the
1656      Program with the Program (or with a work based on the Program) on
1657      a volume of a storage or distribution medium does not bring the
1658      other work under the scope of this License.
1660   3. You may copy and distribute the Program (or a work based on it,
1661      under Section 2) in object code or executable form under the terms
1662      of Sections 1 and 2 above provided that you also do one of the
1663      following:
1665        a. Accompany it with the complete corresponding machine-readable
1666           source code, which must be distributed under the terms of
1667           Sections 1 and 2 above on a medium customarily used for
1668           software interchange; or,
1670        b. Accompany it with a written offer, valid for at least three
1671           years, to give any third party, for a charge no more than your
1672           cost of physically performing source distribution, a complete
1673           machine-readable copy of the corresponding source code, to be
1674           distributed under the terms of Sections 1 and 2 above on a
1675           medium customarily used for software interchange; or,
1677        c. Accompany it with the information you received as to the offer
1678           to distribute corresponding source code.  (This alternative is
1679           allowed only for noncommercial distribution and only if you
1680           received the program in object code or executable form with
1681           such an offer, in accord with Subsection b above.)
1683      The source code for a work means the preferred form of the work for
1684      making modifications to it.  For an executable work, complete
1685      source code means all the source code for all modules it contains,
1686      plus any associated interface definition files, plus the scripts
1687      used to control compilation and installation of the executable.
1688      However, as a special exception, the source code distributed need
1689      not include anything that is normally distributed (in either
1690      source or binary form) with the major components (compiler,
1691      kernel, and so on) of the operating system on which the executable
1692      runs, unless that component itself accompanies the executable.
1694      If distribution of executable or object code is made by offering
1695      access to copy from a designated place, then offering equivalent
1696      access to copy the source code from the same place counts as
1697      distribution of the source code, even though third parties are not
1698      compelled to copy the source along with the object code.
1700   4. You may not copy, modify, sublicense, or distribute the Program
1701      except as expressly provided under this License.  Any attempt
1702      otherwise to copy, modify, sublicense or distribute the Program is
1703      void, and will automatically terminate your rights under this
1704      License.  However, parties who have received copies, or rights,
1705      from you under this License will not have their licenses
1706      terminated so long as such parties remain in full compliance.
1708   5. You are not required to accept this License, since you have not
1709      signed it.  However, nothing else grants you permission to modify
1710      or distribute the Program or its derivative works.  These actions
1711      are prohibited by law if you do not accept this License.
1712      Therefore, by modifying or distributing the Program (or any work
1713      based on the Program), you indicate your acceptance of this
1714      License to do so, and all its terms and conditions for copying,
1715      distributing or modifying the Program or works based on it.
1717   6. Each time you redistribute the Program (or any work based on the
1718      Program), the recipient automatically receives a license from the
1719      original licensor to copy, distribute or modify the Program
1720      subject to these terms and conditions.  You may not impose any
1721      further restrictions on the recipients' exercise of the rights
1722      granted herein.  You are not responsible for enforcing compliance
1723      by third parties to this License.
1725   7. If, as a consequence of a court judgment or allegation of patent
1726      infringement or for any other reason (not limited to patent
1727      issues), conditions are imposed on you (whether by court order,
1728      agreement or otherwise) that contradict the conditions of this
1729      License, they do not excuse you from the conditions of this
1730      License.  If you cannot distribute so as to satisfy simultaneously
1731      your obligations under this License and any other pertinent
1732      obligations, then as a consequence you may not distribute the
1733      Program at all.  For example, if a patent license would not permit
1734      royalty-free redistribution of the Program by all those who
1735      receive copies directly or indirectly through you, then the only
1736      way you could satisfy both it and this License would be to refrain
1737      entirely from distribution of the Program.
1739      If any portion of this section is held invalid or unenforceable
1740      under any particular circumstance, the balance of the section is
1741      intended to apply and the section as a whole is intended to apply
1742      in other circumstances.
1744      It is not the purpose of this section to induce you to infringe any
1745      patents or other property right claims or to contest validity of
1746      any such claims; this section has the sole purpose of protecting
1747      the integrity of the free software distribution system, which is
1748      implemented by public license practices.  Many people have made
1749      generous contributions to the wide range of software distributed
1750      through that system in reliance on consistent application of that
1751      system; it is up to the author/donor to decide if he or she is
1752      willing to distribute software through any other system and a
1753      licensee cannot impose that choice.
1755      This section is intended to make thoroughly clear what is believed
1756      to be a consequence of the rest of this License.
1758   8. If the distribution and/or use of the Program is restricted in
1759      certain countries either by patents or by copyrighted interfaces,
1760      the original copyright holder who places the Program under this
1761      License may add an explicit geographical distribution limitation
1762      excluding those countries, so that distribution is permitted only
1763      in or among countries not thus excluded.  In such case, this
1764      License incorporates the limitation as if written in the body of
1765      this License.
1767   9. The Free Software Foundation may publish revised and/or new
1768      versions of the General Public License from time to time.  Such
1769      new versions will be similar in spirit to the present version, but
1770      may differ in detail to address new problems or concerns.
1772      Each version is given a distinguishing version number.  If the
1773      Program specifies a version number of this License which applies
1774      to it and "any later version", you have the option of following
1775      the terms and conditions either of that version or of any later
1776      version published by the Free Software Foundation.  If the Program
1777      does not specify a version number of this License, you may choose
1778      any version ever published by the Free Software Foundation.
1780  10. If you wish to incorporate parts of the Program into other free
1781      programs whose distribution conditions are different, write to the
1782      author to ask for permission.  For software which is copyrighted
1783      by the Free Software Foundation, write to the Free Software
1784      Foundation; we sometimes make exceptions for this.  Our decision
1785      will be guided by the two goals of preserving the free status of
1786      all derivatives of our free software and of promoting the sharing
1787      and reuse of software generally.
1789                                 NO WARRANTY
1790  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
1791      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
1792      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
1793      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
1794      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
1795      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
1796      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
1797      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
1798      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
1799      SERVICING, REPAIR OR CORRECTION.
1801  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
1802      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
1803      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
1804      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
1805      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
1806      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
1807      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
1808      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
1809      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
1810      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
1812                       END OF TERMS AND CONDITIONS
1813 Appendix: How to Apply These Terms to Your New Programs
1814 =======================================================
1816 If you develop a new program, and you want it to be of the greatest
1817 possible use to the public, the best way to achieve this is to make it
1818 free software which everyone can redistribute and change under these
1819 terms.
1821    To do so, attach the following notices to the program.  It is safest
1822 to attach them to the start of each source file to most effectively
1823 convey the exclusion of warranty; and each file should have at least
1824 the "copyright" line and a pointer to where the full notice is found.
1826      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
1827      Copyright (C) YEAR  NAME OF AUTHOR
1829      This program is free software; you can redistribute it and/or modify
1830      it under the terms of the GNU General Public License as published by
1831      the Free Software Foundation; either version 2 of the License, or
1832      (at your option) any later version.
1834      This program is distributed in the hope that it will be useful,
1835      but WITHOUT ANY WARRANTY; without even the implied warranty of
1836      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1837      GNU General Public License for more details.
1839      You should have received a copy of the GNU General Public License
1840      along with this program; if not, write to the Free Software
1841      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
1843    Also add information on how to contact you by electronic and paper
1844 mail.
1846    If the program is interactive, make it output a short notice like
1847 this when it starts in an interactive mode:
1849      Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR
1850      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
1851      type `show w'.
1852      This is free software, and you are welcome to redistribute it
1853      under certain conditions; type `show c' for details.
1855    The hypothetical commands `show w' and `show c' should show the
1856 appropriate parts of the General Public License.  Of course, the
1857 commands you use may be called something other than `show w' and `show
1858 c'; they could even be mouse-clicks or menu items--whatever suits your
1859 program.
1861    You should also get your employer (if you work as a programmer) or
1862 your school, if any, to sign a "copyright disclaimer" for the program,
1863 if necessary.  Here is a sample; alter the names:
1865      Yoyodyne, Inc., hereby disclaims all copyright interest in the program
1866      `Gnomovision' (which makes passes at compilers) written by James Hacker.
1868      SIGNATURE OF TY COON, 1 April 1989
1869      Ty Coon, President of Vice
1871    This General Public License does not permit incorporating your
1872 program into proprietary programs.  If your program is a subroutine
1873 library, you may consider it more useful to permit linking proprietary
1874 applications with the library.  If this is what you want to do, use the
1875 GNU Library General Public License instead of this License.
1877 \x1f
1878 File: libgomp.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
1880 GNU Free Documentation License
1881 ******************************
1883                       Version 1.2, November 2002
1885      Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
1886      51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
1888      Everyone is permitted to copy and distribute verbatim copies
1889      of this license document, but changing it is not allowed.
1891   0. PREAMBLE
1893      The purpose of this License is to make a manual, textbook, or other
1894      functional and useful document "free" in the sense of freedom: to
1895      assure everyone the effective freedom to copy and redistribute it,
1896      with or without modifying it, either commercially or
1897      noncommercially.  Secondarily, this License preserves for the
1898      author and publisher a way to get credit for their work, while not
1899      being considered responsible for modifications made by others.
1901      This License is a kind of "copyleft", which means that derivative
1902      works of the document must themselves be free in the same sense.
1903      It complements the GNU General Public License, which is a copyleft
1904      license designed for free software.
1906      We have designed this License in order to use it for manuals for
1907      free software, because free software needs free documentation: a
1908      free program should come with manuals providing the same freedoms
1909      that the software does.  But this License is not limited to
1910      software manuals; it can be used for any textual work, regardless
1911      of subject matter or whether it is published as a printed book.
1912      We recommend this License principally for works whose purpose is
1913      instruction or reference.
1915   1. APPLICABILITY AND DEFINITIONS
1917      This License applies to any manual or other work, in any medium,
1918      that contains a notice placed by the copyright holder saying it
1919      can be distributed under the terms of this License.  Such a notice
1920      grants a world-wide, royalty-free license, unlimited in duration,
1921      to use that work under the conditions stated herein.  The
1922      "Document", below, refers to any such manual or work.  Any member
1923      of the public is a licensee, and is addressed as "you".  You
1924      accept the license if you copy, modify or distribute the work in a
1925      way requiring permission under copyright law.
1927      A "Modified Version" of the Document means any work containing the
1928      Document or a portion of it, either copied verbatim, or with
1929      modifications and/or translated into another language.
1931      A "Secondary Section" is a named appendix or a front-matter section
1932      of the Document that deals exclusively with the relationship of the
1933      publishers or authors of the Document to the Document's overall
1934      subject (or to related matters) and contains nothing that could
1935      fall directly within that overall subject.  (Thus, if the Document
1936      is in part a textbook of mathematics, a Secondary Section may not
1937      explain any mathematics.)  The relationship could be a matter of
1938      historical connection with the subject or with related matters, or
1939      of legal, commercial, philosophical, ethical or political position
1940      regarding them.
1942      The "Invariant Sections" are certain Secondary Sections whose
1943      titles are designated, as being those of Invariant Sections, in
1944      the notice that says that the Document is released under this
1945      License.  If a section does not fit the above definition of
1946      Secondary then it is not allowed to be designated as Invariant.
1947      The Document may contain zero Invariant Sections.  If the Document
1948      does not identify any Invariant Sections then there are none.
1950      The "Cover Texts" are certain short passages of text that are
1951      listed, as Front-Cover Texts or Back-Cover Texts, in the notice
1952      that says that the Document is released under this License.  A
1953      Front-Cover Text may be at most 5 words, and a Back-Cover Text may
1954      be at most 25 words.
1956      A "Transparent" copy of the Document means a machine-readable copy,
1957      represented in a format whose specification is available to the
1958      general public, that is suitable for revising the document
1959      straightforwardly with generic text editors or (for images
1960      composed of pixels) generic paint programs or (for drawings) some
1961      widely available drawing editor, and that is suitable for input to
1962      text formatters or for automatic translation to a variety of
1963      formats suitable for input to text formatters.  A copy made in an
1964      otherwise Transparent file format whose markup, or absence of
1965      markup, has been arranged to thwart or discourage subsequent
1966      modification by readers is not Transparent.  An image format is
1967      not Transparent if used for any substantial amount of text.  A
1968      copy that is not "Transparent" is called "Opaque".
1970      Examples of suitable formats for Transparent copies include plain
1971      ASCII without markup, Texinfo input format, LaTeX input format,
1972      SGML or XML using a publicly available DTD, and
1973      standard-conforming simple HTML, PostScript or PDF designed for
1974      human modification.  Examples of transparent image formats include
1975      PNG, XCF and JPG.  Opaque formats include proprietary formats that
1976      can be read and edited only by proprietary word processors, SGML or
1977      XML for which the DTD and/or processing tools are not generally
1978      available, and the machine-generated HTML, PostScript or PDF
1979      produced by some word processors for output purposes only.
1981      The "Title Page" means, for a printed book, the title page itself,
1982      plus such following pages as are needed to hold, legibly, the
1983      material this License requires to appear in the title page.  For
1984      works in formats which do not have any title page as such, "Title
1985      Page" means the text near the most prominent appearance of the
1986      work's title, preceding the beginning of the body of the text.
1988      A section "Entitled XYZ" means a named subunit of the Document
1989      whose title either is precisely XYZ or contains XYZ in parentheses
1990      following text that translates XYZ in another language.  (Here XYZ
1991      stands for a specific section name mentioned below, such as
1992      "Acknowledgements", "Dedications", "Endorsements", or "History".)
1993      To "Preserve the Title" of such a section when you modify the
1994      Document means that it remains a section "Entitled XYZ" according
1995      to this definition.
1997      The Document may include Warranty Disclaimers next to the notice
1998      which states that this License applies to the Document.  These
1999      Warranty Disclaimers are considered to be included by reference in
2000      this License, but only as regards disclaiming warranties: any other
2001      implication that these Warranty Disclaimers may have is void and
2002      has no effect on the meaning of this License.
2004   2. VERBATIM COPYING
2006      You may copy and distribute the Document in any medium, either
2007      commercially or noncommercially, provided that this License, the
2008      copyright notices, and the license notice saying this License
2009      applies to the Document are reproduced in all copies, and that you
2010      add no other conditions whatsoever to those of this License.  You
2011      may not use technical measures to obstruct or control the reading
2012      or further copying of the copies you make or distribute.  However,
2013      you may accept compensation in exchange for copies.  If you
2014      distribute a large enough number of copies you must also follow
2015      the conditions in section 3.
2017      You may also lend copies, under the same conditions stated above,
2018      and you may publicly display copies.
2020   3. COPYING IN QUANTITY
2022      If you publish printed copies (or copies in media that commonly
2023      have printed covers) of the Document, numbering more than 100, and
2024      the Document's license notice requires Cover Texts, you must
2025      enclose the copies in covers that carry, clearly and legibly, all
2026      these Cover Texts: Front-Cover Texts on the front cover, and
2027      Back-Cover Texts on the back cover.  Both covers must also clearly
2028      and legibly identify you as the publisher of these copies.  The
2029      front cover must present the full title with all words of the
2030      title equally prominent and visible.  You may add other material
2031      on the covers in addition.  Copying with changes limited to the
2032      covers, as long as they preserve the title of the Document and
2033      satisfy these conditions, can be treated as verbatim copying in
2034      other respects.
2036      If the required texts for either cover are too voluminous to fit
2037      legibly, you should put the first ones listed (as many as fit
2038      reasonably) on the actual cover, and continue the rest onto
2039      adjacent pages.
2041      If you publish or distribute Opaque copies of the Document
2042      numbering more than 100, you must either include a
2043      machine-readable Transparent copy along with each Opaque copy, or
2044      state in or with each Opaque copy a computer-network location from
2045      which the general network-using public has access to download
2046      using public-standard network protocols a complete Transparent
2047      copy of the Document, free of added material.  If you use the
2048      latter option, you must take reasonably prudent steps, when you
2049      begin distribution of Opaque copies in quantity, to ensure that
2050      this Transparent copy will remain thus accessible at the stated
2051      location until at least one year after the last time you
2052      distribute an Opaque copy (directly or through your agents or
2053      retailers) of that edition to the public.
2055      It is requested, but not required, that you contact the authors of
2056      the Document well before redistributing any large number of
2057      copies, to give them a chance to provide you with an updated
2058      version of the Document.
2060   4. MODIFICATIONS
2062      You may copy and distribute a Modified Version of the Document
2063      under the conditions of sections 2 and 3 above, provided that you
2064      release the Modified Version under precisely this License, with
2065      the Modified Version filling the role of the Document, thus
2066      licensing distribution and modification of the Modified Version to
2067      whoever possesses a copy of it.  In addition, you must do these
2068      things in the Modified Version:
2070        A. Use in the Title Page (and on the covers, if any) a title
2071           distinct from that of the Document, and from those of
2072           previous versions (which should, if there were any, be listed
2073           in the History section of the Document).  You may use the
2074           same title as a previous version if the original publisher of
2075           that version gives permission.
2077        B. List on the Title Page, as authors, one or more persons or
2078           entities responsible for authorship of the modifications in
2079           the Modified Version, together with at least five of the
2080           principal authors of the Document (all of its principal
2081           authors, if it has fewer than five), unless they release you
2082           from this requirement.
2084        C. State on the Title page the name of the publisher of the
2085           Modified Version, as the publisher.
2087        D. Preserve all the copyright notices of the Document.
2089        E. Add an appropriate copyright notice for your modifications
2090           adjacent to the other copyright notices.
2092        F. Include, immediately after the copyright notices, a license
2093           notice giving the public permission to use the Modified
2094           Version under the terms of this License, in the form shown in
2095           the Addendum below.
2097        G. Preserve in that license notice the full lists of Invariant
2098           Sections and required Cover Texts given in the Document's
2099           license notice.
2101        H. Include an unaltered copy of this License.
2103        I. Preserve the section Entitled "History", Preserve its Title,
2104           and add to it an item stating at least the title, year, new
2105           authors, and publisher of the Modified Version as given on
2106           the Title Page.  If there is no section Entitled "History" in
2107           the Document, create one stating the title, year, authors,
2108           and publisher of the Document as given on its Title Page,
2109           then add an item describing the Modified Version as stated in
2110           the previous sentence.
2112        J. Preserve the network location, if any, given in the Document
2113           for public access to a Transparent copy of the Document, and
2114           likewise the network locations given in the Document for
2115           previous versions it was based on.  These may be placed in
2116           the "History" section.  You may omit a network location for a
2117           work that was published at least four years before the
2118           Document itself, or if the original publisher of the version
2119           it refers to gives permission.
2121        K. For any section Entitled "Acknowledgements" or "Dedications",
2122           Preserve the Title of the section, and preserve in the
2123           section all the substance and tone of each of the contributor
2124           acknowledgements and/or dedications given therein.
2126        L. Preserve all the Invariant Sections of the Document,
2127           unaltered in their text and in their titles.  Section numbers
2128           or the equivalent are not considered part of the section
2129           titles.
2131        M. Delete any section Entitled "Endorsements".  Such a section
2132           may not be included in the Modified Version.
2134        N. Do not retitle any existing section to be Entitled
2135           "Endorsements" or to conflict in title with any Invariant
2136           Section.
2138        O. Preserve any Warranty Disclaimers.
2140      If the Modified Version includes new front-matter sections or
2141      appendices that qualify as Secondary Sections and contain no
2142      material copied from the Document, you may at your option
2143      designate some or all of these sections as invariant.  To do this,
2144      add their titles to the list of Invariant Sections in the Modified
2145      Version's license notice.  These titles must be distinct from any
2146      other section titles.
2148      You may add a section Entitled "Endorsements", provided it contains
2149      nothing but endorsements of your Modified Version by various
2150      parties--for example, statements of peer review or that the text
2151      has been approved by an organization as the authoritative
2152      definition of a standard.
2154      You may add a passage of up to five words as a Front-Cover Text,
2155      and a passage of up to 25 words as a Back-Cover Text, to the end
2156      of the list of Cover Texts in the Modified Version.  Only one
2157      passage of Front-Cover Text and one of Back-Cover Text may be
2158      added by (or through arrangements made by) any one entity.  If the
2159      Document already includes a cover text for the same cover,
2160      previously added by you or by arrangement made by the same entity
2161      you are acting on behalf of, you may not add another; but you may
2162      replace the old one, on explicit permission from the previous
2163      publisher that added the old one.
2165      The author(s) and publisher(s) of the Document do not by this
2166      License give permission to use their names for publicity for or to
2167      assert or imply endorsement of any Modified Version.
2169   5. COMBINING DOCUMENTS
2171      You may combine the Document with other documents released under
2172      this License, under the terms defined in section 4 above for
2173      modified versions, provided that you include in the combination
2174      all of the Invariant Sections of all of the original documents,
2175      unmodified, and list them all as Invariant Sections of your
2176      combined work in its license notice, and that you preserve all
2177      their Warranty Disclaimers.
2179      The combined work need only contain one copy of this License, and
2180      multiple identical Invariant Sections may be replaced with a single
2181      copy.  If there are multiple Invariant Sections with the same name
2182      but different contents, make the title of each such section unique
2183      by adding at the end of it, in parentheses, the name of the
2184      original author or publisher of that section if known, or else a
2185      unique number.  Make the same adjustment to the section titles in
2186      the list of Invariant Sections in the license notice of the
2187      combined work.
2189      In the combination, you must combine any sections Entitled
2190      "History" in the various original documents, forming one section
2191      Entitled "History"; likewise combine any sections Entitled
2192      "Acknowledgements", and any sections Entitled "Dedications".  You
2193      must delete all sections Entitled "Endorsements."
2195   6. COLLECTIONS OF DOCUMENTS
2197      You may make a collection consisting of the Document and other
2198      documents released under this License, and replace the individual
2199      copies of this License in the various documents with a single copy
2200      that is included in the collection, provided that you follow the
2201      rules of this License for verbatim copying of each of the
2202      documents in all other respects.
2204      You may extract a single document from such a collection, and
2205      distribute it individually under this License, provided you insert
2206      a copy of this License into the extracted document, and follow
2207      this License in all other respects regarding verbatim copying of
2208      that document.
2210   7. AGGREGATION WITH INDEPENDENT WORKS
2212      A compilation of the Document or its derivatives with other
2213      separate and independent documents or works, in or on a volume of
2214      a storage or distribution medium, is called an "aggregate" if the
2215      copyright resulting from the compilation is not used to limit the
2216      legal rights of the compilation's users beyond what the individual
2217      works permit.  When the Document is included in an aggregate, this
2218      License does not apply to the other works in the aggregate which
2219      are not themselves derivative works of the Document.
2221      If the Cover Text requirement of section 3 is applicable to these
2222      copies of the Document, then if the Document is less than one half
2223      of the entire aggregate, the Document's Cover Texts may be placed
2224      on covers that bracket the Document within the aggregate, or the
2225      electronic equivalent of covers if the Document is in electronic
2226      form.  Otherwise they must appear on printed covers that bracket
2227      the whole aggregate.
2229   8. TRANSLATION
2231      Translation is considered a kind of modification, so you may
2232      distribute translations of the Document under the terms of section
2233      4.  Replacing Invariant Sections with translations requires special
2234      permission from their copyright holders, but you may include
2235      translations of some or all Invariant Sections in addition to the
2236      original versions of these Invariant Sections.  You may include a
2237      translation of this License, and all the license notices in the
2238      Document, and any Warranty Disclaimers, provided that you also
2239      include the original English version of this License and the
2240      original versions of those notices and disclaimers.  In case of a
2241      disagreement between the translation and the original version of
2242      this License or a notice or disclaimer, the original version will
2243      prevail.
2245      If a section in the Document is Entitled "Acknowledgements",
2246      "Dedications", or "History", the requirement (section 4) to
2247      Preserve its Title (section 1) will typically require changing the
2248      actual title.
2250   9. TERMINATION
2252      You may not copy, modify, sublicense, or distribute the Document
2253      except as expressly provided for under this License.  Any other
2254      attempt to copy, modify, sublicense or distribute the Document is
2255      void, and will automatically terminate your rights under this
2256      License.  However, parties who have received copies, or rights,
2257      from you under this License will not have their licenses
2258      terminated so long as such parties remain in full compliance.
2260  10. FUTURE REVISIONS OF THIS LICENSE
2262      The Free Software Foundation may publish new, revised versions of
2263      the GNU Free Documentation License from time to time.  Such new
2264      versions will be similar in spirit to the present version, but may
2265      differ in detail to address new problems or concerns.  See
2266      `http://www.gnu.org/copyleft/'.
2268      Each version of the License is given a distinguishing version
2269      number.  If the Document specifies that a particular numbered
2270      version of this License "or any later version" applies to it, you
2271      have the option of following the terms and conditions either of
2272      that specified version or of any later version that has been
2273      published (not as a draft) by the Free Software Foundation.  If
2274      the Document does not specify a version number of this License,
2275      you may choose any version ever published (not as a draft) by the
2276      Free Software Foundation.
2278 ADDENDUM: How to use this License for your documents
2279 ====================================================
2281 To use this License in a document you have written, include a copy of
2282 the License in the document and put the following copyright and license
2283 notices just after the title page:
2285        Copyright (C)  YEAR  YOUR NAME.
2286        Permission is granted to copy, distribute and/or modify this document
2287        under the terms of the GNU Free Documentation License, Version 1.2
2288        or any later version published by the Free Software Foundation;
2289        with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
2290        Texts.  A copy of the license is included in the section entitled ``GNU
2291        Free Documentation License''.
2293    If you have Invariant Sections, Front-Cover Texts and Back-Cover
2294 Texts, replace the "with...Texts." line with this:
2296          with the Invariant Sections being LIST THEIR TITLES, with
2297          the Front-Cover Texts being LIST, and with the Back-Cover Texts
2298          being LIST.
2300    If you have Invariant Sections without Cover Texts, or some other
2301 combination of the three, merge those two alternatives to suit the
2302 situation.
2304    If your document contains nontrivial examples of program code, we
2305 recommend releasing these examples in parallel under your choice of
2306 free software license, such as the GNU General Public License, to
2307 permit their use in free software.
2309 \x1f
2310 File: libgomp.info,  Node: Funding,  Next: Index,  Prev: GNU Free Documentation License,  Up: Top
2312 Funding Free Software
2313 *********************
2315 If you want to have more free software a few years from now, it makes
2316 sense for you to help encourage people to contribute funds for its
2317 development.  The most effective approach known is to encourage
2318 commercial redistributors to donate.
2320    Users of free software systems can boost the pace of development by
2321 encouraging for-a-fee distributors to donate part of their selling price
2322 to free software developers--the Free Software Foundation, and others.
2324    The way to convince distributors to do this is to demand it and
2325 expect it from them.  So when you compare distributors, judge them
2326 partly by how much they give to free software development.  Show
2327 distributors they must compete to be the one who gives the most.
2329    To make this approach work, you must insist on numbers that you can
2330 compare, such as, "We will donate ten dollars to the Frobnitz project
2331 for each disk sold."  Don't be satisfied with a vague promise, such as
2332 "A portion of the profits are donated," since it doesn't give a basis
2333 for comparison.
2335    Even a precise fraction "of the profits from this disk" is not very
2336 meaningful, since creative accounting and unrelated business decisions
2337 can greatly alter what fraction of the sales price counts as profit.
2338 If the price you pay is $50, ten percent of the profit is probably less
2339 than a dollar; it might be a few cents, or nothing at all.
2341    Some redistributors do development work themselves.  This is useful
2342 too; but to keep everyone honest, you need to inquire how much they do,
2343 and what kind.  Some kinds of development make much more long-term
2344 difference than others.  For example, maintaining a separate version of
2345 a program contributes very little; maintaining the standard version of a
2346 program for the whole community contributes much.  Easy new ports
2347 contribute little, since someone else would surely do them; difficult
2348 ports such as adding a new CPU to the GNU Compiler Collection
2349 contribute more; major new features or packages contribute the most.
2351    By establishing the idea that supporting further development is "the
2352 proper thing to do" when distributing free software for a fee, we can
2353 assure a steady flow of resources into making more free software.
2355      Copyright (C) 1994 Free Software Foundation, Inc.
2356      Verbatim copying and redistribution of this section is permitted
2357      without royalty; alteration is not permitted.
2359 \x1f
2360 File: libgomp.info,  Node: Index,  Prev: Funding,  Up: Top
2362 Index
2363 *****
2365 \0\b[index\0\b]
2366 * Menu:
2368 * Environment Variable <1>:              OMP_NESTED.            (line 6)
2369 * Environment Variable <2>:              OMP_DYNAMIC.           (line 6)
2370 * Environment Variable <3>:              GOMP_STACKSIZE.        (line 6)
2371 * Environment Variable <4>:              GOMP_CPU_AFFINITY.     (line 6)
2372 * Environment Variable <5>:              OMP_WAIT_POLICY.       (line 6)
2373 * Environment Variable <6>:              OMP_THREAD_LIMIT.      (line 6)
2374 * Environment Variable <7>:              OMP_STACKSIZE.         (line 6)
2375 * Environment Variable <8>:              OMP_MAX_ACTIVE_LEVELS. (line 6)
2376 * Environment Variable <9>:              OMP_SCHEDULE.          (line 6)
2377 * Environment Variable:                  OMP_NUM_THREADS.       (line 6)
2378 * FDL, GNU Free Documentation License:   GNU Free Documentation License.
2379                                                                 (line 6)
2380 * Implementation specific setting <1>:   OMP_NESTED.            (line 6)
2381 * Implementation specific setting <2>:   OMP_NUM_THREADS.       (line 6)
2382 * Implementation specific setting <3>:   OMP_SCHEDULE.          (line 6)
2383 * Implementation specific setting:       GOMP_STACKSIZE.        (line 6)
2384 * Introduction:                          Top.                   (line 6)
2387 \x1f
2388 Tag Table:
2389 Node: Top\x7f2037
2390 Node: Enabling OpenMP\x7f3231
2391 Node: Runtime Library Routines\x7f4016
2392 Node: omp_get_active_level\x7f6391
2393 Node: omp_get_ancestor_thread_num\x7f7082
2394 Node: omp_get_dynamic\x7f7996
2395 Node: omp_get_level\x7f8870
2396 Node: omp_get_max_active_levels\x7f9481
2397 Node: omp_get_max_threads\x7f10169
2398 Node: omp_get_nested\x7f10921
2399 Node: omp_get_num_procs\x7f11829
2400 Node: omp_get_num_threads\x7f12343
2401 Node: omp_get_schedule\x7f13413
2402 Node: omp_get_team_size\x7f14320
2403 Node: omp_get_thread_limit\x7f15278
2404 Node: omp_get_thread_num\x7f15897
2405 Node: omp_in_parallel\x7f16751
2406 Node: omp_set_dynamic\x7f17397
2407 Node: omp_set_max_active_levels\x7f18233
2408 Node: omp_set_nested\x7f18995
2409 Node: omp_set_num_threads\x7f19872
2410 Node: omp_set_schedule\x7f20710
2411 Node: omp_init_lock\x7f21754
2412 Node: omp_set_lock\x7f22404
2413 Node: omp_test_lock\x7f23253
2414 Node: omp_unset_lock\x7f24280
2415 Node: omp_destroy_lock\x7f25206
2416 Node: omp_init_nest_lock\x7f25876
2417 Node: omp_set_nest_lock\x7f26608
2418 Node: omp_test_nest_lock\x7f27517
2419 Node: omp_unset_nest_lock\x7f28615
2420 Node: omp_destroy_nest_lock\x7f29624
2421 Node: omp_get_wtick\x7f30372
2422 Node: omp_get_wtime\x7f30959
2423 Node: Environment Variables\x7f31742
2424 Node: OMP_DYNAMIC\x7f32803
2425 Node: OMP_MAX_ACTIVE_LEVELS\x7f33371
2426 Node: OMP_NESTED\x7f34008
2427 Node: OMP_NUM_THREADS\x7f34612
2428 Node: OMP_SCHEDULE\x7f35185
2429 Node: OMP_STACKSIZE\x7f35879
2430 Node: OMP_THREAD_LIMIT\x7f36704
2431 Node: OMP_WAIT_POLICY\x7f37297
2432 Node: GOMP_CPU_AFFINITY\x7f37862
2433 Node: GOMP_STACKSIZE\x7f39346
2434 Node: The libgomp ABI\x7f40156
2435 Node: Implementing MASTER construct\x7f40954
2436 Node: Implementing CRITICAL construct\x7f41367
2437 Node: Implementing ATOMIC construct\x7f42115
2438 Node: Implementing FLUSH construct\x7f42596
2439 Node: Implementing BARRIER construct\x7f42867
2440 Node: Implementing THREADPRIVATE construct\x7f43136
2441 Node: Implementing PRIVATE clause\x7f43788
2442 Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses\x7f44369
2443 Node: Implementing REDUCTION clause\x7f45684
2444 Node: Implementing PARALLEL construct\x7f46240
2445 Node: Implementing FOR construct\x7f47497
2446 Node: Implementing ORDERED construct\x7f49495
2447 Node: Implementing SECTIONS construct\x7f49801
2448 Node: Implementing SINGLE construct\x7f50567
2449 Node: Reporting Bugs\x7f51229
2450 Node: Copying\x7f51537
2451 Node: GNU Free Documentation License\x7f70747
2452 Node: Funding\x7f93158
2453 Node: Index\x7f95675
2454 \x1f
2455 End Tag Table