Unverified Commit c7cc8db3 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Merge pull request #1030 from Microsoft/v0.7

V0.7 merge back to master
parents 71e8ced7 1680f2e5
......@@ -77,6 +77,8 @@ class MsgDispatcherBase(Recoverable):
break
else:
self.enqueue_command(command, data)
if self.worker_exceptions:
break
_logger.info('Dispatcher exiting...')
self.stopping = True
......
......@@ -30,13 +30,15 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
const accSource: Array<DetailAccurPoint> = [];
Object.keys(showSource).map(item => {
const temp = showSource[item];
if (temp.status === 'SUCCEEDED' && temp.acc.default !== undefined) {
const searchSpace = temp.description.parameters;
accSource.push({
acc: temp.acc.default,
index: temp.sequenceId,
searchSpace: JSON.stringify(searchSpace)
});
if (temp.status === 'SUCCEEDED' && temp.acc !== undefined) {
if (temp.acc.default !== undefined) {
const searchSpace = temp.description.parameters;
accSource.push({
acc: temp.acc.default,
index: temp.sequenceId,
searchSpace: JSON.stringify(searchSpace)
});
}
}
});
const resultList: Array<number | string>[] = [];
......
......@@ -32,9 +32,12 @@ def get_yml_content(file_path):
try:
with open(file_path, 'r') as file:
return yaml.load(file, Loader=yaml.Loader)
except TypeError as err:
print('Error: ', err)
return None
except yaml.scanner.ScannerError as err:
print_error('yaml file format error!')
exit(1)
except Exception as exception:
print_error(exception)
exit(1)
def get_json_content(file_path):
'''Load json file content'''
......@@ -42,7 +45,7 @@ def get_json_content(file_path):
with open(file_path, 'r') as file:
return json.load(file)
except TypeError as err:
print('Error: ', err)
print_error('json file format error!')
return None
def print_error(content):
......
......@@ -113,8 +113,11 @@ def start_rest_server(port, platform, mode, config_file_name, experiment_id=None
entry_dir = get_nni_installation_path()
entry_file = os.path.join(entry_dir, 'main.js')
cmds = ['node', entry_file, '--port', str(port), '--mode', platform, '--start_mode', mode]
node_command = 'node'
if sys.platform == 'win32':
node_command = os.path.join(entry_dir[:-3], 'Scripts', 'node.exe')
cmds = [node_command, entry_file, '--port', str(port), '--mode', platform, '--start_mode', mode]
if log_dir is not None:
cmds += ['--log_dir', log_dir]
if log_level is not None:
......
......@@ -136,7 +136,7 @@ def import_data(args):
args.port = get_experiment_port(args)
if args.port is not None:
if import_data_to_restful_server(args, content):
print_normal('Import data success!')
pass
else:
print_error('Import data failed!')
......
......@@ -25,15 +25,20 @@ import time
from xml.dom import minidom
def check_ready_to_run():
#TODO check process in windows
if sys.platform == 'win32':
return True
pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pidList = []
for pid in pgrep_output.splitlines():
pidList.append(int(pid))
pidList.remove(os.getpid())
return len(pidList) == 0
pgrep_output = subprocess.check_output('wmic process where "CommandLine like \'%nni_gpu_tool.gpu_metrics_collector%\' and name like \'%python%\'" get processId')
pidList = pgrep_output.decode("utf-8").strip().split()
pidList.pop(0) # remove the key word 'ProcessId'
pidList = list(map(int, pidList))
pidList.remove(os.getpid())
return len(pidList) == 0
else:
pgrep_output =subprocess.check_output('pgrep -fx \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pidList = []
for pid in pgrep_output.splitlines():
pidList.append(int(pid))
pidList.remove(os.getpid())
return len(pidList) == 0
def main(argv):
metrics_output_dir = os.environ['METRIC_OUTPUT_DIR']
......
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