run_simulation.py 820 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. from auto_namd.functions import *
  3. from auto_namd.job import get_next_job
  4. def main(**kwargs):
  5. while True:
  6. job = get_next_job(kwargs['jobs_path'])
  7. job.simulate(kwargs['ffs_path'], kwargs['steps'], kwargs['namdbin'], kwargs['params'])
  8. if __name__ == '__main__':
  9. # Defaults
  10. args = {
  11. 'jobs_path': ['/home/bryan/MD/CFTR/4-jobs', 'Number of timesteps to run'],
  12. 'ffs_path': ['/home/bryan/MD/CFTR/0-forcefields', 'Location of the forcefield files'],
  13. 'steps': [1000000, 'Number of timesteps to run the simulation'],
  14. 'namdbin': ['namd2', 'Location of the namd2 executable'],
  15. 'params': [f'+p{os.cpu_count() - 1}', 'Optional namd parameters']
  16. }
  17. # Override defaults with user input
  18. args = sim_parser(args)
  19. main(**args)