This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran, 4.7] PR 18918 - Add initial support for a coarray communication library


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]