[postgis-devel] OpenMP / pthread

Darafei "Komяpa" Praliaskouski me at komzpa.net
Wed Oct 31 12:04:04 PDT 2018


Hi,

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 :)

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.

If you're brave, try uncommenting this line and get sql-regression passing
- that's a precondition for easy usage of openmp:
https://github.com/postgis/postgis/blob/svn-trunk/libpgcommon/lwgeom_pg.c#L172


ср, 31 окт. 2018 г. в 6:12, Paul Ramsey <pramsey at cleverelephant.ca>:

> Hey all,
>   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.
>   I raised this with both Tom Lane and Andres Freund at pgconf.eu, 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.
>   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?
> P.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel

-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20181031/8df5fa96/attachment.html>


More information about the postgis-devel mailing list