-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-matrix.py
33 lines (25 loc) · 809 Bytes
/
generate-matrix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
@file generate-data.py
@authors James Simmons, Leslie Horace
@brief script to automate data gathering, analysis, and plot creation
@version 1.0
"""
import os
import sys
import subprocess
def main():
if len(sys.argv) == 2:
mat_size = [int(x) for x in sys.argv[1].split(',')]
else:
mat_size = [250, 500, 750, 1000]
log_dir = './logs/'
if not os.path.exists(log_dir):
os.makedirs(log_dir)
script_log_path = log_dir+"generate_matrix_output.log"
logFile = open(script_log_path, 'w')
for s in mat_size:
make_data = subprocess.run(['./make-2d', str(s), str(s), f'mat-{str(s)}.dat'], stdout=subprocess.PIPE)
sub_output = make_data.stdout.decode()
logFile.writelines(sub_output)
logFile.close()
main()