[GRASS-user] Simultaneous r.horizon processes

Collin Bode collin at berkeley.edu
Tue May 1 10:36:07 EDT 2012


Daniel,

For this discussion, it probably isn't important, but just to clarify, the mp module does multiprocessing, not multithreading.  I haven't worked with objets, so can't help you on that.   I am using g.region with all of my r.sun runs without a problem.   So that is probably not your issue.  How about r.horizon output?  Are you using "-s" flag without horizon maps or with horizon maps?  If you are using them and using multiple mapsets, you either need to have the horizon maps in PERMANENT or copied individually to each of the mapsets.

Collin 




On Apr 29, 2012, at 9:14 AM, Daniel Lee wrote:

> Hey there,
> 
> I'm back with some more multithreading problems.
> 
> Following the previous discussion I've switched from trying to do multithreading with r.horizon and have switched to doing my calculations directly with r.sun. Of course, I want to use all my cores for r.sun, though, so I've tried implementing versions of Collin's code using the multithreading library. Just for testing, I implemented a spatial partitioner that uses g.region to split the map iteratively into different sections, calls r.sun for these smaller sections, and then waits for the processes to finish before continuing. It behaves very strangely, though, and at the end it produces empty maps. The values are all -nan. As I first spatially partition the map and THEN run through the year, I don't think that the partitioning is the problem, but perhaps something with the multiprocessing library. My program uses objects and it seems the library doesn't play nicely with objects and methods, etc. Does anyone have any experience with doing this kind of procedure with objects? I'd hate to have to reprogram everything and just use functional programming, especially because of all the other disadvantages that that would bring for maintenance stuff in the future.
> 
> Best,
> Daniel



More information about the grass-user mailing list