MASON-INTEREST-L Archives

June 2015

MASON-INTEREST-L@LISTSERV.GMU.EDU

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

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

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Sat, 20 Jun 2015 16:39:24 -0400
MIME-version:
1.0 (Mac OS X Mail 7.3 \(1878.6\))
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=iso-8859-1
Subject:
From:
Sean Luke <[log in to unmask]>
In-Reply-To:
Message-ID:
Content-Transfer-Encoding:
8bit
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