This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

FEniCS in Docker

+3 votes

Hello everyone,

There are two versions of FEniCS installed on my machine (operating system is Mac OS X 10.10). One of these FEniCS installations is the Docker image v2016.1.0, and the other is v1.4 (native build) which was installed from a .dmg file a while ago. I have found that the Docker version runs much slower than the native build when running the same sample problems. But in the documentation it says:

"In short, running FEniCS in Docker may actually be faster than using a native build since our Docker images have been tuned for performance, even when running Docker using virtualisation technologies on Mac and Windows."

Hopefully this question is not too vague, but does anyone know what may be causing the slower performance? Is FEniCS v2016.1.0 just slower than v1.4? I'm hoping that this is just a Docker problem that I can fix and get better performance. (I have allowed Docker to access up to 6 CPU's and 8 GB of RAM.)

asked Sep 13, 2016 by jimmy FEniCS Novice (730 points)

Can you post some specific numbers? I've been interested in benchmark results comparing performance for Docker on Mac and native builds, but these are surprisingly difficult to find. Also: Are you using the new Docker on Mac (v1.12) or the older Docker Toolbox? (The former is supposed to be significantly closer to native.)

At the moment I do not have specific numbers to post, but I'll come up with something when time permits. And I'm currently using Docker v1.12.

Are you suggesting that the older Docker Toolbox will run FEniCS faster? Maybe I will try that out in the near future.

The opposite -- Docker Toolbox will almost certainly be slower than the new Docker for Mac.

(And for what it's worth, I find the statement in the documentation to be a straw man at best: Of course you can mess up a native build to get arbitrarily slow performance (gcc -march=i386), but if you half know what you're doing -- and the developers, who provided the native build for macOS, presumably do -- then a virtualized image will always be slower than a native build. The question is only whether it's 10% slower -- which would be an acceptable trade-off -- or 50% slower or more.)

It is not clear that a containerised install will be slower than the native install. Of course, it should be - but the likelihood is that optimisiations and library choices are better in the container than the native build. We often see docker running code faster than native, in fact.

@chris_richardson Do you have numbers to back this up (not doubting you, just really interested)? And to make sure: we're talking specifically about virtualized containers (Docker on Mac), not the native containers used for Linux. As a comparison, the old Mac binary image from https://fenicsproject.org/download/osx_details.html would be the obvious choice -- if Docker is faster (or nearly as fast) as this, the convenience indeed outweighs possible performance improvements from an optimized build from source.

...