Skip to content
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

Add complete_check_at_run parameter #333

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

mski-iksm
Copy link
Contributor

@mski-iksm mski-iksm commented Nov 9, 2023

What is this?

TaskOnKart.complete_check_at_run is a parameter to control whether to check completed cache file existence at TaskOnKArt.run().
If complete_check_at_run==True, when the worker attempt to run the task, it will check the cache file existence, and if exists, run() will be skipped.

Why is this needed?

In the original code, complete check is only evaluated at task scheduling, which is at the very beginning.
However, cache status may change when it comes to run().

This often happens when jobs in multiple nodes runs the same task.
When node1 and node2 runs the same task, the first finished node will create the completed cache, but the other node may rerun the task and recreate the same cache file.

It is okay to run same task again, but it is not efficient.
To prevent running the completed task again, I've implemented TaskOnKart.complete_check_at_run option.

Comment on lines +93 to +94
if self.complete_check_at_run:
self.run = task_complete_check_wrapper(run_func=self.run, complete_check_func=self.complete)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mski-iksm What will the log look like?

I'm wondering if we should add a log that shows what I skipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hi-king Hi-king force-pushed the feature/add_exist_check_at_run branch from 81ddaaa to 115280d Compare November 21, 2023 05:05
@Hi-king Hi-king enabled auto-merge (squash) November 21, 2023 05:06
@Hi-king
Copy link
Member

Hi-king commented Nov 21, 2023

@mski-iksm THX!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants