LSF Version 7.3 - Administering Platform LSF
Memory Preemption Example
338 Administering Platform LSF
DESCRIPTION=jobs may be preempted by jobs in higher-priority queues
...
End Queue
ELIM This is an example of an ELIM that reports the current value of pre_mem. This ELIM
starts on all the hosts that have the
pre_mem resource.
#!/bin/sh
host=`hostname`
while :
do
lsload > /dev/null 2>&1
if [ $? != 0 ] ; then exit 1
fi
memStr=`lsload -I mem -w $host|grep $host|awk '{print $3}'|sed 's/M//'`
reportStr="1 ""pre_mem ""$memStr"
echo "$reportStr \c"
sleep 60
done
Operation
Check how many
pre_mem resources
are available
Check the number of pre_mem existing on hostA by using bhosts -s pre_mem to
display how much memory is available. In this example, 110 MB of memory is
available on
hostA.
bhosts -s pre_mem
RESOURCE TOTAL RESERVED LOCATION
pre_mem 110 0.0 hostA
pre_mem 50 0.0 hostB
...
Using up some
pre_mem resources
Submit 1 job to a low-priority queue to consume 100 MB pre_mem. Assume the
application
mem_app consumes 100 MB memory after it starts.
bsub -J first -q low -R "rusage[pre_mem=100:duration=2]" mem_app
After a while, the first job is running and the pre_mem is reduced.
bjobs
JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
301 you RUN low hostx hostA /first Aug 23 16:42
bhosts -s pre_mem
RESOURCE TOTAL RESERVED LOCATION
pre_mem 10 100.0 hostA
pre_mem 50 0.0 hostB
...