<div>hi,</div>
<div>&nbsp;</div>
<div>i install PETSc using the following command:</div>
<div>&nbsp;</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>&nbsp;</div>
<div>then i got:</div>
<div>&nbsp;</div>
<div>Compilers:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; C Compiler:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /opt/mpich/intel/bin/mpicc&nbsp; -fPIC -g 
<br>&nbsp; Fortran Compiler:&nbsp;&nbsp; /opt/mpich/intel/bin/mpif90&nbsp; -I. -fPIC -g -w90 -w&nbsp; <br>Linkers:<br>&nbsp; Shared linker:&nbsp;&nbsp; /opt/mpich/intel/bin/mpicc&nbsp; -shared&nbsp; -fPIC -g <br>&nbsp; Dynamic linker:&nbsp;&nbsp; /opt/mpich/intel/bin/mpicc&nbsp; -shared&nbsp; -fPIC -g 
<br>PETSc:<br>&nbsp; PETSC_ARCH: linux-mpif90<br>&nbsp; PETSC_DIR: /nas/lsftmp/g0306332/petsc-2.3.2-p8<br>&nbsp; **<br>&nbsp; ** Now build and test the libraries with &quot;make all test&quot;<br>&nbsp; **<br>&nbsp; Clanguage: C<br>&nbsp; Scalar type:real<br>
MPI:<br>&nbsp; Includes: [&#39;/opt/mpich/intel/include&#39;]<br>&nbsp; PETSc shared libraries: enabled<br>&nbsp; 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>&nbsp;</div>
<div>i ran &quot;make all test&quot; and everything seems fine</div>
<div>&nbsp;</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__=&quot;src/snes/examples/tutorials/&quot; 
ex19.c<br>/opt/mpich/intel/bin/mpicc -fPIC -g&nbsp; -o ex19&nbsp; 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&nbsp;&nbsp;&nbsp; -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&nbsp; -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>&nbsp;</div>
<div>I then tried to run my own parallel code. It&#39;s a simple code which prints the rank of each processor. </div>
<div>&nbsp;</div>
<div>If I compile the code using just mpif90 test.F(using just mpif.h)</div>
<div>&nbsp;</div>
<div>I get 0,1,2,3 (4 processors). </div>
<div>&nbsp;</div>
<div>however, if i change the code to use petsc.h etc&nbsp; ie.</div>
<div>&nbsp;</div>
<div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; program ns2d_c</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; implicit none</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>#include &quot;include/finclude/petsc.h&quot;<br>#include &quot;include/finclude/petscvec.h&quot;<br>#include &quot;include/finclude/petscmat.h&quot;<br>#include &quot;include/finclude/petscksp.h&quot;
<br>#include &quot;include/finclude/petscpc.h&quot;<br>#include &quot;include/finclude/petscmat.h90&quot;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; integer,parameter :: size_x=8,size_y=4</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; integer :: ierr,Istart_p,Iend_p,Ntot,Istart_m,Iend_m,k</p>
<p>&nbsp;PetscMPIInt&nbsp;&nbsp;&nbsp;&nbsp; nprocs,rank</p>
<p><br>&nbsp;</p>
<p>call PetscInitialize(PETSC_NULL_CHARACTER,ierr)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call MPI_Comm_size(PETSC_COMM_WORLD,nprocs,ierr)<br></p>
<p>end program ns2d_c</p>
<p>&nbsp;</p>
<p>i then rename the filename to ex2f.F and use &quot;make ex2f&quot;</p>
<p>the result I get is something like 0,0,0,0.</p>
<p>&nbsp;</p>
<p>Why is this so?</p>
<p>Thank you.</p>
<p>&nbsp;</p></div>