suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.

Home Page:http://www.netpyne.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug report] asd_parallel and optuna not working on Windows for batch simulations

josemendez-villanueva opened this issue · comments

commented

Running netpyne/examples/asdOptima/batch.py and netpyne/examples/optunaOptim/batch.py generate the following error:

AttributeError: module 'os' has no attribute 'setsid'

Both files in netpyne/netpyne/batch/asd_parallel.py and netpyne/netpyne/batch/optuna_parallel.py have this attribute 'setsid' that is not usable in Windows.

Pull Request #729

notes:
os is different for Windows. os.setsid does not exist in Windows.
preexec_fn=os.setsid now implemented by setting start_new_session=True
from the subprocess documentation

Note If you need to modify the environment for the child use the env parameter rather than doing it in a preexec_fn. The start_new_session and process_group parameters should take the place of code using preexec_fn to call os.setsid() or os.setpgid() in the child.

/bin/bash is not OS agnostic, and executer now specifies sh which should be a predefined alias if bash is supported

This should help windows users though WSL now available and may be preferred implementation.

So far, the new PR has been working. Will close for now and can reopen if issue reappears.