SDAG: ensure that necessary data structure is initialized
[charm.git] / src / xlat-i / sdag / CSdagConstruct.C
index 33677893fb8ecee3636fc8c0224fb3dfb1d8cc6c..357ea38cd225cc676ab2ce2337741106210ae313 100644 (file)
@@ -1270,6 +1270,8 @@ void SdagConstruct::generateSdagEntry(XStr& decls, XStr& defs, Entry *entry)
   if (!entry->getContainer()->isGroup() || !entry->isConstructor())
     generateTraceEndCall(defs);
 
+  defs << "    if (!__cDep.get())\n"
+       << "        _sdag_init();\n";
   defs << "    ";
   generateCall(defs, *stateVarsChildren, constructs->front()->label);