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

Offset filed of buffer dose not work #9

Open
Gxiandy opened this issue Jul 12, 2024 · 7 comments
Open

Offset filed of buffer dose not work #9

Gxiandy opened this issue Jul 12, 2024 · 7 comments

Comments

@Gxiandy
Copy link

Gxiandy commented Jul 12, 2024

Hi,

This is excellent work! We try to use it to solve some memory allocation problems. We found that when we set a value to the offset filed of a buffer (which will be regard as a fixed position buffer according to the annotation), the solver will re-allocate this buffer instead of using the offet we provided.

Did I use it wrong? Or is this still a todo feature?

@mmoffitt
Copy link
Collaborator

Ah, yes that optional<Offset> field is confusing ... when reading solution files, we use it to store the final (fixed) offset assignment, but it's not a property that is honored by the solver. It would take some extra work if you want the solver to recognize such fixed objects and place buffers around them.

@Gxiandy
Copy link
Author

Gxiandy commented Jul 16, 2024

Thank you for your reply. Now I understand the meaning of offset filed. Do you have any suggestions If I want to add the feature I mentioned above?

@mmoffitt
Copy link
Collaborator

I've just pushed a change that should add solver support for fixed offsets. Would you mind giving it a try?

@Gxiandy
Copy link
Author

Gxiandy commented Jul 17, 2024

That's great! I‘d like to !

@Gxiandy
Copy link
Author

Gxiandy commented Aug 1, 2024

Thanks for your work. I've tried this fix in our project and it works. However, we found that for some cases, minimalloc can not found a solution within the required time (which is 30s for 200 buffers), but when we use first-fit method for memory allocation, we will get right solution in very short time. Seems that the partial-allocation problem is not friendly to minimalloc? btw, I suggest that use number of backtrack times to determine whether timeout occurs because it is more stable.

@mmoffitt
Copy link
Collaborator

mmoffitt commented Aug 3, 2024

There's one more change I ought to make for the "fixed offset" feature to be fully performant -- I'll let you know once it's checked in, might take me a couple days.

@mmoffitt
Copy link
Collaborator

Just added one more check that should allow for earlier termination -- let me know if this fixes the issue (if not, I can try a few more things).

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

No branches or pull requests

2 participants