Skip to Content.
Sympa Menu

charm - Re: [charm] How do I know if a chare exists in a chare array?

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] How do I know if a chare exists in a chare array?


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: Pascal <zetwal AT gmail.com>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] How do I know if a chare exists in a chare array?
  • Date: Mon, 23 Jun 2014 12:03:08 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hi Pascal,

Charm++ does not provide an API for querying whether a given array element exists or not. The reason for this is that Charm++ applications are expected to run in distributed environments, in which the response to such a query can vary unpredictably in time. For instance, the message carrying such a query might race with a message that would insert or delete such an element. In general, I would recommend constructing your parallel algorithm so that it does not need to make such queries.

In the specific case where you want to construct a particular element where it does not already exist, Charm++ offers 'on-demand creation' of chare array elements. This lets applications tag certain entry methods with one of the [createhome] or [createhere] attributes. When one of those entry methods is invoked on a given array index, the runtime system guarantees that the associated message will either be delivered to the element at that index, or will default construct that element and then deliver that message to it. More detail on how this works can be found in our manual.

Phil



On Wed, Jun 18, 2014 at 5:01 PM, Pascal <zetwal AT gmail.com> wrote:
Hello

I have a chare array like this:

array [1D] Node{
...
}

in which I put in values of type Node. Initially there is only one chare but then the chare generates other chares which in turn generate other chares (and deletes itself) which are inserted at specific locations in the array. Thus there might be gaps in the array. 

Is there a way for me to query the array like this: thisProxy[randomIndex] and it will tell me if there is an element in that location or not?

In other words, how do I know if a chare exists in a chare array?

Thanks


Cheers,
Pascal

_______________________________________________
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