From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 0B355385781B for ; Sun, 4 Apr 2021 03:30:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B355385781B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sourceryinstitute.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=damian@sourceryinstitute.org Received: by mail-qt1-x831.google.com with SMTP id y2so6295413qtw.13 for ; Sat, 03 Apr 2021 20:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceryinstitute.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hN1Rs5bpr6y4iuWsp6UFmZs7EtKShnd+efuBcOpCQ6w=; b=Rm2K1meljwZf8muvm37kaRQ5o8RPJx8xEQyhoruenMb/3yO9YEI29faiHgG/GAu5Kn KKf74aMfXcA19NomCZ6NIGod9KNKscJmozuejL0VF04QZ2cV++6mPPm3mMcq691EeM+d /XjCqZE+AKqj5gacySFa51kAaIFw813ER4uEWhC5fNBN5YMGgUqSLu/5cgVOgsayzMiR B5S4Y72qlhWh3BfF0mBqpJvtffI5mDx0cq/JHiODhAiJ+SzW71fZOKQocJhCLzeORf6m OD8028OJnmbjOAtiQGZ3/JEchiyAeaz5iKCoT0Ib3+z2rbWau7CRXTWBnqAoRJB4HdPO 4Fwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hN1Rs5bpr6y4iuWsp6UFmZs7EtKShnd+efuBcOpCQ6w=; b=FBgSU8m0ZheROCvAbfNzxQndA1G79ND9V/cboDCs+X/T1WIE3Zdu9MivcA8tgY250S 1RGzBsy8yWzHNIju+QYMIEYtlrG79Qtoxa7Iz1upKOxFq/RVwwW0AXiqGFUc4lffLT8U c1RjDpJcuTkeqp2iI88/4XUqBrjhtPHyzFx6JzFApzg9/cT76Vs6cMYoMphuI9WmURih qEAcITepYksxQtqK7sX9MlRwqOoORSXPwzGim5sbFIOrvO08osI2B/3G4Ng51O1oxqYA mktpmfk7uIlx3u1z4qSokBhm2SDoKbKW4Ms2dAcr+Sgdmis2rdqdBmNqshOGGV+Pjcfc tFAw== X-Gm-Message-State: AOAM533anb4gj5CaHxu77u4Jl61aYRlU4fm8KoJUkvAs3MTcmII+NO4F +DxvVxs2hXovYBSi+EpWjU1r/aMq48/9Xnx81aguiLIfa13XFuCH X-Google-Smtp-Source: ABdhPJw0uq08NaW05n1JiBprgCVcRfqr0tpyupT2oaDJT8o/kE2Uikpo3FBfjD2IlgObTkqX2dN0uXd3dSyTL54Pjgg= X-Received: by 2002:a05:622a:3c8:: with SMTP id k8mr17557338qtx.101.1617507042398; Sat, 03 Apr 2021 20:30:42 -0700 (PDT) MIME-Version: 1.0 References: <20210403172846.GA14134@troutmask.apl.washington.edu> In-Reply-To: <20210403172846.GA14134@troutmask.apl.washington.edu> From: Damian Rouson Date: Sat, 3 Apr 2021 20:30:31 -0700 Message-ID: Subject: Re: RANDOM_INIT() and coarray Fortran To: Steve Kargl Cc: gfortran , Andre Vehreschild Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2021 03:30:44 -0000 Hi Steve, I hope the gfortran developers won't commit a patch that replaces existing behavior with a stub that simply emits an error message. It has been a while since I looked at the previous emails regarding problems with the current behavior so I'm not expressing an opinion about the current behavior. I'm simply advocating against breaking existing codes that rely on the current behavior if nothing better is being provided. Or as a compromise, would you mind changing the patch so that the error message is emitted only in the problematic cases? You presented one problematic case out of the four possible combinations of RANDOM_INIT() arguments. With only four possible combinations to enumerate, I hope this suggestion isn't burdensome. Regarding "someone who cares about coarray Fortran," finding people to work on such an effort is quite challenging. I believe Andre Verheschild has some limited availability so I'm cc'ing him and will discuss it with him if he's interested. If you know others who might be interested, please let us know. Damian On Sat, Apr 3, 2021 at 10:28 AM Steve Kargl via Fortran wrote: > > What to do about RANDOM_INIT() and coarray Fortran? > > The main issue is that if one compiles with -fcoarray=lib > (or the WIP -fcoarray=shared), then RANDOM_INIT() may > require communication between images. Thus, RANDOM_INIT() > cannot live in libgfortran for at least -fcoarray=lib. > > Consider the simple code: > > subroutine foo > call random_init(.true., .false.) > end subroutine foo > > I have updated the patch for > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98301 > to use a stub routine for -fcoarray=lib and -fcoarray=shared. > Anyone, who knows how to use git, is encouraged to commit the patch. > > For -fcoarray=none (default option) and -fcoarray=single, the > patch will cause gfortran to generate > > __attribute__((fn spec (". "))) > void foo () > { > _gfortran_random_init (1, 0, 0); > } > > _gfortran_random_init() live in libgfortran and it has been updated > to meet the intended requires of the Fortran standard. > > With -fcoarray=lib and -fcoarray=shared, gfortran will now generate > > __attribute__((fn spec (". "))) > void foo () > { > _gfortran_random_init_foobar (1, 0); > } > > where _gfortran_random_init_foobar() lives in libgfortran. It prints > an error message that RANDOM_INIT() is not yet supported for coarray > Fortran and exits. Someone, who cares about coarray Fortran, can fix > -fcoarray=lib and -fcoarray=shared by updating trans-decl.c (see the > FIXME for random_init()) to emit > > __attribute__((fn spec (". "))) > void foo () > { > _gfortran_caf_random_init (1, 0); > } > > or > > __attribute__((fn spec (". "))) > void foo () > { > _gfortran_cas_random_init (1, 0); > } > > -- > Steve