From 2f6faf31ac637a21af0cad5d40f8e34cfd8ee676 Mon Sep 17 00:00:00 2001 From: Ritvik Rao Date: Fri, 5 Sep 2025 09:25:55 -0500 Subject: [PATCH 1/2] Compile charm with CMK_LBDB_ON=0 --- src/ck-core/ck.C | 5 +++-- src/ck-core/ck.h | 2 -- src/ck-core/cklocrec.h | 6 +++--- src/ck-core/ckmigratable.h | 2 +- src/ck-ldb/LBObj.C | 9 ++++----- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/ck-core/ck.C b/src/ck-core/ck.C index ba0bbc0b0f..fe75c4bcbf 100644 --- a/src/ck-core/ck.C +++ b/src/ck-core/ck.C @@ -640,16 +640,17 @@ void CkCallstackPop(Chare *obj) { _ckStartTiming(); // resume timing of the previous obj } -#if CMK_LBDB_ON + CkLocRec *CkActiveLocRec(void) { + #if CMK_LBDB_ON auto *obj = CkActiveObj(); if (obj && obj->ckInitialized) { return obj->getCkLocRec(); } else { return nullptr; } + #endif } -#endif /******************** Basic support *****************/ void CkDeliverMessageFree(int epIdx,void *msg,void *obj) diff --git a/src/ck-core/ck.h b/src/ck-core/ck.h index cfb7937c2c..3af9015daa 100644 --- a/src/ck-core/ck.h +++ b/src/ck-core/ck.h @@ -332,9 +332,7 @@ class CkCoreState { CkpvExtern(CkCoreState *, _coreState); -#if CMK_LBDB_ON CkLocRec *CkActiveLocRec(void); -#endif // CMK_LBDB_ON void CpdHandleLBMessage(LBMigrateMsg **msg); void CkMessageWatcherInit(char **argv,CkCoreState *ck); diff --git a/src/ck-core/cklocrec.h b/src/ck-core/cklocrec.h index 8528aafcd2..09b9d03780 100644 --- a/src/ck-core/cklocrec.h +++ b/src/ck-core/cklocrec.h @@ -17,15 +17,15 @@ class CkLocRec { CmiUInt8 id; bool *deletedMarker; /// Set this if we're deleted during processing bool running; /// True when inside a startTiming/stopTiming pair + CkSyncBarrier* syncBarrier; + LDObjHandle ldHandle; #if CMK_LBDB_ON bool asyncMigrate; /// if readyMove is inited bool readyMigrate; /// status whether it is ready to migrate bool enable_measure; int nextPe; /// next migration dest processor - CkSyncBarrier* syncBarrier; LBManager *lbmgr; MetaBalancer *the_metalb; - LDObjHandle ldHandle; #endif public: @@ -63,7 +63,6 @@ class CkLocRec { public: inline LBManager *getLBMgr(void) const {return lbmgr;} inline MetaBalancer *getMetaBalancer(void) const {return the_metalb;} - inline const LDObjHandle& getLdHandle() const{ return ldHandle; } static void staticMigrate(LDObjHandle h, int dest); static void staticMetaLBResumeWaitingChares(LDObjHandle h, int lb_ideal_period); static void staticMetaLBCallLBOnChares(LDObjHandle h); @@ -80,6 +79,7 @@ class CkLocRec { #else void AsyncMigrate(bool use){}; #endif + inline const LDObjHandle& getLdHandle() const{ return ldHandle; } }; #endif // CK_LOC_REC_H diff --git a/src/ck-core/ckmigratable.h b/src/ck-core/ckmigratable.h index d0e9a96eeb..b21a040405 100644 --- a/src/ck-core/ckmigratable.h +++ b/src/ck-core/ckmigratable.h @@ -101,7 +101,7 @@ class CkMigratable : public Chare { void setMigratable(int migratable) { } void setPupSize(size_t obj_pup_size) { } public: - void ckFinishConstruction(int epoch) { } + void ckFinishConstruction(int epoch = -1) { } #endif #if CMK_OUT_OF_CORE diff --git a/src/ck-ldb/LBObj.C b/src/ck-ldb/LBObj.C index 36ca87d85f..1f13e93186 100644 --- a/src/ck-ldb/LBObj.C +++ b/src/ck-ldb/LBObj.C @@ -4,12 +4,11 @@ /*@{*/ #include - -#if CMK_LBDB_ON - #include "LBObj.h" #include "LBOM.h" +#if CMK_LBDB_ON + /************************************************************* * LBObj Object-data Code *************************************************************/ @@ -30,6 +29,8 @@ void LBObj::Clear(void) #endif } +#endif + void LBObj::IncrementTime(LBRealType walltime, LBRealType cputime) { data.wallTime += walltime; @@ -42,6 +43,4 @@ void LBObj::IncrementTime(LBRealType walltime, LBRealType cputime) #endif } -#endif - /*@}*/ From 5a8ee61159c3c98611167aa6ccd8d20a54f1bf0f Mon Sep 17 00:00:00 2001 From: Ritvik Rao Date: Wed, 24 Sep 2025 17:30:06 -0500 Subject: [PATCH 2/2] always retrieve the location record --- src/ck-core/ck.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ck-core/ck.C b/src/ck-core/ck.C index fe75c4bcbf..2e602e01c8 100644 --- a/src/ck-core/ck.C +++ b/src/ck-core/ck.C @@ -642,14 +642,12 @@ void CkCallstackPop(Chare *obj) { CkLocRec *CkActiveLocRec(void) { - #if CMK_LBDB_ON auto *obj = CkActiveObj(); if (obj && obj->ckInitialized) { return obj->getCkLocRec(); } else { return nullptr; } - #endif } /******************** Basic support *****************/