<div dir="ltr">Hi,<div><br></div><div>By default openmp uses just all cores in the system. You can reset that to arbitrary number but need to know the number. I'll ask on -hackers :)</div><div><br></div><div>Also, I'm stuck with replacing lwfree* to use malloc instead of palloc - I fixed the easy part where lwalloc'd things were pfree'd, but now the error messages are too cryptic for me to figure out. <br><br>If you're brave, try uncommenting this line and get sql-regression passing - that's a precondition for easy usage of openmp:<br><a href="https://github.com/postgis/postgis/blob/svn-trunk/libpgcommon/lwgeom_pg.c#L172">https://github.com/postgis/postgis/blob/svn-trunk/libpgcommon/lwgeom_pg.c#L172</a> <br></div></div><br><div class="gmail_quote"><div dir="ltr">ср, 31 окт. 2018 г. в 6:12, Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hey all,<div>  We discussed this at the sprint, basically wondering what the policy on the PgSQL side was WRT extensions getting all crazy and doing multi-processor calculations in functions.</div><div>  I raised this with both Tom Lane and Andres Freund at <a href="http://pgconf.eu" target="_blank">pgconf.eu</a>, and both sort of shrugged and said “sure”. Basically, anything we do between the function call and return time is up to us. Tom pointed out (as Darafei has already run into) that calling any postgres functions (palloc, pfree, anything) is a no-no, as they are not set up for multi-threading. But otherwise, go for it.</div><div>  I neglected to ask about a good policy for figuring out how many cores to allocate to a MP function. Probably something like max_parallel_workers_per_gather I would guess. Darafei are you setting your number of cores at run-time now?</div><div>P.</div></div>_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></blockquote></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Darafei Praliaskouski<br>Support me: <a href="http://patreon.com/komzpa">http://patreon.com/komzpa</a></div></div>