<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Of course, you are right.
<div class="">In retrospect, trying to create the natural to global SF during distribution does not seem to be the smartest idea…</div>
<div class="">Would you have time to take a pass at distributing the constrains?</div>
<div class="">On our side, we will work on patch that separates the creation of the Naturaltoglobal SF from distribution, and works when the default section was created on the sequential or distributed DM.</div>
<div class="">It would just be noce to have both cases working</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Blaise</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 23, 2019, at 2:39 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">On Sat, Feb 23, 2019 at 10:48 AM Blaise A Bourdin via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="gmail-m_193371271850283721BodyFragment"><font size="2" class=""><span style="font-size: 11pt;" class="">
<div class="gmail-m_193371271850283721PlainText">Hi,<br class="">
<br class="">
My student Alex and I are trying to build an example combining natural to global ordering and constraints.<br class="">
Constraints information do not seem to be distributed,</div>
</span></font></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Well dang. That is true. I never considered doing it the other way since all my specifications come from compact things</div>
<div class="">like an FEM discretization and BC labels, which get distributed. But yes, this is a big hole. I think it could be fixed without</div>
<div class="">too much work since the constraints are just another section+IS to distribute, and the IS does not even have to be renumbered.</div>
<div class="">I think we can just call <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeFieldIS.html" class="">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeFieldIS.html</a><span class="Apple-converted-space"> </span>on
it. </div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="gmail-m_193371271850283721BodyFragment"><font size="2" class=""><span style="font-size: 11pt;" class="">
<div class="gmail-m_193371271850283721PlainText">so the most rational thing to do seems to be creating the default section after distribution, then figuring out a way to reconstruct the natural to global stuff.<br class="">
</div>
</span></font></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">That is what I do, but we could do it the other way.</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="gmail-m_193371271850283721BodyFragment"><font size="2" class=""><span style="font-size: 11pt;" class="">
<div class="gmail-m_193371271850283721PlainText">In the example attached, we do this, then create a global vector, but for some reason that I do not understand, the global vector size is 0 (should be 18) when run on more than 1 CPU. If we make 2 calls to DMGetGlobalVector,
we get a vector of the proper size. What are we doing wrong?<br class="">
</div>
</span></font></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">At the beginning, you turn on </div>
<div class=""><br class="">
</div>
<div class=""> DMSetUseNatural(dm, PETSC_TRUE);</div>
<div class=""><br class="">
</div>
<div class="">so during Distribute() it tries to make the mapping. This process creates a global vector, which has size 0, because</div>
<div class="">the Section is empty. The reason it works when you call it again is that it creates a new vector this time, now with</div>
<div class="">the new Section. So, to do it this way, don't set this flag at the beginning. You have to setup the GlobalToNatural() afterwards.</div>
<div class=""><br class="">
</div>
<div class="">Also, this shows that I should probably invalidate the global/local vector cache after a new Section is set.</div>
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="gmail-m_193371271850283721BodyFragment"><font size="2" class=""><span style="font-size: 11pt;" class="">
<div class="gmail-m_193371271850283721PlainText">Regards,<br class="">
Blaise<br class="">
</div>
</span></font></div>
<div class="gmail-m_193371271850283721BodyFragment"><font size="2" class=""><span style="font-size: 11pt;" class="">
<div class="gmail-m_193371271850283721PlainText"><br class="">
<br class="">
--<span class="Apple-converted-space"> </span><br class="">
Department of Mathematics and Center for Computation & Technology<br class="">
Louisiana State University, Baton Rouge, LA 70803, USA<br class="">
Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276<span class="Apple-converted-space"> </span><a href="http://www.math.lsu.edu/~bourdin" target="_blank" class="">http://www.math.lsu.edu/~bourdin</a><br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
</div>
</span></font></div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<div class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " class="">
-- </div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " class="">
Department of Mathematics and Center for Computation & Technology</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " class="">
Louisiana State University, Baton Rouge, LA 70803, USA</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " class="">
Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 <a href="http://www.math.lsu.edu/~bourdin" class="">
http://www.math.lsu.edu/~bourdin</a></div>
<div class=""><br class="khtml-block-placeholder">
</div>
<div class=""><br class="khtml-block-placeholder">
</div>
<br class="Apple-interchange-newline">
</div>
</span></div>
</span><br class="Apple-interchange-newline">
</div>
</span><br class="Apple-interchange-newline">
</span><br class="Apple-interchange-newline">
</div>
<br class="">
</div>
</body>
</html>