This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, 4.7] PR 18918 - Add initial support for a coarray communication library
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sat, 19 Mar 2011 20:24:51 +0100
- 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>
Hi Tobias,
> void
> _gfortran_caf_init (int *argc, char ***argv, int *this_image, int *num_images)
> {
> int flag;
>
> /* The following is only the case if one does not have a Fortran
> main program. */
> MPI_Initialized (&flag);
> if (!flag)
> MPI_Init (argc, argv);
[...]
> }
>
>
> /* Finalize coarray program. Note: This is only called before the
> program ends; thus the MPI_Initialized status of _gfortran_caf_init
> does not play a role. */
>
> void
> _gfortran_caf_finalize (void)
> {
> MPI_Win_free (&caf_world_window);
> MPI_Finalize ();
> }
Some MPI implementations require that the thread that called MPI_Init
also calls MPI_Finalize. How can this be ensured in this case?
(Sure is something that can be fixed later, but maybe it is not relevant
for this?)
Thanks,
Ralf