[petsc-users] [petsc-maint #61421] ksp/examples/tutorials/Ex2.c: good with with-debugging but error without-debugging

Mengda Wu wumengda at gmail.com
Mon Jan 17 21:29:13 CST 2011


Sorry but I am new to PETSc. This is out of my ability to find why this
happens in PETSc.
I am happy to do some tests to look for the tests if you can instruct me how
to do that.

There is an option in config/configure.py, which I do not use and may be
relevant to check.
  --with-64-bit-pointers=<bool>
   : Use 64 bit compilers and libraries

Thanks,
Mengda

On Mon, Jan 17, 2011 at 2:01 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>   Mengda,
>
>    Thanks for the report. At the website it says "You perform arithmetic on
> 64-bit pointers and then pass the results to an inline function that expects
> an "int" data type." Do you know specifically where this is happening in
> PETSc? We don't intend to in PETSc " perform arithmetic on 64-bit pointers
> and then pass the results to an inline function that expects an "int" data
> type.
>
>   Thanks
>
>   Barry
>
>
>
> On Jan 17, 2011, at 3:43 PM, Mengda Wu wrote:
>
> > This indeed is caused by a bug in Visual c++ 2005 64bit compiler when
> using
> > optimization.
> > The result is correct after installing the hotfix:
> > http://support.microsoft.com/kb/976617/
> > Thanks a lot!
> >
> > Mengda
> >
> > On Mon, Jan 17, 2011 at 12:27 PM, Barry Smith <bsmith at mcs.anl.gov>
> wrote:
> >
> >>
> >> Compiler bug. Immediately before the call to MatMult() in the code add
> the
> >> two lines
> >>
> >> ierr = VecView(u,0);
> >> ierr = MatView(A,0);
> >>
> >> how large are the two objects? Given the code it is inconceivable that
> >> suddenly the vector length becomes 57.
> >>
> >>  Barry
> >>
> >>
> >> On Jan 17, 2011, at 2:43 AM, Mengda Wu wrote:
> >>
> >>> Hi all,
> >>>
> >>>   I just compiled the debugged and optimized versions of petsc-3.1-p7.
> >>> Both are successful. I am running on Windows Vista 64bit machine.
> >>> The C/C++ compiler is cl.exe from visual studio 2005 (64 bit) and no
> >> FORTRAN
> >>> compiler is used. BLAS/LAPACK
> >>> support comes from Intel MKL-10.1.3.028 (under em64t\lib). No MPI is
> >> used.
> >>>
> >>>  The debugged petsc was configured with:
> >>>  $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> >>> --with-mpi=
> >>> 0
> >>>
> >>
> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_thread.lib,mkl_core.lib
> >>> ,libiomp5mt.lib] -CFLAGS='-MDd -W3 -Z7' -CXXFLAGS='-MDd -W3 -Z7'
> >>>
> >>>  The optimized petsc was configured with:
> >>>  $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> >>> --with-mpi=
> >>> 0 --with-debugging=0
> >>> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_threa
> >>> d.lib,mkl_core.lib,libiomp5mt.lib]  -CFLAGS='-MD -wd4996 -O2'
> >> -CXXFLAGS='-MD
> >>> -w
> >>> d4996 -O2'
> >>>
> >>>  When I run ksp/examples/tutorials/Ex2.c. The result with debugged
> petsc
> >>> is
> >>> =================================================================
> >>>  Norm of error 0.000156044 iterations 6
> >>> =================================================================
> >>>
> >>>  However, there are errors with the optimized petsc with the output as
> >>> follows:
> >>> =================================================================
> >>> [0]PETSC ERROR: --------------------- Error Message
> >>> ----------------------------
> >>> --------
> >>> [0]PETSC ERROR: Nonconforming object sizes!
> >>> [0]PETSC ERROR: Mat mat,Vec y: global dim 56 57!
> >>> [0]PETSC ERROR:
> >>> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
> 14:26:37
> >>> CST 20
> >>> 10
> >>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> >>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> >>> [0]PETSC ERROR: See docs/index.html for manual pages.
> >>> [0]PETSC ERROR:
> >>> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR:
> >>> D:\Develop\Test\PETSc\petsc-3.1-p7\src\ksp\ksp\examples\tutorial
> >>> s\ex2.exe on a cygwin-c- named CVBRL-38 by mengda Mon Jan 17 00:35:15
> >> 2011
> >>> [0]PETSC ERROR: Libraries linked from
> >>> /cygdrive/d/Develop/Test/PETSc/petsc-3.1-p
> >>> 7/cygwin-c-opt/lib
> >>> [0]PETSC ERROR: Configure run at Sun Jan 16 23:34:25 2011
> >>> [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0
> --with-cxx=cl
> >>> --with-
> >>> mpi=0 --with-debugging=0
> >>> --with-blas-lapack-lib="[mkl_intel_lp64.lib,mkl_intel_t
> >>> hread.lib,mkl_core.lib,libiomp5mt.lib]" -CFLAGS="-MD -wd4996 -O2"
> >>> -CXXFLAGS="-MD
> >>> -wd4996 -O2" --useThreads=0
> >>> [0]PETSC ERROR:
> >>> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR: MatMult() line 1888 in
> >>> src/mat/interface/D:\Develop\Test\PETSc\P
> >>> ETSC-~1.1-P\src\mat\INTERF~1\matrix.c
> >>> [0]PETSC ERROR: main() line 146 in
> >>> src/ksp/ksp/examples/tutorials/D:\Develop\Tes
> >>> t\PETSc\PETSC-~1.1-P\src\ksp\ksp\examples\TUTORI~1\ex2.c
> >>>
> >>> This application has requested the Runtime to terminate it in an
> unusual
> >>> way.
> >>> Please contact the application's support team for more information.
> >>> =================================================================
> >>>
> >>>  I am wondering what problems may lead to the errors. Please let me
> know
> >>> if you need more
> >>> information.
> >>>
> >>> Thanks,
> >>> Mengda
> >>>
> >>> Hi all,
> >>>
> >>>    I just compiled the debugged and optimized versions of petsc-3.1-p7.
> >> Both are successful. I am running on Windows Vista 64bit machine.
> >>> The C/C++ compiler is cl.exe from visual studio 2005 (64 bit) and no
> >> FORTRAN compiler is used. BLAS/LAPACK
> >>> support comes from Intel MKL-10.1.3.028 (under em64t\lib). No MPI is
> >> used.
> >>>
> >>>   The debugged petsc was configured with:
> >>>   $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> >> --with-mpi=
> >>> 0
> >>
> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_thread.lib,mkl_core.lib
> >>> ,libiomp5mt.lib] -CFLAGS='-MDd -W3 -Z7' -CXXFLAGS='-MDd -W3 -Z7'
> >>>
> >>>   The optimized petsc was configured with:
> >>>   $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> >> --with-mpi=
> >>> 0 --with-debugging=0
> >> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_threa
> >>> d.lib,mkl_core.lib,libiomp5mt.lib]  -CFLAGS='-MD -wd4996 -O2'
> >> -CXXFLAGS='-MD -w
> >>> d4996 -O2'
> >>>
> >>>   When I run ksp/examples/tutorials/Ex2.c. The result with debugged
> >> petsc is
> >>> =================================================================
> >>>   Norm of error 0.000156044 iterations 6
> >>> =================================================================
> >>>
> >>>   However, there are errors with the optimized petsc with the output as
> >> follows:
> >>> =================================================================
> >>> [0]PETSC ERROR: --------------------- Error Message
> >> ----------------------------
> >>> --------
> >>> [0]PETSC ERROR: Nonconforming object sizes!
> >>> [0]PETSC ERROR: Mat mat,Vec y: global dim 56 57!
> >>> [0]PETSC ERROR:
> >> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
> 14:26:37
> >> CST 20
> >>> 10
> >>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> >>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> >>> [0]PETSC ERROR: See docs/index.html for manual pages.
> >>> [0]PETSC ERROR:
> >> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR:
> >> D:\Develop\Test\PETSc\petsc-3.1-p7\src\ksp\ksp\examples\tutorial
> >>> s\ex2.exe on a cygwin-c- named CVBRL-38 by mengda Mon Jan 17 00:35:15
> >> 2011
> >>> [0]PETSC ERROR: Libraries linked from
> >> /cygdrive/d/Develop/Test/PETSc/petsc-3.1-p
> >>> 7/cygwin-c-opt/lib
> >>> [0]PETSC ERROR: Configure run at Sun Jan 16 23:34:25 2011
> >>> [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0
> --with-cxx=cl
> >> --with-
> >>> mpi=0 --with-debugging=0
> >> --with-blas-lapack-lib="[mkl_intel_lp64.lib,mkl_intel_t
> >>> hread.lib,mkl_core.lib,libiomp5mt.lib]" -CFLAGS="-MD -wd4996 -O2"
> >> -CXXFLAGS="-MD
> >>> -wd4996 -O2" --useThreads=0
> >>> [0]PETSC ERROR:
> >> ----------------------------------------------------------------
> >>> --------
> >>> [0]PETSC ERROR: MatMult() line 1888 in
> >> src/mat/interface/D:\Develop\Test\PETSc\P
> >>> ETSC-~1.1-P\src\mat\INTERF~1\matrix.c
> >>> [0]PETSC ERROR: main() line 146 in
> >> src/ksp/ksp/examples/tutorials/D:\Develop\Tes
> >>> t\PETSc\PETSC-~1.1-P\src\ksp\ksp\examples\TUTORI~1\ex2.c
> >>>
> >>> This application has requested the Runtime to terminate it in an
> unusual
> >> way.
> >>> Please contact the application's support team for more information.
> >>> =================================================================
> >>>
> >>>   I am wondering what problems may lead to the errors. Please let me
> >> know if you need more
> >>> information.
> >>>
> >>> Thanks,
> >>> Mengda
> >>
> >>
> >
> > This indeed is caused by a bug in Visual c++ 2005 64bit compiler when
> using optimization.
> > The result is correct after installing the hotfix:
> http://support.microsoft.com/kb/976617/
> > Thanks a lot!
> >
> > Mengda
> >
> > On Mon, Jan 17, 2011 at 12:27 PM, Barry Smith <bsmith at mcs.anl.gov>
> wrote:
> >
> >  Compiler bug. Immediately before the call to MatMult() in the code add
> the two lines
> >
> > ierr = VecView(u,0);
> > ierr = MatView(A,0);
> >
> > how large are the two objects? Given the code it is inconceivable that
> suddenly the vector length becomes 57.
> >
> >   Barry
> >
> >
> > On Jan 17, 2011, at 2:43 AM, Mengda Wu wrote:
> >
> > > Hi all,
> > >
> > >    I just compiled the debugged and optimized versions of petsc-3.1-p7.
> > > Both are successful. I am running on Windows Vista 64bit machine.
> > > The C/C++ compiler is cl.exe from visual studio 2005 (64 bit) and no
> FORTRAN
> > > compiler is used. BLAS/LAPACK
> > > support comes from Intel MKL-10.1.3.028 (under em64t\lib). No MPI is
> used.
> > >
> > >   The debugged petsc was configured with:
> > >   $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> > > --with-mpi=
> > > 0
> > >
> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_thread.lib,mkl_core.lib
> > > ,libiomp5mt.lib] -CFLAGS='-MDd -W3 -Z7' -CXXFLAGS='-MDd -W3 -Z7'
> > >
> > >   The optimized petsc was configured with:
> > >   $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> > > --with-mpi=
> > > 0 --with-debugging=0
> > > --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_threa
> > > d.lib,mkl_core.lib,libiomp5mt.lib]  -CFLAGS='-MD -wd4996 -O2'
> -CXXFLAGS='-MD
> > > -w
> > > d4996 -O2'
> > >
> > >   When I run ksp/examples/tutorials/Ex2.c. The result with debugged
> petsc
> > > is
> > > =================================================================
> > >   Norm of error 0.000156044 iterations 6
> > > =================================================================
> > >
> > >   However, there are errors with the optimized petsc with the output as
> > > follows:
> > > =================================================================
> > > [0]PETSC ERROR: --------------------- Error Message
> > > ----------------------------
> > > --------
> > > [0]PETSC ERROR: Nonconforming object sizes!
> > > [0]PETSC ERROR: Mat mat,Vec y: global dim 56 57!
> > > [0]PETSC ERROR:
> > > ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
> 14:26:37
> > > CST 20
> > > 10
> > > [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> > > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> > > [0]PETSC ERROR: See docs/index.html for manual pages.
> > > [0]PETSC ERROR:
> > > ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR:
> > > D:\Develop\Test\PETSc\petsc-3.1-p7\src\ksp\ksp\examples\tutorial
> > > s\ex2.exe on a cygwin-c- named CVBRL-38 by mengda Mon Jan 17 00:35:15
> 2011
> > > [0]PETSC ERROR: Libraries linked from
> > > /cygdrive/d/Develop/Test/PETSc/petsc-3.1-p
> > > 7/cygwin-c-opt/lib
> > > [0]PETSC ERROR: Configure run at Sun Jan 16 23:34:25 2011
> > > [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0
> --with-cxx=cl
> > > --with-
> > > mpi=0 --with-debugging=0
> > > --with-blas-lapack-lib="[mkl_intel_lp64.lib,mkl_intel_t
> > > hread.lib,mkl_core.lib,libiomp5mt.lib]" -CFLAGS="-MD -wd4996 -O2"
> > > -CXXFLAGS="-MD
> > > -wd4996 -O2" --useThreads=0
> > > [0]PETSC ERROR:
> > > ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR: MatMult() line 1888 in
> > > src/mat/interface/D:\Develop\Test\PETSc\P
> > > ETSC-~1.1-P\src\mat\INTERF~1\matrix.c
> > > [0]PETSC ERROR: main() line 146 in
> > > src/ksp/ksp/examples/tutorials/D:\Develop\Tes
> > > t\PETSc\PETSC-~1.1-P\src\ksp\ksp\examples\TUTORI~1\ex2.c
> > >
> > > This application has requested the Runtime to terminate it in an
> unusual
> > > way.
> > > Please contact the application's support team for more information.
> > > =================================================================
> > >
> > >   I am wondering what problems may lead to the errors. Please let me
> know
> > > if you need more
> > > information.
> > >
> > > Thanks,
> > > Mengda
> > >
> > > Hi all,
> > >
> > >     I just compiled the debugged and optimized versions of
> petsc-3.1-p7. Both are successful. I am running on Windows Vista 64bit
> machine.
> > > The C/C++ compiler is cl.exe from visual studio 2005 (64 bit) and no
> FORTRAN compiler is used. BLAS/LAPACK
> > > support comes from Intel MKL-10.1.3.028 (under em64t\lib). No MPI is
> used.
> > >
> > >    The debugged petsc was configured with:
> > >    $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> --with-mpi=
> > > 0
>  --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_thread.lib,mkl_core.lib
> > > ,libiomp5mt.lib] -CFLAGS='-MDd -W3 -Z7' -CXXFLAGS='-MDd -W3 -Z7'
> > >
> > >    The optimized petsc was configured with:
> > >    $ ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
> --with-mpi=
> > > 0 --with-debugging=0
> --with-blas-lapack-lib=[mkl_intel_lp64.lib,mkl_intel_threa
> > > d.lib,mkl_core.lib,libiomp5mt.lib]  -CFLAGS='-MD -wd4996 -O2'
> -CXXFLAGS='-MD -w
> > > d4996 -O2'
> > >
> > >    When I run ksp/examples/tutorials/Ex2.c. The result with debugged
> petsc is
> > > =================================================================
> > >    Norm of error 0.000156044 iterations 6
> > > =================================================================
> > >
> > >    However, there are errors with the optimized petsc with the output
> as follows:
> > > =================================================================
> > > [0]PETSC ERROR: --------------------- Error Message
> ----------------------------
> > > --------
> > > [0]PETSC ERROR: Nonconforming object sizes!
> > > [0]PETSC ERROR: Mat mat,Vec y: global dim 56 57!
> > > [0]PETSC ERROR:
> ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
> 14:26:37 CST 20
> > > 10
> > > [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> > > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> > > [0]PETSC ERROR: See docs/index.html for manual pages.
> > > [0]PETSC ERROR:
> ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR:
> D:\Develop\Test\PETSc\petsc-3.1-p7\src\ksp\ksp\examples\tutorial
> > > s\ex2.exe on a cygwin-c- named CVBRL-38 by mengda Mon Jan 17 00:35:15
> 2011
> > > [0]PETSC ERROR: Libraries linked from
> /cygdrive/d/Develop/Test/PETSc/petsc-3.1-p
> > > 7/cygwin-c-opt/lib
> > > [0]PETSC ERROR: Configure run at Sun Jan 16 23:34:25 2011
> > > [0]PETSC ERROR: Configure options --with-cc=cl --with-fc=0
> --with-cxx=cl --with-
> > > mpi=0 --with-debugging=0
> --with-blas-lapack-lib="[mkl_intel_lp64.lib,mkl_intel_t
> > > hread.lib,mkl_core.lib,libiomp5mt.lib]" -CFLAGS="-MD -wd4996 -O2"
> -CXXFLAGS="-MD
> > >  -wd4996 -O2" --useThreads=0
> > > [0]PETSC ERROR:
> ----------------------------------------------------------------
> > > --------
> > > [0]PETSC ERROR: MatMult() line 1888 in
> src/mat/interface/D:\Develop\Test\PETSc\P
> > > ETSC-~1.1-P\src\mat\INTERF~1\matrix.c
> > > [0]PETSC ERROR: main() line 146 in
> src/ksp/ksp/examples/tutorials/D:\Develop\Tes
> > > t\PETSc\PETSC-~1.1-P\src\ksp\ksp\examples\TUTORI~1\ex2.c
> > >
> > > This application has requested the Runtime to terminate it in an
> unusual way.
> > > Please contact the application's support team for more information.
> > > =================================================================
> > >
> > >    I am wondering what problems may lead to the errors. Please let me
> know if you need more
> > > information.
> > >
> > > Thanks,
> > > Mengda
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110117/fd987255/attachment-0001.htm>


More information about the petsc-users mailing list