Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Merge v0.3 2 #352

Merged
merged 8 commits into from
Nov 12, 2018
Merged
5 changes: 5 additions & 0 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ class NNIManager implements Manager {

private async requestTrialJobsStatus(): Promise<number> {
let finishedTrialJobNum: number = 0;
if (this.dispatcher === undefined) {
throw new Error('Error: tuner has not been setup');
}
for (const trialJobId of Array.from(this.trialJobs.keys())) {
const trialJobDetail: TrialJobDetail = await this.trainingService.getTrialJob(trialJobId);
const oldTrialJobDetail: TrialJobDetail | undefined = this.trialJobs.get(trialJobId);
Expand All @@ -367,13 +370,15 @@ class NNIManager implements Manager {
case 'USER_CANCELED':
this.trialJobs.delete(trialJobId);
finishedTrialJobNum++;
this.dispatcher.sendCommand(TRIAL_END, JSON.stringify({trial_job_id: trialJobDetail.id, event: trialJobDetail.status}));
break;
case 'FAILED':
case 'SYS_CANCELED':
// In the current version, we do not retry
// TO DO: push this job to queue for retry
this.trialJobs.delete(trialJobId);
finishedTrialJobNum++;
this.dispatcher.sendCommand(TRIAL_END, JSON.stringify({trial_job_id: trialJobDetail.id, event: trialJobDetail.status}));
break;
case 'WAITING':
case 'RUNNING':
Expand Down