Skip to content
Discussion options

You must be logged in to vote

@TessellateDataScience I think the easiest would be to use AsyncFoamCase, which uses asyncio to be able to run multiple cases in parallel.

With AsyncFoamCase, you can launch as many cases as you have, and it will run as many of them concurrently as it can without oversubscribing the available CPUs.

Very basically it can look something like this:

import asyncio
from foamlib import AsyncFoamCase

cases = [AsyncFoamCase(path1), AsyncFoamCase(path2), …]

async def run_all():
    await asyncio.gather(*(case.run() for case in cases))

asyncio.run(run_all())

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TessellateDataScience
Comment options

Answer selected by TessellateDataScience
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants