(j3.2006) this_image( team=zzz), for zzz not current or an ancestor

Bill Long longb
Tue Jun 6 15:36:46 EDT 2017


> On May 31, 2017, at 4:38 AM, Anton Shterenlikht <mexas at BRIS.AC.UK> wrote:
> 
> use iso_fortran_env
> type( team_type ) :: team_new
> form team( 1 + mod(this_image(),2), team_new )
> print *, this_image( team_new )
> end
> 
> I think this program is not conforming because
> CD 16.9.190p3 [435:10-11] has:
> "TEAM ... scalar ... whose value identifies
> the current or an ancestor team."
> In this case team_new is neither.
> Correct?

Correct. 

> 
> Are implementers likely to issue a runtime error at this point?

Probably no compile time message.  This is a contrived example, but in general it is not possible at compile time to determine whether the team argument is for the current or an ancestor team. 

In terms of a runtime message, it depends on how teams are implemented, and the team_type data structure is defined, by the implementation.  If it is complete enough to supply the result of this_image, the this_image(team_new) reference might return the expected value with no message issued.  When you have a code construct that does not have semantics specified in the standard, the implementation can do anything, including treating it as an extension.  But you run the risk of the code being not portable.   Of course, the implementation can offer switches for various kinds of runtime checking (along the lines of array bounds checking), and might offer one for this case, even if it works as an extension.   The NAG compiler is usually a good candidate for this sort of robust diagnostic capability. 

Cheers,
Bill


> 
> Anton
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray Inc./ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425





More information about the J3 mailing list