<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018 at 10:46 AM Krzysztof Kamieniecki <<a href="mailto:krys@kamieniecki.com">krys@kamieniecki.com</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"><div dir="ltr">Hi Matt,<div><br></div><div>What does "COMPLETELY independent" mean? Should I call PetscInitialize in each thread?</div></div></blockquote><div><br></div><div>No, it means that separate threads do not access the same objects. Your error message indicated</div><div>that this was happening.</div><div> <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><div>We have an "approximate" model where we treat different regions as independent. It's a "realtime" system where measurements from the different regions arrives a different times and we want to process regions ASAP.</div></div></div></blockquote><div><br></div><div>Yes. None of that necessitates threads, or is even really easier with threads. Tons of realtime systems use</div><div>processes. The only real difference between processes and threads is that threads share memory, which</div><div>is inherently unsafe.</div><div><div><br class="gmail-Apple-interchange-newline">  Thanks,</div><div><br></div><div>    Matt</div><br class="gmail-Apple-interchange-newline"></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>Best Regards,</div><div>Krys</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018 at 10:35 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</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"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018 at 10:30 AM Krzysztof Kamieniecki via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello All,<div><br></div><div>I have an embarrassingly parallel problem that I would like to use TAO on, is there some way to do this with threads as opposed to multiple processes?</div></div></div></div></div></blockquote><div><br></div><div>You should be able to run COMPLETELY independent object on different threads. However, notice that</div><div>there is absolutely no advantage to doing this. Why do you want to run independent instances on multiple</div><div>threads?</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 dir="ltr"><div dir="ltr"><div dir="ltr"><div> I compiled PETSc with the following flags</div><div>./configure \<br></div><div><div>--prefix=${DEP_INSTALL_DIR} \</div><div>--with-threadsafety --with-log=0 --download-concurrencykit \</div><div>--with-openblas=1 \</div><div>--with-openblas-dir=${DEP_INSTALL_DIR} \</div><div>--with-mpi=0 \</div><div>--with-shared=0 \</div><div>--with-debugging=0 COPTFLAGS='-O3' CXXOPTFLAGS='-O3' FOPTFLAGS='-O3' </div></div><div><br></div><div>When I run TAO in multiple threads I get the error "Called VecxxxEnd() in a different order or with a different vector than VecxxxBegin()"</div><div><br></div><div>Thanks,</div><div>Krys</div><div><br></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_4907526057780627897gmail-m_2950405439188718633gmail_signature"><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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><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>