<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Are you sure the mpirun you are using matches the mpi that PETSc was built with? <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 22, 2022, at 2:31 PM, Rafel Amer Ramon <<a href="mailto:rafel.amer@upc.edu" class="">rafel.amer@upc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
<div class="">
Hi,<br class="">
<br class="">
I have installed the following packages on fedora 36<br class="">
<br class="">
<pre class=""><font color="#0000ff" class="">~# rpm -qa | grep petsc
petsc64-3.16.4-3.fc36.x86_64
petsc-3.16.4-3.fc36.x86_64
petsc-openmpi-3.16.4-3.fc36.x86_64
petsc-openmpi-devel-3.16.4-3.fc36.x86_64
python3-petsc-openmpi-3.16.4-3.fc36.x86_64
petsc-devel-3.16.4-3.fc36.x86_64
petsc64-devel-3.16.4-3.fc36.x86_64</font>
<font color="#0000ff" class="">~# rpm -qa | grep openmpi
openmpi-4.1.2-3.fc36.x86_64
ptscotch-openmpi-6.1.2-2.fc36.x86_64
scalapack-openmpi-2.1.0-11.fc36.x86_64
openmpi-devel-4.1.2-3.fc36.x86_64
MUMPS-openmpi-5.4.1-2.fc36.x86_64
superlu_dist-openmpi-6.1.1-9.fc36.x86_64
hdf5-openmpi-1.12.1-5.fc36.x86_64
hypre-openmpi-2.18.2-6.fc36.x86_64
petsc-openmpi-3.16.4-3.fc36.x86_64
fftw-openmpi-libs-double-3.3.10-2.fc36.x86_64
fftw-openmpi-libs-long-3.3.10-2.fc36.x86_64
fftw-openmpi-libs-single-3.3.10-2.fc36.x86_64
fftw-openmpi-libs-3.3.10-2.fc36.x86_64
fftw-openmpi-devel-3.3.10-2.fc36.x86_64
petsc-openmpi-devel-3.16.4-3.fc36.x86_64
python3-petsc-openmpi-3.16.4-3.fc36.x86_64
scalapack-openmpi-devel-2.1.0-11.fc36.x86_64
python3-openmpi-4.1.2-3.fc36.x86_64
hdf5-openmpi-devel-1.12.1-5.fc36.x86_64
cgnslib-openmpi-4.2.0-6.fc36.x86_64
cgnslib-openmpi-devel-4.2.0-6.fc36.x86_64</font>
</pre>
and I try to compile and run the program written in the file e.c<br class="">
<br class="">
<pre class=""><font color="#0000ff" class="">~# cat e.c
#include <petsc.h>
int main(int argc, char **argv) {
PetscErrorCode ierr;
PetscMPIInt rank;
ierr = PetscInitialize(&argc,&argv,NULL,
"Compute e in parallel with PETSc.\n\n"); if (ierr) return ierr;
ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank); CHKERRQ(ierr);
ierr = PetscPrintf(PETSC_COMM_WORLD,"My rank is %d\n",rank); CHKERRQ(ierr);
return PetscFinalize();
}
</font>
</pre>
I compile it with the command<br class="">
<br class="">
<pre class=""><font color="#0000ff" class="">~# mpicc -o e e.c -I/usr/include/petsc64 -lpetsc64</font>
</pre>
and I run it with <br class="">
<br class="">
<pre class=""><font color="#0000ff" class="">~# mpirun -np 8 ./e</font>
<font color="#0000ff" class="">My rank is 0
My rank is 0
My rank is 0
My rank is 0
My rank is 0
My rank is 0
My rank is 0
My rank is 0</font>
</pre>
but all my process get rank 0.<br class="">
<br class="">
Do you know what I'm doing wrong?<br class="">
<br class="">
Thank you!!<br class="">
<br class="">
Best regards,<br class="">
<br class="">
Rafel Amer
</div>
</div></blockquote></div><br class=""></body></html>