Thank you for your replies !<br><br>Yes you guys are right. The MPI that I installed was calling ifort, but the other mpi was calling gfortran. So I ran the program with ifort and gfortran, and it seems the problem is with ifort. I have asked for help in the intel forums. I am little new to these things, so I couldn't figure it out sooner. Sorry about that :)<br>
<br><br>Thanks !!<br><br><div class="gmail_quote">On 19 June 2012 21:15, Darius Buntinas <span dir="ltr"><<a href="mailto:buntinas@mcs.anl.gov" target="_blank">buntinas@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The -show parameter to mpif90 will show the exact command that's used to compile the program.  From that you can see which version of the fortran compiler is being used by each mpif90 wrapper.  That should help you track down the problem.<br>

<span class="HOEnZb"><font color="#888888"><br>
-d<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Jun 19, 2012, at 3:45 AM, Shitij Bhargava wrote:<br>
<br>
> Hi all !!<br>
><br>
><br>
> I have a simple code in fortran that reads a file, and outputs it as it is. I have two different versions of mpif90 in my system. When I compile the same program with the two different compilers and examine the output of the resulting two executables, they differ. This is just a toy program of course, actually I am using MPICH2 with PETSc/SLEPc, and I have the mpif90 that is configured with PETSc/SLEPc in  /home/shitij/Lib/MPI/mpich2-1.3.2/bin/. The problem is that this version of mpif90 is giving the wrong output. I am giving the -v outputs of both versions below:<br>

><br>
> (this one is configured with PETSc/SLEPc and gives incorrect output)<br>
> shitij@shitij:~/JNCASR2012$ /home/shitij/Lib/MPI/mpich2-1.3.2/bin/mpif90 -v<br>
> mpif90 for MPICH2 version 1.3.2<br>
> Version 11.0<br>
><br>
> shitij@shitij:~/JNCASR2012$ mpif90 -v<br>
> Using built-in specs.<br>
> COLLECT_GCC=/usr/bin/gfortran<br>
> COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper<br>
> Target: x86_64-linux-gnu<br>
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu<br>

> Thread model: posix<br>
> gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)<br>
><br>
> The differences in the files I mentioned are varied (and weird), for example some lines are missing (always the same across different runs), some line is read half-way/incorrectly, for example a line:<br>
> ATOM NE2  NR2    -0.70<br>
> is always read as<br>
> ATOM NE2      -0.70<br>
> for some reason.<br>
><br>
> This is the first time I am having a problem like this. Is this a problem with installation of MPICH2 ?<br>
><br>
> I am also giving the code below:<br>
><br>
> program exp4<br>
> implicit none<br>
><br>
>       character(79)::line<br>
><br>
>       open(unit=1,file='top_all27_prot_na_RTF.txt',action='read',ACCESS='STREAM',FORM='FORMATTED')<br>
><br>
>       do<br>
>       read(1,'(a)',END=10)line   !! Read line as string<br>
>       write(*,*)line<br>
>       enddo<br>
>       10 write(*,*)'Done !!'<br>
><br>
> end program exp4<br>
><br>
> Thank you for your help in advance !!!<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
<br>
_______________________________________________<br>
mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
</div></div></blockquote></div><br>