charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
- From: Julien Bigot <julien.bigot AT inria.fr>
- To: charm AT cs.uiuc.edu
- Subject: [charm] use of chareProxy.ckLocal(); whithout CMK_CHARE_USE_PTR
- Date: Fri, 24 Jun 2011 20:33:05 +0200
- List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
- List-id: CHARM parallel programming system <charm.cs.uiuc.edu>
- Organization: INRIA Team-project Graal
Hi,
I'm trying to use chareProxy.ckLocal() on a platform where CMK_CHARE_USE_PTR
is undefined (net-linux-x86_64).
I've tried the attached test code and when runned I obtain the following
results:
% ./tst
[19:53]
Charm++: standalone mode (not using charmrun)
Converse/Charm++ Commit ID: v6.3.0-270-g47c6ae9
Charm++> scheduler running in netpoll mode.
Charm++> Running on 1 unique compute nodes (2-way SMP).
Charm++> cpu topology info is gathered in 0.000 seconds.
Tst1::Tst1(0xe5e9a0)
Tst2::Tst2(0xe5ee00)
Tst2::Tst2(0xe5f080)
Tst2::show_liveness(0xe5ee00)
Tst2::show_liveness(0xe5f080)
Tst1::on_quiescence(0xe5e9a0): proxy0.ckLocal() == 0, proxy1.ckLocal() == 0x1
As you can see, when calling ckLocal, I obtain values that are neither valid
pointers nor always NULL while all chares are on the same node.
After some investigation in Charm++ code it seems to me that on not
CMK_CHARE_USE_PTR platforms, the value of chareProxy.ckLocal() for virtual
chare ids (returned as a result of CProxy::ckNew()) is an index in
CkpvAccess(chare_objs) and not a pointer.
* CkCreateChare creates a virtual ChareID (onPE<0) since the actual chare
doesn't exist yet and it sends a message to create the chare
* _processNewVChareMsg handles the message and calls _allocNewChare to
allocate the chare memory
* _allocNewChare returns an index in CkpvAccess(chare_objs) for a pointer on
the chare memory, not the actual pointer
* _processNewVChareMsg creates a message and sets its payload to a CkChareID
whose objPtr is this index
* _processFillVidMsg handles the message and uses its value to fill the
virtual id actualID.objPtr value
* when chareProxy.ckLocal() is called it returns the actualID.objPtr value
Is this a known behavior of Charm++ or am I doing something wrong ?
Regards,
--
Julien Bigot, Post-Doc., INRIA Team-Project Graal
LIP - 46 Allee d'Italie - 69364 Lyon - FRANCE
jabber:
jbigot AT jabber.org
web: http://graal.ens-lyon.fr/~jbigot
phone: +33 (0)4 37 28 76 43
mainmodule tst {
mainchare Tst1 {
entry Tst1 ();
entry void on_quiescence ();
};
chare Tst2 {
entry Tst2 ();
entry void show_liveness ();
};
}
#include <iostream> #include "tst.decl.h" using namespace std; class Tst1: public CBase_Tst1 { public: CProxy_Tst2 proxy0; CProxy_Tst2 proxy1; Tst1 ( CkArgMsg* msg ): proxy0(CProxy_Tst2::ckNew()), proxy1(CProxy_Tst2::ckNew()) { cout << "Tst1::Tst1("<<this<<")"<<endl; proxy0.show_liveness(); proxy1.show_liveness(); CkStartQD(CkCallback(CkIndex_Tst1::on_quiescence(), thisProxy)); } void on_quiescence () { cout << "Tst1::on_quiescence("<<this<<"): proxy0.ckLocal() == "<<proxy0.ckLocal()<<", proxy1.ckLocal() == "<<proxy1.ckLocal()<<endl; } }; class Tst2: public CBase_Tst2 { public: Tst2 () { cout << "Tst2::Tst2("<<this<<")" << endl; } void show_liveness () { cout << "Tst2::show_liveness("<<this<<")" << endl; } }; #include "tst.def.h"
Attachment:
signature.asc
Description: This is a digitally signed message part.
- [charm] use of chareProxy.ckLocal(); whithout CMK_CHARE_USE_PTR, Julien Bigot, 06/24/2011
- Re: [charm] [ppl] use of chareProxy.ckLocal(); whithout CMK_CHARE_USE_PTR, Gengbin Zheng, 06/24/2011
- Re: [charm] [ppl] use of chareProxy.ckLocal(); whithout CMK_CHARE_USE_PTR, Julien Bigot, 06/24/2011
- Re: [charm] [ppl] use of chareProxy.ckLocal(); whithout CMK_CHARE_USE_PTR, Gengbin Zheng, 06/24/2011
Archive powered by MHonArc 2.6.16.