Skip to content

Commit

Permalink
Minor cosmetic updates and fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jithunnair-amd committed Feb 9, 2021
1 parent b16b4b9 commit f833838
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions rccl_nccl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,25 @@ def parse_nccl_log(nccl_lines):
return commands

def generate_script(commands, output_script):
fs = open(output_script + ".sh", "w")
filename = output_script + ".sh"
fs = open(filename, "w")
for j in range(len(commands)):
fs.write(commands[j])
fs.write("\n")
fs.close()
print("INFO: Dumped out the commands in a script named: {}".format(output_script))
print("INFO: Dumped out the commands in a script named: {}".format(filename))

def dump_counts_map(counts_map, output_file):
fs = open(output_file + ".csv", 'w')
filename = output_file + ".csv"
fs = open(filename, 'w')
fs.write("sep=|")
fs.write("\n")
keys = counts_map.keys()
for key in keys:
fs.write(key + "|" + str(counts_map[key]))
fs.write("\n")
fs.close()
print ("INFO: Done dumping the count map of each command.")
print ("INFO: Dumped out the count of each command in a file named: {}".format(filename))

def get_unique_commands(commands_and_nranks):
unique_values = []
Expand Down
10 changes: 5 additions & 5 deletions run_parser_and_generate_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def main():
os.system("cp net_unique.sh " + rccl_tests_path)
#os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "rccl-tests"))
os.chdir(rccl_tests_path)
os.system("cd rccl-tests")
if os.system("./install.sh"):
if os.system("./install.sh > /dev/null 2>&1"):
print("ERROR: Failed to install rccl-tests.")
sys.exit(1)

os.system("cat net_unique.sh")
run_script_cmd = "sh net_unique.sh | tee rccl_perf_log.txt"
if os.system(run_script_cmd):
print ("ERROR: Unalbe to run rccl-tests properly.")
print ("ERROR: Unable to run rccl-tests properly.")
sys.exit(1)
os.system("mv rccl_perf_log.txt ../")
os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
Expand All @@ -38,16 +38,16 @@ def main():
nccl_tests_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "nccl-tests")
os.system("cp net_unique.sh " + nccl_tests_path)
os.chdir(nccl_tests_path)
if os.system("make"):
if os.system("make > /dev/null 2>&1"):
print ("ERROR: Failed to install nccl-unit tests")
sys.exit(1)

os.system("cat net_unique.sh")
run_script_cmd = "sh net_unique.sh | tee nccl_perf_log.txt"
if os.system(run_script_cmd):
print ("ERROR: unable to run nccl-tests")
sys.exit(1)
os.system("mv nccl_perf_log.txt ../")
#os.system("cd ../")
os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))

summary_cmd = "python generate_summary.py --log-file nccl_perf_log.txt --script-file net_unique.sh --output-file-name nv_net_summary --count-file net_counts.csv"
Expand Down

0 comments on commit f833838

Please sign in to comment.