-
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
Spawn many small reprojection tasks #41
Draft
drewoldag
wants to merge
12
commits into
main
Choose a base branch
from
issue/40/smaller-reproj-tasks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+650
−13
Draft
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b06b059
Initial commit to parallelize the reprojection step across many small…
drewoldag 47f1aaf
Adding a temporary testing workflow to prove out that the approach to…
drewoldag fb2b9a4
WIP - Expect several bugs, but need to test on Klone now.
drewoldag 5a40a35
Updates to workflow to support older version of parsl.
drewoldag f8f2b5f
Fixes to get workflow running on Klone.
drewoldag 5084621
Add relax=True
drewoldag bed7b54
Fix variable name typo.
drewoldag d703dff
Fix keyword typo.
drewoldag 8df4964
Merge branch 'issue/40/smaller-reproj-tasks' of https://github.com/di…
drewoldag e73e755
Fix another keyword typo.
drewoldag 9b16a9a
Include more parameters to align with what kbmod reproject.py is doing.
drewoldag c9efb14
Copying the WCS header info to the other layers in the fits shard.
drewoldag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading status checks…
WIP - Expect several bugs, but need to test on Klone now.
commit fb2b9a4b7a7ad89cffe7419aa94c1676d1639104
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from parsl import python_app | ||
from kbmod_wf.utilities.executor_utilities import get_executors | ||
|
||
|
||
@python_app( | ||
cache=True, executors=get_executors(["local_dev_testing", "large_mem"]), ignore_for_cache=["logging_file"] | ||
) | ||
def ic_to_wu_return_shards(inputs=(), outputs=(), runtime_config={}, logging_file=None): | ||
"""This app will call the ic_to_wu function to convert a given ImageCollection | ||
file into a WorkUnit file. | ||
Parameters | ||
---------- | ||
inputs : tuple, optional | ||
A tuple with a single parsl.File object that references the ImageCollection | ||
file, by default () | ||
outputs : tuple, optional | ||
A tuple with a single parsl.File object that references the output WorkUnit | ||
file, by default () | ||
runtime_config : dict, optional | ||
A dictionary of configuration setting specific to this task, by default {} | ||
logging_file : parsl.File, optional | ||
The parsl.File object the defines where the logs are written, by default None | ||
Returns | ||
------- | ||
parsl.File | ||
The file object that points to the WorkUnit file that was created. | ||
""" | ||
from pathlib import Path | ||
from kbmod_wf.utilities.logger_utilities import get_configured_logger, ErrorLogger | ||
|
||
logger = get_configured_logger("task.ic_to_wu", logging_file) | ||
|
||
from kbmod_wf.task_impls.ic_to_wu import ic_to_wu | ||
|
||
logger.info("Starting ic_to_wu") | ||
with ErrorLogger(logger): | ||
_, wcs = ic_to_wu( | ||
ic_filepath=inputs[0].filepath, | ||
wu_filepath=outputs[0].filepath, | ||
runtime_config=runtime_config, | ||
logger=logger, | ||
) | ||
logger.info("Completed ic_to_wu") | ||
|
||
# get parent directory of outputs[0] and fine all .wu files in that directory | ||
shard_files = [s for s in Path(outputs[0]).parent.glob("*.wu")] | ||
|
||
# remove the original .wu file from the shard_files list | ||
shard_files = [f for f in shard_files if f != outputs[0]] | ||
|
||
return shard_files, wcs |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If this PR is ultimately merged to
main
, we should delete this file. I only created it initially to ensure that using Futures in a specific way would not block the workflow. Specifically on line 217 of this file, the input for the next task is defined as[i.result() for i in list_of_futures]
.