<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> The code in ex125.c contains<div><br></div><div><div> PetscCall(MatCreate(PETSC_COMM_WORLD, &C));</div><div> PetscCall(MatSetOptionsPrefix(C, "rhs_"));</div><div> PetscCall(MatSetSizes(C, m, PETSC_DECIDE, PETSC_DECIDE, nrhs));</div><div> PetscCall(MatSetType(C, MATDENSE));</div><div> PetscCall(MatSetFromOptions(C));</div><div> PetscCall(MatSetUp(C));</div><div><br></div><div>This dense parallel matrix is suitable for passing to MatMatSolve() as the right-hand side matrix. Note it is created with PETSC_COMM_WORLD and its type is set to be MATDENSE.</div><div><br></div><div> You may need to make a sample code by stripping out all the excess code in ex125.c to just create an MATAIJ and MATDENSE and solves with MatMatSolve() to determine why you code does not work.</div><div><br></div><div><br></div><div><br><blockquote type="cite"><div>On May 4, 2023, at 3:20 AM, 권승리 / 학생 / 항공우주공학과 <ksl7912@snu.ac.kr> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Dear Barry Smith<div><br></div><div>Thank you for your reply.</div><div><br></div><div>I've already installed MUMPS.</div><div><br></div><div>And I checked the example you said (ex125.c), I don't understand why the RHS matrix becomes the SeqDense matrix.</div><div><br></div><div>Could you explain in more detail?</div><div><br></div><div>Best regards</div><div>Seung Lee Kwon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2023년 5월 4일 (목) 오후 12:08, Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> You can configure with MUMPS ./configure --download-mumps --download-scalapack --download-ptscotch --download-metis --download-parmetis <div><br></div><div> And then use MatMatSolve() as in <span style="color:rgb(200,20,201);font-family:Menlo;font-size:14px">src/mat/tests/ex125.c</span> with parallel MatMatSolve() using MUMPS as the solver.</div><div><br></div><div> Barry</div><div><br><div><br><blockquote type="cite"><div>On May 3, 2023, at 10:29 PM, 권승리 / 학생 / 항공우주공학과 <<a href="mailto:ksl7912@snu.ac.kr" target="_blank">ksl7912@snu.ac.kr</a>> wrote:</div><br><div><div dir="ltr">Dear developers<div><br></div><div>Thank you for your explanation.</div><div><br></div><div>But I should use the MatCreateSeqDense because I want to use the MatMatSolve that B matrix must be a SeqDense matrix.</div><div><br></div><div>Using MatMatSolve is an inevitable part of my code.</div><div><br></div><div>Could you give me a comment to avoid this error?</div><div><br></div><div>Best,</div><div><br></div><div>Seung Lee Kwon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2023년 5월 3일 (수) 오후 7:30, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, May 3, 2023 at 6:05 AM 권승리 / 학생 / 항공우주공학과 <<a href="mailto:ksl7912@snu.ac.kr" target="_blank">ksl7912@snu.ac.kr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear developers<div><br></div><div>I'm trying to use parallel computing and I ran the command 'mpirun -np 4 ./app'</div><div><br></div><div>In this case, there are two problems.</div><div><br></div><div><b>First,</b> I encountered error message</div><div>///</div><div>[0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[1]PETSC ERROR: Invalid argument<br>[1]PETSC ERROR: Comm must be of size 1</div><div>///<br><div><div>The code on the error position is </div><div>MatCreateSeqDense(PETSC_COMM_SELF, nns, ns, NULL, &Kns));</div></div></div></div></blockquote><div><br></div><div>1) "Seq" means sequential, that is "not parallel".</div><div><br></div><div>2) This line should still be fine since PETSC_COMM_SELF is a serial communicator</div><div><br></div><div>3) You should be checking the error code for each call, maybe using the CHKERRQ() macro</div><div><br></div><div>4) Please always send the entire error message, not a snippet</div><div><br></div><div> THanks</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Could "MatCreateSeqDense" not be used in parallel computing?</div><div><br></div><div><b>Second</b>, the same error message is repeated as many times as the number of cores.</div><div>if I use command -np 4, then the error message is repeated 4 times.</div><div>Could you recommend some advice related to this?<br></div><div><br></div><div><div>Best,</div><div>Seung Lee Kwon</div></div><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div>Seung Lee Kwon, Ph.D.Candidate</div><div>Aerospace Structures and Materials Laboratory</div><div>Department of Mechanical and Aerospace Engineering</div><div>Seoul National University</div><div>Building 300 Rm 503, Gwanak-ro 1, Gwanak-gu, Seoul, South Korea, 08826</div><div>E-mail : <a href="mailto:ksl7912@snu.ac.kr" target="_blank">ksl7912@snu.ac.kr</a></div><div>Office : +82-2-880-7389</div><div>C. P : +82-10-4695-1062</div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div>Seung Lee Kwon, Ph.D.Candidate</div><div>Aerospace Structures and Materials Laboratory</div><div>Department of Mechanical and Aerospace Engineering</div><div>Seoul National University</div><div>Building 300 Rm 503, Gwanak-ro 1, Gwanak-gu, Seoul, South Korea, 08826</div><div>E-mail : <a href="mailto:ksl7912@snu.ac.kr" target="_blank">ksl7912@snu.ac.kr</a></div><div>Office : +82-2-880-7389</div><div>C. P : +82-10-4695-1062</div></div></div>
</div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Seung Lee Kwon, Ph.D.Candidate</div><div>Aerospace Structures and Materials Laboratory</div><div>Department of Mechanical and Aerospace Engineering</div><div>Seoul National University</div><div>Building 300 Rm 503, Gwanak-ro 1, Gwanak-gu, Seoul, South Korea, 08826</div><div>E-mail : <a href="mailto:ksl7912@snu.ac.kr" target="_blank">ksl7912@snu.ac.kr</a></div><div>Office : +82-2-880-7389</div><div>C. P : +82-10-4695-1062</div></div></div>
</div></blockquote></div><br></div></body></html>