Last modified: |today| .. _memory: memory reservation ================== A job will be terminated if there is insufficient memory (RAM) on a workstation. If your job uses more than 2GB RAM, then reserve memory via qsub (see below). But PLEASE!! only reserve what you need... reserved memory can't be used by others, and there is a limited supply. determine memory requirement ---------------------------- The 'qacct' command prints information about completed SGE jobs, including memory usage. So if your job finished successfully in the past, then use 'qacct' to print how much memory it used:: $ qacct You may print up to 1000 entries using the -n option (the default is '30'):: $ qacct -n 100 reserve memory -------------- qsub ^^^^ To reserve memory with qsub, use the qsub -l option, and replace with the numeric value:: -l mem_free= For example, if the memory requirement (maxvmem) is 4G:: -l mem_free=4G for more information about qsub, see: | | https://www.neuro.berkeley.edu//resources/software/sge/commands.html | https://www.neuro.berkeley.edu//resources/software/sge/scripting.html submit ^^^^^^ When using 'submit' to run jobs, create an options file with the memory reservation. For example, if the name of your options file is /home/lab/joe/sge-options', and you want to reserve 43G of RAM, then you can run:: echo "-l mem_free=43G" >> /home/lab/joe/sge-options When you run submit, specify the options file with '-o /home/lab/joe/sge-options' For more information about submit, see https://www.neuro.berkeley.edu//resources/software/sge/scripting.html#submit modify reservation ------------------ It's impossible to change the reservation for running jobs, but you CAN change the memory reservation for jobs waiting in the queue. To do this, copy and paste the following command, and replace with the value obtained from the qacct command:: for jobID in `qstat | grep qw | awk '{print $1}'`; do qalter -l mem_free= $jobID; done For example, if the memory reservation is 4G:: for jobID in `qstat | grep qw | awk '{print $1}'`; do qalter -l mem_free=4G $jobID; done restricted access ----------------- A job may be terminated if there is insufficient memory available. When this happens, you will receive email to the address listed in the .forward file in your home directory ($HOME/.forward). Please keep this email address current. If 3 or more jobs are terminated within 3 hours, then all your jobs will be terminated. You may resubmit your jobs, but only one job will run. This is to reduce the risk of system failure from insufficient memory. If you don't know how much memory a job needs, then submit a single job, and monitor it with the :ref:`qstat` command. When it's finished, use the :ref:`qacct` command as described above. After you change the memory reservation, email support-neuro@berkeley.edu to allow jobs in parallel.