<p dir="ltr">Hi,</p>
<p dir="ltr">Seems like your code didn&#39;t call the corresponding init routine. Whoever implemented this has commented that the behaviour of returning zero should provoke errors, but clearly that is not good enough. Since it is a coding error to call the nthreads_get routine before initialising that module, it seems like an assertion should fire.</p>
<p dir="ltr">Mark</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, 26 Feb 2016 16:37 David van der Spoel &lt;<a href="mailto:spoel@xray.bmc.uu.se">spoel@xray.bmc.uu.se</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I&#39;m (deep)linking my code to gromacs (so could have forgotten some<br>
initialization). Running on Apple with clang, so no OpenMP.<br>
<br>
Therefore when in the mentioned routine we have:<br>
     /* These thread local data structures are used for bondeds only */<br>
     bt-&gt;nthreads = gmx_omp_nthreads_get(emntBonded);<br>
<br>
it returns 0, not surprising, or is it?<br>
Down the road in listed-forces.cpp we have<br>
<br>
#pragma omp parallel for num_threads(bt-&gt;nthreads) schedule(static)<br>
     for (thread = 0; thread &lt; bt-&gt;nthreads; thread++)<br>
     {<br>
        // Compute all the bonded forces and energies<br>
<br>
However, since the number of threads is zero, no bonded forces are<br>
computed. Am I missing something that is going on under the hood?<br>
<br>
Cheers,<br>
--<br>
David van der Spoel, Ph.D., Professor of Biology<br>
Dept. of Cell &amp; Molec. Biol., Uppsala University.<br>
Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.<br>
<a href="mailto:spoel@xray.bmc.uu.se" target="_blank">spoel@xray.bmc.uu.se</a>    <a href="http://folding.bmc.uu.se" rel="noreferrer" target="_blank">http://folding.bmc.uu.se</a><br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
</blockquote></div>