[J3] Type Finalization and Coarrays - a possible interp

Brad Richardson everythingfunctional at protonmail.com
Wed May 24 19:48:19 UTC 2023


Hi all,

My understanding is that we want to get Fortran 2023 published before
accepting any more interps, but I found something that may warrant one
when we're ready for them.

In 7.5.6.2 The finalization process, there are a couple of statements
that I think are worth making more strict for program correctness
reasons.

> All finalizable components that appear in the type definition are
finalized in a processor-dependent order.

> If several entities are to be finalized as a consequence of an event
specified in 7.5.6.3, the order in which they are finalized is
processor dependent.

> Note 1: An implementation might need to ensure that when an event
causes more than one coarray to be deallocated, they are deallocated in
the same order on all images in the current team.

The issue is that I see nowhere (and maybe I just missed it) that
collective procedures or image control statements are prohibited from
final subroutines. The above statements allow the processor to possibly
choose order that would cause the collective procedures or image
control statements to be executed in a non-coherent way (i.e.
finalizers are called in a different order on different images).

IMO Note 1 should be made normative text that states

If an event causes more than one coarray to be deallocated, they shall
be deallocated in the same order on all images in the current team.

It is probably also worth adding verbage to the effect of that while
the order of components and entities to be finalized is processor
dependent, the order of component finalization shall be the same every
time a type is finalized and that the order of entities to be finalized
shall be the same every time a particular event occurs.

What do you all think?

Regards,
Brad Richardson



More information about the J3 mailing list