Skip to content

IndexError: list index out of range from get_restart_pdb #34

@lee212

Description

@lee212

Describe the bug
I am reporting this first, there are 12 items in the list but the index seeks more than the actual size, e.g., 12, 13, 14, ... which generates the error:

Traceback (most recent call last):
  File "/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py", line 215, in <module>
    run_simulation(cfg)
  File "/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py", line 167, in run_simulation
    ctx = SimulationContext(cfg)
  File "/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py", line 28, in __init__
    self._init_workdir()
  File "/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py", line 67, in _init_workdir
    self._pdb_file = self._get_pdb_file()
  File "/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py", line 80, in _get_pdb_file
    outlier = self.api.get_restart_pdb(self.cfg.task_idx, self.cfg.stage_idx - 1)
  File "/jet/home/sanjrani/anaconda3/envs/conda-entk/lib/python3.7/site-packages/deepdrivemd/data/api.py", line 229, in get_restart_pdb
    print(data[index])
IndexError: list index out of range

To Reproduce
Steps to reproduce the behavior:

  1. HPC Platform
    PSC Bridges2

  2. Link to YAML configuration file
    https://github.com/DeepDriveMD/DeepDriveMD-pipeline/blob/feature/psc_bridges2/experiment/deepdrivemd_bridges.yaml

  3. Commands run ...

  4. Failed command

"/jet/home/sanjrani/DeepDriveMD-pipeline/deepdrivemd/sim/openmm/run_openmm.py" 
"-c" "/jet/home/sanjrani/test_sim_5/molecular_dynamics_runs/stage0001/task0014/stage0001_task0014.yaml"

Expected behavior
Check data size (if index < len(data)) before locating an index in the list.
or warning message to adjust incorrect parameters in the yaml configuration.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
1st iteration was finished successfully (16 num_tasks), and this error happened in the middle of 2nd iteration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions