Skip to content

simplify acc logic #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 30, 2023
Merged

simplify acc logic #451

merged 5 commits into from
Jun 30, 2023

Conversation

asm582
Copy link
Member

@asm582 asm582 commented Jun 30, 2023

No description provided.

@asm582 asm582 changed the title simply acc logic simplify acc logic Jun 30, 2023
z103cb
z103cb previously approved these changes Jun 30, 2023
Copy link
Contributor

@z103cb z103cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick, looking good otherwise

Copy link
Member

@tardieu tardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR makes unintended changes to the computation in Dispatcher mode. In dispatcher mode and if strings.Compare(dispatchedAgentId, agentId) == 0 we should add the aggregated AW request to preemptable if we want to preserve the existing behavior.

if strings.Compare(dispatchedAgentId, agentId) != 0 {
					klog.V(10).Infof("[getAggAvaiResPri] %s: Skipping adjustments for %s since it is in cluster %s which is not in the same cluster under evaluation: %s.",
						time.Now().String(), value.Name, dispatchedAgentId, agentId)
					continue
} else {
    for _, resctrl := range qjm.qjobResControls {
        qjv := resctrl.GetAggregatedResources(value)
          preemptable = preemptable.Add(qjv)
     }
    for _, genericItem := range value.Spec.AggrResources.GenericItems {
        qjv, _ := genericresource.GetResources(&genericItem)
        preemptable = preemptable.Add(qjv)
    }
    continue
}

@asm582
Copy link
Member Author

asm582 commented Jun 30, 2023

I think the PR makes unintended changes to the computation in Dispatcher mode. In dispatcher mode and if strings.Compare(dispatchedAgentId, agentId) == 0 we should add the aggregated AW request to preemptable if we want to preserve the existing behavior.

if strings.Compare(dispatchedAgentId, agentId) != 0 {
					klog.V(10).Infof("[getAggAvaiResPri] %s: Skipping adjustments for %s since it is in cluster %s which is not in the same cluster under evaluation: %s.",
						time.Now().String(), value.Name, dispatchedAgentId, agentId)
					continue
} else {
    for _, resctrl := range qjm.qjobResControls {
        qjv := resctrl.GetAggregatedResources(value)
          preemptable = preemptable.Add(qjv)
     }
    for _, genericItem := range value.Spec.AggrResources.GenericItems {
        qjv, _ := genericresource.GetResources(&genericItem)
        preemptable = preemptable.Add(qjv)
    }
    continue
}

No changes were done for dispatcher mode and I would avoid doing it as there are no test cases yet AFAIK

@tardieu
Copy link
Member

tardieu commented Jun 30, 2023

No changes were done for dispatcher mode and I would avoid doing it as there are no test cases yet AFAIK

OK. You are right, the problematic changes were in fact made in PR #415. I was looking at the combination of the two PRs. We'll address these changes separately.

@asm582 asm582 merged commit d4d856b into project-codeflare:main Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants