charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
- From: Nels John Frazier <nfrazie1 AT uwyo.edu>
- To: Bilge Acun <acun2 AT illinois.edu>
- Cc: "charm AT cs.illinois.edu" <charm AT cs.illinois.edu>
- Subject: Re: [charm] Unrecognized PUP::able::PUP_ID
- Date: Mon, 7 Mar 2016 15:41:25 +0000
- Accept-language: en-US
- Authentication-results: cs.illinois.edu; dkim=none (message not signed) header.d=none;cs.illinois.edu; dmarc=none action=none header.from=uwyo.edu;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
Bilge,
Thanks for the reply. In simplifying my example, I may have misslead you. I don't want these classes to be chares. I need a chare object to hold a reference to B, and I need this to be migratable. Here is the code I used to do this. I have elements that processes B objects, so each object may have a reference to B. The following code creates a simlpe array of 2 elements, where each element has a pointer to a B object. Then I want these elements to migrate, and the B pointer to correctly migrate with it. So in my previous message, I was only illustrating the fact that creating a PUP::able object seemed to fail, because the register function is never called. If I manually register I can make this example work. So classes A and B are only using the PUP mechanics, as outlined in section 17.2 http://charm.cs.illinois.edu/manuals/html/charm++/17.html.
Am I still doing something wrong? Why do I have to manually call the _register<>() function?
main.ci:
Sent: Saturday, March 5, 2016 1:15 PM
To: Nels John Frazier
Cc: charm AT cs.illinois.edu
Subject: Re: [charm] Unrecognized PUP::able::PUP_ID
Hi,
Following the charm documentation, I created a set of migratable sub classes. However, when I run a small test program, I get
------------- Processor 1 Exiting: Called CmiAbort ------------Reason: Unrecognized PUP::able::PUP_ID. is there an unregistered module?
My classes looks something like this
//FILE 1
#include "B.h"
#include "A.decl.h"
class A : public B
{
private:
static double moreData[3];
public:
int a = 0;
double data = "1;
A():B(a)
{
}
PUPable_decl(A);A(CkMigrateMessage* m) : B(m) {}virtual void pup(PUP::er &p){B::pup(p);if(p.isUnpacking()) CkPrintf("Unpacking A\n");else CkPrintf("Packing A\n");p|data;p(moreData, 3);if(p.isUnpacking()){CkPrintf("Unpacked stuff %f\n", a);CkPrintf("Array value: %f\n", moreData[2]);}}
};
double A::moreData[3] = {0,1,2}
#include "A.def.h"
//FILE 2
#include "pup.h"
#include "B.decl.h"
class B: public PUP::able
{
public:
int a;
B(int a_):a(a_){};
B(){};
virtual ~B(){};
PUPable_decl(B);
B(CkMigrateMessage* m) : PUP::able(m){};
vitrual void pup(PUP::er& p)
{
if(p.isUnpacking()) CkPrintf("Unpacking B\n");else CkPrintf("Packing B\n");PUP::able::pup(p);p|a;if(p.isUnpacking()) CkPrintf("Unpacked %ld\n",a);}};
#include "B.def.h"
The generated decl and def files:
A.decl.h
#ifndef _DECL_A_H_#define _DECL_A_H_#include "charm++.h"#include "envelope.h"#include <memory>#include "sdag.h"
extern void _registerrA(void);#endif
A.def.h#ifndef CK_TEMPLATES_ONLYPUPable_def(A)#endif /* CK_TEMPLATES_ONLY */
#ifndef CK_TEMPLATES_ONLYvoid _registerA(void){static int _done = 0; if(_done) return; _done = 1;PUPable_reg(A);
}#endif /* CK_TEMPLATES_ONLY */
B.decl.h#ifndef _DECL_B_H_#define _DECL_B_H_#include "charm++.h"#include "envelope.h"#include <memory>#include "sdag.h"
extern void _registerB(void);
#endif
B.def.h#ifndef CK_TEMPLATES_ONLYPUPable_def(B)#endif /* CK_TEMPLATES_ONLY */
#ifndef CK_TEMPLATES_ONLYvoid _registerB(void){static int _done = 0; if(_done) return; _done = 1;PUPable_reg(B);
}#endif /* CK_TEMPLATES_ONLY */
My A.ci file looks like this
module A{PUPable A;
}
B.cimodule B{PUPable B;}
Simple compile:
charmc A.ci
charmc B.ci
Long story short, I have a small sample file to test migrating my A objects, and I get the indicated error. I found a workaround, which is manually registering the module in A's constructor:
A():B(a)
{
_registerA();
}
Is this a bug in charm or am I not doing this properly?
Thanks,
Nels Frazier
- [charm] Unrecognized PUP::able::PUP_ID, Nels John Frazier, 03/04/2016
- <Possible follow-up(s)>
- Re: [charm] Unrecognized PUP::able::PUP_ID, Bilge Acun, 03/05/2016
- Re: [charm] Unrecognized PUP::able::PUP_ID, Nels John Frazier, 03/07/2016
Archive powered by MHonArc 2.6.16.