(j3.2006) Finalization and STOP, ALL STOP

Bill Long longb at cray.com
Thu May 14 18:42:42 EDT 2009


Right.  For finalization we say this explicitly at 09-007r1[77:1-3]. 

NOTE TO Malcolm: In looking at the DEALLOCATE case, I noticed that 
09-007r1  [132:17-18, 6.7.3.1p6] and [133:23-24, 6.7.3.2p13] appear to 
be identical sentences.  I think the second one could be deleted.

Otherwise, deallocation looks OK.  In particular, you do not want to 
deallocate memory at a STOP or END PROGRAM statement, at least until 
after the global barrier is cleared, since other images might still want 
to access it.  In the case of ALL STOP, you don't care.  At that point 
the "deallocation" is happening at the OS level, and your entire memory 
image is wiped out.

Cheers,
Bill


 

Aleksandar Donev wrote:
> Van Snyder wrote:
>   
>> Should an allocatable object be deallocated when a STOP statement is
>> executed? 
>>     
> I believe the decision has been made for F2003, and we have not changed 
> it, that there is no duty to do deallocation and finalization upon STOP. 
> It would be difficult to do since one can do a STOP anywhere and there 
> may be many object lying around. By contrast, when you execute a RETURN 
> you know exactly which objects are in that local scope that may need to 
> be freed/finalized.
> ALL STOP is even worse---no cleanup of any sort is required.
> Aleks
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3
>   

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            



More information about the J3 mailing list