This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

'MPI' has no attribute 'process_number'

0 votes

Hi!

I am sorry for the simple question.

I am trying to solve the following example:

http://fenicsproject.org/documentation/dolfin/1.1.0/python/demo/pde/cahn-hilliard/python/documentation.html

And I am having this error:

random.seed(2 + MPI.process_number())
AttributeError: type object 'MPI' has no attribute 'process_number'

What am I doing wrong? Any comments are appreciated!

Thanks!

asked Mar 6, 2016 by C. Okubo FEniCS Novice (470 points)

1 Answer

+1 vote
 
Best answer

Hi, the interface for MPI has changed. The call is now MPI.rank(communicator), e.g.

from dolfin import *
print MPI.rank(mpi_comm_world())
answered Mar 7, 2016 by MiroK FEniCS Expert (80,920 points)
selected Mar 8, 2016 by C. Okubo

Thanks, MiroK!

...