charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
- From: Shad Kirmani <sxk5292 AT cse.psu.edu>
- To: charm AT cs.uiuc.edu
- Subject: [charm] Freeing memory
- Date: Tue, 29 May 2012 14:48:59 -0400
- List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
- List-id: CHARM parallel programming system <charm.cs.uiuc.edu>
I have a question regarding freeing memory passed into CkReduction:
The following code segment illustrates the issue:
In mainproxy, I have a method that expects array segments from all other cores.
*********************************
{
CkReductionMsg *msg;
chareArrayProxy.getArraySegments(msg);
double *wholeArray = (double*)msg->getData();
//Do something with wholeArray;
delete msg;
}
**********************************
In the chares:
void getArraySegment(CkCallback& cb) {
double *arraysegment = (double*) malloc (SIZE * sizeof(double));
//Do something with arraysegment
contribute(SIZE*sizeof(double), arraysegment, CKReduction:concat, cb);
}
*********************************
My question is how can I free arraysegment?
Thanks,
Shad
The following code segment illustrates the issue:
In mainproxy, I have a method that expects array segments from all other cores.
*********************************
{
CkReductionMsg *msg;
chareArrayProxy.getArraySegments(msg);
double *wholeArray = (double*)msg->getData();
//Do something with wholeArray;
delete msg;
}
**********************************
In the chares:
void getArraySegment(CkCallback& cb) {
double *arraysegment = (double*) malloc (SIZE * sizeof(double));
//Do something with arraysegment
contribute(SIZE*sizeof(double), arraysegment, CKReduction:concat, cb);
}
*********************************
My question is how can I free arraysegment?
Thanks,
Shad
- [charm] Freeing memory, Shad Kirmani, 05/29/2012
Archive powered by MHonArc 2.6.16.