Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
tphung3 committed Dec 16, 2024
1 parent 360ce50 commit eb0c670
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions parsl/executors/taskvine/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import uuid

from parsl.executors.taskvine import exec_parsl_function
from parsl.executors.taskvine.utils import VineTaskToParsl, run_parsl_function
from parsl.executors.taskvine.utils import VineTaskToParsl
from parsl.process_loggers import wrap_with_logs
from parsl.serialize import deserialize, serialize
from parsl.utils import setproctitle
Expand Down Expand Up @@ -141,6 +141,7 @@ def _deserialize_object_from_file(path):
obj = deserialize(f_in.read())
return obj


def _serialize_object_to_file(path, obj):
"""Serialize an object to the given file path."""
serialized_obj = serialize(obj)
Expand All @@ -149,6 +150,7 @@ def _serialize_object_to_file(path, obj):
while written < len(serialized_obj):
written += f_out.write(serialized_obj[written:])


@wrap_with_logs
def _taskvine_submit_wait(ready_task_queue=None,
finished_task_queue=None,
Expand Down Expand Up @@ -314,7 +316,8 @@ def _taskvine_submit_wait(ready_task_queue=None,
libs_installed[task.func_name] = lib_name
try:
# deserialize the arguments to the function call so they can be serialized again in TaskVine way.
# this double serialization hurts the performance of the system, but there's no way around it at the moment. Mark as TODO for future work.
# this double serialization hurts the performance of the system,
# but there's no way around it at the moment. Mark as TODO for future work.
all_args = _deserialize_object_from_file(task.argument_file)
args = all_args['args']
kwargs = all_args['kwargs']
Expand Down Expand Up @@ -458,10 +461,9 @@ def _taskvine_submit_wait(ready_task_queue=None,
try:
if t.successful():
_serialize_object_to_file(result_file, t.output)
except:
except Exception:
is_serverless_output_ok = False


# A tasks completes 'succesfully' if it has result file.
# A check whether the Python object represented using this file can be
# deserialized happens later in the collector thread of the executor
Expand Down
2 changes: 1 addition & 1 deletion parsl/executors/taskvine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self,
function_file: Optional[str], # pickled file containing the function information
argument_file: Optional[str], # pickled file containing the arguments to the function call
result_file: Optional[str], # path to the pickled result object of the function execution
function_context_file: Optional[list], # path to the pickled list of function context details for serverless functions
function_context_file: Optional[list], # path to the pickled list of function context details for serverless functions
cores: Optional[float], # number of cores to allocate
memory: Optional[int], # amount of memory in MBs to allocate
disk: Optional[int], # amount of disk in MBs to allocate
Expand Down

0 comments on commit eb0c670

Please sign in to comment.