Keep Instant cache using docker image

Hi,
My OS is Ubuntu 18.04, and I am currently using the docker image quay.io/fenicsproject/stable:current . I would like to use it as an application as explained in the link below:

https://fenics-containers.readthedocs.io/en/latest/work_flows.html#run-fenics-in-a-docker-container-like-an-application

However, if I:

  1. Create a data volume:
    docker volume create --name instant-cache

  2. Run the following command several times:
    docker run --rm -v instant-cache:/home/fenics/.instant -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable:current "python3 my-code.py"

the JIT compiler is called every time, and not just on the first run. Has anything changed since that documentation was written, or am I doing something wrong?

The “my-code.py” example from the page is:

    from dolfin import *
    print("Running FEniCS...")
    mesh = UnitSquareMesh(10, 10)
    V = FunctionSpace(mesh, "P", 1)
    u = interpolate(Constant(1.0), V)
    with XDMFFile("f.xdmf") as f:
        f.write(u)

Thanks,
Baptista

Try using the mapping

instant-cache:/home/fenics/.cache

instead. If I run the command twice that way, there is no JIT compilation on the second run.

2 Likes

It worked!

Thank you, @kamensky.