(j3.2006) finalizing undefined entities

Robert W. Numrich rwn
Tue Mar 18 19:31:16 EDT 2008


If the derived type contains an allocatable coarray component,
the finalizer will likely include a deallocate that will induce
an implicit synchronization.  Or the programmer might just
throw in a sync all into the finalizer.

This creates yet another hidden sync that will be very difficult to
debug when something goes wrong.

			-bob numrich


On Tue, Mar 18, 2008 at 08:00:57PM +0000, John Reid wrote:
> 
> 
> Michael Ingrassia wrote:
> 
> >>I would expect to 
> >>see statements that begin IF (ALLOCATED( ... or IF (ASSOCIATED ( pretty 
> >>often in a robust final routine.
> > 
> > 
> > But  ASSOCIATED(X) has no semantics if the pointer association status
> > of X is undefined, right?  So it can't be used for this purpose.
> > 
> > I agree that ALLOCATED( ... can, but does that mean that programmers
> > are limited to finalizing  
> > allocatable entities if they want robust finalizers?
> 
> 
> How about
> 
>          DEALLOCATE (pointer, stat=istat)
> 
> This would need to be done separately for each pointer; otherwise, there is no 
> certainty that each valid target is deallocated.
> 
> Cheers,
> 
> John.
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

-- 

			-bob numrich

--
Robert W. Numrich, PhD
Senior Research Associate
Minnesota Supercomputing Institute
465 Walter Library
117 Pleasant Street SE
Minneapolis, MN 55455

Tel:  612-624-4341



More information about the J3 mailing list