The thing is that:
def main_fun(x):
...
print(x)
if __name__ == "__main__":
with Pool(5) as pool:
pool.map(main_fun,range(10000))
pool.close()
pool.join()
My question is that: if I run the code on my own computer, it output subprocess print result. But when I submit it as a job to the cluster, I could not see the print result until the whole programs finished. How could I fix it? By the way, the cluster uses the Slurm.