hackbench: make sure we obey cpulist constraints

When --loads-cpulist is specified, make sure we take that into
account when setting up to use either numactl or taskset to place
the hackbench workloads.

Signed-off-by: Clark Williams <williams@redhat.com>
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 0a7c664..8456a24 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -63,6 +63,12 @@
         for n in self.nodes:
             self.cpus[n] = [ int(c.split('/')[-1][3:]) for c in glob.glob('/sys/devices/system/node/node%s/cpu[0-9]*' % n) ]
             self.cpus[n].sort()
+
+            # if a cpulist was specified, only allow cpus in that list on the node
+            if self.cpulist:
+                self.cpus[n] = [ c for c in self.cpus[n] if c in expand_cpulist(self.cpulist) ]
+
+            # track largest number of cpus used on a node
             if len(self.cpus[n]) > biggest:
                 biggest = len(self.cpus[n])
 
@@ -106,7 +112,7 @@
         self.started = False
 
     def __starton(self, node):
-        if self.__multinodes:
+        if self.__multinodes or self.cpulist:
             if self.__usenumactl:
                 args = [ 'numactl', '--cpunodebind', node ] + self.args
             else: