Skip to content

Memory and Runtime Requirements

Why should you specify memory and runtimes for your jobs? Because the cluster scheduler needs this information to ensure your job can complete and can be allowed to run as soon as possible...

Memory requirements

By specifying how much memory your task needs the scheduler can fit your task onto otherwise partially used compute nodes in the most efficient manner and ensure that your job can complete.

If you don't specify the memory requirements, the scheduler will assume you need the default amount for that particular partition. If this is much more than you require then you are either using up resource someone else could use, or causing your job to wait longer for a larger slot to become available. If your task then uses more memory than this then your task may be terminated (if the scheduler is configured to do this) or could cause the compute node to run out of memory causing your job and potentially others from succeeding (and thus wasting electricity).

You should of course be cautious with your memory request, allow a little head room in case your specific task needs a little more than you think.

Runtime requirements

Again, specifying this allows more efficient use of resources. Schedulers usually use a mechanism called back fill to fill up otherwise unused compute resource.

If someone requests a job that requires, say 8 CPU cores and 128GB of memory, but the only available compute node is already running tasks such that there are only 4 CPUs and 96GB of memory left then the scheduler will reserve these and wait for the currently running jobs to complete. Nothing can run on these idle CPUs/memory during this unless the scheduler knows that there are pending tasks that need four or less CPUs and less than 96GB of memory and will complete before the currently running tasks. If your job fulfills these requirements it gets to use the otherwise idle resources.

If you don't specify runtime, then your job gets the maximum runtime for that partition!

But how do I know what to specify?

Your best option is to run a trial processing job that is typical for your analysis and then ask the cluster how long it took and how much memory it required. Increase these a little to allow for variations in data/options and then provide these to fsl_sub for the remainder of your dataset analysis.

You can use the sacct tool to get this information:

sacct -j 123456 --format=JobID,JobName,State,Elapsed,ReqMem,MaxRSS,Timelimit

Output:

JobID     JobName     State       Elapsed   ReqMem  MaxRSS  Timelimit
123456    analysis    COMPLETED   00:18:42  8G      5.6G   01:00:00

Here, the job ran for 18 minutes 42 seconds, used a maximum of 5.6 GB of resident memory, and had 8 GB requested with a 1-hour time limit.

A job may have multiple accounting rows for its batch job and steps, so choose the largest figures.