Print

Print


> It might be of value if you could hint at _why_
> you want to be able to detect whether variable is in fact a coarray.

I have a choice in domain decomposition - I can either
1) use coarrays only for halos, or
2) use the whole model as a coarray variable.

Both options have merits.

Option (1) reduces demands for the amount of symmetric memory,
but requires an extra step in halo exchange (HX) - copy non-coarray
edges into coarray halos, then remote ops.

Option (2) makes it easier to do primitive single writer coarray IO
(because all model data, not just halos, is available to any image) 
+ halo exchange takes 1 step less, but on some systems (Cray) one
has to know in advance how much symmetric memory to ask for.

However, after HX, for local calculations on every image,
it makes no difference whether the image data is a coarray
or a non-coarray variable. 
So this makes it attractive to have a single routine doing local
processing and accepting both coarray and non-coarray actual arguments.

However, this does not work as soon as you want to pass such a
procedure to another procedure, because this requires explicit
interface.

I just wrote a module assuming option 1.
Now I want to extend it to allow for option 2 as well.
But it seems I have to replicate nearly the whole module
because I now pass a coarray variable between routines.

I was thinking of some sort of resolution, a bit
like a generic resolution, based on whether a passed
variable is a coarray or not.

Do I make any sense?

Anton