MASON-INTEREST-L Archives

June 2015

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Sat, 20 Jun 2015 16:39:24 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (14 lines)
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

ATOM RSS1 RSS2