Can I run FEniCSx in Apple silicon M3 max?

Hello I am using a MacBook pro with m3 max chip wishing to have a better performance. I am using vs code and jupyter notebook in anaconda. I download FEniCSx package using the way on this page. But as I run import dolfinx.fem, the kernel crashed in both vscode and jupyter. I wonder what’s wrong. Here’s a screenshot if I run it in terminal

It looks something wrong with PETSC?

It turned out that migration from my old MacBook to this new one was the issue. The old one was from 2015 and really out of date. I solved this issue by erase everything in the new MacBook and set it up by hand, not use migration.

For a comparison, my old is 2.8GHz quad-core i7 MacBook pro mid 2015. The new one is 16 inch M3 max. For 10-iteration run time around 70s in my old device, it can take maybe a little less than 30s, not a huge improvement for me though.

I want to ask which platform you guys use, is linux more commonly used for heavy calculations, did you use parallel so two or more points can be ran at the same time? Since I am going to run for different parameters and in each parameter setting I have to adjust initial guess to get a convergence result. So a lot of running to do. The more efficient the more desired.

Several core developers use Mac in their development.
Most hpc clusters (which one use for really large problems) are Linux based.

Without having an example at hand, its hard to give guidance as to what can improve run-times of your code. Some things are mentioned in
https://jsdokken.com/dolfinx-tutorial/chapter4/compiler_parameters.html
http://jsdokken.com/FEniCS23-tutorial/src/form_compilation.html
but there are plenty of other things to optimize as well.

1 Like

Thank you very much! Your comments really gave me a picture.

Hello,

I wanted to ask how you were able to fix the migration issue to the M3 silicon chip. My dolfinx module does not import correctly and the kernel fails each time. I am wondering which lines you used in terminal to fix the issue when you downloaded the fenicsx modules. Thank you!

Hello can you also screenshot the error message? I just run the code on the Download web page of fenicsx. This is like an integrated installation. They packed everything and it will install every missing parts including some preliminaries like python. If install each library one by one, that would be more complicated for me.

Hi,

Yes, I have the screenshot below. When I run these other lines below there is no issue:

import numpy as np
import matplotlib.pyplot as plt
import basix
import ffcx
import ufl
import pyvista
import mpi4py

When I try to import dolfinx using import dolfinx I get this message:
Screenshot 2024-02-14 at 11.49.43 AM

Thank you!

Did you follow exactly the instruction above to install it? Did you install in some other ways? The issue I had was because I transfer files from my old laptop to the new one and bug occured. So I wiped out the new laptop and installed everything by myself and it was fixed.

Hi,

Yes, I followed the steps exactly. Understood, it seems the migration would be the root cause of the issue then because of existing files. Thank you!