|
@@ -21,21 +21,31 @@ PUBKEYS = "./../App/pubkeys.yaml"
|
|
|
CLIENTS = "./clients"
|
|
|
|
|
|
# Client thread allocation
|
|
|
-prefix = "numactl -C24-31 "
|
|
|
+prefix = "numactl -C36-39,76-79 "
|
|
|
|
|
|
-def launch(config, cmd, threads):
|
|
|
+def launch(config, cmd, threads, ip_start, lgfile):
|
|
|
cmdline = ''
|
|
|
cmdline += prefix + CLIENTS + " -t " + str(threads) + ""
|
|
|
+
|
|
|
+ stdout_file = subprocess.PIPE
|
|
|
+ if(lgfile):
|
|
|
+ stdout_file = open(lgfile, "a+")
|
|
|
+
|
|
|
proc = subprocess.Popen(shlex.split(cmdline) + cmd,
|
|
|
- stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
|
|
+ stdin=subprocess.PIPE, stdout=stdout_file,
|
|
|
stderr=subprocess.STDOUT, bufsize=0)
|
|
|
print(cmdline)
|
|
|
proc.stdin.write(config.encode('utf-8'))
|
|
|
- while True:
|
|
|
- line = proc.stdout.readline()
|
|
|
- if not line:
|
|
|
- break
|
|
|
- print(line.decode('utf-8'), end='', flush=True)
|
|
|
+
|
|
|
+ if(lgfile):
|
|
|
+ proc.wait()
|
|
|
+ stdout_file.close()
|
|
|
+ else:
|
|
|
+ while True:
|
|
|
+ line = proc.stdout.readline()
|
|
|
+ if not line:
|
|
|
+ break
|
|
|
+ print(line.decode('utf-8'), end='', flush=True)
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
@@ -61,6 +71,8 @@ if __name__ == "__main__":
|
|
|
help='override max number of outgoing public messages per user per epoch')
|
|
|
aparse.add_argument('-c', default=None,
|
|
|
help='override max number of incoming public messages per user per epoch')
|
|
|
+ aparse.add_argument('-l', default=None,
|
|
|
+ help='log file to store client simulator log for an experiment')
|
|
|
aparse.add_argument('-n', nargs='*', help='nodes to include')
|
|
|
aparse.add_argument('cmd', nargs='*', help='experiment to run')
|
|
|
args = aparse.parse_args()
|
|
@@ -86,7 +98,4 @@ if __name__ == "__main__":
|
|
|
# Now add a trailing newline
|
|
|
config += "\n"
|
|
|
|
|
|
- thread = threading.Thread(target=launch,
|
|
|
- args=(config, args.cmd, args.t))
|
|
|
- thread.start()
|
|
|
- thread.join()
|
|
|
+ launch(config, args.cmd, args.t, args.q, args.l)
|