-
Notifications
You must be signed in to change notification settings - Fork 97
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
Julia script creation system custom images #436
Julia script creation system custom images #436
Conversation
script from which to create the image, instead of extracting it from the tutorials Git repo
Codecov Report
@@ Coverage Diff @@
## master #436 +/- ##
=======================================
Coverage 87.34% 87.34%
=======================================
Files 158 158
Lines 11170 11170
=======================================
Hits 9756 9756
Misses 1414 1414 Continue to review full report at Codecov.
|
Hi @fverdugo, I have already done the following in this PR:
However, I get the following error while executing the system image generation script on Travis: https://travis-ci.com/github/gridap/Gridap.jl/jobs/425860847#L318 I could confirm that the error does not arise on my local machine with Julia 1.4.0, but it does with Julia 1.5.2! (the one that is being used for the travis job that fails). The error seems to be quite cryptic to me, it is like some kind of low-level error while executing LLVM code. Does the error message tell you something? If not, I can try to open an issue either on PackageCompiler.jl or the main Julia repo. What do u think? |
Hi @amartinhuertas I have never seen this error... However, I find some very weird error from time to time, perhaps it is a manifestation of the same problem. See this issue #400 (you can go straight to my first comment). |
Yes, I was aware about this akward error ... Indeed, I also though that this might be behind this particular error. However, today I have discovered that the following command: julia compile/create_gridap_image.jl --do-not-clone-gridap --gridap-path . --user-provided-script-path ../Tutorials/src/stokes.jl -n ./Gridap.so did not fail. For completeness, I am using the The command that fails (reproducibly) is:
So perhaps is something in |
I have been able to reproduce the error with a different test (
|
@amartinhuertas It seems a tricky error! since Gridap is going to change A LOT (see wip in branch |
ok, agreed. |
…t_creation_system_custom_images
…t_creation_system_custom_images
Codecov Report
@@ Coverage Diff @@
## master #436 +/- ##
==========================================
- Coverage 87.98% 0.00% -87.99%
==========================================
Files 133 132 -1
Lines 14237 14506 +269
==========================================
- Hits 12527 0 -12527
- Misses 1710 14506 +12796
Continue to review full report at Codecov.
|
@fverdugo ... I could make it work without issues with Gridap 0.16.0 + Julia 16. Thus, I guess that this PR is (almost) ready to be merged. The only pending decision is whether |
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.
Hi @amartinhuertas !
I have been thinking about this and I have some comments
- The approach seems a bit complicated to me. In particular, with the clones of Gridap, Gridap Tutorials. It feels like we are trying to re-implement something that the package manager already provides.
- Wrapping calls to PackageCompiler is a bit rigid and one needs to learn the API of the wrapper. I would prefer to use PackageCompiler directly. It is a well documented package and once the user knows how to use it, it can be useful for other Julia projects, not just Gridap.
- This approach is vulnerable to code invalidation. When the user imports packages that were not present at this point, some code generated in the image can be invalidated.
In summary:
In Gridap, I would only provide a path to a "warm-up file", or some function returning a path in function of some arguments if we want some customization. Then, the user can use this warm-up file to call PackageCompiler in the way she/he needs for the case at hand.
Some tentative user code
using PackageCompiler
using Gridap
# load other packages that the user wants to use to avoid code invalidations
using Plots
using DrWatson
using GridapEmbedded
# Recover the warmup file for the Gridap version installed
# (package manager will handle the installation of Gridap)
warmup_gridap = Gridap.warmup_file
# Here one has the oportunity to compile more things
pkgs = [:Gridap,:OtherPackage1,...]
warmups= [warmup_gridap, other_warmup, ....]
PackageCompiler.create_sysimage(
pkgs,
sysimage_path="whatever.so",
precompile_execution_file=warmups)
Ok, I agree this makes sense for Gridap. I will thus add the script to GridapDistributed (it is helpful there in the meantime) and close this PR. I have created issue #630 to not forget on these ideas. |
Note: this PR is highly related to #432