-
Notifications
You must be signed in to change notification settings - Fork 96
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
Pyclaw hdf5 parallel read/write #528
Conversation
updating fork
…ith the 4D dimensions (for 3D datasets), where the global dimensions are num_eqn, nx, ny, nz. This makes the file compatable with the serial hdf5 output, and is also more user friendly for visualization. The processor ranges are for each dimension are retrieved with patch._da.getRanges()
…on filters with parallel h5py.
942bb4b
to
f1be4d8
Compare
f1be4d8
to
2fc6ca9
Compare
|
And so is the python bindings, nice! If no one else objects to the new inclusion of the |
@aymkhalil thanks for following up on this. Looks great! One comment: I noticed previously before this development that if one uses Petclaw, and has the serial hdf5 |
@@ -284,8 +317,41 @@ def check_diff(expected, test, **kwargs): | |||
else: | |||
raise Exception('Incorrect use of check_diff verifier, specify tol!') | |||
|
|||
|
|||
|
|||
def check_solutions_are_same(sol_a,sol_b): |
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.
Good idea; moving this to util.py makes sense to me.
@weslowrie is referring to issue #490. I agree that if one is using petclaw and requests HDF output, it should default to the parallel writer. This means that in solution.write(), we need to check whether the solution object is a pyclaw Solution or a petclaw Solution, and import the appropriate write function. @aymkhalil, can you add that logic? Meanwhile, in the serial HDF5 writer, we should check if it is a parallel run and if so throw a warning or exception. |
@weslowrie & @ketch, I see what you are saying and it makes sense. But what about the test cases? I followed the current testing theme: all tests are run from pyclaw (in serial) and then some utility functions generate variations to run the parallel tests based on function arguments (like use_petsc, in my case, it is file_format). If we were to omit the dedicated parallel hdf5p file_format and solely depend on the imported solution object, then we either need to write specific parallel tests under pyclaw directory (with the proper solution object imported), or maybe just move the parallel tests under petclaw directory and update .travis.yaml to run tests directly from there for the petclaw package test (which is inconsistent with what we already have), so what are your thoughts here? On a side note, are you fine with overriding the read() function in petclaw solution and have it import the proper parallel read/write functions instead of having pyclaw make the import decision for serial as well as parallel I/O? |
7df5f7d
to
0604218
Compare
|
On a side note, I noticed that sometimes, even though some tests fail, Travis reports a successful build (when TEST_PACKAGE="petclaw"): |
Does not seem like it. Are those somehow marked as skipped (I do not see that they are)? |
0604218
to
44c57e0
Compare
Nothing is skipped. They are just regular tests. However, I noticed that in .travis.yml, if I use:
instead of:
and some of the tests fail, Travis will correctly report failure. I included this modification, but I don't have a good explanation though. |
I'm guessing that it only checks the exit code of the last command. Which seems strange, but would explain what you see. |
elif len(patch.name) == 3: | ||
dset[:,r[0][0]:r[0][1],r[1][0]:r[1][1],r[2][0]:r[2][1]] = state.aux | ||
|
||
elif use_PyTables: |
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.
Let's just remove all the references to PyTables from this file.
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.
Done. Check bafefc7.
globalSize.append(state.num_aux) | ||
globalSize.extend(patch.num_cells_global) | ||
dset = subgroup.create_dataset('aux',globalSize,dtype='float',**options) | ||
if len(patch.name) == 1: |
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 would use patch.dimensions
here. Actually, I don't have any idea why patch.name
gives a list of the dimensions! @mandli ?
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.
Done. For example, check https://github.com/aymkhalil/pyclaw/blob/pyclaw_hdf5_parallel_write/src/petclaw/io/hdf5.py#L200.
Besides my relatively minor comments above, I think this PR looks good -- many thanks to @weslowrie and @aymkhalil . One last thing to consider is that this introduces a different mechanism for running the same tests in PyClaw and PetClaw without duplicating code. Previously we have done that through the |
44c57e0
to
bafefc7
Compare
@ketch Nope, I would love to remove |
That makes sense from some perspective, but I feel like it's more confusing than helpful. Having forgotten the original design, when I see Merging. |
This PR:
Please note that the tests could fail if we don't have parallel HDF5 on Travis.