From d21ed3f087b166807c43fe0310d43a875af88a0a Mon Sep 17 00:00:00 2001
From: "Simon Michnowicz (Monash University)"
 <smichnow@m3-mgmt1.massive.org.au>
Date: Thu, 24 Nov 2016 15:22:02 +1100
Subject: [PATCH] check that the NUMA configuration is correct on each node.
 Simple at this stage as N(Sockets)==2

---
 roles/nhc/files/scripts/check_numa.nhc | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 roles/nhc/files/scripts/check_numa.nhc

diff --git a/roles/nhc/files/scripts/check_numa.nhc b/roles/nhc/files/scripts/check_numa.nhc
new file mode 100644
index 00000000..a261f73a
--- /dev/null
+++ b/roles/nhc/files/scripts/check_numa.nhc
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+function check_numa() {
+#echo ">>> Checking Numa Configuration >>>>>>>>>>>>>>>>>>>>>>>>>"
+#TODO: currently checks if N sockets is 2. Really need to check N(sockets)<N(processors)
+
+#CPU(s):                2
+#Socket(s):             2
+
+NSOCKETS=`lscpu | grep Socket | awk '{print $2}'`
+#NCPU=`lscpu | grep "^CPU.s.:" | awk '{print $2}'`
+#echo "NSOCKETS is $NSOCKETS"
+#echo "NCPU is $NCPU"
+if [ $NSOCKETS -ne 2 ]
+then
+     die 1 " $FUNCNAME ERROR NUMA on node not configured properly. Number of sockets is $NSOCKETS"
+     return 1
+fi
+return 0
+}
+
-- 
GitLab