<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Can I preallocate space for a rectangular matrix using MatCreateAIJ() in parallel?</div><div>It is not clear to me how I have to define d_nnz when the matrix is rectangular?<br></div><div><br></div><div><font face="monospace">X * * * *</font></div><div><font face="monospace">* </font><span style="font-family:monospace">X</span><span style="font-family:monospace"> </span><span style="font-family:monospace">* * *</span></div><div><font face="monospace">* </font><span style="font-family:monospace">* </span><span style="font-family:monospace">X</span><span style="font-family:monospace"> </span><span style="font-family:monospace">* *</span></div><div><font face="monospace">* </font><span style="font-family:monospace">* * </span><span style="font-family:monospace">X</span><span style="font-family:monospace"> </span><span style="font-family:monospace">*</span></div><div><font face="monospace">* </font><span style="font-family:monospace">* * * </span><span style="font-family:monospace">X</span><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">* * * * *</span></div><div><span style="font-family:monospace">* * * * *</span></div><div><span style="font-family:monospace"><br></span></div><div><div>The example shown is for an 8x8 matrix on 3 cpu</div><div><font face="monospace">X * *</font></div><div><font face="monospace">* X *</font></div></div><div><font face="monospace">* * X</font></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 17, 2022 at 9:02 AM Jose E. Roman <<a href="mailto:jroman@dsic.upv.es">jroman@dsic.upv.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You have to preallocate, see <a href="https://petsc.org/release/docs/manual/mat/#sec-matsparse" rel="noreferrer" target="_blank">https://petsc.org/release/docs/manual/mat/#sec-matsparse</a><br>
<br>
> El 17 oct 2022, a las 8:37, fujisan <<a href="mailto:fujisan43@gmail.com" target="_blank">fujisan43@gmail.com</a>> escribió:<br>
> <br>
> Hi everyone,<br>
> <br>
> I initialize a large sparse matrix (50000x20000) using MatCreate() and then filling it with MatSetValues() line by line <br>
> but it takes a bit more than an hour on 80 cores to fill in the matrix.<br>
> <br>
> Is there a way to optimize this initialization?<br>
> <br>
> Fuji<br>
<br>
</blockquote></div>