def basic_func(id):
np.random.seed()
model_name = "inception_v3"
file_path = "atc_exp/exp_settings/partition_info/compress/NS/" + \
"fine_grained/5G/" + model_name + "_NS_partition_info.xlsx"
data = pd.read_excel(file_path)[["p", "headroom", "thr"]]
idx = np.random.randint(0, len(data), frag_num)
model_list = data.iloc[idx].values
print(id, model_list)
exc = ProcessPoolExecutor(max_workers=5)
for id in range(5):
try:
exc.submit(basic_func,id)
#basic_func(id)
except Exception as e:
print(e)
exc.shutdown()
https://www.sicara.fr/blog/2019-01-28-how-computer-generate-random-numbers
python - Seeding random number generators in parallel programs - Stack Overflow