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

fix bug in nnimanager #341

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ class NNIManager implements Manager {
private async requestTrialJobsStatus(): Promise<number> {
const deferred: Deferred<number> = new Deferred<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 @@ -369,13 +372,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