swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Solution to EZgraph line colors and a question


From: Dinis Gökaydin
Subject: Re: [Swarm-Support] Solution to EZgraph line colors and a question
Date: Fri, 19 Aug 2005 20:57:11 +0100
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Thanks for the advice. Vary good tips to use in the future. However, after struggling with my model and trying all your suggestions, I´m almost sure the only thing delaying things is the scheduling itself. I hope it's not that a schedule doesn't support a lot of actions scheduled at the same time, because then I would have to do some extensive rewriting of my model and have it run MUCH more slowly with a basic "messageToAll()" at each timestep.

So I'll just post here what I've done in the hope that someone reads it and sees anything wrong I did:

1 - I created two schedules, one with an action group and another I just left open to dynamic scheduling.

2 - I have my model set so that each time step corresponds to one day, so before I even run the model I just tell every agent to schedule itself in the next 25567 days (70 years). This way I don't expect too much superimposition of events when scheduling 1exp5 agents in the future (average about 4 events each timestep). However it takes 26min42sec to do this. If I delete the scheduling step it takes 1 sec to build the agents, as I have already said.

3 - I have a pentium 4 3.2 GHz with 1Gb memory, so I don't think it's hardware. I've tried changing the heap space: It does allow for more agents, and that's great, but does nothing for the time to schedule them.

I sure could appreciate some help on this,

Thanks in advance,

Dinis Gökaydin

Ken Cline wrote:
Wrt your performance questions... One obvious question is whether
you are exceeding the capabilities of your system?  That is, is
your OS no longer able to keep everything in memory and starting
to do a lot of "paging"?

It could also be the Java VM that's affecting performance.  Have
you tried changing the heap size?

Another thought... Are your actions being scheduled for the same
(model) time?  If so, what is the ConcurrentGroupType set to for
the Schedule?  If you randomizing concurrent actions, that could
chew up alot of CPUs.

Finally, I'd recommend searching the mail archive for postings by
Marcus that address ways to improve performance.  I recall that
he's discussed it a few times.  In fact, I think I have one of
those messages saved... yup, see below.

Hope that helps.
Ken

--- "Marcus G. Daniels" <address@hidden> wrote:

To: address@hidden
Subject: Re: swarm-Java performance
From: address@hidden (Marcus G. Daniels)
Date: 04 Apr 2002 15:43:43 -0700


"PP" == Petros Petrou <address@hidden> writes:

PP> Could you please tell me if there is anything else I could
PP> possibly do to improve Java's performance for Swarm applications?

The first and most important thing is to profile your model.  Basic
Java profiling is a good start, and will be sufficient in most cases.
Understand where time is going.
For full information about what is happening you need a version of
Swarm compiled with `-pg' and your model compiled to native code with
profiling in gcj.  I think there are some remarks to swarm-support
about that dated about middle of last year.

A couple tips:

 o Learn to use the FActionForEach{Homogeneous,Heterogeneous} callout
   interfaces.  This feature avoids cross-language object lookup
   costs by invoking your target Java objects and arguments directly.

   In general, avoid passing generic object arguments to Swarm interfaces
   at all.  The FCall/FArguments interfaces make it possible to construct
   calls direct to Java.  (Instead of sending a generic message that
   needs to then be forwarded on from inside Java.)

   [There is nothing hackish about using FCall/FArguments interfaces or
   the FAction activity variants.  It generalizes to any language.]

 o Avoid use of swarm.collections in favor of pure Java collections.
   Memory use will be more efficient this way and there will not be
   constant conversions between Swarm's idea of a Java object (as a proxy)
   and the real Java objects.



--- Dinis Gökaydin <address@hidden> wrote:


Hello again Swarm Support,

First I would like to share with the Java users the (almost) heuristically found solution to the EZgraph colors problem I had posted previously. The problem is that Java users like myself don't have a clue to what createBegin() and createEnd() are. Reading some previous posts and noticing by chance that the two aforementioned methods still existed in SwarmJava I came up with this. Dunno if it's the best way to do it but it works.

-------------------------------------------------------
String[] colors = {"color_1","color_2"};

name_of_your_graph = new EZGraphImpl();
        
_whatever_= new EZGraphCImpl(name_of_your_graph);
                
_whatever_.createBegin(getZone());
_whatever_.setAxisLabelsX$Y("x_label","y_label");
_whatever_.setColors$count(colors,2);
_whatever_.setGraphics(true);
_whatever_.setTitle("name_of_your_graph");
_whatever_.createEnd(); 
-------------------------------------------------------

I also have a question. Taking advantage of dynamic scheduling I came up with a way to speed up my program considerably.

I was happy about myself for a while, but then I encountered a problem. My scheme demads a first scheduling step for every agent with at$createActionTo$message() at time 0. I was handling 10000 agents then, and it takes 20sec to build and schedule them. Great - I thought to myself - then 100000 will take 200sec, or 3min20sec. Nope... It takes 26min42sec!! My deep mathematical insight tells me this is not linearly increasing :-)

By the way,it takes (cough) one second to build 100000 agents without the at$createActionTo$message() step. Anyone has any idea why this is happening and has a simple solution before I start creating multiple 10000 schedules? This would a real problem since I am aiming for 1000000 agents. I don't even know if swarm can handle 1exp6 agents...

Thank you very much,

Dinis Gökaydin
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support




_________________________________________________________
 Ken Cline                             W: (443) 287-2636
 address@hidden
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support



reply via email to

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