From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 57AE538930C6 for ; Mon, 4 Jan 2021 21:59:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 57AE538930C6 Received: by mail-ot1-x335.google.com with SMTP id 11so27449930oty.9 for ; Mon, 04 Jan 2021 13:59:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=joO8ylPppKvq3Lrh7aHFZWRX6CGj7Tb5OCetLANKrcY=; b=Tk8XMznarEQF/gyJm+x51NFRaijijqaeaWXtK5HIG4w273LyGH3t+ilIQHfB8/OeBJ 9uwSqvBouHa+ox8vTY77dn2ZH8jEPfVI9mUvH+sF24lvKUayjWqTOM62VbQf5cC4mkom RLVhF5yZRYm3KS3TdPACu4MK6aJsd9q+YG/sVkGQQswyoZ0qyKDmOs9PldOiLH6enrOK n4Ffjl+5phhtqmXHPA1FHjC06xU3aifrspFP/D4OZ1dA5lLFFuDUIusMngk/49RmySoC 6reA+K5WxVgIkpVgeiEqozBOKKczYAfm08LRhR8PEjVG0jK2T866v2CCDpR+JPHRXHqN sqwg== X-Gm-Message-State: AOAM533/Iv64a+VrEBRl6zUQDMlcy/6KA0/RZVMSTKA+W4mwOO+BSD2o hrvUZ617PjRvHA29t9m8ANV7A006W/gR7PPI+ObGhArNfvw= X-Google-Smtp-Source: ABdhPJxo2ZfmBYpifrWewmUg1+GneYB2n02+AFVJJC1Tih5Gotq3PaBVSeAC0+KmLe/DBnxj945DnEYsNBYbEM5XNgo= X-Received: by 2002:a05:6830:13c8:: with SMTP id e8mr55121276otq.139.1609797546777; Mon, 04 Jan 2021 13:59:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: nu quaquaraqua Date: Mon, 4 Jan 2021 22:58:55 +0100 Message-ID: Subject: Re: [OpenMP] 40% slow down when setting OMP_PLACES="sockets" To: gcc-help@gcc.gnu.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2021 21:59:08 -0000 okay, I think I can already answer myself why Clang is unaffected by this setting. The environment variables in libgomp are parsed in static void __attribute__((constructor)) initialize_env (void) this is attribute is GCC specific and basically ignored by Clang. And therefore all env. vars for openmp are ignored when linking the library with Clang, great. The other issue I suspect it is because these OMP env. vars are mere wrappers to pthread, that is, they affect all threads in the program, rather than only the threads handled by openmp. Again, great. Yours, quack On Mon, 4 Jan 2021 at 22:28, nu quaquaraqua wrote: > Hey there, > I have a multi-threaded experiment that runs with 60+ logical threads on a > dual-socket 40-cores-in total machine. When setting the env. var. > OMP_PLACES="sockets", the experiment is 40% slower. While the program is > indeed linked with -fopenmp, it does not use it any opemp clause in the > experiment nor before. Also this seems specific to GCC, as exporting the > env. var. does not cause any slow down when compiling the program with > Clang, despite both being linked to the same libgomp. > > Can someone explain what it is occurring here? > > Linux 5.0.17, Fedora 30, gcc v10.2 > > Yours, > quack >