Skip to content

Commit

Permalink
Remove unreachable condition when write host list (#512)
Browse files Browse the repository at this point in the history
Remove unreachable condition when write host list in mpi mode.
  • Loading branch information
abuccts authored Apr 12, 2023
1 parent 4c5417f commit 5a2addd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions superbench/common/utils/gen_traffic_pattern_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,14 @@ def gen_traffic_pattern_host_groups(host_list, pattern, mpi_pattern_path, benchm
logger.error('Unsupported traffic pattern: {}'.format(pattern.type))
host_groups = __convert_config_to_host_group(config, host_list)
# write traffic pattern host groups to specified path
if pattern.mpi_pattern:
with open(mpi_pattern_path, 'a') as f:
f.write('benchmark_name: {} pattern_type: {}'.format(benchmark_name, pattern.type) + '\n')
for host_group in host_groups:
row = []
for host_list in host_group:
group = ','.join(host_list)
row.append(group)
group = ';'.join(row)
f.write(group + '\n')
f.write('\n')
with open(mpi_pattern_path, 'a') as f:
f.write('benchmark_name: {} pattern_type: {}'.format(benchmark_name, pattern.type) + '\n')
for host_group in host_groups:
row = []
for host_list in host_group:
group = ','.join(host_list)
row.append(group)
group = ';'.join(row)
f.write(group + '\n')
f.write('\n')
return host_groups

0 comments on commit 5a2addd

Please sign in to comment.