from sh import Command
from collections import defaultdict

priority = Command('./priority')

results = defaultdict(list)

no=0
for cpu in [0.25, 0.5, 0.75, 0.9]:
    for io in [0.25, 0.5, 0.75, 0.9]:
        for mem in [0.25, 0.5, 0.75, 0.9]:
            for n_try in [2, 5, 10]:
                for processes in [10, 50, 100]:
                    for n in range(20):
                        no += 1
                        print(f"Run {no}")
                        results[(cpu, io, mem, n_try, processes)].append(priority('-c', cpu, '-i', io, '-m', mem, '-n', n_try, '-p', processes))
                        

print(str(results[(0.25, 0.25, 0.25, 2, 10)]))

import pickle

with open('output.pickle', 'wb') as f:
    pickle.dump( results, f)
