-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec.py
More file actions
24 lines (22 loc) · 779 Bytes
/
exec.py
File metadata and controls
24 lines (22 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data_args = []
with open('metadata.txt') as f:
metadata = f.readlines()
for datum in metadata:
line_data = datum.split(';')
name = line_data[0]
target_file = f'img_rgb/{name}.rgb'
width = line_data[1]
lenght = line_data[2].replace('\n','')
data_args.append((target_file, width, lenght))
statements = []
executable_name = 'pixelate'
nchannels = 3
nprocessors = 4
window_width = 16
window_height = 16
for data in data_args:
statements.append(f'mpirun -np {nprocessors} {executable_name} {data[0]} {data[1]} {data[2]} {nchannels} {window_width} {window_height}')
with open(f'exec_{nprocessors}-{window_width}.sh', 'w') as f:
f.write('#!/bin/bash\n')
for statement in statements:
f.write(statement + '\n')