From patchwork Tue Oct 27 17:31:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 1388816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=vzCnCiE9; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLJfb4LHcz9sTf for ; Wed, 28 Oct 2020 04:31:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5EF0C388A415; Tue, 27 Oct 2020 17:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EF0C388A415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1603819905; bh=9+Wb2dQZe5dhTqiVwOpUjotIS+9Sqyjse72/OpA3ERs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vzCnCiE9yIW+iw58ZINZ+mzkOsbw72V2ycGPNRySMspAW6Da5by4Xk6s7UlIJdz+Z l3o/O6i96dPzwrk584K91ipTDVkbSXioWJ8ju4HXVmpxNXfS2MgvSHysu6mglOzWN8 O+oXpdJdRQzYReTV8J5gpYCRz+N9on6/tP3O/JPw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cc-smtpout3.netcologne.de (cc-smtpout3.netcologne.de [89.1.8.213]) by sourceware.org (Postfix) with ESMTPS id 6EEA13857C6C; Tue, 27 Oct 2020 17:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6EEA13857C6C Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id C9B8412991; Tue, 27 Oct 2020 18:31:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id BBE9F11F55; Tue, 27 Oct 2020 18:31:39 +0100 (CET) Received: from [2001:4dd7:d19d:0:873d:89f5:3b48:970a] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.11.6) (envelope-from ) id 5f98597b-02f5-7f0000012729-7f000001abf2-1 for ; Tue, 27 Oct 2020 18:31:39 +0100 Received: from linux-p51k.fritz.box (2001-4dd7-d19d-0-873d-89f5-3b48-970a.ipv6dyn.netcologne.de [IPv6:2001:4dd7:d19d:0:873d:89f5:3b48:970a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Tue, 27 Oct 2020 18:31:36 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches Subject: [patch, shared coarrays, committed] Make header use more consistent Message-ID: <03c2155b-c196-2d0a-ef80-185179766c5c@netcologne.de> Date: Tue, 27 Oct 2020 18:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Language: de-DE X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Thomas Koenig via Gcc-patches From: Thomas Koenig Reply-To: Thomas Koenig Cc: David Edelsohn Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" I just committed https://gcc.gnu.org/g:0c261d5b5c931d9e9214d06531bdc7e9e16aeaab to hopefully fix the header issue on the native_coarray branch. If anybody wants to give this a spin, please go right ahead. I've also discussed with Nicolas on how best to proceed. The best way forward is probably to merge the branch into trunk at the end of stage 1 and follow Richard's suggestion to use configure.tgt to only compile the shared coarray library for systems where it is known to at least compile. As people test more systems, we can then add these to configure.tgt. Best regards Thomas Always include libgfortran.h first; sanitize header dependencies. libgfortran/ChangeLog: * nca/coarraynative.c: Do not include util.h. Remove commented include for stdlib.h.. * nca/collective_subroutine.c: Move #include after other #include statement. * nca/hashmap.c: Include shared_memory.h and allocator.h * nca/hashmap.h: Remove includess. * nca/libcoarraynative.h: Include only those headers which are needed. * nca/shared_memory.c: Do not include util.h * nca/shared_memory.h: Do not include other headers. * nca/sync.c: Move include of string.h after other headers. * nca/sync.h: Remove include of shared_memory.h and alloc.h. * nca/util.h: Do not include stdint.h and stddef.h; include limits.h and assert.h. * nca/wrapper.c: Remove include for sync.h, util.h and collective_subroutine.h. Move include of string.h after other headers. diff --git a/libgfortran/nca/coarraynative.c b/libgfortran/nca/coarraynative.c index 109bf88b30f..251e7c9dd57 100644 --- a/libgfortran/nca/coarraynative.c +++ b/libgfortran/nca/coarraynative.c @@ -27,13 +27,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libcoarraynative.h" #include "allocator.h" #include "hashmap.h" -#include "util.h" #include "lock.h" #include "collective_subroutine.h" #include #include -// #include #include #define GFORTRAN_ENV_NUM_IMAGES "GFORTRAN_NUM_IMAGES" diff --git a/libgfortran/nca/collective_subroutine.c b/libgfortran/nca/collective_subroutine.c index cc7cbb7fbaf..14bd517d576 100644 --- a/libgfortran/nca/collective_subroutine.c +++ b/libgfortran/nca/collective_subroutine.c @@ -22,12 +22,13 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -#include #include "libgfortran.h" #include "libcoarraynative.h" #include "collective_subroutine.h" #include "allocator.h" +#include + void * get_collsub_buf (collsub_iface *ci, size_t size) { diff --git a/libgfortran/nca/hashmap.c b/libgfortran/nca/hashmap.c index 865ec6a1488..61fe966a3f0 100644 --- a/libgfortran/nca/hashmap.c +++ b/libgfortran/nca/hashmap.c @@ -23,6 +23,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #include "libgfortran.h" +#include "shared_memory.h" +#include "allocator.h" #include "hashmap.h" #include diff --git a/libgfortran/nca/hashmap.h b/libgfortran/nca/hashmap.h index 29490951575..10a43d0be91 100644 --- a/libgfortran/nca/hashmap.h +++ b/libgfortran/nca/hashmap.h @@ -24,13 +24,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef HASHMAP_H -#include "shared_memory.h" -#include "allocator.h" - -#include -#include - - /* Data structures and variables: memid is a unique identifier for the coarray, the address of its diff --git a/libgfortran/nca/libcoarraynative.h b/libgfortran/nca/libcoarraynative.h index 85746f3189c..4bd7e3ca740 100644 --- a/libgfortran/nca/libcoarraynative.h +++ b/libgfortran/nca/libcoarraynative.h @@ -25,12 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef COARRAY_NATIVE_HDR #define COARRAY_NATIVE_HDR -#include "libgfortran.h" - -#include -#include -#include - #define DEBUG_NATIVE_COARRAY 0 #if defined(DEBUG_NATIVE_COARRAY) && DEBUG_NATIVE_COARRAY @@ -39,10 +33,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DEBUG_PRINTF(...) do {} while(0) #endif -#include "allocator.h" -#include "hashmap.h" +#include "shared_memory.h" +#include "alloc.h" #include "sync.h" -#include "lock.h" +#include "util.h" #include "collective_subroutine.h" typedef struct { diff --git a/libgfortran/nca/shared_memory.c b/libgfortran/nca/shared_memory.c index 7d68126f40f..0d80b79a6b3 100644 --- a/libgfortran/nca/shared_memory.c +++ b/libgfortran/nca/shared_memory.c @@ -24,13 +24,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include "libcoarraynative.h" -#include "util.h" + #include #include #include -#include "shared_memory.h" - /* This implements shared memory based on POSIX mmap. We start with memory block of the size of the global shared memory data, rounded up to one pagesize, and enlarge as needed. diff --git a/libgfortran/nca/shared_memory.h b/libgfortran/nca/shared_memory.h index 59123688de5..09692fce601 100644 --- a/libgfortran/nca/shared_memory.h +++ b/libgfortran/nca/shared_memory.h @@ -25,16 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef SHARED_MEMORY_H #define SHARED_MEMORY_H -#include -#include -#include -#include -#include -#include -#include -#include -#include - /* A struct to serve as an opaque shared memory object. */ struct shared_memory_act; diff --git a/libgfortran/nca/sync.c b/libgfortran/nca/sync.c index cd30f2f863b..7cf5ee28d9b 100644 --- a/libgfortran/nca/sync.c +++ b/libgfortran/nca/sync.c @@ -23,12 +23,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -#include - #include "libgfortran.h" #include "libcoarraynative.h" -#include "sync.h" -#include "util.h" + +#include static void sync_all_init (pthread_barrier_t *b) diff --git a/libgfortran/nca/sync.h b/libgfortran/nca/sync.h index 6eec14e3864..53aa3dcb15f 100644 --- a/libgfortran/nca/sync.h +++ b/libgfortran/nca/sync.h @@ -25,8 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef IPSYNC_HDR #define IPSYNC_HDR -#include "shared_memory.h" -#include "alloc.h" #include typedef struct { diff --git a/libgfortran/nca/util.h b/libgfortran/nca/util.h index 9abd7adf708..1d335129520 100644 --- a/libgfortran/nca/util.h +++ b/libgfortran/nca/util.h @@ -25,9 +25,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef UTIL_HDR #define UTIL_HDR -#include -#include #include +#include +#include #define PTR_BITS (CHAR_BIT*sizeof(void *)) diff --git a/libgfortran/nca/wrapper.c b/libgfortran/nca/wrapper.c index b31e750ead3..d3d50f5d211 100644 --- a/libgfortran/nca/wrapper.c +++ b/libgfortran/nca/wrapper.c @@ -22,13 +22,11 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -#include #include "libgfortran.h" #include "libcoarraynative.h" -#include "sync.h" #include "lock.h" -#include "util.h" -#include "collective_subroutine.h" + +#include static inline int div_ru (int divident, int divisor)