lammps fortran version, FFT problem

Hi,

There is a communication problem between C and fortran,

when they are used with openmpi. There is no problem, if you use mpich or mpich2.

When using openmpi, the code crashes in line 602 in "fft_3d.c" where the MPI_Comm_rank(comm,&me) is executed. This happens because the <<comm>> variable in "fft_3d.c" has different default value from the fortran <<MPI_COMM_WORLD>>.

If you insist on using openmpi, then you should replace the <<comm>> variable in fft_3d.c with MPI_COMM_WORLD inside all mpi commands; then the code should run without any problem.

More details about this problem, please see http://www.lam-mpi.org/MailArchives/lam/2005/02/9993.php

Takis Kolokathis

School of Chemical Engineering

National Technical University of Athens

The Fortran version of LAMMPS was written before
OpenMPI existed. If you have a simple fix for this
issue, we’d consider adding it to the Fortran version.
But we really don’t maintain the 15-year old version

of the code.

Steve

The Fortran version of LAMMPS was written before
OpenMPI existed. If you have a simple fix for this
issue, we’d consider adding it to the Fortran version.
But we really don’t maintain the 15-year old version
of the code.

MPI_Comm_f2c() and MPI_Comm_c2f() are the canonical way to exchange communicators between fortran and C/C++