From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12314 invoked by alias); 19 Mar 2011 21:09:00 -0000 Received: (qmail 12299 invoked by uid 22791); 19 Mar 2011 21:08:59 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Mar 2011 21:08:54 +0000 Received: from [192.168.178.22] (port-92-204-81-219.dynamic.qsc.de [92.204.81.219]) by mx01.qsc.de (Postfix) with ESMTP id F28AC3CB33; Sat, 19 Mar 2011 22:08:51 +0100 (CET) Message-ID: <4D851B63.7040905@net-b.de> Date: Sat, 19 Mar 2011 21:09:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7 MIME-Version: 1.0 To: Ralf Wildenhues CC: gfortran , gcc patches Subject: Re: [Patch, Fortran, 4.7] PR 18918 - Add initial support for a coarray communication library References: <4D84D875.9010501@net-b.de> <20110319172607.GA3407@troutmask.apl.washington.edu> <4D84EF5A.4060706@net-b.de> <20110319192450.GC30944@gmx.de> In-Reply-To: <20110319192450.GC30944@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg01212.txt.bz2 Hi Ralf, Ralf Wildenhues wrote: > Some MPI implementations require that the thread that called MPI_Init > also calls MPI_Finalize. How can this be ensured in this case? Well, the front-end only calls (via the wrapper) MPI_Finalize for STOP and at the end of the main program. However, the end of the main program cannot be present if the main program is not in Fortran - and if the main program is written in Fortran, it will be MPI_Init. And in case of STOP, if the program exits, there is no chance to leave invoke MPI_Finalize of the original thread. (STOP is the normal termination, ERROR STOP is the error termination.) Thus, I think the code is OK. Thanks for scrutinizing at the code. Tobias