devito icon indicating copy to clipboard operation
devito copied to clipboard

Naming of global vs local methods

Open rhodrin opened this issue 3 years ago • 3 comments

Many concepts in Devito are 'global', but certain properties of Function's are not e.g. f.shape returns the local shape - f.shape_global is also present but elsewhere the opposite is true, e.g. for distributed SubDomain's I believe we have shape_local.

Since our philosophy is that moving from non-distributed to distributed is simply (as close to possible) flicking a switch we should update these: Function.shape -> Function.shape_local, Function.shape_global -> Function.shape etc.

rhodrin avatar Nov 06 '20 17:11 rhodrin

I think that makes sense to me, would make the API more uniform from user point of view

mloubout avatar Nov 06 '20 18:11 mloubout

indeed!

Now the question is what would break if we did that

  • internally, and
  • in all user codes running with MPI

There's a non negligible risk we would break some code

One thing we could do is finalising some of the big things we're working on (eg GPU support, Functions on subdomains), change this API, and burn Devito 5. (@ggorman )

A major change in version is probably necessary here

FabioLuporini avatar Nov 09 '20 09:11 FabioLuporini

From some grep'ing, would be a 'fairly' quick and easy change on our side - a few things need updating and a few tests fixing but wouldn't be too painful.

But as you mention, I think the big question is whose mpi code would this break?

rhodrin avatar Nov 09 '20 09:11 rhodrin