From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 43D733857C50 for ; Mon, 7 Mar 2022 17:40:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43D733857C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 08778210FE; Mon, 7 Mar 2022 17:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646674845; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iMB4Bf+llFIBMdlQ266vlJQSJY2wt1JAXenXHXwduG0=; b=GtQGeUXZHRb+6WNHRiQh10YxUAgVpD6hgpilSTHiWpvCizgfdv4cEg3kx8Lw2ylYvHmaf7 Kdy48sefEZz/N96YnsBky2ooGlookzFsDXvDEjcWtgNJgAtxqWecEXt2tT7vynkobrpwKG kg1M/YCAOlBFlJh5cNLX6gMtACKPyf4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646674845; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iMB4Bf+llFIBMdlQ266vlJQSJY2wt1JAXenXHXwduG0=; b=ERhqYXU3KLKKKjjoiAjFVnIh8/fCjla/Z+tKS3XJbrH6MbYrNxHQuYdN5Uy6XYHvDnRj5B hJfyBZzOMg3zusBg== Received: from suse.cz (virgil.suse.cz [10.100.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EA318A3B81; Mon, 7 Mar 2022 17:40:44 +0000 (UTC) From: Martin Jambor To: Mohamed Atef Cc: gcc@gcc.gnu.org Subject: Re: Beginning OpenMP Threads In-Reply-To: References: User-Agent: Notmuch/0.34.1 (https://notmuchmail.org) Emacs/27.2 (x86_64-suse-linux-gnu) Date: Mon, 07 Mar 2022 18:40:44 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2022 17:40:47 -0000 Hi, it's been a while since I had a serious look into libgomp... On Fri, Feb 25 2022, Mohamed Atef via Gcc wrote: > Hello everyone, > From OpenMP specs. > "The OpenMP implementation must execute ompd_bp_thread_begin at every > native-thread-begin and initial-thread-begin event. This execution occurs > before the thread starts > the execution of any OpenMP region" > > "When terminating an OpenMP thread, the implementation executes > ompd_bp_thread_end." > > are these team_start and team_end in team.c file? ...but - based on a rather quick look - while I think you correctly tracked down that gomp_team_start is the place actually creating the threads, I think that the OMPD implementation wants to execute the ompd_bp_thread_begin function for each thread and by the native (pthread) thread. And, as far as I can tell, that seems to be the function gomp_thread_start. At the moment I cannot quite tell if the end of the function would be a good place for the thread termination event - or rather if it is sufficient and there may be others, I would need to dig deeper. But perhaps this already help? Martin