Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

RFC: Parallel shadow map generation #3

@buma

Description

@buma

I started working on Paralelizing shadow map generation with joblib in my paralel branch. I added new parameter n_jobs and it works already. It is a little faster then with only one job.

Joblib is only needed if more than one job is requested.

This height map:

python heightmap.py --projection EPSG:3857 --elevation-dir data/ --output my.heightmap10004 --geojson export2.geojson --save-image my10004.png 46.55 15.65 4 1000

with this render:

 python render.py my.heightmap10004 "2014-08-04 03:00" "2014-08-04 20:00" 5 rendered5 --background-map heightmap1004_image.png --opacity 0.7 --n_jobs=4

Renders in 14 seconds with 4 jobs and 42 seconds with one on 4 core Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz

The problem is that now height map is pickled for each job. Running time is strangely longer if I save height map myself and do mmap of height map for each job.

Another problem is background image. Previously it was opened once, now it is opened for each job, because It can't be pickled, I have to optimize it.

And parallel could use threads instead of multiprocessing if GIL isn't needed in C code. With no gil I don't know if this is possible here.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions