DaskCluster: a general dask wrapper for mintpy#357
Conversation
…ompted via object argument (default True)
…it_workers and compile_workers. Also added methods for closing cluster/client connections and moving out/err files.
…ew cluster abstraction. Moved old_cluster.py to legacy/.
|
@yunjunz @falkamelung I would have someone checkout this branch and test it on reasonably large dataset (AND LOOK AT THE RESULTS) to make sure it works as expected. I messed it up in a few places when I initially wrote it, which caused only part of the dataset to run correctly. Kilauea would be a good dataset to test on in my opinion. |
It's fine to remove the old version as it's in the git history.
+ move initiation and scale code to open() for a light weight __init()__ + simplify the submit_work() and collect_result() and add more content to run() + bring back the comments from old ifgram_inversion.py for book keeping + change the default value for config_name from 'no' to None in ifgram_inversion.py and False to None in template file, so that they are consistent.
|
From my testing with two datasets, the current memory usage is not quite as specified in the -r option. We need to re-check the following to make sure memorySize we input is the max memory the program is gonna use during the whole time period. This is important for job scheduling on HPC where control/check is more restrict.
|
|
On my laptop, when I have 2 ifgram_inversion.py running, the following message came out. I guess it's fine. The "6 workers" is a little bit weird, will check again in more details tomorrow (it was a bug, now it's fixed). FYI, I was running |
|
@Ovec8hkin could we remove the |
in utils1.check_template_auto_value()
ifgram_inversion: + add block-by-block writing for all output data. + move weight calculation before obs reading to reduce memory usage due to the internal float64 format while calculating weight. + remove obsolete write_aux2hdf5_file() writefile: + add write_hdf5_block() to support block-by-block writing.
Ovec8hkin
left a comment
There was a problem hiding this comment.
@yunjunz these changes to cluster.py use quite a few non-pythonic anti patterns that I think we should avoid. Namely, there doesn't need to be empty returns in most of the functions, and most of the variables do not need to be written as self.parameter_name, especially those that are simply computed and then used once within their own function (ie. self.futures, self.start_time_sub) Permission to clean this up?
This it probably due to how dask creates its worker |
add cluster to the module_hierarchy doc
|
Hi @Ovec8hkin, the Dask cluster port change message is fine as explained, so we can ignore it I think. For the variables in the cluster.py, if you find variables used once and can be cleaned, yes please. From my side, the last thing to check is the memory. With the default 4GB memory input, ifgram_inversion.py is actually using up to 10 GB in the process. We definitely want to avoid that. But this is not related to Dask, I guess we do that in another issue / pull request. The rest looks all good to me! |
following codacy's suggestion
|
Complexity increasing per file
==============================
- mintpy/ifgram_inversion.py 1
Complexity decreasing per file
==============================
+ mintpy/objects/cluster.py -5
Clones removed
==============
+ mintpy/ifgram_inversion.py -2
See the complete overview on Codacy |
yunjunz
left a comment
There was a problem hiding this comment.
All the tests look good and normal. After so many rounds of refactoring, I think now ifgram_inversion.py is the most beautiful script in this repo!
Generalized use of Dask with creation of DaskCluster object that handles cluster setup, client connections, and worker submission and processing (#354). This should make integrating dask into other scripts much easier.
And update the Dask performance figure of runtime vs number of cores (6 in #347).
Reminders
$MINTPY_HOME/test/test_smallbaselineApp.py