public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/102320] New: Set cpu affinity error
@ 2021-09-14  9:22 zhuguanghong at uniontech dot com
  2021-09-14 12:05 ` [Bug libgomp/102320] " zhuguanghong at uniontech dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zhuguanghong at uniontech dot com @ 2021-09-14  9:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102320

            Bug ID: 102320
           Summary: Set cpu affinity error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhuguanghong at uniontech dot com
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

libgomp/config/linux/affinity.c
this   is error ?
.......

void
gomp_init_affinity (void)
{
  if (gomp_places_list == NULL)
    {
      if (!gomp_affinity_init_level (1, ULONG_MAX, true))
        return;
    }

  struct gomp_thread *thr = gomp_thread ();
  pthread_setaffinity_np (pthread_self (), gomp_cpuset_size,
                          (cpu_set_t *) gomp_places_list[0]); // this set one
cpu ?because parse_affinity 
  thr->place = 1;
  thr->ts.place_partition_off = 0;
  thr->ts.place_partition_len = gomp_places_list_len;
}
.......






parse_affinity
......

 while (needed--)
 11                 {
 10                   void *p = gomp_places_list[gomp_places_list_len];
  9                   gomp_affinity_init_place (p);
  8                   if (gomp_affinity_add_cpus (p, cpu_beg, 1, 0,
true))//different  cpuset ,GOMP_CPU_AFFINITY=0-x ,gomp_places_list[0] is ?
  7                     ++gomp_places_list_len;
  6                   cpu_beg += cpu_stride;
  5                 }


......

//error

GOMP_CPU_AFFINITY=0-x

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-14 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14  9:22 [Bug libgomp/102320] New: Set cpu affinity error zhuguanghong at uniontech dot com
2021-09-14 12:05 ` [Bug libgomp/102320] " zhuguanghong at uniontech dot com
2021-09-14 12:10 ` jakub at gcc dot gnu.org
2021-09-14 12:16 ` zhuguanghong at uniontech dot com
2021-09-14 12:19 ` zhuguanghong at uniontech dot com
2021-09-14 12:20 ` zhuguanghong at uniontech dot com
2021-09-14 12:32 ` jakub at gcc dot gnu.org
2021-09-14 12:35 ` zhuguanghong at uniontech dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).