-
Notifications
You must be signed in to change notification settings - Fork 0
16 write work model tests #21
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
base: master
Are you sure you want to change the base?
Conversation
|
More test need to be written |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds unit tests for the work model functionality in the load balancing library and introduces a simplified Task constructor to facilitate test creation.
- Adds comprehensive unit tests for
WorkModelCalculatorfunctionality including work computation, memory usage, and incremental updates - Introduces a simplified
Task(TaskType id, LoadType load)constructor for easier task creation in tests
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit/work_model/test_work_model.cc | New test file with 4 test cases covering work computation, memory usage calculation, memory fit checking, and work update operations |
| src/vt-lb/model/Task.h | Adds simplified two-parameter constructor for creating Task instances with just ID and load |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
|
|
||
| struct Task { | ||
| Task() = default; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding documentation for this constructor to clarify its intended use case and the default values that will be used for uninitialized fields (home_, current_, migratable_, memory_, shared_blocks_). This would help other developers understand when to use this simplified constructor versus the full constructor.
| Task() = default; | |
| Task() = default; | |
| /** | |
| * @brief Simplified constructor for Task. | |
| * | |
| * Initializes a Task with the given id and load. | |
| * Other fields are set to their default values: | |
| * - home_ = invalid_node | |
| * - current_ = invalid_node | |
| * - migratable_ = true | |
| * - memory_ = default-constructed TaskMemory (all fields 0.0) | |
| * - shared_blocks_ = empty set | |
| * | |
| * Use this constructor when only id and load are known, and other fields can be defaulted. | |
| * For full control, use the more detailed constructor. | |
| */ |
a4c6eac to
e2cee9f
Compare
e2cee9f to
822e065
Compare
c841482 to
8f9d587
Compare
4698fc3 to
f7b46c5
Compare
3684e85 to
50e851e
Compare
b946c0a to
2e4c643
Compare
Closes #16