[Trilinos-Users] PyTrilinos and MPI_comm_size error

Bill Spotz wfspotz at sandia.gov
Thu Jan 21 19:34:54 MST 2010


Scott,

The Epetra.PyComm() function returns an MpiComm object if PyTrilinos  
was compiled with MPI support.  If MPI is not initialized by running  
ipython with mpirun (or mpiexec, or whatever is appropriate), then you  
will get the error you see.

If you want to work with PyTrilinos interactively in serial, you'll  
need to explicitly use Epetra.SerialComm(), or compile Trilinos/ 
PyTrilinos without MPI.  If you want to work with PyTrilinos  
interactively in parallel, you can actually do that, using parallel  
ipython1.

On Jan 21, 2010, at 9:14 PM, Scott Askey wrote:

> When use the Epetra.PyComm() method in both my PyTrilinos version  
> built from source on a Centos 5.4 with openmpi 1.4 (on computer A)  
> and  the packages installed from the debian sid repositories (on  
> computer B) I get the following error with Epetra.PyComm().
>
> The the mpi paths in the cmake file point to the the directory where  
> I installed openmpi.   Are there some mpi parameters that need to be  
> set in the environment to assist the  MPI_comm_size?
>
> V/R
>
> Scott
>
>
>
> In [3]: PyTrilinos.version()
> Out[3]: 'Trilinos version: 10.0.4\nPyTrilinos version: 4.2'
> IPython 0.10 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints  
> more.
>
> In [1]: import PyTrilinos
>
> In [2]: PyTrilinos.version
> Out[2]: <function version at 0x2837de8>
>
> In [3]: PyTrilinos.version()
> Out[3]: 'Trilinos version: 10.0.4\nPyTrilinos version: 4.2'
>
> In [4]: from PyTrilinos import Epetra
>
> In [5]: Epetra.SerialComm()
> Out[5]: <PyTrilinos.Epetra.SerialComm; proxy of <Swig Object of type  
> '_p_Epetra_SerialComm' at 0x3007690> >
>
> In [6]: Epetra.PyComm()
> *** An error occurred in MPI_comm_size
> *** before MPI was initialized
> *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
> [debian:4438] Abort before MPI_INIT completed successfully; not able  
> to guarantee that all other processes were killed!
>
>
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-0154      **
** Albuquerque, NM 87185-0370    Email: wfspotz at sandia.gov **







More information about the Trilinos-Users mailing list