0

A lot of answers say that I should put pool under a with statement, which I already have. I failed to find any related topics, let alone available solutions.

p.s.: I am spawning 100 processes (the n_games in the code) on a 48-core CPU in Linux.

The code is basically

with mp.Pool(mp.cpu_count() - 1) as pool:

    jobs = [pool.apply_async(
        game.start_play,
        (player1, player2, i % 2, 0)
    ) for i in range(n_games)]

    for job in jobs:
        win_cnt[job.get()] += 1

    pool.close()
    pool.join()
  • 3
    Check how many files your processes may open with [`ulimit -n`](https://stackoverflow.com/questions/34588/how-do-i-change-the-number-of-open-files-limit-in-linux/). You may need to increase that. – metatoaster May 27 '20 at 13:03
  • @metatoaster It says 1024. I don't know if it's sufficient. – Jonathan Cui May 27 '20 at 13:47

0 Answers0