Multicore and Ubuntu

OK, quite a different scenario then. You want multithreading, not multicore. Dolfin (and petsc) is set up to use MPI, so it’s normal that a single processor launch would only run over 1 processor. The weird thing here is the opposite situation, why is your workstation running multithreaded?

Multithreading would mean compiled with OpenMP support, or with pthreads. libpetsc is compiled against pthreads, so that may be the multithreading your workstation is giving you.

Common advice is to set OMP_NUM_THREADS=1 to run MPI jobs, so that multithreading does not interfere with MPI operations. (It is possible in principle to have both in play at the same time but it tends to complicate the code to the point that it becomes unmaintainable). But that’s done to make sure there’s only one OpenMP thread (not pthread) per process.

In your case, look into what controls PETSc’s use of pthreads. I would have expected your workstation to work the same way as the laptop if they’re both running the same Ubuntu. If they’re behaving differently then perhaps there’s some environment variable set differently somewhere, say in /etc/profile.d. Or since you’ve got different kernels, perhaps libpthread inspects kernel capabilities. I don’t know if it’s possible to control communication between libpthread and the kernel, I can’t see anything in pthread docs about it.

There’s some discussion of PETSc and pthreads at
https://www.mcs.anl.gov/petsc/miscellaneous/petscthreads.html
https://www.mcs.anl.gov/petsc/meetings/2016/slides/nothreads.pdf

I’ve no complete answer but I hope that helps a little.

1 Like