From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by sourceware.org (Postfix) with ESMTPS id 8B7E13892470 for ; Sat, 12 Dec 2020 16:27:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8B7E13892470 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-x82a.google.com with SMTP id k4so8828507qtj.10 for ; Sat, 12 Dec 2020 08:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceryinstitute.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=6AVIaBnEt8CV9B/F5moB++T2PExq7j8hfJBqkkUJIrM=; b=bd/aiDBq/L15wB5WS2wf50vADwPLpFeS4UseTUxUAo/ninUuziumr7+721qTLNtgmW odOYyj1PNe+yCPCq8oA72q8S3Wgy2k8TlYtBRUIYtYbq3m5yKDJ510DHY/DSzit16umK Z9X0Fexbq0FO3Nt5o9Wb3Aira2/CVDwJHKiVbX54h6rm71DnecstEN7KMDshp3WwZneb HFEekr5WSDpmbFhfKWyvZUsQ8tJs+d8Fth3rc/NEBWDZU3kcWe4hx1H39KcmsQA6MP76 kK7sGgpDTq5CiarE5XmhX2W/dR8E2GzY7anGEkOANezS0juVcyvuWTYAL4wssJNRzVHk 5STg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=6AVIaBnEt8CV9B/F5moB++T2PExq7j8hfJBqkkUJIrM=; b=GAIEuJjyivU+s8iZtOV5L7V4piAXyHRZ7oCKmIl1UNX1GsHMKbxIfNXJ/H3dXYz2Ub EvQRLXex2F0SrIgY1Wg4ytpnLQUw0f05FKzCLzStUU4noR0ko0ddqRIqwh2UGOQPD6Jq oweBREPsLOP7bWS02CYr96RXmwLGVJBQGCsK7Vo3Bc+Kprku3LkT1sSlMugqIrolgniz 8cWMsr0oGvl3ymxKe3eyabQm/Tvjpnikd2b9jKsGeDwAdIpr8gxcNWp/UhTMhwUDU9Mc qQyki23B3cuG50Sy8KaSCfs/0jfSuqDTy+e4esV00/DJa+5CjrSSfT4NfEqFfQ+RRURK xfrg== X-Gm-Message-State: AOAM531YF+v+DUqqC5Mfc8iM2TmuoDRmcUiwXSaes0iB5cjRDH4FGIRj KegoSeD5s9dlcSLQ5GoT85nZBTn6X8+W8rDpi35YVK2isEvHCnxL X-Google-Smtp-Source: ABdhPJwF/77mCZZBO2cILQP9rv0fPIi6QnBZHzi06EIxgsyM0+bcc+Aabx4Cc1ULduiRDFVu/VAS5cTlUhD3LsZirpg= X-Received: by 2002:aed:3442:: with SMTP id w60mr22896549qtd.92.1607790456734; Sat, 12 Dec 2020 08:27:36 -0800 (PST) MIME-Version: 1.0 From: Damian Rouson Date: Sat, 12 Dec 2020 08:27:26 -0800 Message-ID: Subject: Bug 98253 - Conflicting random_seed/random_init results To: gfortran Cc: Brad Richardson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Sat, 12 Dec 2020 16:27:38 -0000 16.9.155 Case (i) in the Fortran 2018 standard states CALL RANDOM_INIT (REPEATABLE=true, IMAGE_DISTINCT=true) is equivalent to invoking RANDOM_SEED with a processor-dependent value for PUT that is different on every invoking image. In each execution of the program with the same execution environment, if the invoking image index value in the initial team is the same, the value for PUT shall be the same. but the two programs below give different results. % cat random_init.f90 implicit none integer i real r call random_init(repeatable=.true., image_distinct=.true.) do i=1,5 call random_number(r) print *,r end do end % cat random_seed.f90 implicit none integer i, n real r call random_seed(size=n) call random_seed(put=[(i,i=1,n)]) do i=1,5 call random_number(r) print *,r end do end % /usr/local/Cellar/gnu/11.0.0/bin/gfortran random_init.f90 % ./a.out 0.731217086 0.652637541 0.381399393 0.817764997 0.394176722 % /usr/local/Cellar/gnu/11.0.0/bin/gfortran random_seed.f90 % ./a.out 0.471070886 0.117344737 0.357547939 0.318134785 0.696753800 % /usr/local/Cellar/gnu/11.0.0/bin/gfortran --version GNU Fortran (GCC) 11.0.0 20200804 (experimental)