public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Mikael Morin <morin-mikael@orange.fr>, <gscfq@t-online.de>,
	Kwok Cheung Yeung <kcy@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	fortran <fortran@gcc.gnu.org>
Subject: Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131]
Date: Tue, 1 Mar 2022 10:17:54 +0100	[thread overview]
Message-ID: <14be1163-51e6-19bd-0032-c18a53ffe254@codesourcery.com> (raw)
In-Reply-To: <Yh3WcFjhygX+Q7Fd@tucnak>

First, thanks for looking into the standard. I think the information is
too much spread through the standard. I keep searching for restrictions,
find them at 5 places and miss another 5. With OpenMP 5.2, it became
even worse.

On 01.03.22 09:16, Jakub Jelinek wrote:
> As there is no explicit allowing of array sections, array sections aren't
> allowed in detach, and it must be scalar integer.
> The question is if a non-coindexed coarray is a scalar integer variable or
> not.

I think the Fortran sense, yes. That only coindexed vars are disallowed
also implies this in the OpenMP spec. In terms of the implementation,
a local part of a coarray is really not much different from any other
variable, except that all coarrays have to be either in static memory
or allocatables/pointers (which are collectively allocated).

For a non-descriptor variable like:

program main
   integer, save :: a[*]
   call foo(a)
contains
   subroutine foo(x)
    integer :: x[*]
   end
end

That's also the case for the internal representation:

   static void * restrict caf_token.2;
   static integer(kind=4) * restrict a;

   void foo (integer(kind=4) * restrict x,
             void * restrict caf_token.0,
             integer(kind=8) caf_offset.1)
'x' is a pretty normal variable (admittedly, internally now a pointer)
which can be used like a noncoarray. (The pointer is there to permit
to put the var into some special, remote accessible memory.)

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  reply	other threads:[~2022-03-01  9:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 14:01 Kwok Cheung Yeung
2022-02-28 14:07 ` Jakub Jelinek
2022-02-28 14:27   ` Kwok Cheung Yeung
2022-02-28 15:54     ` Mikael Morin
2022-02-28 16:00       ` Jakub Jelinek
2022-02-28 17:33         ` Mikael Morin
2022-02-28 17:37           ` Jakub Jelinek
2022-02-28 18:38             ` Kwok Cheung Yeung
2022-02-28 20:37               ` Mikael Morin
2022-02-28 20:45                 ` Mikael Morin
2022-02-28 21:37                   ` Jakub Jelinek
2022-02-28 22:36                     ` Mikael Morin
2022-03-01  7:58                     ` Tobias Burnus
2022-03-01  8:16                       ` Jakub Jelinek
2022-03-01  9:17                         ` Tobias Burnus [this message]
2022-03-01 15:37                           ` Mikael Morin
2022-03-02 17:22                             ` [PATCH][v2] openmp, fortran: Check that the type of an event handle in a detach clause is suitable [PR104131] Kwok Cheung Yeung
2022-03-02 17:31                               ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14be1163-51e6-19bd-0032-c18a53ffe254@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gscfq@t-online.de \
    --cc=jakub@redhat.com \
    --cc=kcy@codesourcery.com \
    --cc=morin-mikael@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).