FEniCS Performance on Mac vs. Linux

Hello,

I am running Fenics on two different work stations, one is a MacBook Pro on macOS Mojave 10.14.6 with 1.4 GHz Intel Core i5 (4 cores) and 16GB RAM, the other one is a Dell desktop on Linux Mint 19.2 Cinnamon 4.2.4 with Intel Xeon Silver 4116 @2.10GHz (12 cores) and 62.5 GB RAM. I would expect that the Linux machine run better than Mac for the hardware I got, however, running the same tutorial codes, specifically, Cahn-Hillard, the Linux machine is about 4 times slower than the Mac, I wonder if there is any potential cause for this difference on my Linux machine. Both machines have FEniCS 2019.1.0 and both run FEniCS in Anaconda, and they both were purchased and setup around the same time this year.

Something is not configured correctly on your Linux machine. I have two of the exact same CPU in my workstation. A usual gotcha is here. Failing that, if you trace one component of the code running particularly slowly, then let us know.

Hi nate

I just tried the solution in the link you provided, I set the OpenMP to go on 1 thread and still there is not a noticeable change in performance. Part of my codes that is running particularly slower (comparing to running the same code on Mac) is on the Newton solver, it is implemented exactly the same as the Cahn-Hillard sample code. What do you think?

Do you see any speedup if you run in parrallel? E.g. 1 MPI process vs 4 MPI processes?

I’ve never used FEniCS in Anaconda, so I can’t comment there, but you could also try the FEniCS docker container?

Unfortunately due to department policy, I could not use docker, nor having admin privilege on my workstations. The only way as for now I could use FEniCS is via anaconda. I didn’t run the code on MPI, for both Mac and Linux machine, I simply do python3 code.py after activating Fenics environment on shell.

Continue on my previous comment, I just tried running the code with mpi mpirun -n 4 python3 code.py , nothing exciting yet but the code seems frozen.

If the code’s frozen, looks like a bad MPI configuration. Hopefully someone with more experience with Anaconda can weigh in.

Mint is based on Debian (and Ubuntu), which has a native build of FEniCS.

You could look into testing that version rather than the version from Anaconda. The Mint docs have some references, e.g. https://community.linuxmint.com/software/view/fenics Mind you, it’s not clear from the Mint pages that they’ve kept it up-to-date (they have a reference to dolfin 1.3 which is ancient). Check on your own system what version they’re offering.

Unfortunately I don’t have root access to install Fenics from mint, I am not if this is a container issue though since it’s working fine on Mac. It seems very likely that my linux station was configured badly, it would be very helpful to found out which parts were not configured properly and then I could request to reconfigure it.

Probably it should be possible to get your anaconda version working properly.

In any case, it would be interesting to know what your Mint fenics version is.
What version is returned by
grep "Package.*fenics" -A 25 /var/lib/dpkg/status
or
grep "Package.*dolfin" -A 25 /var/lib/dpkg/status
?

Both command did not return anything, I don’t think this Mint I got has Fenics built in

Thanks. They must have had it in the past, since it shows up on their software list, but looks like they aren’t currently providing it.