[petsc-users] PETSc on fedora 36
Matthew Knepley
knepley at gmail.com
Tue Aug 23 10:21:17 CDT 2022
On Tue, Aug 23, 2022 at 10:33 AM Rafel Amer Ramon <rafel.amer at upc.edu>
wrote:
> Hi,
>
> the files rules and variables are in /usr/lib64/petsc/conf, so I have set
>
> ~$ export PETSC_DIR=/usr
>
> ~$ cat Makefile
>
> e: e.o
> ${CLINKER} -o e e.o ${PETSC_LIB}
>
> include ${PETSC_DIR}/lib64/petsc/conf/variables
> include ${PETSC_DIR}/lib64/petsc/conf/rules
>
> ~$
>
> but, when I try to compile the program, I get the error
>
> ~$ make e
> gcc -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -o e e.o -L/usr/lib64 -L/usr//lib -lpetsc -lsuperlu -lflexiblas -lcgns -lhdf5 -lhdf5_hl -lmetis -lm -lX11 -lquadmath -lstdc++ -ldl
> /usr/bin/ld: cannot open linker script file /builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld: El fitxer o directori no existeix
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:2: e] Error 1
>
>
> In the file /usr/lib64/petsc/conf/petscvariables, there are some
> references to the inexistent file
> /builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld:
>
> ~$ grep /builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld /usr/lib64/petsc/conf/petscvariables
> CXX_LINKER_FLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3
> PCC_LINKER_FLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3
> FC_LINKER_FLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -lgfortran -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O3 -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O3
> CONFIGURE_OPTIONS = --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --with-dependency-tracking=0 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-cc=gcc --with-cxx=g++ --with-fc=gfortran CFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC\" CXXFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC\" FFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O3 -fPIC\" LDFLAGS=\"-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC\" COPTFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3\" CXXOPTFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3\" FOPTFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O3\" FCFLAGS=\"-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O3 -fPIC\" --CC_LINKER_FLAGS=\"-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld\" --FC_LINKER_FLAGS=\"-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -lgfortran\" --with-default-arch=0 --with-make=1 --with-cmake-exec=/usr/bin/cmake3 --with-ctest-exec=/usr/bin/ctest3 --with-single-library=1 --with-precision=double --with-petsc-arch=x86_64 --with-clanguage=C --with-shared-libraries=1 --with-fortran-interfaces=1 --with-windows-graphics=0 --CC=gcc --FC=gfortran --CXX=g++ --with-shared-ld=ld --with-pic=1 --with-clib-autodetect=0 --with-fortranlib-autodetect=0 --with-threadsafety=0 --with-log=1 --with-mkl_sparse=0 --with-mkl_sparse_optimize=0 --with-mkl_cpardiso=0 --with-mkl_pardiso=0 --with-python=0 --with-cxxlib-autodetect=1 --with-debugging=0 --with-mumps-serial=1 --with-mpi=0 --with-hdf5=1 --with-hdf5-include= --with-hdf5-lib=\"-lhdf5 -lhdf5_hl\" --with-cgns=1 --with-cgns-include= --with-cgns-lib=-lcgns --with-x=1 --with-openmp=0 --with-hwloc=0 --with-ssl=0 --with-pthread=1 --with-valgrind=1 --with-64-bit-indices=0 --with-blaslapack=1 --with-blaslapack-lib=-lflexiblas --with-blaslapack-include=/usr/include/flexiblas --with-metis=1 --with-superlu=1 --with-superlu-include=/usr/include/SuperLU --with-superlu-lib=-lsuperlu
> SL_LINKER_FUNCTION = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld -fPIC -shared -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O3 -Wl,-soname,$(call SONAME_FUNCTION,$(notdir $(1)),$(2))
> ~$
>
>
> then, I get the error
>
> /usr/bin/ld: cannot open linker script file /builddir/build/BUILD/petsc-3.16.4/.package_note-petsc-3.16.4-3.fc36.x86_64.ld: the file or folder doesn't exist
>
> I do not know who maintains these PETSc packages for Fedora, but they seem
hopelessly broken.
I would recommend just installing yourself.
Thanks,
Matt
> Best regards,
>
> Rafel Amer
>
>
>
>
>
> El 23/8/22 a les 16:04, Matthew Knepley ha escrit:
>
> On Tue, Aug 23, 2022 at 9:48 AM Rafel Amer Ramon <rafel.amer at upc.edu>
> wrote:
>
>>
>> Hi,
>>
>> yes, I can compile and run it:
>>
>> ~$ mpicc -o pi-mpi pi-mpi.c -lm
>> ~$ mpirun -np 16 --hostfile ~/hosts ./pi-mpi
>> Number of intervals: 2048
>> Result: 3.1411043724
>> Accuracy: 0.0004882812
>> Time: 0.0314383930
>> ~$
>>
>>
>> PETSc does not control the launch, so you must be using a different MPI.
> For building the PETSc executable, try instead
> the minimum makefile
>
> e: e.o
> ${CLINKER} -o e e.o ${PETSC_LIB}
>
> include ${PETSC_DIR}/lib/petsc/conf/variables
> include ${PETSC_DIR}/lib/petsc/conf/rules
>
> Thanks,
>
> Matt
>
>
>> Best regards,
>>
>> Rafel Amer
>>
>>
>>
>>
>> El 23/8/22 a les 14:46, Matthew Knepley ha escrit:
>>
>> Can you run anything in parallel? Say the small sample code that
>> calculates pi?
>>
>>
>> https://www.cs.usfca.edu/~mmalensek/cs220/schedule/code/week09/pi-mpi.c.html
>>
>> Thanks,
>>
>> Matt
>>
>> On Tue, Aug 23, 2022 at 6:34 AM Rafel Amer Ramon <rafel.amer at upc.edu>
>> wrote:
>>
>>>
>>> Hi,
>>>
>>> mpicc and mpirun are from the package openmpi-devel-4.1.2-3.fc36.x86_64
>>> and the petsc64 library is linked with
>>> /usr/lib64/openmpi/lib/libmpi.so.40
>>>
>>> ~# ldd /lib64/libpetsc64.so.3.16.4
>>> linux-vdso.so.1 (0x00007fff5becc000)
>>> libflexiblas64.so.3 => /lib64/libflexiblas64.so.3 (0x00007f3030e30000)
>>> libcgns.so.4.2 => /usr/lib64/openmpi/lib/libcgns.so.4.2 (0x00007f3030d46000)
>>> libhdf5.so.200 => /usr/lib64/openmpi/lib/libhdf5.so.200 (0x00007f303091a000)
>>> libm.so.6 => /lib64/libm.so.6 (0x00007f303083c000)
>>> libX11.so.6 => /lib64/libX11.so.6 (0x00007f30306f4000)
>>> libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f30304c0000)
>>> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f303049e000)
>>> libc.so.6 => /lib64/libc.so.6 (0x00007f303029c000)
>>> libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007f302ffcf000)
>>> libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f302ff87000)
>>> /lib64/ld-linux-x86-64.so.2 (0x00007f30327bb000)
>>> libmpi.so.40 => /usr/lib64/openmpi/lib/libmpi.so.40 (0x00007f302fe59000)
>>> libsz.so.2 => /lib64/libsz.so.2 (0x00007f302fe50000)
>>> libz.so.1 => /lib64/libz.so.1 (0x00007f302fe34000)
>>> libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f302fe08000)
>>> libopen-rte.so.40 => /usr/lib64/openmpi/lib/libopen-rte.so.40 (0x00007f302fd4d000)
>>> libopen-pal.so.40 => /usr/lib64/openmpi/lib/libopen-pal.so.40 (0x00007f302fc9f000)
>>> libhwloc.so.15 => /lib64/libhwloc.so.15 (0x00007f302fc42000)
>>> libevent_core-2.1.so.7 => /lib64/libevent_core-2.1.so.7 (0x00007f302fc07000)
>>> libevent_pthreads-2.1.so.7 => /lib64/libevent_pthreads-2.1.so.7 (0x00007f302fc02000)
>>> libXau.so.6 => /lib64/libXau.so.6 (0x00007f302fbfc000)
>>>
>>>
>>> I think that it's correct, but it don't work.
>>>
>>> Best regards,
>>>
>>> Rafel Amer
>>>
>>> El 22/8/22 a les 20:36, Barry Smith ha escrit:
>>>
>>>
>>> Are you sure the mpirun you are using matches the mpi that PETSc was
>>> built with?
>>>
>>> On Aug 22, 2022, at 2:31 PM, Rafel Amer Ramon <rafel.amer at upc.edu>
>>> wrote:
>>>
>>> Hi,
>>>
>>> I have installed the following packages on fedora 36
>>>
>>> ~# 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
>>> ~# 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
>>>
>>> and I try to compile and run the program written in the file e.c
>>>
>>> ~# 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();
>>> }
>>>
>>> I compile it with the command
>>>
>>> ~# mpicc -o e e.c -I/usr/include/petsc64 -lpetsc64
>>>
>>> and I run it with
>>>
>>> ~# mpirun -np 8 ./eMy 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
>>>
>>> but all my process get rank 0.
>>>
>>> Do you know what I'm doing wrong?
>>>
>>> Thank you!!
>>>
>>> Best regards,
>>>
>>> Rafel Amer
>>>
>>>
>>>
>>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>> https://www.cse.buffalo.edu/~knepley/
>> <http://www.cse.buffalo.edu/~knepley/>
>>
>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220823/2b073c00/attachment-0001.html>
More information about the petsc-users
mailing list