Help installing gfortran on MacBook Pro with M1pro

Thank you @shahmoradi . I can confirm that the latest version of gfortran and mpich in brew (11.3.0 I believe) is now fully working with my code which contains procedure and pointer as below,

No sig 11 error anymore. For me, it is perfect now! Great!!!

2 Likes

A quick comment on parallel performance:
I compiled an Fortran+MPI particle tracking code using mpif90. Then I ran it using mpirun with -n set to 1,2,4 and 8. Execution time was

1 process: 38 sec
2 processes: 21 sec
4 processes: 13 sec
8 processes: 9sec

This was basically an embarrassingly parallel problem (hardly any communication compared with computation).

2 Likes

If the application is memory bandwidth limited, then the performance will depend on which M1 chip it is run on. The memory bandwidths are currently 200, 400, and 800 GB/s for the various configurations.

1 Like

What about if you run on a Intel Chip?

@RonShepard I don’t know if the application is memory bandwidth limited. It’s a simple code: In the initialization phase (which takes very little time) I generate 4 million particles that are distributed among the MPI processes. Then I propagate them for 500 steps using a split-operator symplectic integrator. At the end of each step a diagnostic is called that computes the 2nd moments, so there is a small amount of communication there.

1 Like

@CRquantum When I run the same code on my 2016 (Intel) MacBook Pro the timings are:
1 process: 85 sec
2 processes: 59 sec
4 processes: 54 sec

1 Like

Intel chip seems perform worse.
Have you checked the MPI communication time (can use mpi_wtime)? How do you know the communication is not the bottleneck?
Or is it possible that, say, like, you distribute 100 jobs to each core, but the time of solving 100 jobs on each core is different, so the overall speed is depend on the slowest core. Things like that?

Especially on a laptop, the CPU have power limits, like the max CPU TDP is 60w. If you run on only one core cost 30w, now you run on 8 cores, and since the power is limited at 60w, you will not really have 8x speedup compared with running on just one core. Your MBP’s parallel performance is not bad, with 8 cores, 4-6X speedup is not bad.

If you run on a desktop, perhaps you may see a more linear speedup.