suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
144 stars 135 forks source link

Changes to netpyne/batch/utils.py to make OS agnostic #729

Closed jchen6727 closed 1 year ago

jchen6727 commented 1 year ago

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