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