Skip to content

[BUG] Timesharing only shares with the resources of the first scheduled job for each slot. #102

@ClementGre

Description

@ClementGre

To track timesharing, slots contain an attribute ts_itvs which is a mapping: (user_name or *) -> (job_name or *) -> ProcSet with ProcSet being the resources claimed by a job that is time-shareable with the job job_name or any if * of the user job_user or any if *.

When a job is scheduled, resources are subtracted with the function sub_slot_during_job, that also updates ts_itvs.
The bug is that sub_slot_during_job never updates the value of slot.ts_itvs[job.ts_user][job.ts_name]:

if job.ts_name not in slot.ts_itvs[job.ts_user]:
    slot.ts_itvs[job.ts_user][job.ts_name] = copy.copy(job.res_set)

(slot.py:604)

Then, if on the same slot, a job is scheduled, and then a bigger job with the same name and type happens to be scheduled on the resources of the smaller job plus some others, the value of slot.ts_itvs[job.ts_user][job.ts_name] will remain the resources of the smaller job instead of expanding.

To fix it, update the map with an union operator even if a record already exists:

if job.ts_name not in slot.ts_itvs[job.ts_user]:
    slot.ts_itvs[job.ts_user][job.ts_name] = copy.copy(job.res_set)
else:
    slot.ts_itvs[job.ts_user][job.ts_name] |= copy.copy(job.res_set)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions