Skip to Content.
Sympa Menu

charm - Re: [charm] Unrecognized PUP::able::PUP_ID

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Unrecognized PUP::able::PUP_ID


Chronological Thread 
  • From: Bilge Acun <acun2 AT illinois.edu>
  • To: Nels John Frazier <nfrazie1 AT uwyo.edu>
  • Cc: "charm AT cs.illinois.edu" <charm AT cs.illinois.edu>
  • Subject: Re: [charm] Unrecognized PUP::able::PUP_ID
  • Date: Sat, 5 Mar 2016 14:15:24 -0600

Hi,

I have realized our manual does not show an inheritance example for regular chare objects. We'll work on improving our manual. 
There are a few problems with your code:

You can declare a regular migratable chare object as shown in this chaper. It does not need to declared as PUPable to be able to inherit from another chare. It also does not need to inherit from PUP::able, it can inherit from CBase_ChareType as regular chares. Writing pup functions enables them to migrate.

The second problem is with your module declaration. If you have a module that depends on another module, you need to declare it as extern as shown here. You can also put multiple chare declarations in one module.

I hope this helps fixing your code.

~Bilge


On 4 March 2016 at 14:37, Nels John Frazier <nfrazie1 AT uwyo.edu> wrote:

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_ONLY
  PUPable_def(A)
#endif /* CK_TEMPLATES_ONLY */

#ifndef CK_TEMPLATES_ONLY
void _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_ONLY
  PUPable_def(B)
#endif /* CK_TEMPLATES_ONLY */

#ifndef CK_TEMPLATES_ONLY
void _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.ci
module 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




--
Bilge Acun
PhD Candidate, Computer Science Department
University of Illinois at Urbana-Champaign



Archive powered by MHonArc 2.6.16.

Top of Page