<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>  The options database option should work also. Are you calling KSPSetFromOptions()?<div class=""><br class=""></div><div class="">  Also -ksp_view should include information about the orthogonalization used.</div><div class=""><br class=""></div><div class="">  Barry</div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 10, 2020, at 8:32 PM, Zhang, Hong via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" class="">
<style type="text/css" style="display:none;" class=""> P {margin-top:0;margin-bottom:0;} </style>

<div dir="ltr" class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important" class="">Zhuo,</span><br class="">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important" class="">Call </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important" class="">KSPSetType(ksp,KSPGMRES);<br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important" class="">KSPGMRESSetOrthogonalization(ksp,KSPGMRESModifiedGramSchmidtOrthogonalization);<br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important" class="">Hong</span></div>
<div id="appendonsend" class=""></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%" class="">
<div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size:11pt" class=""><b class="">From:</b> Zhuo Chen <<a href="mailto:chenzhuotj@gmail.com" class="">chenzhuotj@gmail.com</a>><br class="">
<b class="">Sent:</b> Thursday, September 10, 2020 8:17 PM<br class="">
<b class="">To:</b> Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>><br class="">
<b class="">Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class="">
<b class="">Subject:</b> Re: [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?</font>
<div class=""> </div>
</div>
<div class="">
<div dir="ltr" class="">Hi Hong,
<div class=""><br class="">
</div>
<div class="">Thank you very much for your help.</div>
<div class=""><br class="">
</div>
<div class="">It seems that if I simply append -ksp_gmres_modifiedgramschmidt the warning goes away. However KSPGMRESSetOrthogonalization(ksp,KSPGMRESModifiedGramSchmidtOrthogonalization,ierr) has another issue.</div>
<div class=""><br class="">
</div>
<div class="">Error: Symbol â€˜kspgmresmodifiedgramschmidtorthogonalization’ at (1) has no IMPLICIT type<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Is it because the argument is too long? I am using gcc 8.4.0 instead of ifort</div>
</div>
<br class="">
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Sep 10, 2020 at 7:08 PM Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>> wrote:<br class="">
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr" class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">Zhuo,</span><br class="">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">Run your code with option '-ksp_gmres_modifiedgramschmidt'. For example, </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">petsc/src/ksp/ksp/tutorials<br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">mpiexec -n 2 ./ex2 -ksp_view -ksp_gmres_modifiedgramschmidt
<div class="">KSP Object: 2 MPI processes</div>
<div class="">  type: gmres</div>
<div class="">    restart=30, using Modified Gram-Schmidt Orthogonalization</div>
<div class="">    happy breakdown tolerance 1e-30</div>
<div class="">  maximum iterations=10000, initial guess is zero</div>
<div class="">  tolerances:  relative=0.000138889, absolute=1e-50, divergence=10000.</div>
<div class="">  left preconditioning</div>
<div class="">  using PRECONDITIONED norm type for convergence test</div>
<div class="">PC Object: 2 MPI processes</div>
  type: bjacobi<br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">...</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class=""><br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">You can call KSPGMRESSetOrthogonalization(ksp,KSPGMRESModifiedGramSchmidtOrthogonalization) in your program.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class=""><br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="color:rgb(0,0,255); font-family:arial,sans-serif; font-size:12.8px; background-color:rgb(255,255,255); display:inline" class="">Hong</span></div>
<div id="x_gmail-m_4843333755770207763appendonsend" class=""></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<hr style="display:inline-block; width:98%" class="">
<div id="x_gmail-m_4843333755770207763divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size:11pt" class=""><b class="">From:</b> petsc-users <<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank" class="">petsc-users-bounces@mcs.anl.gov</a>>
 on behalf of Zhuo Chen <<a href="mailto:chenzhuotj@gmail.com" target="_blank" class="">chenzhuotj@gmail.com</a>><br class="">
<b class="">Sent:</b> Thursday, September 10, 2020 7:52 PM<br class="">
<b class="">To:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>><br class="">
<b class="">Subject:</b> [petsc-users] How to activate the modified Gram-Schmidt orthogonalization process in Fortran?</font>
<div class=""> </div>
</div>
<div class="">
<div dir="ltr" class="">Dear Petsc users,
<div class=""><br class="">
</div>
<div class="">I found an ancient thread discussing this problem.</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2011-October/010607.html" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2011-October/010607.html</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">However, when I add</div>
<div class=""><br class="">
</div>
<div class="">call KSPSetType(ksp,KSPGMRES,ierr);CHKERRQ(ierr)</div>
<div class="">call PetscOptionsSetValue(PETSC_NULL_OPTIONS,'-ksp_gmres_modifiedgramschmidt','1',ierr);CHKERRQ(ierr)<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">the program will tell me</div>
<div class=""><br class="">
</div>
<div class="">WARNING! There are options you set that were not used!<br class="">
WARNING! could be spelling mistake, etc!<br class="">
There is one unused database option. It is:<br class="">
Option left: name:-ksp_gmres_modifiedgramschmidt value: 1<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I would like to know the most correct way to activate the modified Gram-Schmidt orthogonalization process in Fortran. Thank you very much!</div>
<div class=""><br class="">
</div>
<div class="">Best regards. </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><font color="#0000ff" style="font-family:arial,sans-serif; font-size:12.8px" class="">Zhuo Chen</font>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">Department of Physics</font></div>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">University of Alberta</font></div>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">Edmonton Alberta, Canada T6G 2E1</font></div>
<div class=""><font face="'comic sans ms', sans-serif" class=""><a href="http://www.pas.rochester.edu/~zchen25/" target="_blank" style="background-color:rgb(255,255,255)" class=""><font class="">http://www.pas.rochester.edu/~zchen25/</font></a><br class="">
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class=""><font color="#0000ff" style="font-family:arial,sans-serif; font-size:12.8px" class="">Zhuo Chen</font>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">Department of Physics</font></div>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">University of Alberta</font></div>
<div style="font-family:arial,sans-serif; font-size:12.8px" class=""><font color="#0000ff" class="">Edmonton Alberta, Canada T6G 2E1</font></div>
<div class=""><font face="'comic sans ms', sans-serif" class=""><a href="http://www.pas.rochester.edu/~zchen25/" target="_blank" style="background-color:rgb(255,255,255)" class=""><font class="">http://www.pas.rochester.edu/~zchen25/</font></a><br class="">
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div></blockquote></div><br class=""></div></body></html>