Skip to content

Scheduler: First-fit algorithm throws exception for empty device list #29

Description

@marusshi

Scheduler.js:282 : devices[0] is undefined

tasks.forEach(function(task){
	var most_space = Object.keys(mapping).reduce(function(acc, id){
		return (mapping[id].available_memory > mapping[acc].available_memory) ? id : acc;
	}, devices[0].id); 

Error thrown:

     TypeError: Cannot read property 'id' of undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions