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

Remove Thread-local storage from CHOLMOD and SPQR #206

Merged
merged 4 commits into from
Aug 5, 2022
Merged

Conversation

rayegun
Copy link
Member

@rayegun rayegun commented Aug 4, 2022

See #204

This PR takes the path of least resistance and just uses task_local_storage. The part that most needs review is the addition of a call to cholmod_l_finish. This is attached to the cholmod_common object which is lazily created in each task (which uses CHOLMOD).

I think this is correct, but I'm not 100% certain on the lifetime of task_local_storage.

@rayegun
Copy link
Member Author

rayegun commented Aug 4, 2022

@IanButterworth does this fix the issue?

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2022

Codecov Report

Merging #206 (ea193df) into main (643734c) will increase coverage by 0.06%.
The diff coverage is 94.23%.

@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   92.06%   92.13%   +0.06%     
==========================================
  Files          11       11              
  Lines        7161     7160       -1     
==========================================
+ Hits         6593     6597       +4     
+ Misses        568      563       -5     
Impacted Files Coverage Δ
src/solvers/cholmod.jl 90.66% <94.00%> (-0.02%) ⬇️
src/solvers/spqr.jl 88.31% <100.00%> (ø)
src/linalg.jl 84.58% <0.00%> (+0.43%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

src/solvers/cholmod.jl Outdated Show resolved Hide resolved
@DilumAluthge DilumAluthge requested a review from vtjnash August 4, 2022 13:44
end

function getcommon()
return get!(task_local_storage(), :cholmod_common, newcommon())::Ref{cholmod_common}
Copy link
Member

Choose a reason for hiding this comment

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

Should this not be

get!(newcommon, task_local_storage(), :cholmod_common)::Ref{cholmod_common}

? As it is now a new object is created for every call.

Copy link
Member Author

Choose a reason for hiding this comment

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

The docs say it's collection, key, default right?

Copy link
Contributor

@IanButterworth IanButterworth Aug 6, 2022

Choose a reason for hiding this comment

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

There's another method where you can give a function/type as a first arg. Note that Fredrik's suggestion gives the type but doesn't evaluate it

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.

6 participants