On 10/4/06, <b class="gmail_sendername">Xiaoxu Wang</b> <<a href="mailto:xiwang@dragon.rutgers.edu">xiwang@dragon.rutgers.edu</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Does it work as long as the global length is several times of the local<br>length?</blockquote><div><br>I think you are misunderstanding these terms. The local length is the<br>number of matrix rows assigned to the given process. The global length
<br>is the sum of the local lengths.<br><br> Matt<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks<br>Xiaoxu<br><br>Matthew Knepley wrote:
<br><br>> On 10/4/06, *Xiaoxu Wang* <<a href="mailto:xiwang@dragon.rutgers.edu">xiwang@dragon.rutgers.edu</a><br>> <mailto:<a href="mailto:xiwang@dragon.rutgers.edu">xiwang@dragon.rutgers.edu</a>>> wrote:
<br>><br>> Hi, Thank you for your help already. Can anybody tell me how to<br>> set the<br>> size of local matrix? Can I set it arbitrarily?<br>><br>><br>> Yes, you can. If you also set the global size it must be consistent.
<br>><br>> Matt<br>><br>> Xiaoxu<br>><br>> Xiaoxu Wang wrote:<br>><br>> ><br>> > The error is at line 1023 of " plog.c".<br>> > ---------------<br>> > An unhandled exception of type '
System.NullReferenceException'<br>> > occurred in Unknown Module.<br>> ><br>> > Additional information: Object reference not set to an instance<br>> of an<br>> > object.<br>> > ----------------
<br>> ><br>> > The matrix I am trying to initialize is the stiffness matrix K of<br>> > finite element methods. Later the dynamical system is solved<br>> as (I +<br>> > Dt*K) U(t+1) = U(t) +
Dt.F(t) by calling KSPSolve. Any idea how<br>> to set<br>> > the number of local rows? I am running the code on PC now, but want<br>> > to keep MatCreateMPIAIJ in it.<br>> > Xiaoxu<br>
> > ----- Original Message ----- From: "Barry Smith" <<br>> <a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a> <mailto:<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>>>
<br>> > To: <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a> <mailto:<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>>><br>> > Sent: Tuesday, October 03, 2006 8:32 AM
<br>> > Subject: Re: MatCreateMPIAIJ<br>> ><br>> ><br>> >><br>> >><br>> >> On Mon, 2 Oct 2006, Xiaoxu Wang wrote:<br>> >><br>> >>> Hi,
<br>> >>><br>> >>> I am a beginner on PETSC. This is my question about<br>> >>> MatCreateMPIAIJ. I<br>> >>> have a sparse matrix and only know the total number of
<br>> nonzeros each<br>> >>> row. The<br>> >>> number of local rows and the number of local columns has been<br>> set to<br>> >>> PETSC_DECIDE. Therefore I don't know the size of each portion
<br>> and it<br>> >>> is hard<br>> >>> to tell d_nnz and o_nnz. I use the total number of nunzeros as<br>> d_nnz<br>> >>> and get<br>> >>> an allocation error.
<br>> >><br>> >><br>> >><br>> >> It would be helpful to know the exact error message:<br>> >><br>> >>> How to deal with this problem? Should I explicitly
<br>> >>> specify the number of local rows and the number of local<br>> columns and<br>> >>> calculate<br>> >>> d_nnz and o_nnz? Or let PETSC decide the number of local rows and
<br>> >>> the number<br>> >>> of local columns, and then use another function to get these<br>> >>> values? Any<br>> >>> other better solution?<br>> >>
<br>> >><br>> >><br>> >> You should specifically set the number of local rows and columns<br>> >> and then<br>> >> compute the values of d_nnz and o_nnz. How you determine d_nnz and
<br>> >> o_nnz is<br>> >> problem dependent and depends on what type of discretization<br>> you are<br>> >> using:<br>> >> finite differences, elements etc.<br>> >>
<br>> >><br>> >> Barry<br>> >><br>> >>><br>> >>> Thanks a lot,<br>> >>> Xiaoxu<br>> >>><br>> >>><br>
> >><br>> >><br>> ><br>><br>><br>><br>><br>> --<br>> "Failure has a thousand explanations. Success doesn't need one" -- Sir<br>> Alec Guiness<br><br><br></blockquote>
</div><br><br clear="all"><br>-- <br>"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness