Skip to content

Commit

Permalink
mqsub_aqua: Clean up RAM:CPU ratio.
Browse files Browse the repository at this point in the history
  • Loading branch information
wwood committed Jan 30, 2025
1 parent 1d517c1 commit 27ffbb8
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions bin/mqsub_aqua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import time
from smtplib import SMTP
import datetime

DEFAULT_RAM_TO_CPU_RATIO = 1495.0 / 192.0

## Code below copied from the extern python package. Copy the code here so there are no dependencies.

def run(command, stdin=None):
Expand Down Expand Up @@ -343,9 +345,10 @@ Example usage:
#parser.add_argument('--version', help='output version information and quit', action='version', version=repeatm.__version__)
parser.add_argument('--quiet', help='only output errors', action="store_true")
parser.add_argument('-t','--cpus',default=1,type=int, help="Number of CPUs to queue job with [default: 1]")
parser.add_argument('-g','--gpu',type=int,default=0, help="Number of GPUs to use [default: 0]")
parser.add_argument('-g','--gpu',type=int,default=0, help="Number of GPUs to use [default: 0]")
ram_ratio = round(DEFAULT_RAM_TO_CPU_RATIO, 2)
parser.add_argument('-m','--mem','--ram',type=int, help=f"GB of RAM to ask for [default: num_cpus*{ram_ratio} rounded down to the nearest GB]")
parser.add_argument('--array', help="Submit as an array job with the given number of tasks [default: Not used]")
parser.add_argument('-m','--mem','--ram',type=int, help="GB of RAM to ask for [default: 8*num_cpus]")
parser.add_argument('--directive', help="Arbitrary PBS directory to add e.g. '-l ngpus=1' to ask for a GPU [default: Not used]")
parser.add_argument('-q','--queue', default='aqua', help="Name of queue to send to [default: aqua]")
walltime_group = parser.add_mutually_exclusive_group()
Expand Down Expand Up @@ -422,7 +425,7 @@ Further information can also be found in the CMR Compute Notes - https://tinyur
sys.stderr.write('\n###################################################################\n\n')

if args.mem is None:
mem = int(7.8125*args.cpus)
mem = int(DEFAULT_RAM_TO_CPU_RATIO*args.cpus)
else:
mem = args.mem
if mem < 8 and args.queue == 'lyra' and (args.scratch_data or args.run_tmp_dir):
Expand All @@ -438,24 +441,7 @@ Further information can also be found in the CMR Compute Notes - https://tinyur
hours = args.hours
if hours > 48:
logging.warning("The requested walltime is greater than 48 hours. Truncating to 48 since aquarius cannot currently handle longer running jobs.")
hours = 48

if args.mem is not None and args.cpus is not None:
if args.mem > 250 and args.cpus/124 != args.mem/1000 :
sys.stderr.write('\n#######################################################################################################')
sys.stderr.write('\nWARNING: The number of CPUs is not scaled to the amount of RAM')
sys.stderr.write('\nGiven each node has 124 CPUs and ~1000 GB RAM, some properly scaled examples are:')
sys.stderr.write('\n31 CPU + 250 RAM | 62 CPU + 500 RAM | 93 CPU and 750 RAM')
sys.stderr.write('\ni.e. 25% of the CPUs should typically be matched with 25% of the RAM, on so on')
sys.stderr.write('\nThis helps ensure that resources are fully utilised when all the CPU or RAM of a node has been reserved')
sys.stderr.write('\n#######################################################################################################\n\n')
if args.mem is not None:
if args.mem == 128 or args.mem == 256 or args.mem == 512 or args.mem == 768:
sys.stderr.write('\n##############################################################################################################')
sys.stderr.write('\nWARNING: An inefficient amount of RAM has been requested')
sys.stderr.write('\nGiven each node has ~1000 GB RAM, using the following RAM amount enables jobs to fit onto a nodes more easily:')
sys.stderr.write('\n125 GB | 250 GB | 500 GB | 750 GB')
sys.stderr.write('\n##############################################################################################################\n\n')
hours = 48

whoami = getpass.getuser()
email = '{}@qut.edu.au'.format(whoami)
Expand Down

0 comments on commit 27ffbb8

Please sign in to comment.