<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font size="+1"><font face="Times New Roman, Times, serif">The
problem is solved with the new 3.9.0 release on conda-forge. <br>
<br>
Thanks Lisandro !!<br>
<br>
Loic<br>
</font></font><br>
<div class="moz-cite-prefix">Le 23/04/2018 à 13:25, Loic Gouarin a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:c0c44305-de6f-2284-3d0f-a40b28ef84e2@math.u-psud.fr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<font size="+1"><font face="Times New Roman, Times, serif">Thanks
Lawrence for your reply.</font></font><br>
<br>
<div class="moz-cite-prefix">Le 23/04/2018 à 12:36, Lawrence
Mitchell a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:E50BBB61-270E-4140-870F-767F40DB3F90@imperial.ac.uk">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">On 23 Apr 2018, at 11:32, Loic Gouarin <a class="moz-txt-link-rfc2396E" href="mailto:loic.gouarin@math.u-psud.fr" moz-do-not-send="true"><loic.gouarin@math.u-psud.fr></a> wrote:
Hi,
I try to use MATIS from petsc4py but I am not able to use setValuesLocal (I have a segmentation fault). And I don't understand why.
Could you tell me if I did a mistake or if it's a bug ?
</pre>
</blockquote>
<pre wrap="">This code works for me with:
PETSc: 7bfdb6492ce
petsc4py: 9137bf78e
Perhaps you have a mismatching petsc4py/PETSc combo?</pre>
</blockquote>
The problem probably comes from the conda package. I reinstalled a
new environment and tried again but I still have this issue.<br>
<br>
Did you compile petsc and petsc4py ?<br>
<br>
The versions that I use are those given on conda-forge :
petsc-3.8.4 and petsc4py-3.8.1.<br>
<br>
I did the following thing<br>
<br>
conda create -n petsc_tmp<br>
source activate petsc_tmp<br>
conda install petsc4py -c conda-forge<br>
<br>
and execute my script.<br>
<br>
Loic<br>
<blockquote type="cite"
cite="mid:E50BBB61-270E-4140-870F-767F40DB3F90@imperial.ac.uk">
<pre wrap="">
Lawrence
</pre>
<blockquote type="cite">
<pre wrap="">My example
=======
from petsc4py import PETSc
import numpy as np
n = 10
da = PETSc.DMDA().create([n, n], dof=1, stencil_width=1)
da.setMatType(PETSc.Mat.Type.IS)
A = da.createMatrix()
#ltog = da.getLGMap()
#A.setLGMap(ltog, ltog)
elem = da.getElements()
melem = np.ones((4, 4))
for e in elem:
A.setValuesLocal(e, e, melem, PETSc.InsertMode.ADD_VALUES)
Thanks,
Loic
--
Tel: 01 69 15 60 14
<a class="moz-txt-link-freetext" href="http://www.math.u-psud.fr/%7Egouarin" moz-do-not-send="true">http://www.math.u-psud.fr/~gouarin</a>
<a class="moz-txt-link-freetext" href="https://github.com/gouarin" moz-do-not-send="true">https://github.com/gouarin</a>
</pre>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Tel: 01 69 15 60 14
<a class="moz-txt-link-freetext" href="http://www.math.u-psud.fr/%7Egouarin" moz-do-not-send="true">http://www.math.u-psud.fr/~gouarin</a>
<a class="moz-txt-link-freetext" href="https://github.com/gouarin" moz-do-not-send="true">https://github.com/gouarin</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Tel: 01 69 15 60 14
<a class="moz-txt-link-freetext" href="http://www.math.u-psud.fr/~gouarin">http://www.math.u-psud.fr/~gouarin</a>
<a class="moz-txt-link-freetext" href="https://github.com/gouarin">https://github.com/gouarin</a></pre>
</body>
</html>