-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partitioner refactor 1 #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jwallwork23 . Looks good so far
|
||
// Create 2 dimensions | ||
// The values to be written are associated with the netCDF variable by | ||
// assuming that the last dimension of the netCDF variable varies fastest in | ||
// the C interface | ||
const int NDIMS = 2; | ||
const int NDIMS = 2; // TODO: Why redeclared? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It is also defined in Grid.cpp
. I think we will only ever work with a 2D landmask. So I don't know why it's defined so many times.
I am not suggesting to change as part of this PR but perhaps we can factor this out in the second round
} | ||
|
||
// There are two neighbours for each dimension | ||
const int NNBRS = NDIMS * 2; // TODO: Why redeclared? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess when we figure out the other one we can remove this too?
Thanks @TomMelt! |
A first refactoring of the
Partitioner
class.Main changes
get_top_neighbours
,get_bottom_neighbours
, etc. into a single method._0
or_1
into vectors.These changes cut down duplication and will make it easier to switch direction orderings.
Future work
Some of this gets propagated through to the
ZoltanPartitioner
class but it will need further refactoring. There is also further refactoring to be done handling the bounding boxes.