Open sangallidavide opened 1 month ago
Honestly, I do not see why -nompi
flag is needed? Any specific reason why this is added? According to MPI standard, running mpirun -n 1 yambo
must be same as running simply calling yambo
and no special care needs to be taken in the code. Here is what is in standard (please note yambo does not call any special functions such as MPI_UNIVERSE_SIZE)
When an application enters MPI_INIT, clearly it must be able to determine if these special steps were taken. If a process enters MPI_INIT and determines that no special steps were taken (i.e., it has not been given the information to form an MPI_COMM_WORLD with other processes) it succeeds and forms a singleton MPI program, that is, one in which MPI_COMM_WORLD has size 1.
In my machine with nvfortran and cuda support
mpirun -np 1 yambo
works just fineyambo -nompi
works just fineyambo
hangs foreverI've reproduced the same behavior with nvfortran on a couple of other machines. No idea of why.
I do not know why -nompi
was added either. Just it is there, and I use it sometimes.
First time I tested yambo with elpa+gpu I used yambo -nompi
and it gave me segmentation fault. :-)
@muralidhar-nalabothula yambo can be
a) compiled without mpi:
--disable-mpi
at configure time,-D_MPI
is not defined. Of course scalapck/blacs cannot be linked. Probably it does not make sense to link elpa neither. We can de-activate the ydiago implementation as well in such case.b) compiled with mpi but mpi disabled at runtime using
yambo -nompi
. In such case the code can be compiled with all mpi libraries (including sclapack/blacs/etc .. ), butMPI_Init
is not called. Moreover, all calls such ascall MPI_COMM_SIZE
are protected by something likeif(ncpu>1) return
.For case (a), we can leave it as an open issue, and work on this in the future.
For case (b) it might be enough to put some
if(ncpu>1) then / else
insideK_diagonalize
to avoid seg-fault at runtime.