Skip to content

Commit

Permalink
Removed memory function
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Nov 14, 2023
1 parent ad131ac commit 66b5d1e
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,15 @@ def trsh_ess_job(label: str,
logger_info.append('using a fine grid')

# Check if memory is in the keyword
ess_trsh_methods, trsh_keyword, memory, couldnt_trsh = trsh_keyword_memory(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh, servers[server], memory)
if 'too high' in ess_trsh_methods:
max_mem = server_mem.get('memory', 128)
if memory > memory_gb:
logger_info.append(f'using {memory} GB memory instead of {memory_gb} GB')
if 'Memory' in job_status['keywords'] and 'too high' not in job_status['error'] and server is not None:
# Increase memory allocation
couldnt_trsh = False
max_mem = servers[server].get('memory', 128) # Node memory in GB, defaults to 128 if not specified
memory = min(memory_gb * 2, max_mem * 0.95)
if memory > memory_gb:
logger.info(f'Troubleshooting {job_type} job in {software} for {label} using more memory: {memory} GB '
f'instead of {memory_gb} GB')
ess_trsh_methods.append('memory')

# Log information
if logger_info:
Expand Down Expand Up @@ -1601,15 +1605,3 @@ def trsh_keyword_unconverged(job_status, ess_trsh_methods, trsh_keyword, couldnt
else:
fine = False
return ess_trsh_methods, trsh_keyword, fine, couldnt_trsh

def trsh_keyword_memory(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh, servers, memory) -> bool:
"""
Check if the job requires more memory
"""
if 'Memory' in job_status['keywords'] and 'too high' not in job_status['error']:
# Increase memory allocation
memory = min(memory_gb * 2, max_mem * 0.95)
ess_trsh_methods.append('memory')

return ess_trsh_methods, trsh_keyword, memory, couldnt_trsh

0 comments on commit 66b5d1e

Please sign in to comment.