swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Multithreading question


From: gepr
Subject: RE: Multithreading question
Date: Wed, 29 Jan 2003 12:12:06 -0800

Darold Higa writes:
 > 
 > I know I need to rewrite my code in order to improve performance.  I feel
 > however that I should stick to Objective-C for replication/methodological
 > reasons.
 > 
 > My simulation works fine with a low agent count, but I get much more
 > interesting results as my population densities rise, hence my desire to
 > improve performance.  Even with more efficient code, once I hit the magic
 > number of around 1200 agents, things really slow down.
 > 
 > As a result I was hoping that I could throw more hardware at the issue, so
 > as I refine and add more stages to my model, I can maintain reasonable
 > performance.  The goal of this model is to add layers of social complexity
 > and increase the simulation area.  My fear is that as I add social
 > complexity, multi-day runs turn into multi-week runs.

Well, the inherent problem is knowing what takes the most time.  And
if one can't find a more efficient algorithm for the things that take
the most time, then one parallelizes the bits of computation that
take the most time.

So, in order to effectively parallelize your system, you should do the
profiling.

So, regardless of whether or not you think you can make your
simulation efficient enough on a single thread to handle >1200 agents
or not, in order to do any better than you're already doing, you must
do the profiling.

>  One of my programming friends has offered to look over my
> simulation structure to suggest how to parcel out tasks.

The first thing this guy will probably do is profile the sim.  (Unless
he's a code reader, in which case, it'll be the second thing he
does. [grin]) At the very least, get him to show you the run-time
analysis.  As the modeler, it could very well be the case that you're
spending alot of time doing ancillary things like searching lists,
I/O, or using a spatial index to a sparsely populated space.

And none of this implies stepping away from objective-c, really.

-- 
glen e. p. ropella              =><=                           Hail Eris!
H: 831.335.4950                              http://www.ropella.net/~gepr
M: 831.247.7901                               http://www.tempusdictum.com


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]