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

Each GAP.jl session uses fresh dir for mutable GAP root #1079

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Resolves #993 -- I measured that it is not slower than the current approach which fully regenerates the GAP root each time anyway.

Specifically on my test machines it takes about 0.09 - 0.11 seconds. Which is not nothing, but still relatively little.

An alternative would be to keep using a scratch space but be more aggressive in switching to a new one when anything changes, i.e. incorporating a hash value into its name that involves more components, such as

  • a hash of the content of setup.jl
  • hashes of the artifact dirs of all involved artifacts / JLLs
  • ...

src/packages.jl Outdated Show resolved Hide resolved
src/packages.jl Outdated Show resolved Hide resolved
src/packages.jl Outdated Show resolved Hide resolved
src/packages.jl Outdated Show resolved Hide resolved
@fingolfin fingolfin force-pushed the mh/gaproot-in-temp-dir branch 3 times, most recently from cbcc0db to de7bed9 Compare December 10, 2024 23:14
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.57%. Comparing base (0412fa6) to head (de7bed9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1079      +/-   ##
==========================================
+ Coverage   74.54%   74.57%   +0.02%     
==========================================
  Files          55       55              
  Lines        4588     4593       +5     
==========================================
+ Hits         3420     3425       +5     
  Misses       1168     1168              
Files with missing lines Coverage Δ
src/GAP.jl 86.88% <100.00%> (+0.44%) ⬆️
src/packages.jl 53.90% <ø> (-0.36%) ⬇️
src/setup.jl 86.17% <100.00%> (+0.22%) ⬆️

@lgoettgens
Copy link
Member

Specifically on my test machines it takes about 0.09 - 0.11 seconds. Which is not nothing, but still relatively little.

I compared de7bed9 (tip of this PR) to 0412fa6 (the master commit this branch is based on) w.r.t. @time @time_imports using GAP (after doing ] up, waiting for precompilation and running multiple times to simulate a non-dev usage). There were no statistically significant changes between the two commits. This may be due to the removal of a pid-file usage that could counter the times you measured.

The only thing I am a little bit worried about is that some OSs may clear the /tmp directory after a set number of days. If this is done while a long running GAP.jl/OSCAR computation is still running, this may break.

@fingolfin
Copy link
Member Author

Oh, good point about stuff in /tmp or /var/tmp potentially being deleted by cron jobs. That's indeed a thing.

So how about instead we keep the scratch space and create the temp dirs in it (mktempdir has an option for that). The scratch space name then could stay relatively fixed. The tempdir names could consist of the current date&time in ISO8601 format followed by a random string (I am suggesting to put in time because that way it's trivial to spot any such dirs that should have been deleted but were not e.g. due to a crash. It might also help recognize the dirs for the "long running" jobs).

@lgoettgens
Copy link
Member

lgoettgens commented Dec 11, 2024 via email

@fingolfin
Copy link
Member Author

I want a different directory for each julia process loading GAP.jl. Scratchspaces alone do not provide for that.

@lgoettgens
Copy link
Member

No, it does. If you call get_scratch!(some_unique_string_that_contains_datetime), this creates a unique folder (as the key is unique). However, Scratch.jl will track that usage dates of these folders and gc them after some time

@fingolfin fingolfin changed the title Use temp dir (no scratch space) for mutable GAP root Make each GAP.jl session use a fresh directory for mutable GAP root Dec 12, 2024
@fingolfin fingolfin changed the title Make each GAP.jl session use a fresh directory for mutable GAP root Each GAP.jl session uses fresh dir for mutable GAP root Dec 12, 2024
@fingolfin fingolfin force-pushed the mh/gaproot-in-temp-dir branch from de7bed9 to d8459a9 Compare December 12, 2024 19:41
@fingolfin fingolfin force-pushed the mh/gaproot-in-temp-dir branch from d8459a9 to 830e8c1 Compare December 12, 2024 19:42
@fingolfin
Copy link
Member Author

@lgoettgens updated now as discussed on #1083

@lgoettgens
Copy link
Member

@fingolfin fingolfin marked this pull request as draft December 12, 2024 22:28
@fingolfin
Copy link
Member Author

Nope the failure is caused by the use of our gap.sh wrapper, which now every time has a fresh GAP root. That messes with the build system of JuliaInterface: the configure script read sysinfo.gap and uses that to generate Makefile from Makefile.in. But also the path to the sysinfo.gap file is put into Makefile, so facilitate re-generation of everything if the GAP config changes. As a result, when we run make clean in etc/ci_test.sh it runs into an error because it can't fight sysinfo.gap.

Gotta think a bit about 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.

Revise setup of the faux GAP root
2 participants