From 5a2adddc51f07290fd0a85b00c645de888485f1f Mon Sep 17 00:00:00 2001 From: Yifan Xiong Date: Wed, 12 Apr 2023 11:55:02 +0800 Subject: [PATCH] Remove unreachable condition when write host list (#512) Remove unreachable condition when write host list in mpi mode. --- .../utils/gen_traffic_pattern_config.py | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/superbench/common/utils/gen_traffic_pattern_config.py b/superbench/common/utils/gen_traffic_pattern_config.py index 97864784c..84a2e65d0 100644 --- a/superbench/common/utils/gen_traffic_pattern_config.py +++ b/superbench/common/utils/gen_traffic_pattern_config.py @@ -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