<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <div>&gt;&gt; Please send the entire error message (this is missing
      the stack), but I am guessing you</div>
    <div>&gt;&gt; are not changed the default preconditioner (ILU) which
      cannot act on a shell matrix. Use</div>
    <div>&gt;&gt; -ksp_view to see what solver is begin used.</div>
    <br>
    The full error message:<br>
    <br>
    test.exe -log_summary -ksp_view<br>
    <br>
    [0]PETSC ERROR: --------------------- Error Message
    ------------------------------------<br>
    [0]PETSC ERROR: No support for this operation for this object type!<br>
    [0]PETSC ERROR: Mat type shell!<br>
    [0]PETSC ERROR:
    ------------------------------------------------------------------------<br>
    [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20
    14:26:37 CST 2010<br>
    [0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
    [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
    [0]PETSC ERROR: See docs/index.html for manual pages.<br>
    [0]PETSC ERROR:
    ------------------------------------------------------------------------<br>
    [0]PETSC ERROR: test.exe on a cygwin-cx named M0. by Unknown Mon Jun
    27 16:51:32 2011<br>
    [0]PETSC ERROR: Libraries linked from
    /cygdrive/d/dev/petsc-3.1-p7/cygwin-cxx-debug/lib<br>
    [0]PETSC ERROR: Configure run at Fri Mar&nbsp; 4 10:10:06 2011<br>
    [0]PETSC ERROR: Configure options --with-cc="win32fe cl"
    --with-fc="win32fe ifort" --with-cxx="win32fe cl"
    --with-windows-graphics=0<br>
    --with-precision=double --with-scalar-type=complex
    --with-clanguage=cxx
    --with-mpi-include=/cygdrive/d/Dev/HPC_2008_SDK/Include --wi<br>
    /HPC_2008_SDK/Lib/amd64/msmpi.lib,/cygdrive/d/Dev/HPC_2008_SDK/Lib/amd64/msmpifec.lib]"
    --useThreads=0 --useThreads=0<br>
    [0]PETSC ERROR:
    ------------------------------------------------------------------------<br>
    [0]PETSC ERROR: MatNorm() line 4512 in
    src/mat/interface/D:\dev\PETSC-~3.1-P\src\mat\INTERF~1\matrix.c<br>
    [0]PETSC ERROR: KSPSolve_LSQR() line 90 in
    src/ksp/ksp/impls/lsqr/D:\dev\PETSC-~3.1-P\src\ksp\ksp\impls\lsqr\lsqr.c<br>
    [0]PETSC ERROR: KSPSolve() line 396 in
    src/ksp/ksp/interface/D:\dev\PETSC-~3.1-P\src\ksp\ksp\INTERF~1\itfunc.c<br>
    <br>
    job aborted:<br>
    [ranks] message<br>
    <br>
    [0] application aborted<br>
    aborting MPI_COMM_WORLD, error 56, comm rank 0<br>
    <br>
    On 27.06.2011 16:47, Matthew Knepley wrote:
    <blockquote
      cite="mid:BANLkTi=AW8m09CnWgp9sggyQU2C8L04Ctw@mail.gmail.com"
      type="cite">On Mon, Jun 27, 2011 at 9:34 AM, Alexander Grayver <span
        dir="ltr">&lt;<a moz-do-not-send="true"
          href="mailto:agrayver@gfz-potsdam.de">agrayver@gfz-potsdam.de</a>&gt;</span>
      wrote:<br>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          Thanks Barry,<br>
          <br>
          Now I get this:</blockquote>
        <div><br>
        </div>
        <div>Please send the entire error message (this is missing the
          stack), but I am guessing you</div>
        <div>are not changed the default preconditioner (ILU) which
          cannot act on a shell matrix. Use</div>
        <div>-ksp_view to see what solver is begin used.</div>
        <div><br>
        </div>
        <div>&nbsp; &nbsp;Matt</div>
        <div>&nbsp;</div>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div class="im">
            [0]PETSC ERROR: --------------------- Error Message
            ----------------------------<br>
            --------<br>
          </div>
          [0]PETSC ERROR: No support for this operation for this object
          type!<br>
          [0]PETSC ERROR: Mat type shell!
          <div class="im"><br>
            [0]PETSC ERROR: ----------------------------------------------------------------<br>
            --------<br>
            [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon
            Dec 20 14:26:37 CST 20<br>
            10<br>
            [0]PETSC ERROR: See docs/changes/index.html for recent
            updates.<br>
            [0]PETSC ERROR: See docs/faq.html for hints about trouble
            shooting.<br>
            [0]PETSC ERROR: See docs/index.html for manual pages.<br>
            [0]PETSC ERROR: ----------------------------------------------------------------<br>
            --------<br>
          </div>
          [0]PETSC ERROR: test.exe on a cygwin<br>
          -cx named MT0. by Unknown Mon Jun 27 16:30:42 2011
          <div class="im"><br>
            [0]PETSC ERROR: Libraries linked from
            /cygdrive/d/dev/petsc-3.1-p7/cygwin-cxx-de<br>
            bug/lib<br>
            [0]PETSC ERROR: Configure run at Fri Mar &nbsp;4 10:10:06 2011<br>
            [0]PETSC ERROR: Configure options --with-cc="win32fe cl"
            --with-fc="win32fe ifor<br>
            t" --with-cxx="win32fe cl" --with-windows-graphics=0
            --download-f-blas-lapack=1<br>
            --with-precision=double --with-scalar-type=complex
            --with-clanguage=cxx --with-m<br>
            pi-include=/cygdrive/d/Dev/HPC_2008_SDK/Include
            --with-mpi-lib="[/cygdrive/d/Dev<br>
            /HPC_2008_SDK/Lib/amd64/msmpi.lib,/cygdrive/d/Dev/HPC_2008_SDK/Lib/amd64/msmpife<br>
            c.lib]" --useThreads=0 --useThreads=0<br>
            [0]PETSC ERROR: ----------------------------------------------------------------<br>
            --------<br>
          </div>
          [0]PETSC ERROR: MatNorm() line 4512 in
          src/mat/interface/D:\dev\PETSC-3.1-P\src\mat\INTERF~1\matrix.c
          <div>
            <div class="h5"><br>
              <br>
              On <a moz-do-not-send="true" href="tel:27.06.2011%2016"
                value="+12706201116" target="_blank">27.06.2011 16</a>:32,
              Barry Smith wrote:<br>
            </div>
          </div>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div>
              <div class="h5"> &nbsp; You should pass H as third argument to
                KSPSetOperators() as well as the second.<br>
                <br>
                &nbsp; Barry<br>
                <br>
                On Jun 27, 2011, at 9:23 AM, Alexander Grayver wrote:<br>
                <br>
              </div>
            </div>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              <div>
                <div class="h5">
                  Hello!<br>
                  <br>
                  I'm using matrix-free formulation and KSPLSQR to solve
                  normal equations system:<br>
                  <br>
                  (A'*A)b = -g<br>
                  <br>
                  I managed to write all necessary code:<br>
                  <br>
                  &nbsp;call MatCreateShell(MPI_COMM_WORLD,m,N,N,N,PETSC_NULL_INTEGER,H,ierr)<br>
                  &nbsp;call MatShellSetOperation(H,MATOP_MULT,MFMatMult,ierr)<br>
                  <br>
                  &nbsp;call KSPCreate(MPI_COMM_WORLD,ksp,ierr);CHKERRQ(ierr)<br>
                  &nbsp;call KSPSetType(ksp,KSPLSQR,ierr);CHKERRQ(ierr)<br>
                  &nbsp;call KSPGetPC(ksp,pc,ierr);CHKERRQ(ierr)<br>
                  &nbsp;call PCSetType(pc,PCNONE,ierr);CHKERRQ(ierr)<br>
                  &nbsp;call KSPSetOperators(ksp,H,PETSC_NULL_OBJECT,SAME_PRECONDITIONER,ierr);CHKERRQ(ierr)<br>
                  &nbsp;call KSPSolve(ksp,g,b,ierr);CHKERRQ(ierr)<br>
                  <br>
                  <br>
                  but fail in KSPSolve stage with that:<br>
                  [0]PETSC ERROR: --------------------- Error Message
                  ----------------------------<br>
                  --------<br>
                  [0]PETSC ERROR: Object is in wrong state!<br>
                  [0]PETSC ERROR: Mat object's type is not set: Argument
                  # 1!<br>
                  [0]PETSC ERROR: ----------------------------------------------------------------<br>
                  --------<br>
                  [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7,
                  Mon Dec 20 14:26:37 CST 20<br>
                  10<br>
                  [0]PETSC ERROR: See docs/changes/index.html for recent
                  updates.<br>
                  [0]PETSC ERROR: See docs/faq.html for hints about
                  trouble shooting.<br>
                  [0]PETSC ERROR: See docs/index.html for manual pages.<br>
                  [0]PETSC ERROR: ----------------------------------------------------------------<br>
                  --------<br>
                </div>
              </div>
              [0]PETSC ERROR: test.exe on a cygwin
              <div class="im"><br>
                -cx named MT0. by Unknown Mon Jun 27 16:18:43 2011<br>
                [0]PETSC ERROR: Libraries linked from
                /cygdrive/d/dev/petsc-3.1-p7/cygwin-cxx-de<br>
                bug/lib<br>
                [0]PETSC ERROR: Configure run at Fri Mar &nbsp;4 10:10:06
                2011<br>
                [0]PETSC ERROR: Configure options --with-cc="win32fe cl"
                --with-fc="win32fe ifor<br>
                t" --with-cxx="win32fe cl" --with-windows-graphics=0
                --download-f-blas-lapack=1<br>
                --with-precision=double --with-scalar-type=complex
                --with-clanguage=cxx --with-m<br>
                pi-include=/cygdrive/d/Dev/HPC_2008_SDK/Include
                --with-mpi-lib="[/cygdrive/d/Dev<br>
                /HPC_2008_SDK/Lib/amd64/msmpi.lib,/cygdrive/d/Dev/HPC_2008_SDK/Lib/amd64/msmpife<br>
                c.lib]" --useThreads=0 --useThreads=0<br>
                [0]PETSC ERROR: ----------------------------------------------------------------<br>
                --------<br>
                [0]PETSC ERROR: MatNorm() line 4507 in
                src/mat/interface/D:\dev\PETSC-3.1-P\src\mat\INTERF~1\matrix.c<br>
                [0]PETSC ERROR: KSPSolve_LSQR() line 90 in
                src/ksp/ksp/impls/lsqr/D:\dev\PETSC-3.1-P\src\ksp\ksp\impls\lsqr\lsqr.c<br>
                <br>
                Any suggestions? Do I have to set MATOP_NORM operation?
                Then how?<br>
                <br>
                Regards,<br>
                Alexander<br>
              </div>
            </blockquote>
          </blockquote>
          <br>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      What most experimenters take for granted before they begin their
      experiments is infinitely more interesting than any results to
      which their experiments lead.<br>
      -- Norbert Wiener<br>
    </blockquote>
    <br>
  </body>
</html>