long timestamp;
if(comargs.idonly) {
- cout << programid << headMaster() << endl << flush;
+ cout << programid << headMaster(true) << endl << flush;
exit(0);
}
exit(0);
}
- out = new writeout(comargs.outdir, programid+headMaster(), rank, numprocs);
+ out = new writeout(comargs.outdir, programid+headMaster(true), rank, numprocs);
}
void o815::mainLoop() {
}
}
-string o815::headMaster()
+string o815::headMaster(bool hashedrange)
{
stringstream hm;
- hm << "-L" << comargs.lsize[0] << "_" << comargs.lsize[1] << "-E" << comargs.nequi << "-S" << comargs.nskip << "-N" << comargs.nmeas
- << paraQ->rangeString();
+ hm << "_L" << comargs.lsize[0] << "x" << comargs.lsize[1] << "_E" << comargs.nequi << "_S" << comargs.nskip << "_N" << comargs.nmeas;
+
+ if( ! hashedrange )
+ hm << paraQ->rangeString();
+ else
+ hm << "_" << hash( paraQ->rangeString() );
return hm.str();
}
cachedir = arg.substr( 0, arg.rfind(":") );
}
+
+unsigned long o815::hash(const string& str)
+{
+ unsigned long hash = 5381;
+
+ for(string::const_iterator it=str.begin();it!=str.end();it++)
+ hash = ((hash << 5) + hash) + *it; /* hash * 33 + character */
+
+ return hash;
+}