Commit ae45599c authored by Mark Hymers's avatar Mark Hymers

Add script to initialise cpuset for SGE

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 9527966b
#!/bin/bash
set -e
set -u
# Script to run on execd's to ensure that /dev/cpuset exists
# which allows gridengine's execd to use cgroups to manage
# CPUs and force jobs to use certain ones
if [ "$(id -u)" != "0" ]; then
echo "Error: must run as root"
exit 1
fi
umask 0022
# Check whether our top level directory exists
if [ ! -d /dev/cpuset ]; then
mkdir -p /dev/cpuset
fi
# Is the filesystem mounted?
if [ ! -e /dev/cpuset/tasks ]; then
mount -t cpuset none /dev/cpuset
fi
# Create the SGE subset
if [ ! -d /dev/cpuset/sge ]; then
mkdir -p /dev/cpuset/sge
# Insert CPUs and Memory
cp /dev/cpuset/cpuset.mems /dev/cpuset/sge/cpuset.mems
cp /dev/cpuset/cpuset.cpus /dev/cpuset/sge/cpuset.cpus
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment