summaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.texi
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-25 06:07:15 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-25 06:07:15 +0000
commit52306a180a2a0b9058112e9d54b76def8f8be75b (patch)
treeea6982429800a36515244a6e806f388dff9ccc3b /gcc/fortran/intrinsic.texi
parent611c73ea0132f1ed756139d270f5b828686372a9 (diff)
downloadgcc-52306a180a2a0b9058112e9d54b76def8f8be75b.tar.gz
2014-09-25 Tobias Burnus <burnus@net-b.de>
gcc/fortran * check.c (check_co_collective): Renamed from * check_co_minmaxsum, handle co_reduce. (gfc_check_co_minmax, gfc_check_co_sum): Update call. (gfc_check_co_broadcast, gfc_check_co_reduce): New. * gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_BROADCAST and GFC_ISYM_CO_REDUCE. * intrinsic.c (add_subroutines): Add co_reduce and co_broadcast. * intrinsic.h (gfc_check_co_broadcast, gfc_check_co_reduce): Add proto types. * intrinsic.texi (CO_BROADCAST): Add. * trans.h (gfor_fndecl_co_broadcast): New. * trans-decl.c (gfor_fndecl_co_broadcast): Ditto. (gfc_build_builtin_function_decls): Add decl for it, * trans-intrinsic.c (conv_co_collective): Renamed from conv_co_minmaxsum. Handle co_reduce. (gfc_conv_intrinsic_subroutine): Handle co_reduce. gcc/testsuite/ * gfortran.dg/coarray/collectives_3.f90: New. * gfortran.dg/coarray_collectives_9.f90: New. * gfortran.dg/coarray_collectives_10.f90: New. * gfortran.dg/coarray_collectives_11.f90: New. * gfortran.dg/coarray_collectives_12.f90: New. libgfortran/ * caf/libcaf.h (_gfortran_caf_co_broadcast): New prototype. * caf/single.c (_gfortran_caf_co_broadcast): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/intrinsic.texi')
-rw-r--r--gcc/fortran/intrinsic.texi60
1 files changed, 57 insertions, 3 deletions
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 48713a67519..4d884d737e9 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -95,6 +95,7 @@ Some basic guidelines for editing this document:
* @code{CHDIR}: CHDIR, Change working directory
* @code{CHMOD}: CHMOD, Change access permissions of files
* @code{CMPLX}: CMPLX, Complex conversion function
+* @code{CO_BROADCAST}: CO_BROADCAST, Copy a value to all images the current set of images
* @code{CO_MAX}: CO_MAX, Maximal value on the current set of images
* @code{CO_MIN}: CO_MIN, Minimal value on the current set of images
* @code{CO_SUM}: CO_SUM, Sum of values on the current set of images
@@ -3291,6 +3292,59 @@ end program test_cmplx
+@node CO_BROADCAST
+@section @code{CO_BROADCAST} --- Copy a value to all images the current set of images
+@fnindex CO_BROADCAST
+@cindex Collectives, value broadcasting
+
+@table @asis
+@item @emph{Description}:
+@code{CO_BROADCAST} copies the value of argument @var{A} on the image with
+image index @code{SOURCE_IMAGE} to all images in the current team. @var{A}
+becomes defined as if by intrinsic assignment. If the execution was
+successful and @var{STAT} is present, it is assigned the value zero. If the
+execution failed, @var{STAT} gets assigned a nonzero value and, if present,
+@var{ERRMSG} gets assigned a value describing the occurred error.
+
+@item @emph{Standard}:
+Technical Specification (TS) 18508 or later
+
+@item @emph{Class}:
+Collective subroutine
+
+@item @emph{Syntax}:
+@code{CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{A} @tab INTENT(INOUT) argument; shall have the same
+dynamic type and type paramters on all images of the current team. If it
+is an array, it shall have the same shape on all images.
+@item @var{SOURCE_IMAGE} @tab (optional) a scalar integer expression.
+It shall have the same the same value on all images and refer to an
+image of the current team.
+@item @var{STAT} @tab (optional) a scalar integer variable
+@item @var{ERRMSG} @tab (optional) a scalar character variable
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+program test
+ integer :: val(3)
+ if (this_image() == 1) then
+ val = [1, 5, 3]
+ end if
+ call co_broadcast (val, source_image=1)
+ print *, this_image, ":", val
+end program test
+@end smallexample
+
+@item @emph{See also}:
+@ref{CO_MAX}, @ref{CO_MIN}, @ref{CO_SUM}
+@end table
+
+
+
@node CO_MAX
@section @code{CO_MAX} --- Maximal value on the current set of images
@fnindex CO_MAX
@@ -3340,7 +3394,7 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MIN}, @ref{CO_SUM}
+@ref{CO_MIN}, @ref{CO_SUM}, @ref{CO_BROADCAST}
@end table
@@ -3394,7 +3448,7 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MAX}, @ref{CO_SUM}
+@ref{CO_MAX}, @ref{CO_SUM}, @ref{CO_BROADCAST}
@end table
@@ -3448,7 +3502,7 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MAX}, @ref{CO_MIN}
+@ref{CO_MAX}, @ref{CO_MIN}, @ref{CO_BROADCAST}
@end table