[mpich-discuss] Two different mpif90 (in mpich2) versions giving different output for same source code

Jeff Hammond jhammond at alcf.anl.gov
Tue Jun 19 10:41:45 CDT 2012


your program does not call MPI so it is not an MPI program.  if you're
not using MPI, it seems the problem is not due to MPI.  do you
disagree with this logic?

can you compile your program with a plain, non-MPI Fortran compiler
and see what happens?  it is possible that your different versions of
mpif90 point to different Fortran compilers and that this is the
origin of your issues.  in any case, this has nothing to do with MPI,
but rather your use of two different compilers.

jeff

On Tue, Jun 19, 2012 at 1:45 AM, Shitij Bhargava <shitij.cse at gmail.com> wrote:
> Hi all !!
>
>
> 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:
>
> (this one is configured with PETSc/SLEPc and gives incorrect output)
> shitij at shitij:~/JNCASR2012$ /home/shitij/Lib/MPI/mpich2-1.3.2/bin/mpif90 -v
> mpif90 for MPICH2 version 1.3.2
> Version 11.0
>
> shitij at shitij:~/JNCASR2012$ mpif90 -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/gfortran
> COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
> Target: x86_64-linux-gnu
> 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
> Thread model: posix
> gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
>
> 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:
> ATOM NE2  NR2    -0.70
> is always read as
> ATOM NE2      -0.70
> for some reason.
>
> This is the first time I am having a problem like this. Is this a problem
> with installation of MPICH2 ?
>
> I am also giving the code below:
>
> program exp4
> implicit none
>
> character(79)::line
> open(unit=1,file='top_all27_prot_na_RTF.txt',action='read',ACCESS='STREAM',FORM='FORMATTED')
>
> do
> read(1,'(a)',END=10)line   !! Read line as string
> write(*,*)line
> enddo
> 10 write(*,*)'Done !!'
> end program exp4
>
> Thank you for your help in advance !!!
>
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond


More information about the mpich-discuss mailing list