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

doflin.MPI returns NotImplementedError

0 votes

I have recently upgraded to dolfin 1.6 and now I get an error when using MPI. The simplest code is:

import dolfin

print dolfin.MPI.min(1)

and the error I get is:

    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/cpp/common.py in min(*args)
    883 
    884         """
--> 885         return _common.MPI_min(*args)
    886 
    887     min = staticmethod(min)

NotImplementedError: Wrong number or type of arguments for overloaded function 'MPI_min'.
  Possible C/C++ prototypes are:
    dolfin::MPI::min< double >(MPI_Comm,double const &)
    dolfin::MPI::min< int >(MPI_Comm,int const &)
    dolfin::MPI::min< unsigned int >(MPI_Comm,unsigned int const &)
    dolfin::MPI::min< std::size_t >(MPI_Comm,std::size_t const &)
    dolfin::MPI::min< dolfin::Table >(MPI_Comm,dolfin::Table const &)

Does anyone know what can be the source of this error?

Thank you

asked Nov 30, 2015 by apalha FEniCS Novice (440 points)

1 Answer

+1 vote
 
Best answer

you need to supply an MPI_Comm as the first argument, e.g.

print dolfin.MPI.min(dolfin.mpi_comm_world(), 1)

Usually you can use mesh.mpi_comm() when you have a mesh handy.

answered Nov 30, 2015 by chris_richardson FEniCS Expert (31,740 points)
selected Nov 30, 2015 by apalha

Thank you Chris!

This solves my problem. Was this changed from previous versions? My code was running fine before upgrading.

...