"profiler/include/profile_softmax_impl.hpp" did not exist on "3da5c19e629174c234fe86c17ebd04732ea548b7"
Unverified Commit ba5d18c4 authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Handle exception and kill restserver in nnictl (#2086)

parent ff2728c0
......@@ -525,7 +525,15 @@ def create_experiment(args):
nni_config.set_config('experimentConfig', experiment_config)
nni_config.set_config('restServerPort', args.port)
launch_experiment(args, experiment_config, 'new', config_file_name)
try:
launch_experiment(args, experiment_config, 'new', config_file_name)
except Exception as exception:
nni_config = Config(config_file_name)
restServerPid = nni_config.get_config('restServerPid')
if restServerPid:
kill_command(restServerPid)
print_error(exception)
exit(1)
def manage_stopped_experiment(args, mode):
'''view a stopped experiment'''
......@@ -553,8 +561,16 @@ def manage_stopped_experiment(args, mode):
new_config_file_name = ''.join(random.sample(string.ascii_letters + string.digits, 8))
new_nni_config = Config(new_config_file_name)
new_nni_config.set_config('experimentConfig', experiment_config)
launch_experiment(args, experiment_config, mode, new_config_file_name, experiment_id)
new_nni_config.set_config('restServerPort', args.port)
try:
launch_experiment(args, experiment_config, mode, new_config_file_name, experiment_id)
except Exception as exception:
nni_config = Config(new_config_file_name)
restServerPid = nni_config.get_config('restServerPid')
if restServerPid:
kill_command(restServerPid)
print_error(exception)
exit(1)
def view_experiment(args):
'''view a stopped experiment'''
......
Markdown is supported
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