Skip to content

Commit

Permalink
PBS Memory Conversion (#633)
Browse files Browse the repository at this point in the history
Update the memory conversion for PBS in the adapter.py to accurately
request gb of memory instead of mb
  • Loading branch information
kfir4444 committed Apr 3, 2023
2 parents 6c7513e + 35e7ec6 commit 5ae999b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arc/job/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def set_cpu_and_mem(self):
self.submit_script_memory = math.ceil(total_submit_script_memory) # in MB
if cluster_software in ['pbs']:
# In PBS, "#PBS -l select=1:ncpus=8:mem=12000000" specifies the memory for all cores to be 12 MB.
self.submit_script_memory = math.ceil(total_submit_script_memory) * 1E6 # in Bytes
self.submit_script_memory = math.ceil(total_submit_script_memory) * 1E8 # in Bytes
elif cluster_software in ['slurm']:
# In Slurm, "#SBATCH --mem-per-cpu=2000" specifies the memory **per cpu/thread** to be 2000 MB.
self.submit_script_memory = math.ceil(total_submit_script_memory / self.cpu_cores) # in MB
Expand Down
2 changes: 1 addition & 1 deletion arc/job/adapter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_set_cpu_and_mem(self):
self.job_4.server = 'server3'
self.job_4.cpu_cores = None
self.job_4.set_cpu_and_mem()
expected_memory = math.ceil(14 * 1024 * 1.1) * 1E6
expected_memory = math.ceil(14 * 1024 * 1.1) * 1E8
self.assertEqual(self.job_4.submit_script_memory, expected_memory)
self.job_4.server = 'local'

Expand Down

0 comments on commit 5ae999b

Please sign in to comment.