(j3.2006) Integration of co-arrays with the intrinsic shift functions

Michael Ingrassia michaeli
Tue Jul 17 19:06:55 EDT 2007


>I don't see any deadlock issues?

Here's some pseudo-code ... that is,
I'm not sure whether it's Fortran 2008 or not ...
I'm guessing  that an implementation that relies on the phase of the moon
to decide which function to call first might have some deadlock problems.
Seems like if it's a problem for the language to solve then it might already
be a problem without changing the intrinsics?

	FUNCTION MY_RIGHT()
	INTEGER :: ME 
	ME = THIS_IMAGE()
	IF (ME < NUM_IMAGES())  THEN
		MY_RIGHT = ME+1
		SYNC IMAGES(MY_RIGHT)
	ELSE
		MY_RIGHT = ME+1
	END IF
	END FUNCTION
	
	FUNCTION MY_LEFT()
	INTEGER :: ME 
	ME = THIS_IMAGE()
	IF (ME > 1) THEN
		MY_LEFT = ME -1
		SYNC IMAGES(MY_LEFT)
	ELSE
		MY_LEFT = ME - 1
	END IF
	END FUNCTION

	PRINT *, 'I am image ', (MY_RIGHT()+MY_LEFT())/2
	END

	--Michael I.



More information about the J3 mailing list