Print

Print


On Jun 20, 2015, at 4:51 AM, Axel Kowald <[log in to unmask]> wrote:

> I decided to use the doLoop and collect my data in static class variables.
> Because that worked fine I'm now also trying to use the -parallel option.
> It seems that my static variable is filled from all parallel batches. 
> How is this possible if all batches run in independent threads?  Are 
> there some issues when different threads try to read/write into the same 
> variable?
> I'm normally not using parallel stuff, so please excuse if this is trivial.

If you want to run parallel jobs, you CANNOT use static class variables: you'd create a race condition.  Do *not* do that.  Parallel runs must be done with entirely separate simulation instances that share nothing in common.  This isn't a MASON thing, it's a foundational result in parallel programming.

Sean