Skip to content

Commit

Permalink
deploy: 2b5e18d
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Nov 28, 2023
1 parent 774fd59 commit 7b2f7d7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions _modules/arc/job/trsh.html
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ <h1>Source code for arc.job.trsh</h1><div class="highlight"><pre>
<span class="n">logger_info</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">fine</span> <span class="o">=</span> <span class="kc">False</span>

<span class="n">attempted_ess_trsh_methods</span> <span class="o">=</span> <span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">ess_trsh_methods</span> <span class="k">else</span> <span class="kc">None</span>
<span class="c1"># Check if Checkfile removal is in the keywords. Removal occurs when:</span>
<span class="c1"># - Basis Set Mismatch</span>
<span class="c1"># - Corrupt or Incomplete Data</span>
Expand All @@ -1041,8 +1041,8 @@ <h1>Source code for arc.job.trsh</h1><div class="highlight"><pre>

<span class="c1"># Check if SCF is in the keyword</span>
<span class="n">ess_trsh_methods</span><span class="p">,</span> <span class="n">trsh_keyword</span><span class="p">,</span> <span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="n">trsh_keyword_scf</span><span class="p">(</span><span class="n">job_status</span><span class="p">,</span> <span class="n">ess_trsh_methods</span><span class="p">,</span> <span class="n">trsh_keyword</span><span class="p">,</span> <span class="n">couldnt_trsh</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;scf=(NDump=30)&#39;</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">logger_info</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;using scf=(NDump=30)&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;scf=(NDamp=30)&#39;</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">logger_info</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;using scf=(NDamp=30)&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;scf=(qc)&#39;</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">logger_info</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;using scf=(qc)&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;scf=(NoDIIS)&#39;</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
Expand All @@ -1058,6 +1058,7 @@ <h1>Source code for arc.job.trsh</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">fine</span><span class="p">:</span>
<span class="n">logger_info</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;using a fine grid&#39;</span><span class="p">)</span>


<span class="c1"># Check if memory is in the keyword</span>
<span class="k">if</span> <span class="s1">&#39;Memory&#39;</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;keywords&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="s1">&#39;too high&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;error&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="n">server</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="c1"># Increase memory allocation</span>
Expand All @@ -1068,8 +1069,15 @@ <h1>Source code for arc.job.trsh</h1><div class="highlight"><pre>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Troubleshooting </span><span class="si">{</span><span class="n">job_type</span><span class="si">}</span><span class="s1"> job in </span><span class="si">{</span><span class="n">software</span><span class="si">}</span><span class="s1"> for </span><span class="si">{</span><span class="n">label</span><span class="si">}</span><span class="s1"> using more memory: </span><span class="si">{</span><span class="n">memory</span><span class="si">}</span><span class="s1"> GB &#39;</span>
<span class="sa">f</span><span class="s1">&#39;instead of </span><span class="si">{</span><span class="n">memory_gb</span><span class="si">}</span><span class="s1"> GB&#39;</span><span class="p">)</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;memory&#39;</span><span class="p">)</span>
<span class="c1"># Log information</span>
<span class="k">if</span> <span class="n">logger_info</span><span class="p">:</span>

<span class="k">if</span> <span class="n">attempted_ess_trsh_methods</span><span class="p">:</span>
<span class="k">if</span> <span class="n">attempted_ess_trsh_methods</span> <span class="o">==</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">logger_phrase</span><span class="si">}</span><span class="s1"> was not successful. Already attempted all possible troubleshooting methods. Will not troubleshoot again.&#39;</span><span class="p">)</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">logger_info</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">logger_phrase</span><span class="si">}</span><span class="s1"> </span><span class="si">{</span><span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">logger_info</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">logger_info</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">logger_phrase</span><span class="si">}</span><span class="s1"> </span><span class="si">{</span><span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">logger_info</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>

<span class="k">elif</span> <span class="n">software</span> <span class="o">==</span> <span class="s1">&#39;qchem&#39;</span><span class="p">:</span>
Expand Down Expand Up @@ -1758,13 +1766,17 @@ <h1>Source code for arc.job.trsh</h1><div class="highlight"><pre>
<span class="c1"># try both qc and nosymm</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;scf=(qc)&#39;</span><span class="p">)</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">elif</span> <span class="s1">&#39;SCF&#39;</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;keywords&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="s1">&#39;scf=(NDump=30)&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="k">elif</span> <span class="s1">&#39;SCF&#39;</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;keywords&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="s1">&#39;scf=(NDamp=30)&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="c1"># Switching off Pulay&#39;s Direct Inversion</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;scf=(NDump=30)&#39;</span><span class="p">)</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;scf=(NDamp=30)&#39;</span><span class="p">)</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">elif</span> <span class="s1">&#39;SCF&#39;</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;keywords&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="s1">&#39;scf=(NoDIIS)&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;scf=(NoDIIS)&#39;</span><span class="p">)</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">elif</span> <span class="s1">&#39;SCF&#39;</span> <span class="ow">in</span> <span class="n">job_status</span><span class="p">[</span><span class="s1">&#39;keywords&#39;</span><span class="p">]</span> <span class="ow">and</span> <span class="s1">&#39;guess=INDO&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">:</span>
<span class="n">ess_trsh_methods</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;guess=INDO&#39;</span><span class="p">)</span>
<span class="n">couldnt_trsh</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">trsh_keyword</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;guess=INDO&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="s1">&#39;scf&#39;</span> <span class="ow">in</span> <span class="n">keyword</span> <span class="k">for</span> <span class="n">keyword</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">):</span>
<span class="n">scf_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">match</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span> <span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="n">scf_pattern</span><span class="p">,</span> <span class="n">element</span><span class="p">)]</span> <span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">scf_pattern</span><span class="p">,</span> <span class="n">element</span><span class="p">)</span> <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">ess_trsh_methods</span><span class="p">)</span> <span class="k">else</span> <span class="p">[]</span>
<span class="n">trsh_keyword</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;scf=(&#39;</span> <span class="o">+</span> <span class="s1">&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">scf_list</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">)</span>
Expand Down

0 comments on commit 7b2f7d7

Please sign in to comment.