Skip to content
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

fix(cpu): fixed reading cpus.yaml #1858

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

vimalk78
Copy link
Collaborator

  • fixed reading cpus.yaml file
  • added unit tests

Copy link

github-actions bot commented Nov 21, 2024

🤖 SeineSailor

Here's a concise summary of the pull request changes:

Summary: This pull request fixes an issue with reading cpus.yaml and adds unit tests. Key changes include:

  • Renaming fields in the cpuModelData struct from lowercase to uppercase
  • Introducing an unknownCpuArch constant and updating the cpuArch() function to return it on failure
  • Adding a new cpuMicroArchitectureFromModel() function to determine microarchitecture from YAML file data
  • Updating the existing cpuMicroArchitecture() function to use the new function

Impact: These changes do not affect the external interface or behavior of the code, except in error cases where the behavior might be affected.

Observations: The changes seem to improve the robustness of the code in handling errors when reading the cpus.yaml file. However, it would be beneficial to consider adding more comprehensive error handling and logging to ensure that any issues are properly reported and debuggable.

@vimalk78 vimalk78 force-pushed the fix-cpuid branch 2 times, most recently from 4cb8da4 to 87f9787 Compare November 21, 2024 11:44
pkg/node/node.go Outdated
Comment on lines 262 to 264
if err != nil {
return arch, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if err != nil {
return arch, nil
}
if err == nil {
return arch, nil
}

Copy link
Collaborator

@sthaha sthaha left a comment

Choose a reason for hiding this comment

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

lgtm

@sthaha sthaha merged commit f438e59 into sustainable-computing-io:main Nov 21, 2024
20 checks passed
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.

2 participants