From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A741B3853C10 for ; Thu, 12 Aug 2021 11:31:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A741B3853C10 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-14-vNyjCsAQMRC_FKFFj2AuYg-1; Thu, 12 Aug 2021 07:31:34 -0400 X-MC-Unique: vNyjCsAQMRC_FKFFj2AuYg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF33E87D542; Thu, 12 Aug 2021 11:31:33 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4760C1ACBB; Thu, 12 Aug 2021 11:31:32 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 17CBVQ2r1058947 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 12 Aug 2021 13:31:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 17CBVNjl1058944; Thu, 12 Aug 2021 13:31:23 +0200 Date: Thu, 12 Aug 2021 13:31:23 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: gcc-patches , fortran Subject: Re: [Patch] OpenMP 5.1: Add proc-bind 'primary' support Message-ID: <20210812113123.GA2380545@tucnak> Reply-To: Jakub Jelinek References: <7c8ee5ba-8a6d-a254-2e3b-31611b57abee@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <7c8ee5ba-8a6d-a254-2e3b-31611b57abee@codesourcery.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Thu, 12 Aug 2021 11:31:47 -0000 On Thu, Aug 12, 2021 at 12:52:17PM +0200, Tobias Burnus wrote: > gcc/c/ChangeLog: > > * c-parser.c (c_parser_omp_clause_proc_bind): Accept > 'primary' as alias for 'master'. > > gcc/cp/ChangeLog: > > * parser.c (cp_parser_omp_clause_proc_bind): Accept > 'primary' as alias for 'master'. > > gcc/fortran/ChangeLog: > > * dump-parse-tree.c (show_omp_clauses): Add TODO comment to > change 'master' to 'primary' in proc_bind for OpenMP 5.1. > * intrinsic.texi (OMP_LIB): Mention OpenMP 5.1; add > omp_proc_bind_primary. > * openmp.c (gfc_match_omp_clauses): Accept > 'primary' as alias for 'master'. > > gcc/ChangeLog: > > * tree-pretty-print.c (dump_omp_clause): Add TODO comment to > change 'master' to 'primary' in proc_bind for OpenMP 5.1. > > libgomp/ChangeLog: > > * env.c (parse_bind_var): Accept 'primary' as alias for > 'master'. > (omp_display_env): Add TODO comment to > change 'master' to 'primary' in proc_bind for OpenMP 5.1. > * libgomp.texi: Change 'master thread' to 'primary thread' > in line with OpenMP 5.1. > (omp_get_proc_bind): Add omp_proc_bind_primary and note that > omp_proc_bind_master is an alias of it. > (OMP_PROC_BIND): Mention 'PRIMARY'. > * omp.h.in (__GOMP_DEPRECATED_5_1): Define. > (omp_proc_bind_primary): Add. > (omp_proc_bind_master): Deprecate for OpenMP 5.1. > * omp_lib.f90.in (omp_proc_bind_primary): Add. > (omp_proc_bind_master): Deprecate for OpenMP 5.1. > * omp_lib.h.in (omp_proc_bind_primary): Add. > * testsuite/libgomp.c/affinity-1.c: Check that > 'primary' works and is identical to 'master'. > > gcc/testsuite/ChangeLog: > > * c-c++-common/gomp/pr61486-2.c: Duplicate one proc_bind(master) > testcase and test proc_bind(primary) instead. > * gfortran.dg/gomp/affinity-1.f90: Likewise. LGTM, some nits below. > @@ -15975,7 +15976,9 @@ c_parser_omp_clause_proc_bind (c_parser *parser, tree list) > if (c_parser_next_token_is (parser, CPP_NAME)) > { > const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); > - if (strcmp ("master", p) == 0) > + if (strcmp ("primary", p) == 0) > + kind = OMP_CLAUSE_PROC_BIND_MASTER; > + else if (strcmp ("master", p) == 0) Maybe in tree-core.h do: - OMP_CLAUSE_PROC_BIND_MASTER = 2, + OMP_CLAUSE_PROC_BIND_PRIMARY = 2, + OMP_CLAUSE_PROC_BIND_MASTER = OMP_CLAUSE_PROC_BIND_PRIMARY, and use OMP_CLAUSE_PROC_BIND_PRIMARY for the "primary" cases? I'd keep tree-pretty-print.c as is though for now (so print master). And in omp-expand we actually just count on those enumerators matching the omp.h omp_proc_bind_* ones. > @@ -39037,7 +39038,9 @@ cp_parser_omp_clause_proc_bind (cp_parser *parser, tree list, > tree id = cp_lexer_peek_token (parser->lexer)->u.value; > const char *p = IDENTIFIER_POINTER (id); > > - if (strcmp ("master", p) == 0) > + if (strcmp ("primary", p) == 0) > + kind = OMP_CLAUSE_PROC_BIND_MASTER; > + else if (strcmp ("master", p) == 0) Ditto. > - if (gfc_match ("proc_bind ( master )") == MATCH_YES) > + /* Primary is new and master is deprecated in OpenMP 5.1. */ > + if (gfc_match ("proc_bind ( primary )") == MATCH_YES) > + c->proc_bind = OMP_PROC_BIND_MASTER; > + else if (gfc_match ("proc_bind ( master )") == MATCH_YES) Maybe here too with gfortran.h change? > --- a/libgomp/omp_lib.f90.in > +++ b/libgomp/omp_lib.f90.in > @@ -48,6 +48,8 @@ > parameter :: omp_proc_bind_false = 0 > integer (omp_proc_bind_kind), & > parameter :: omp_proc_bind_true = 1 > + integer (omp_proc_bind_kind), & > + parameter :: omp_proc_bind_primary = 2 > integer (omp_proc_bind_kind), & > parameter :: omp_proc_bind_master = 2 > integer (omp_proc_bind_kind), & > @@ -670,6 +672,10 @@ > > #if _OPENMP >= 201811 > !GCC$ ATTRIBUTES DEPRECATED :: omp_get_nested, omp_set_nested > +#endif > + > +#if _OPENMP >= 202011 > +!GCC$ ATTRIBUTES DEPRECATED :: omp_proc_bind_master > #endif I must say I have no idea how this will work, but for omp_*_nested it is like that already. I think the file is *.f90, not *.F90 and so it isn't preprocessed (and is it compiled with -fopenmp at all)? But let's deal with it incrementally. Jakub