Commit c7ea4778 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

WftStacksOnDisk: works but runs non restartable/observable

parent f315f0c7
......@@ -124,10 +124,12 @@ public:
isRestart_(parameters_.options.isSet("restart")),
systemStack_(parameters_.options.isSet("shrinkStacksOnDisk"),
parameters_.filename,
"Stacks",
"system",
isObserveCode),
envStack_(systemStack_.onDisk(),
parameters_.filename,
"Stacks",
"environ",
isObserveCode),
progress_("Checkpoint"),
......
......@@ -16,14 +16,15 @@ public:
DiskOrMemoryStack(bool onDisk,
const PsimagLite::String filename,
const PsimagLite::String post,
PsimagLite::String label,
bool isObserveCode)
: diskW_(0), diskR_(0)
: isObserveCode_(isObserveCode), diskW_(0), diskR_(0)
{
if (!onDisk) return;
size_t lastindex = filename.find_last_of(".");
PsimagLite::String file = filename.substr(0, lastindex) + "Stacks.hd5";
PsimagLite::String file = filename.substr(0, lastindex) + post + ".hd5";
if (createFile_) {
PsimagLite::IoNg::Out out(file, PsimagLite::IoNg::ACC_TRUNC);
......@@ -105,23 +106,15 @@ public:
{
if (diskW_) {
assert(diskR_);
err("write\n");
std::cerr<<__FILE__<<": write(): not writing, cannot restart\n";
std::cout<<__FILE__<<": write(): not writing, cannot restart\n";
return;
}
MemoryStackType m = memory_;
io.write(prefix, m);
}
void write(PsimagLite::String prefix, PsimagLite::IoNgSerializer& io)
{
if (diskW_) {
assert(diskR_);
err("write\n");
}
io.write(prefix, memory_);
}
template<typename StackType1,typename StackType2>
static void loadStack(StackType1& stackInMemory, StackType2& stackInDisk)
{
......@@ -140,6 +133,7 @@ private:
DiskOrMemoryStack& operator=(const DiskOrMemoryStack&);
bool isObserveCode_;
mutable MemoryStackType memory_;
DiskStackType *diskW_;
DiskStackType *diskR_;
......
......@@ -27,8 +27,8 @@ public:
const PsimagLite::String filename,
bool isObserveCode)
: lrs_("pSE", "pSprime", "pEprime"),
wsStack_(onDisk, filename, "system", isObserveCode),
weStack_(onDisk, filename, "environ", isObserveCode),
wsStack_(onDisk, filename, "Wstacks", "system", isObserveCode),
weStack_(onDisk, filename, "Wstacks", "environ", isObserveCode),
needsPop_(false)
{}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment