Patchwork [libgomp] PR57423 - correct argument names in omp_lib.f90 and .texi

login
register
mail settings
Submitter Tobias Burnus
Date May 27, 2013, 9:21 a.m.
Message ID <51A325A1.6000208@net-b.de>
Download mbox | patch
Permalink /patch/246550/
State New
Headers show

Comments

Tobias Burnus - May 27, 2013, 9:21 a.m.
The dummy arguments names in a Fortran interface block are part of the 
interface as one can use "call proc(argname=value)" besides "call 
proc(value)"; thus, the dummy argument names are significant.

The attached patch updates the names in the module file - and for 
completeness also in the documentation.

OK for the trunk?

Tobias

PS: That the *_lock arguments are called "lock" in C/C++ but "svar" and 
"nvar" in Fortran is an odd inconsistency in the OpenMP spec.
Jakub Jelinek - May 27, 2013, 9:25 a.m.
On Mon, May 27, 2013 at 11:21:37AM +0200, Tobias Burnus wrote:
> The dummy arguments names in a Fortran interface block are part of
> the interface as one can use "call proc(argname=value)" besides
> "call proc(value)"; thus, the dummy argument names are significant.
> 
> The attached patch updates the names in the module file - and for
> completeness also in the documentation.
> 
> OK for the trunk?
> 
> Tobias
> 
> PS: That the *_lock arguments are called "lock" in C/C++ but "svar"
> and "nvar" in Fortran is an odd inconsistency in the OpenMP spec.

Ok, thanks.

> 2013-05-27  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/57423
> 	* libgomp.texi (omp_set_dynamic, omp_set_nested, omp_set_nested,
> 	omp_set_num_threads, omp_init_lock, omp_set_lock, omp_test_lock,
> 	omp_unset_lock, omp_destroy_lock, omp_init_nest_lock,
> 	omp_set_nest_lock, omp_test_nest_lock, omp_unset_nest_lock,
> 	omp_destroy_nest_lock): Correct arguments to match the one in
> 	the OpenMP spec.
> 	* omp_lib.f90.in (omp_init_lock, omp_init_nest_lock, omp_destroy_lock
> 	omp_destroy_nest_lock, omp_set_lock, omp_set_nest_lock, omp_unset_lock,
> 	omp_unset_nest_lock, omp_set_dynamic, omp_set_nested,
> 	omp_set_num_threads, omp_test_lock, omp_test_nest_lock): Ditto.

	Jakub

Patch

2013-05-27  Tobias Burnus  <burnus@net-b.de>

	PR fortran/57423
	* libgomp.texi (omp_set_dynamic, omp_set_nested, omp_set_nested,
	omp_set_num_threads, omp_init_lock, omp_set_lock, omp_test_lock,
	omp_unset_lock, omp_destroy_lock, omp_init_nest_lock,
	omp_set_nest_lock, omp_test_nest_lock, omp_unset_nest_lock,
	omp_destroy_nest_lock): Correct arguments to match the one in
	the OpenMP spec.
	* omp_lib.f90.in (omp_init_lock, omp_init_nest_lock, omp_destroy_lock
	omp_destroy_nest_lock, omp_set_lock, omp_set_nest_lock, omp_unset_lock,
	omp_unset_nest_lock, omp_set_dynamic, omp_set_nested,
	omp_set_num_threads, omp_test_lock, omp_test_nest_lock): Ditto.

diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 40c3830..2985128 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -601,13 +601,13 @@  adjustment of team sizes and @code{false} disables it.
 
 @item @emph{C/C++}:
 @multitable @columnfractions .20 .80
-@item @emph{Prototype}: @tab @code{void omp_set_dynamic(int set);}
+@item @emph{Prototype}: @tab @code{void omp_set_dynamic(int dynamic_threads);}
 @end multitable
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_set_dynamic(set)}
-@item                   @tab @code{logical, intent(in) :: set}
+@item @emph{Interface}: @tab @code{subroutine omp_set_dynamic(dynamic_threads)}
+@item                   @tab @code{logical, intent(in) :: dynamic_threads}
 @end multitable
 
 @item @emph{See also}:
@@ -657,13 +657,13 @@  dynamic adjustment of team sizes and @code{false} disables it.
 
 @item @emph{C/C++}:
 @multitable @columnfractions .20 .80
-@item @emph{Prototype}: @tab @code{void omp_set_nested(int set);}
+@item @emph{Prototype}: @tab @code{void omp_set_nested(int nested);}
 @end multitable
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_set_nested(set)}
-@item                   @tab @code{logical, intent(in) :: set}
+@item @emph{Interface}: @tab @code{subroutine omp_set_nested(nested)}
+@item                   @tab @code{logical, intent(in) :: nested}
 @end multitable
 
 @item @emph{See also}:
@@ -685,13 +685,13 @@  argument of @code{omp_set_num_threads} shall be a positive integer.
 
 @item @emph{C/C++}:
 @multitable @columnfractions .20 .80
-@item @emph{Prototype}: @tab @code{void omp_set_num_threads(int n);}
+@item @emph{Prototype}: @tab @code{void omp_set_num_threads(int num_threads);}
 @end multitable
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_set_num_threads(n)}
-@item                   @tab @code{integer, intent(in) :: n}
+@item @emph{Interface}: @tab @code{subroutine omp_set_num_threads(num_threads)}
+@item                   @tab @code{integer, intent(in) :: num_threads}
 @end multitable
 
 @item @emph{See also}:
@@ -750,8 +750,8 @@  an unlocked state.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_init_lock(lock)}
-@item                   @tab @code{integer(omp_lock_kind), intent(out) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_init_lock(svar)}
+@item                   @tab @code{integer(omp_lock_kind), intent(out) :: svar}
 @end multitable
 
 @item @emph{See also}:
@@ -779,8 +779,8 @@  a deadlock occurs.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_set_lock(lock)}
-@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_set_lock(svar)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: svar}
 @end multitable
 
 @item @emph{See also}:
@@ -809,8 +809,8 @@  does not block if the lock is not available. This function returns
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{logical function omp_test_lock(lock)}
-@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{logical function omp_test_lock(svar)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: svar}
 @end multitable
 
 @item @emph{See also}:
@@ -839,8 +839,8 @@  again, set the lock to itself.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_unset_lock(lock)}
-@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_unset_lock(svar)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: svar}
 @end multitable
 
 @item @emph{See also}:
@@ -866,8 +866,8 @@  in the unlocked state.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_destroy_lock(lock)}
-@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_destroy_lock(svar)}
+@item                   @tab @code{integer(omp_lock_kind), intent(inout) :: svar}
 @end multitable
 
 @item @emph{See also}:
@@ -893,8 +893,8 @@  an unlocked state and the nesting count is set to zero.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_init_nest_lock(lock)}
-@item                   @tab @code{integer(omp_nest_lock_kind), intent(out) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_init_nest_lock(nvar)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(out) :: nvar}
 @end multitable
 
 @item @emph{See also}:
@@ -921,8 +921,8 @@  nesting count for the lock is incremented.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_set_nest_lock(lock)}
-@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_set_nest_lock(nvar)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: nvar}
 @end multitable
 
 @item @emph{See also}:
@@ -951,8 +951,8 @@  is returned. Otherwise, the return value equals zero.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{logical function omp_test_nest_lock(lock)}
-@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{logical function omp_test_nest_lock(nvar)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: nvar}
 @end multitable
 
 
@@ -982,8 +982,8 @@  one of them is chosen to, again, set the lock to itself.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_unset_nest_lock(lock)}
-@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_unset_nest_lock(nvar)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: nvar}
 @end multitable
 
 @item @emph{See also}:
@@ -1009,8 +1009,8 @@  in the unlocked state and its nesting count must equal zero.
 
 @item @emph{Fortran}:
 @multitable @columnfractions .20 .80
-@item @emph{Interface}: @tab @code{subroutine omp_destroy_nest_lock(lock)}
-@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: lock}
+@item @emph{Interface}: @tab @code{subroutine omp_destroy_nest_lock(nvar)}
+@item                   @tab @code{integer(omp_nest_lock_kind), intent(inout) :: nvar}
 @end multitable
 
 @item @emph{See also}:
diff --git a/libgomp/omp_lib.f90.in b/libgomp/omp_lib.f90.in
index c6108e1..c9bc5fd 100644
--- a/libgomp/omp_lib.f90.in
+++ b/libgomp/omp_lib.f90.in
@@ -39,85 +39,85 @@ 
         integer (omp_sched_kind), parameter :: omp_sched_auto = 4
 
         interface
-          subroutine omp_init_lock (lock)
+          subroutine omp_init_lock (svar)
             use omp_lib_kinds
-            integer (omp_lock_kind), intent (out) :: lock
+            integer (omp_lock_kind), intent (out) :: svar
           end subroutine omp_init_lock
         end interface
 
         interface
-          subroutine omp_init_nest_lock (lock)
+          subroutine omp_init_nest_lock (nvar)
             use omp_lib_kinds
-            integer (omp_nest_lock_kind), intent (out) :: lock
+            integer (omp_nest_lock_kind), intent (out) :: nvar
           end subroutine omp_init_nest_lock
         end interface
 
         interface
-          subroutine omp_destroy_lock (lock)
+          subroutine omp_destroy_lock (svar)
             use omp_lib_kinds
-            integer (omp_lock_kind), intent (inout) :: lock
+            integer (omp_lock_kind), intent (inout) :: svar
           end subroutine omp_destroy_lock
         end interface
 
         interface
-          subroutine omp_destroy_nest_lock (lock)
+          subroutine omp_destroy_nest_lock (nvar)
             use omp_lib_kinds
-            integer (omp_nest_lock_kind), intent (inout) :: lock
+            integer (omp_nest_lock_kind), intent (inout) :: nvar
           end subroutine omp_destroy_nest_lock
         end interface
 
         interface
-          subroutine omp_set_lock (lock)
+          subroutine omp_set_lock (svar)
             use omp_lib_kinds
-            integer (omp_lock_kind), intent (inout) :: lock
+            integer (omp_lock_kind), intent (inout) :: svar
           end subroutine omp_set_lock
         end interface
 
         interface
-          subroutine omp_set_nest_lock (lock)
+          subroutine omp_set_nest_lock (nvar)
             use omp_lib_kinds
-            integer (omp_nest_lock_kind), intent (inout) :: lock
+            integer (omp_nest_lock_kind), intent (inout) :: nvar
           end subroutine omp_set_nest_lock
         end interface
 
         interface
-          subroutine omp_unset_lock (lock)
+          subroutine omp_unset_lock (svar)
             use omp_lib_kinds
-            integer (omp_lock_kind), intent (inout) :: lock
+            integer (omp_lock_kind), intent (inout) :: svar
           end subroutine omp_unset_lock
         end interface
 
         interface
-          subroutine omp_unset_nest_lock (lock)
+          subroutine omp_unset_nest_lock (nvar)
             use omp_lib_kinds
-            integer (omp_nest_lock_kind), intent (inout) :: lock
+            integer (omp_nest_lock_kind), intent (inout) :: nvar
           end subroutine omp_unset_nest_lock
         end interface
 
         interface omp_set_dynamic
-          subroutine omp_set_dynamic (set)
-            logical (4), intent (in) :: set
+          subroutine omp_set_dynamic (dynamic_threads)
+            logical (4), intent (in) :: dynamic_threads
           end subroutine omp_set_dynamic
-          subroutine omp_set_dynamic_8 (set)
-            logical (8), intent (in) :: set
+          subroutine omp_set_dynamic_8 (dynamic_threads)
+            logical (8), intent (in) :: dynamic_threads
           end subroutine omp_set_dynamic_8
         end interface
 
         interface omp_set_nested
-          subroutine omp_set_nested (set)
-            logical (4), intent (in) :: set
+          subroutine omp_set_nested (nested)
+            logical (4), intent (in) :: nested
           end subroutine omp_set_nested
-          subroutine omp_set_nested_8 (set)
-            logical (8), intent (in) :: set
+          subroutine omp_set_nested_8 (nested)
+            logical (8), intent (in) :: nested
           end subroutine omp_set_nested_8
         end interface
 
         interface omp_set_num_threads
-          subroutine omp_set_num_threads (set)
-            integer (4), intent (in) :: set
+          subroutine omp_set_num_threads (num_threads)
+            integer (4), intent (in) :: num_threads
           end subroutine omp_set_num_threads
-          subroutine omp_set_num_threads_8 (set)
-            integer (8), intent (in) :: set
+          subroutine omp_set_num_threads_8 (num_threads)
+            integer (8), intent (in) :: num_threads
           end subroutine omp_set_num_threads_8
         end interface
 
@@ -143,10 +143,10 @@ 
         end interface
 
         interface
-          function omp_test_lock (lock)
+          function omp_test_lock (svar)
             use omp_lib_kinds
             logical (4) :: omp_test_lock
-            integer (omp_lock_kind), intent (inout) :: lock
+            integer (omp_lock_kind), intent (inout) :: svar
           end function omp_test_lock
         end interface
 
@@ -179,10 +179,10 @@ 
         end interface
 
         interface
-          function omp_test_nest_lock (lock)
+          function omp_test_nest_lock (nvar)
             use omp_lib_kinds
             integer (4) :: omp_test_nest_lock
-            integer (omp_nest_lock_kind), intent (inout) :: lock
+            integer (omp_nest_lock_kind), intent (inout) :: nvar
           end function omp_test_nest_lock
         end interface