<html><head></head><body><div dir="auto">Hi, <br></div>
<div dir="auto">There might be the problem because I'm using ArgumentParser class to catch complex command line arguments. In this case is there any chance to make both to cooperate or the only solution is to pass everything through argument to init method of petsc4py? <br></div>
<div dir="auto">Best, <br></div>
<div dir="auto">Damian</div>
<div class="gmail_quote" >W dniu 20 kwi 2017, o 17:37, użytkownik Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>> napisał:
 <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">
 <div class="gmail_extra">
  <br>
  <div class="gmail_quote">
   On 20 April 2017 at 17:09, Damian Kaliszan 
   <span dir="ltr"><<a href="mailto:damian@man.poznan.pl" target="_blank">damian@man.poznan.pl</a>></span> wrote:
   <br>
   <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    <span style="font-family:'courier new';font-size:9pt">Thank you for reply:) Sorry for maybe stupid question in the scope of setting petsc(4py) options.<br> Should the following calls (somewhere before creating matrix & vectors):<br> <br> PETSc.Options().setValue("ksp_<wbr>view", "")<br> PETSc.Options().setValue("log_<wbr>view", "")<br></span>
   </blockquote>
  </div>
  <br>Unfortunately, no. There are a few options (-log_view ?) that you should set before calling PetscInitialize() (which happens automatically at import time), otherwise things do not work as expected. To pass things from the command line and set them before PetscInitialize() the usual idiom is:
 </div>
 <div class="gmail_extra">
  <br>
 </div>
 <div class="gmail_extra">
  import sys, petsc4py
 </div>
 <div class="gmail_extra">
  petsc4py.init(sys.argv)
 </div>
 <div class="gmail_extra">
  from petsc4py import PETSc
 </div>
 <div class="gmail_extra">
  <br>
 </div>
 <div class="gmail_extra">
  <br clear="all">
  <div>
   <br>
  </div>-- 
  <br>
  <div class="gmail_signature" data-smartmail="gmail_signature">
   Lisandro Dalcin
   <br>============
   <br>Research Scientist
   <br>Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
   <br>Extreme Computing Research Center (ECRC)
   <br>King Abdullah University of Science and Technology (KAUST)
   <br>
   <a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a>
   <br>
   <br>4700 King Abdullah University of Science and Technology
   <br>al-Khawarizmi Bldg (Bldg 1), Office # 0109
   <br>Thuwal 23955-6900, Kingdom of Saudi Arabia
   <br>
   <a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a>
   <br>
   <br>Office Phone: +966 12 808-0459
  </div> 
 </div>
</div></blockquote></div></body></html>