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: Roberto de Quadros Gomes <rqg.gomes AT gmail.com>
  • To: Phil Miller <mille121 AT illinois.edu>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] [ppl] Object size
  • Date: Fri, 9 Aug 2013 00:50:26 -0300
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Phil,

That is my main idea in this moment. I'd like pass memory information by LDStats.

My problem started when I followed the sample from manual, using ObjGraph, I didn't get the size of objects (Vertex).
The goal is consider the cost of migration on strategy, how Mr Kale told. But I want use mpi code where the user doesn't use PUP functions.

For example the simple code:
int main(ac,av)
{
  int a,b,c;
 
Mpi_init()
  while(x)
  {
    Mpi_funtions();
    Mpi_barrier();
    Mpi_migrate();
   }
 }
}
    
Considering that this code is transformed to tcharm objects by ampicc, how I could read the amount of data will be migrated on lb strategy? Is there a easier way to do this?
 




2013/8/9 Phil Miller <mille121 AT illinois.edu>
The run time can provide this information automatically, by passing a
sizing PUP::er to each object's PUP routine. Users should not have to
do this for themselves. For users who configure the build suitably,
that data should then be recorded in the LB database before passing it
to strategies.

On Thu, Aug 8, 2013 at 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
>>>>>> To: <charm AT cs.uiuc.edu>
>>>>>>
>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
> _______________________________________________
> charm mailing list
> charm AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/charm
>
> _______________________________________________
> ppl mailing list
> ppl AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/ppl
>




Archive powered by MHonArc 2.6.16.

Top of Page