Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] Object size

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] Object size


Chronological Thread 
  • From: "Kale, Laxmikant V" <kale AT illinois.edu>
  • To: "Gopalakrishnan Menon, Harshitha Menon" <gplkrsh2 AT illinois.edu>, "Roberto de Quadros Gomes" <rqg.gomes AT gmail.com>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] [ppl] Object size
  • Date: Fri, 9 Aug 2013 03:17:54 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Memory size is a natural (and universal, unlike, say, "centroid" that some strategies needed) and useful metric to be associated with an object for load balancing. So, I think we should just add it to the default (unless memory needed for it is an issue; I suggest using some compressed measure of memory, such as "in multiple of 4K bytes" or even coarser, but actual size dependent metric.. That can be made to fit within 8 or 16 bits). At least eventually.

This has been on my mind in connection with some other applications , so its good to get more use cases.

It still leaves the question: size at what time? Max size during previous iterations? Size at the time of migration?
The former is useful for staying within memory limits as we move objects to a node; the latter is useful as a metric of cost of migration.

-- 
-- 
Laxmikant (Sanjay) Kale         http://charm.cs.uiuc.edu
Professor, Computer Science     kale AT illinois.edu
201 N. Goodwin Avenue           Ph:  (217) 244-0094
Urbana, IL  61801-2302          FAX: (217) 265-6582


On 8/8/13 10:08 PM, "Harshitha Menon" <gplkrsh2 AT illinois.edu> wrote:

How about adding a setter and getter (setObjSize and getObjSize) functions? You can look at how setObjTime method is implemented.

Alternatively, a better way would be for you to use a feature implemented by Gengbin (in branch  gzheng/lb-userdata) to add arbitrary user-defined data in LB database. This is in a separate branch of charm. I have sample code which includes the object size to lb database and a lb strategy can use it.

Harshitha








On Thu, Aug 8, 2013 at 7:07 PM, Roberto de Quadros Gomes <rqg.gomes AT gmail.com> wrote:
Yes, I am trying to use the size of data will be transfer on migration process in lb strategy. I want to combine cpuload, communication and memory size.

Let me explain what i am doing...

Cpu load and communication is easy to get, but when i use the ObjGraph on strategy the  memory size in not a member of Vertex class . Then, I opened the code and added this filed. I did some modifications for collect and put memory info to LDStats. With this way I can put any value and I can read that inside of strategy.
I modified LBObj , LDObjData too. I just put "int mem_size" in each struct and modifying the pup functions.

But I don't know how feed memory info with real value. I believe that there is some way to do this. I asked about AddObj method because I tried the reverse path (from LDStats to AMPI code) and there seems a good place to read this.

I don't have sure if tcharm size, or its stack size, has the memory information of my variables used in MPI code but I'd like try use this.


And yes, the object size of part of code could help me.



2013/8/8 Harshitha Menon <gplkrsh2 AT illinois.edu>
Are you trying to use the size of the object in some load balancing strategy?

How about collecting the object size as a part of the application code and using that in the lb strategy? Will that work for you?


On Thu, Aug 8, 2013 at 5:59 PM, Roberto de Quadros Gomes <rqg.gomes AT gmail.com> wrote:
Hi Harshitha,

Your code block worked! Thank you for that.
But now I would like to share my real problem.

I didn't understand what is the part of code represents the tcharm object created from AMPI code in LB.

I was thinking that the method AddObj ( located in LBDBManager.C) would be the best place to collect memory size from this object, but i don't know how do this. I thought that "__userdata"  represented this tcharm object, but I failed when tried use (TCharm*)__userdata.
 
I belive I think wrong and I really appreciate some help.

Thanks
Roberto Gomes



2013/8/8 Harshitha Menon <gplkrsh2 AT illinois.edu>
To get the size of an object, you can use the following piece of code.

int size;
PUP::sizer ps;
this->pup(ps);
size=ps.size();

Let me know if are having trouble using it in the LB strategy.

Harshitha


On Thu, Aug 8, 2013 at 9:43 AM, Bohm, Eric J <ebohm AT illinois.edu> wrote:


Begin forwarded message:

From: Roberto de Quadros Gomes <rqg.gomes AT gmail.com>
Subject: [charm] Object size
Date: August 5, 2013 9:12:09 PM CDT

Is there some way to get amount of bytes will be transfer in advance when the an object will be migrated?
I try collect this value to use on lb strategy but i am having difficulties.

Looking the code in cklocation.C file, CkLocRec_local constructor seems the best location, but i dont know to do this.

Some tip?
Thanks
Roberto Gomes
_______________________________________________
charm mailing list
charm AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/charm









Archive powered by MHonArc 2.6.16.

Top of Page