Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving KeyError: '0' when attempting arcrestart #623

Closed
calvinp0 opened this issue Mar 25, 2023 · 4 comments · Fixed by #626
Closed

Receiving KeyError: '0' when attempting arcrestart #623

calvinp0 opened this issue Mar 25, 2023 · 4 comments · Fixed by #626

Comments

@calvinp0
Copy link
Member

calvinp0 commented Mar 25, 2023

Describe the bug

Conformer number 0 for species r_173_C[C][C]c1ccccc1 is used for geometry optimization.
Running local queue job opt_a12766 using gaussian for r_173_C[C][C]c1ccccc1
Traceback (most recent call last):
  File "/Local/ce_dana/Code/ARC//ARC.py", line 69, in <module>
    main()
  File "/Local/ce_dana/Code/ARC//ARC.py", line 65, in main
    arc_object.execute()
  File "/Local/ce_dana/Code/ARC/arc/main.py", line 583, in execute
    fine_only=self.fine_only,
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 484, in __init__
    self.schedule_jobs()
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 499, in schedule_jobs
    self.run_opt_job(species.label, fine=self.fine_only)
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 1115, in run_opt_job
    job_type='opt', fine=fine)
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 831, in run_job
    self.save_restart_dict()
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 3469, in save_restart_dict  
    for job_name in self.running_jobs[spc.label] if 'tsg' in job_name]
  File "/Local/ce_dana/Code/ARC/arc/scheduler.py", line 3469, in <listcomp>
    for job_name in self.running_jobs[spc.label] if 'tsg' in job_name]
KeyError: 0

How to reproduce
This is a 20 reaction list I am using and had to restart after an issue in the initial run. When attempting to arcrestart, I receive this error.

Additional Context
Uncertain if this is also related to this: #622?

Here is the restart.yml

restart.zip

@calvinp0
Copy link
Member Author

calvinp0 commented Mar 26, 2023

[self.job_dict[spc.label]['tsg'][get_i_from_job_name(job_name)].as_dict()
                           for job_name in self.running_jobs[spc.label] if 'tsg' in job_name]

In this line of code, when get_i_from_job_name(job_name) is returning 0, which appears to be expected.

However, self.job_dict[spc.label]['tsg'] returns this:

{'tsg0': <arc.job.adapters.ts...4ac054890>, 1: <arc.job.adapters.ts...4ac0549d0>}

As we can see, it has kept 'tsg' in the key.

Going back further for self.job_dict[spc.label], we get:

{'tsg': {'tsg0': <arc.job.adapters.ts...4ac054890>, 1: <arc.job.adapters.ts...4ac0549d0>}}

@alongd
Copy link
Member

alongd commented Mar 26, 2023

Good catch! Can you see where self.job_dict[spc.label] is initialized for transition state guesses (tsg)?

@calvinp0
Copy link
Member Author

Okay, so moving far enough back, I have found the issue:

In the restart file, here is an example of TS

running_jobs:
  TS0:
  - args:
      block: {}
      keyword: {}
      trsh: {}
    constraints: []
    cpu_cores: 8
    ess_settings: *id002
    execution_type: incore
    initial_time: '2023-03-25 12:27:55.256610'
    job_adapter: heuristics
    job_id: 12224
    job_memory_gb: 7.0
    job_name: tsg0
    job_num: 12224
    job_server_name: a12224
    job_status:
    - done
    - error: ''
      keywords: []
      line: ''
      status: done
    job_type: tsg
    level: null
    max_job_time: 120
    project: arc_ll_hab
    project_directory: /storage/ce_dana/calvinp/runs/nn_arc/low_level/20_rows_171_to_190
    reaction_indices:
    - 0
  - args:
      block: {}
      keyword: {}
      trsh: {}
    constraints: []
    cpu_cores: 8
    ess_settings: *id002
    execution_type: incore
    initial_time: '2023-03-25 12:28:04.085632'
    job_adapter: autotst
    job_id: 12225
    job_memory_gb: 7.0
    job_name: tsg1
    job_num: 12225
    job_server_name: a12225
    job_status:
    - done
    - error: ''
      keywords: []
      line: ''
      status: done
    job_type: tsg
    level: null
    max_job_time: 120
    project: arc_ll_hab
    project_directory: /storage/ce_dana/calvinp/runs/nn_arc/low_level/20_rows_171_to_190
    reaction_indices:
    - 0
    tsg: 1

Notice that for tsg1 it has tsg: 1 as a key and value, BUT in tsg0, it has no such key or value.

@calvinp0
Copy link
Member Author

At this line

if self.tsg:

When it has tsg=0 it will interpret it as false, thus not meeting the condition

@calvinp0 calvinp0 linked a pull request Mar 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants