SDAG: intialize cDep structure after migration
authorPhil Miller <mille121@illinois.edu>
Wed, 10 Oct 2012 21:38:56 +0000 (16:38 -0500)
committerPhil Miller <mille121@illinois.edu>
Wed, 10 Oct 2012 21:57:13 +0000 (16:57 -0500)
src/xlat-i/sdag/CParsedFile.C

index 6bed313ece3aaafea3e1c1c4ed408d3af2baae43..f3dac23e6de400d35d483624d290713e96130079 100644 (file)
@@ -160,7 +160,10 @@ void CParsedFile::generatePupFunction(XStr& decls)
 {
   decls << "public:\n";
   decls << "  void __sdag_pup(PUP::er& p) {\n";
-  decls << "    if (__cDep.get()) { __cDep->pup(p); }\n";
+  decls << "    bool hasSDAG = __cDep.get();\n";
+  decls << "    p|hasSDAG;\n";
+  decls << "    if (p.isUnpacking() && hasSDAG) _sdag_init();\n";
+  decls << "    if (hasSDAG) { __cDep->pup(p); }\n";
   decls << "  }\n";
 }