summaryrefslogtreecommitdiff
diff options
-rwxr-xr-xbin/memory_stress_ng7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/memory_stress_ng b/bin/memory_stress_ng
index e619772..35c7725 100755
--- a/bin/memory_stress_ng
+++ b/bin/memory_stress_ng
@@ -114,7 +114,12 @@ echo "Variable run time is $variable_time seconds per stressor"
had_error=0
-numa_nodes=$(numactl --hardware | grep available | head -n 1 | cut -f 2 -d " ")
+command -v numactl >/dev/null 2>&1
+if [ $? == 0 ] ; then
+ numa_nodes=$(numactl --hardware | grep available | head -n 1 | cut -f 2 -d " ")
+else
+ numa_nodes=1
+fi
# NOTE: Specify stressors in two arrays rather than rely on stress-ng's
# --class memory,vm option for two reasons: