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 <>
parent 9527966b
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
umask 0022
# Check whether our top level directory exists
if [ ! -d /dev/cpuset ]; then
mkdir -p /dev/cpuset
# Is the filesystem mounted?
if [ ! -e /dev/cpuset/tasks ]; then
mount -t cpuset none /dev/cpuset
# 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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment