Commit 83e664e7 authored by Florian Fischer's avatar Florian Fischer
Browse files

client: readd additional client argument support

This is needed for the latency evaluation.
parent 13b76a98
Pipeline #81670 passed with stage
in 59 seconds
......@@ -26,7 +26,8 @@ CLIENT_ERR = '{arg_prefix}.err'
CLIENT_TIMEOUT_FACTOR = 20
CLIENT_DEFAULT_TERMINATION = ('time', 60)
CLIENT_CMD = '{exe} -c {cons} -s {size} {termination_flag} -a {host} -f {outfile} --no-quit'
CLIENT_CMD = ('{exe} -c {cons} -s {size} {termination_flag}'
' -a {host} -f {outfile} --no-quit {additional_args}')
def run_clients(run: int,
......@@ -36,6 +37,7 @@ def run_clients(run: int,
substitutions=None,
termination=None,
remote_cmd=None,
additional_args='',
hosts=None,
env=None,
implementation='emper') -> BenchResult:
......@@ -46,10 +48,6 @@ def run_clients(run: int,
log.debug('output file prefix: %s generated from: %s', arg_prefix,
arg_prefix_template)
client_out = CLIENT_OUT.format(arg_prefix=arg_prefix)
client_err = CLIENT_ERR.format(arg_prefix=arg_prefix)
client_csv = CLIENT_CSV.format(arg_prefix=arg_prefix)
termination = termination or CLIENT_DEFAULT_TERMINATION
if termination[0] == 'time':
termination_flag = f'-t {termination[1]}'
......@@ -61,16 +59,27 @@ def run_clients(run: int,
else:
log.error('Unknown termination option: %s', termination[0])
client_out = CLIENT_OUT.format(arg_prefix=arg_prefix)
client_err = CLIENT_ERR.format(arg_prefix=arg_prefix)
client_csv = CLIENT_CSV.format(arg_prefix=arg_prefix)
out = result_dir / client_out
err = result_dir / client_err
csv = result_dir / client_csv
if additional_args:
additional_args = additional_args.format(**args,
**substitutions,
run=run,
result_dir=result_dir)
client_impl = CLIENT_IMPLEMENTATIONS[implementation]
if not hosts:
cmd = CLIENT_CMD.format(exe=client_impl,
host=server_host,
outfile=csv,
termination_flag=termination_flag,
additional_args=additional_args,
**args,
**substitutions)
return run_local_client(cmd, out, err, timeout, env=env)
......@@ -81,6 +90,7 @@ def run_clients(run: int,
host=server_host,
outfile='{outfile}',
termination_flag=termination_flag,
additional_args=additional_args,
**args,
**substitutions)
return run_remote_clients(cmd, out, err, csv, remote_cmd, hosts, timeout)
......
......@@ -204,16 +204,18 @@ def bench(server_cmds) -> EvalResult:
client_remote_cmd = None if not REMOTE_CMD else REMOTE_CMD.format(
host='{host}', ssh_port=SSH_PORT)
bench_results[i] = run_clients(run,
client_args,
bench_dir,
HOST,
substitutions=substitutions,
termination=TERMINATION,
remote_cmd=client_remote_cmd,
hosts=CLIENTS,
env=CLIENT_ENV,
implementation=args.client_impl)
bench_results[i] = run_clients(
run,
client_args,
bench_dir,
HOST,
substitutions=substitutions,
termination=TERMINATION,
remote_cmd=client_remote_cmd,
additional_args=args.additional_client_args,
hosts=CLIENTS,
env=CLIENT_ENV,
implementation=args.client_impl)
if bench_results[i] == BenchResult.FAIL:
log.warning('\nClient cmd failed. Terminate server')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment