<div>hi,</div>
<div> </div>
<div>i install PETSc using the following command:</div>
<div> </div>
<div>./config/configure.py --with-vendor-compilers=intel --with-gnu-compilers=0 --with-blas-lapack-dir=/lsftmp/g0306332/inter/mkl/lib/32 --with-mpi-dir=/opt/mpich/intel/ --with-x=0 --with-shared</div>
<div> </div>
<div>then i got:</div>
<div> </div>
<div>Compilers: <br> C Compiler: /opt/mpich/intel/bin/mpicc -fPIC -g
<br> Fortran Compiler: /opt/mpich/intel/bin/mpif90 -I. -fPIC -g -w90 -w <br>Linkers:<br> Shared linker: /opt/mpich/intel/bin/mpicc -shared -fPIC -g <br> Dynamic linker: /opt/mpich/intel/bin/mpicc -shared -fPIC -g
<br>PETSc:<br> PETSC_ARCH: linux-mpif90<br> PETSC_DIR: /nas/lsftmp/g0306332/petsc-2.3.2-p8<br> **<br> ** Now build and test the libraries with "make all test"<br> **<br> Clanguage: C<br> Scalar type:real<br>
MPI:<br> Includes: ['/opt/mpich/intel/include']<br> PETSc shared libraries: enabled<br> PETSc dynamic libraries: disabled<br>BLAS/LAPACK: -Wl,-rpath,/lsftmp/g0306332/inter/mkl/lib/32 -L/lsftmp/g0306332/inter/mkl/lib/32 -lmkl_lapack -lmkl_ia32 -lguide
</div>
<div> </div>
<div>i ran "make all test" and everything seems fine</div>
<div> </div>
<div>/opt/mpich/intel/bin/mpicc -c -fPIC -g -I/nas/lsftmp/g0306332/petsc-2.3.2-p8 -I/nas/lsftmp/g0306332/petsc-2.3.2-p8/bmake/linux-mpif90 -I/nas/lsftmp/g0306332/petsc-2.3.2-p8/include -I/opt/mpich/intel/include -D__SDIR__="src/snes/examples/tutorials/"
ex19.c<br>/opt/mpich/intel/bin/mpicc -fPIC -g -o ex19 ex19.o -Wl,-rpath,/nas/lsftmp/g0306332/petsc-2.3.2-p8/lib/linux-mpif90 -L/nas/lsftmp/g0306332/petsc-2.3.2-p8/lib/linux-mpif90 -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -Wl,-rpath,/lsftmp/g0306332/inter/mkl/lib/32 -L/lsftmp/g0306332/inter/mkl/lib/32 -lmkl_lapack -lmkl_ia32 -lguide -lPEPCF90 -Wl,-rpath,/opt/intel/compiler70/ia32/lib -Wl,-rpath,/opt/mpich/intel/lib -L/opt/mpich/intel/lib -Wl,-rpath,-rpath -Wl,-rpath,-ldl -L-ldl -lmpich -Wl,-rpath,/opt/intel/compiler70/ia32/lib -Wl,-rpath,/opt/intel/compiler70/ia32/lib -L/opt/intel/compiler70/ia32/lib -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib -L/usr/lib -limf -lirc -lcprts -lcxa -lunwind -ldl -lmpichf90 -lPEPCF90 -Wl,-rpath,/opt/intel/compiler70/ia32/lib -L/opt/intel/compiler70/ia32/lib -Wl,-rpath,/usr/lib -L/usr/lib -lintrins -lIEPCF90 -lF90 -lm -Wl,-rpath,\ -Wl,-rpath,\ -L\ -ldl -lmpich -Wl,-rpath,/opt/intel/compiler70/ia32/lib -L/opt/intel/compiler70/ia32/lib -Wl,-rpath,/usr/lib -L/usr/lib -limf -lirc -lcprts -lcxa -lunwind -ldl
<br>/bin/rm -f ex19.o<br>C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process<br>C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI processes<br>Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process
<br>Completed test examples<br> </div>
<div>I then tried to run my own parallel code. It's a simple code which prints the rank of each processor. </div>
<div> </div>
<div>If I compile the code using just mpif90 test.F(using just mpif.h)</div>
<div> </div>
<div>I get 0,1,2,3 (4 processors). </div>
<div> </div>
<div>however, if i change the code to use petsc.h etc ie.</div>
<div> </div>
<div>
<p> program ns2d_c</p>
<p> implicit none</p>
<p> <br>#include "include/finclude/petsc.h"<br>#include "include/finclude/petscvec.h"<br>#include "include/finclude/petscmat.h"<br>#include "include/finclude/petscksp.h"
<br>#include "include/finclude/petscpc.h"<br>#include "include/finclude/petscmat.h90"</p>
<p> integer,parameter :: size_x=8,size_y=4</p>
<p> integer :: ierr,Istart_p,Iend_p,Ntot,Istart_m,Iend_m,k</p>
<p> PetscMPIInt nprocs,rank</p>
<p><br> </p>
<p>call PetscInitialize(PETSC_NULL_CHARACTER,ierr)</p>
<p> call MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)</p>
<p> call MPI_Comm_size(PETSC_COMM_WORLD,nprocs,ierr)<br></p>
<p>end program ns2d_c</p>
<p> </p>
<p>i then rename the filename to ex2f.F and use "make ex2f"</p>
<p>the result I get is something like 0,0,0,0.</p>
<p> </p>
<p>Why is this so?</p>
<p>Thank you.</p>
<p> </p></div>