[petsc-users] petsc4py & GPU

Lisandro Dalcin dalcinl at gmail.com
Thu Apr 20 10:36:48 CDT 2017


On 20 April 2017 at 17:09, Damian Kaliszan <damian at man.poznan.pl> wrote:

> Thank you for reply:) Sorry for maybe stupid question in the scope of
> setting petsc(4py) options.
> Should the following calls (somewhere before creating matrix & vectors):
>
> PETSc.Options().setValue("ksp_view", "")
> PETSc.Options().setValue("log_view", "")
>

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:

import sys, petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc



-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 0109
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170420/765bfae9/attachment.html>


More information about the petsc-users mailing list