Improve argument handling and clean up unecessary files
This commit is contained in:
27
run_simulation.py
Executable file
27
run_simulation.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from auto_namd.functions import *
|
||||
from auto_namd.job import get_next_job
|
||||
|
||||
|
||||
def main(**kwargs):
|
||||
|
||||
while True:
|
||||
job = get_next_job(kwargs['jobs_path'])
|
||||
job.simulate(kwargs['ffs_path'], kwargs['steps'], kwargs['namdbin'], kwargs['params'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
# Defaults
|
||||
args = {
|
||||
'jobs_path': ['/home/bryan/MD/CFTR/4-jobs', 'Number of timesteps to run'],
|
||||
'ffs_path': ['/home/bryan/MD/CFTR/0-forcefields', 'Location of the forcefield files'],
|
||||
'steps': [1000000, 'Number of timesteps to run the simulation'],
|
||||
'namdbin': ['namd2', 'Location of the namd2 executable'],
|
||||
'params': [f'+p{os.cpu_count() - 1}', 'Optional namd parameters']
|
||||
}
|
||||
|
||||
# Override defaults with user input
|
||||
args = sim_parser(args)
|
||||
main(**args)
|
||||
Reference in New Issue
Block a user