From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40284 invoked by alias); 23 Oct 2019 16:02:02 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 40275 invoked by uid 89); 23 Oct 2019 16:02:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:822, HX-HELO:sk:mail-wm, H*RU:sk:mail-wm, H*r:sk:mail-wm X-HELO: mail-wm1-f41.google.com Received: from mail-wm1-f41.google.com (HELO mail-wm1-f41.google.com) (209.85.128.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Oct 2019 16:02:01 +0000 Received: by mail-wm1-f41.google.com with SMTP id i13so6607474wmd.3 for ; Wed, 23 Oct 2019 09:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=tOWC0f1wht1Qnujq1QSami02dW3uKMo8+Q+d/HXf63Y=; b=FhICxwo9YW2laxVhE2+cy9IklhtxuMttbrU24srdd+5fIhcqw0pc1UT5yVc20vyb3a G6rMw2HQt7q0rFPhaFAC3iEzVnKIZmaFazX7raNJh/Rv3btr8R2iGjIo7qi7gxXH1cGC HEjFoYOijzq0/RAtUWCZ81WHdOEJf6XwO0BwG5UeOtj5juM6ebe9kCtRG7n23ZmBVrZt FfkeA9v//fhP2AwH8AgkQRRHFh4ae2KUbTrbrX3FFTZn4kbCRRcAIdzEOGXuy+i5J2kc TSpWaCitajotFSLsVPul+QHaYYfkSDGYVlRCFujq1s4FLVci/JWbmkKvaeYn3pxHptru gEog== Return-Path: Received: from sebastian (50728764.static.ziggozakelijk.nl. [80.114.135.100]) by smtp.gmail.com with ESMTPSA id c14sm16565503wru.24.2019.10.23.09.01.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 09:01:58 -0700 (PDT) Date: Wed, 23 Oct 2019 16:02:00 -0000 From: =?ISO-8859-1?Q?Quaquaraqu=E0?= To: gcc-help@gcc.gnu.org Subject: [OpenMP] [libgomp] Limit the number of threads spawned around Message-Id: <20191023180157.50b8bb41cfcc254bfdfe3672@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00101.txt.bz2 Hi there, I'm an external user of a target library written in C++/OpenMP. The library= has its own API and it claims to be thread-safe. Internally, its operation= s are parallelised with the usual #pragma omp parallel for. I'm deploying i= t on a server with 40 physical threads and invoking the library from 40 (ac= tive) logical threads. This creates 40*40=3D3600 logical threads in the mac= hine. My question is whether there is a way, as external user of this targe= t library, to limit this insanity so that the OpenMP threads use the resour= ces available in a more composed manner (e.g. worker pool) or should I limi= t myself to interact with this library from a single logical thread? Thanks in advance, Yours, quaquaraqua --=20 Quaquaraqu=E0