Skip to content

Commit 8a6335f

Browse files
committed
minor fixes
1 parent 4db8015 commit 8a6335f

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

workflowhub/generator/workflow/blast_recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def from_num_tasks(cls,
7474
to the total number of tasks provided.
7575
:rtype: BLASTRecipe
7676
"""
77-
if num_tasks < 6:
78-
raise ValueError("The upper bound for the number of tasks should be at least 6.")
77+
if num_tasks < 5:
78+
raise ValueError("The upper bound for the number of tasks should be at least 5.")
7979

8080
return cls(num_subsample=int(num_tasks - 3),
8181
data_footprint=None,

workflowhub/trace/logs/makeflow.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def _parse_workflow_file(self):
114114

115115
for file in itertools.chain(outputs, inputs):
116116
if not file in self.files_map:
117-
self.files_map[file] = {'task_name': None, 'children': [], 'file': None}
117+
self.files_map[file] = {'task_name': None, 'children': [], 'file': []}
118118

119119
elif len(line.strip()) > 0:
120120
# task execution command
@@ -161,20 +161,25 @@ def _create_files(self, files_list: List[str], link: FileLink, task_name: str):
161161
list_files = []
162162
for file in files_list:
163163
if self.files_map[file]['file']:
164-
list_files.append(self.files_map[file]['file'])
164+
list_files.append(
165+
self.files_map[file]['file'][0] if link == FileLink.INPUT else self.files_map[file]['file'][1])
165166
else:
166167
size = 0
167168
if os.path.isdir('{}/{}'.format(self.execution_dir, file)):
168169
size = sum(os.path.getsize(f) for f in os.listdir('.') if os.path.isfile(f))
169170
elif os.path.isfile('{}/{}'.format(self.execution_dir, file)):
170171
size = int(math.ceil(os.stat('{}/{}'.format(self.execution_dir, file)).st_size / 1000)) # B to KB
171172

172-
file_obj = File(name=file,
173-
size=size,
174-
link=link,
175-
logger=self.logger)
176-
list_files.append(file_obj)
177-
self.files_map[file]['file'] = file_obj
173+
file_obj_in = File(name=file,
174+
size=size,
175+
link=FileLink.INPUT,
176+
logger=self.logger)
177+
file_obj_out = File(name=file,
178+
size=size,
179+
link=FileLink.OUTPUT,
180+
logger=self.logger)
181+
list_files.append(file_obj_in if link == FileLink.INPUT else file_obj_out)
182+
self.files_map[file]['file'].extend([file_obj_in, file_obj_out])
178183

179184
# files dependencies
180185
if link == FileLink.INPUT:
@@ -201,7 +206,9 @@ def _parse_makeflow_log_file(self):
201206
elif line.startswith('# FILE') and not 'condorlog' in line:
202207
file_name = line.split()[3]
203208
if file_name in self.files_map:
204-
self.files_map[file_name]['file'].size = int(math.ceil(int(line.split()[5]) / 1000)) # B to KB
209+
size = int(math.ceil(int(line.split()[5]) / 1000)) # B to KB
210+
for file_obj in self.files_map[file_name]['file']:
211+
file_obj.size = size
205212

206213
def _parse_resource_monitor_logs(self):
207214
"""Parse the log files produced by resource monitor"""

0 commit comments

Comments
 (0)