Traceback (most recent call last):
File "try.py", line 8, in <module>
parameters["num_threads"] = 6 # invoke multi-thread parallel support
RuntimeError: Parameter num_threads not found in Parameters object
Concurrent processing with threads was removed a long time ago, circa 2014 I believe.
Parallelism in FEniCS is achieved by partitioning problems to MPI processes. E.g. running a script in the following manner will employ 4 MPI processes:
mpirun -np 4 python3 demo_poisson.py to run the code but its showing in different output with four processor
Process 0: Solving linear variational problem.
Process 3: Solving linear variational problem.
Process 1: Solving linear variational problem.
Process 2: Solving linear variational problem.
That is the expected behavior. When you run in parallel, every task is divided between processes, so the output shows which task each process is doing. If you don’t want to see a lot of outputs, you can use something like this at the begining of your code:
# MPI parameters
comm = MPI.comm_world
rank = MPI.rank(comm)
# Sets log level for parallel runs
set_log_level(LogLevel.ERROR)
if rank == 0: set_log_level(LogLevel.PROGRESS)