Skip to content

Commit

Permalink
Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Oct 30, 2024
1 parent 45be0ac commit 509b6e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 11 additions & 1 deletion arc/job/adapters/ts/heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ def combine_coordinates_with_redundant_atoms(xyz_1: Union[dict, str],

a = mol_1.atoms.index(list(mol_1.atoms[h1].edges.keys())[0])
b = mol_2.atoms.index(list(mol_2.atoms[h2].edges.keys())[0])

#log if a and b are different from prev step
logger.info(f'Combining coordinates with redundant atoms for atoms A ({a}) and B ({b})')
if c == a:
raise ValueError(f'The value for c ({c}) is invalid (it represents atom A, not atom C)')
if d == b:
Expand Down Expand Up @@ -1054,7 +1057,14 @@ def h_abstraction(arc_reaction: 'ARCReaction',

val_inc = - 1 if h2 < b else 0

b_atom = len(arc_reactant.get_xyz()['symbols']) + b + val_inc
b_atom = len(arc_product.get_xyz()['symbols']) + b + val_inc

# log info a, b, h1, h2, b_atom, a_atom, h_atom, val_inc
logger.info(f'a: {a}, b: {b}, h1: {h1}, h2: {h2}, b_atom: {b_atom}, a_atom: {a_atom}, h_atom: {h_atom}, val_inc: {val_inc}')
# log len of arc_product.get_xyz()['symbols']
logger.info(f"len of arc_product.get_xyz()[\'symbols\']: {len(arc_product.get_xyz()['symbols'])}")
# log len of arc_reactant.get_xyz()['symbols']
logger.info(f"len of arc_reactant.get_xyz()[\'symbols\']: {len(arc_reactant.get_xyz()['symbols'])}")

xyz_guess = crest_ts_conformer_search(xyz_guesses_crest, a_atom, h_atom, b_atom, path=path)
if xyz_guess is not None:
Expand Down
5 changes: 3 additions & 2 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,14 +981,15 @@ def trsh_ess_job(label: str,
elif 'Memory' in job_status['keywords'] and 'too high' in job_status['error'] and server is not None:
# Reduce memory allocation by 80%, rounded to the nearest 5 GB increment
couldnt_trsh = False
reduced_memory = max(20, round(memory_gb * 0.8 / 5) * 5) # Ensure reduction, rounded to nearest 5 GB, with 20 GB minimum

reduced_memory = max(4, round(memory_gb * 0.8 / 5) * 5) # Ensure reduction, rounded to nearest 5 GB, with 20 GB minimum
logger.info(f'Troubleshooting {job_type} job in {software} for {label} using less memory: {reduced_memory} GB '
f'instead of {memory_gb} GB')

# Check for existing 'waste_memory_' entries and calculate next reduction level
if f'waste_memory_{reduced_memory}' not in ess_trsh_methods:
ess_trsh_methods.append(f'waste_memory_{reduced_memory}')
memory_gb = reduced_memory # Update memory to the reduced value for next iteration
memory = reduced_memory # Update memory to the reduced value for next iteration
else:
couldnt_trsh = True
logger.info(f'{logger_phrase} was unsuccessful. No further reductions possible without reaching threshold.')
Expand Down

0 comments on commit 509b6e8

Please sign in to comment.