From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A67BE3858413; Tue, 14 Sep 2021 12:16:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A67BE3858413 From: "zhuguanghong at uniontech dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/102320] Set cpu affinity error Date: Tue, 14 Sep 2021 12:16:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: zhuguanghong at uniontech dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:16:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102320 --- Comment #3 from zhuguanghong --- hi =EF=BC=8Cthanks for your reply initialize_env (void) 1 { 0 ........=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 1 if (parse_affinity (ignore)) 2 { 3 if (gomp_global_icv.bind_var =3D=3D omp_proc_bind_false) 4 gomp_global_icv.bind_var =3D true; 5 ignore =3D true; 6 } 7 if (gomp_global_icv.bind_var !=3D omp_proc_bind_false) 8 gomp_init_affinity (); Set the cpuset in the parse_affinity function and set it in different gomp_places_list .the cpuset is set in the parse_affinity function and is s= et in different gomp_places_list, but in the function gomp_init_affinity it is only set using gomp_places_list[0]=