Initially, Sinergym was not designed to run multiple experiments in parallel on a single machine. The intended use was to run one experiment per machine.
However, running multiple experiments in parallel is a common use case that needs to be addressed. Parallelism can generally be applied to Sinergym using typical libraries like multiprocessing, as each execution is saved in a separate output folder, meaning there are no shared factors between processes that could cause errors.
There is one exception: the creation of output folder names. If two or more processes attempt to create the same folder simultaneously, this can result in errors due to the FileExistsError.
To Reproduce
You can test this by using multiprocessing to create many environments simultaneously. You will find that some folders may not be created, and you'll encounter this type of error:
Expected behavior
To resolve this, the critical section handling described earlier should ensure that all folders are created without issues.
Checklist
[x] I have checked that there is no similar issue in the repo (required)
Bug 🐛
Initially, Sinergym was not designed to run multiple experiments in parallel on a single machine. The intended use was to run one experiment per machine.
However, running multiple experiments in parallel is a common use case that needs to be addressed. Parallelism can generally be applied to Sinergym using typical libraries like
multiprocessing
, as each execution is saved in a separate output folder, meaning there are no shared factors between processes that could cause errors.There is one exception: the creation of output folder names. If two or more processes attempt to create the same folder simultaneously, this can result in errors due to the
FileExistsError
.To Reproduce
You can test this by using
multiprocessing
to create many environments simultaneously. You will find that some folders may not be created, and you'll encounter this type of error:Expected behavior
To resolve this, the critical section handling described earlier should ensure that all folders are created without issues.
Checklist
:pencil: Please, don't forget to include more labels besides
bug
if it is necessary.