<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>Hi
everybody</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=343214313-28052008><FONT face=Arial size=2>I have a problem
with MatSetValues, since the building of my matrix takes much longer (35
s) than its solution (0.2 s). When the number of degrees of freedom is
increased, then the problem worsens. The rate of which the elements of
the (sparse) matrix is set also seems to decrease with the number of elements
already set. That is, it becomes slower near
the end. </FONT></SPAN></DIV>
<DIV><SPAN class=343214313-28052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=343214313-28052008><FONT face=Arial size=2>The structure of my
program is something like:</FONT> </SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>for element in
finite elements</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>
for dof in element
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008> for
equations in FEM formulation
</SPAN></FONT></DIV></SPAN></FONT></DIV></SPAN></FONT><FONT face=Arial
size=2><SPAN class=343214313-28052008></SPAN></FONT></DIV>
<DIV><SPAN class=343214313-28052008>
<DIV><SPAN class=343214313-28052008><FONT face=Arial
size=2> ierr =
MatSetValues(M->M,1,&i,1,&j,&tmp,ADD_Values);</FONT>
<DIV><SPAN class=343214313-28052008><FONT face=Arial
size=2> ierr =
MatSetValues(M->M,1,&k,1,&l,&tmp,ADD_Values);</FONT>
<DIV><SPAN class=343214313-28052008><FONT face=Arial
size=2> ierr =
MatSetValues(M->M,1,&i,1,&l,&tmp,ADD_Values);</FONT>
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008>
ierr =
MatSetValues(M->M,1,&k,1,&j,&tmp,ADD_Values);</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008>
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>where i,j,k,l are
appropriate integers and tmp is a double value to be added. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>The code has fine
worked with previous version of petsc (not compiled by me). The version of
petsc that I use is slightly newer (I think), 2.3.3 vs ~2.3.
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=343214313-28052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>I<SPAN class=343214313-28052008>s it
something of an dynamic allocation problem? I have tried using
MatSetValuesBlock, but this is only slightly faster. If I monitor the program's
CPU and memory consumption then the CPU is 100 % used and the memory consumption
is only 20-30 mb. </SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=343214313-28052008></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=343214313-28052008>My computer is
a red hat linux with a xeon quad core processor. I use Intel's MKL blas and
lapack.
</SPAN></FONT></FONT></SPAN></SPAN></SPAN></SPAN></DIV></DIV></DIV></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=343214313-28052008>What should I do to
speed up the petsc?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=343214313-28052008><FONT face=Arial size=2>Kind
regards</FONT></SPAN></DIV>
<DIV><SPAN class=343214313-28052008><FONT face=Arial
size=2>Lars</FONT></SPAN></DIV>
<DIV align=left>
<P class=MsoNormal><B><SPAN
style="FONT-SIZE: 10pt; COLOR: #5c5a52; FONT-FAMILY: 'Verdana','sans-serif'">_____________________________<?xml:namespace
prefix = o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></SPAN></B></P><SPAN style="COLOR: #404040">
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><BR></SPAN><B><SPAN
style="FONT-SIZE: 10pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'">Lars
Rindorf</SPAN></B><SPAN
style="FONT-SIZE: 7.5pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'"><BR></SPAN><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'">M.Sc.,
Ph.D. </SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'"></SPAN><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'"><A
title=http://www.teknologisk.dk/ href="http://www.teknologisk.dk/"><SPAN
title=http://www.teknologisk.dk/
style="COLOR: #595959">http://www.dti.dk</SPAN></A><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'">Danish
Technological Institute<BR>Gregersensvej<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'">2630
Taastrup<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 8pt; COLOR: #595959; FONT-FAMILY: 'Verdana','sans-serif'">Denmark<BR>Phone
+45 72 20 20 00</SPAN></P></DIV>
<DIV> </DIV></BODY></HTML>