Skip to Content.
Sympa Menu

charm - Re: [charm] chare ?

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] chare ?


Chronological Thread 
  • From: "Kale, Laxmikant V" <kale AT illinois.edu>
  • To: "Mitchell, John A" <jamitch AT sandia.gov>, "charm AT lists.cs.illinois.edu" <charm AT lists.cs.illinois.edu>
  • Subject: Re: [charm] chare ?
  • Date: Mon, 5 Dec 2016 23:38:52 +0000
  • Accept-language: en-US

You can hold a *reference* to another chare inside a chare (but not the chare itself). The reference is called a Proxy. Your code is almost ok, except for the fact that left and right should be declared to be of type CProxy_HierarchicalNode

(See section 3.2 of the Charm++ manual:

http://charm.cs.illinois.edu/manuals/html/charm++/manual-1p.html )

 

I am not sure a NULL proxy is possible. A better way is to control it with another variable (e.g. bool leftExists, rightExists).

 

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 

 

 

From: "Mitchell, John A" <jamitch AT sandia.gov>
Reply-To: "Mitchell, John A" <jamitch AT sandia.gov>
Date: Monday, December 5, 2016 at 5:19 PM
To: "charm AT lists.cs.illinois.edu" <charm AT lists.cs.illinois.edu>
Subject: [charm] chare ?

 

I am new to Charm++.

Is there a 'default' type constructor for chare objects?  

I am struggling with an idea in which one chare objects will create and store two chare objects as private members -- is that possible?  

In some cases the nested objects are essentially Null objects while in other cases I will recurse to create a tree of additional chares and so on.  I am wandering if the default instantiation of 'left' and 'right' makes any sense or if it will work?  This is depicted below.

struct HierarchicalNode : CBase_HierarchicalNode {
  HierarchicalNode left, right;  
  HierarchicalNode(int num_points, int num_points_leaf) : left(0,0), right(0,0) {
    
    int num_points_left=0, num_points_right=0;
    if(0==num_points%2){
       // even
       num_points_left=num_points/2;
       num_points_right=num_points/2;
    }else {
       // even
       num_points_left=1+(num_points-1)/2;
       num_points_right=(num_points-1)/2;
    }   
    if(num_points_left>num_points_leaf)
       left=CProxy_HierarchicalNode::ckNew(num_points_left,num_p);
    if(num_points_right>num_points_leaf)
       right=CProxy_HierarchicalNode::ckNew(num_points_right);
  }



  • [charm] chare ?, Mitchell, John A, 12/05/2016
    • <Possible follow-up(s)>
    • Re: [charm] chare ?, Kale, Laxmikant V, 12/05/2016

Archive powered by MHonArc 2.6.19.

Top of Page