This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp] GOMP_CPU_AFFINITY support
Jakub,
thanks for answering my questions. Please find attached the updated
documentation for libgomp. Tested info and dvi targets on i686-pc-linux-gnu.
2007-04-11 Daniel Franke <franke.daniel@gmail.com>
* libgomp.texi (GOMP_CPU_AFFINITY): Updated.
Ok for trunk?
Daniel
Index: libgomp.texi
===================================================================
--- libgomp.texi (revision 123524)
+++ libgomp.texi (working copy)
@@ -895,14 +895,24 @@
@cindex Environment Variable
@table @asis
@item @emph{Description}:
-A patch for this extension has been submitted, but was not yet applied at the
-time of writing.
+Binds threads to specific CPUs. The variable should contain space or
+comma separated list of CPUs, e. g. either a zero based CPU number, or a
+range of CPUs (M-N) or a range with some stride (M-N:S). For example,
+@code{GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"} will bind the initial thread
+to CPU 0, the second to CPU 3, the third to CPU 1, the fourth to
+CPU 2, the fifth to CPU 4, the sixth to CPU 6, the seventh to CPU 8, ...
+tenth to CPU 14 and then starts assigning back from the beginning of the
+list. @code{GOMP_CPU_AFFINITY=0} binds all threads to CPU 0.
-@item @emph{Reference}:
-@uref{http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00982.html,
-GCC Patches Mailinglist}
-@uref{http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01133.html,
-GCC Patches Mailinglist}
+There is no GNU OpenMP library routine to determine whether CPU affinity
+is in effect. As a workaround, language specific library functions, e. g.
+@code{getenv} in C or @code{GET_ENVIRONMENT_VARIABLE} in Fortran, may
+be used to query the setting of the environment variable. A defined CPU
+affinity on startup can not be changed or disabled during the runtime of
+the application.
+
+If this environment variable is omitted, the host system while handle the
+assignment of threads to CPUs.
@end table