Skip to content

Commit

Permalink
Bug--
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Dec 17, 2024
1 parent 3ea1ef5 commit e73d2ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions wrench/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self, simulation: Simulation, workflow: Workflow, name: str) -> Non
self.min_num_cores = None
self.max_num_cores = None
self.memory = None
self.input_files = []
self.output_files = []
self.input_files = None
self.output_files = None

class TaskState(Enum):
NOT_READY = 0
Expand Down Expand Up @@ -74,6 +74,8 @@ def add_input_file(self, file: File) -> None:
:type file: File
"""
self._simulation._add_input_file(self, file)
if self.input_files is None:
self.input_files = []
self.input_files.append(file)

def add_output_file(self, file: File) -> None:
Expand All @@ -83,6 +85,8 @@ def add_output_file(self, file: File) -> None:
:type file: File
"""
self._simulation._add_output_file(self, file)
if self.output_files is None:
self.output_files = []
self.output_files.append(file)

def get_input_files(self) -> List[File]:
Expand All @@ -91,17 +95,19 @@ def get_input_files(self) -> List[File]:
:return: List of input file names
:rtype: List[File]
"""
if self.input_files is None:
self.input_files = self._simulation._get_task_input_files(self)
return self.input_files
# return self._simulation._get_task_input_files(self)

def get_output_files(self) -> List[File]:
"""
Get the list of output files for this task
:return: List of output file names
:rtype: List[File]
"""
if self.output_files is None:
self.output_files = self._simulation._get_task_output_files(self)
return self.output_files
# return self._simulation._get_task_output_files(self)

def get_flops(self) -> float:
"""
Expand Down

0 comments on commit e73d2ad

Please sign in to comment.