Оптимизация команды Exists для SSH

This commit is contained in:
2023-12-04 14:42:36 +03:00
parent 1f8ebdc9a2
commit 163552d74f
13 changed files with 93 additions and 100 deletions

View File

@@ -126,7 +126,7 @@ public:
String pathRes("results");
Utils::Mkdir(pathRes);
//string buf;
string buf;
while (activeTasks) {
long oldActiveTasks = activeTasks;
@@ -174,7 +174,7 @@ public:
busyKernels -= task->getKernels();
printf(" done task with %d kernels and id %ld\n", task->getKernels(), task->getId());
//buf += to_string(task->getId()) + " " + string(task->printState().getCharArray()) + " " + to_string(task->getTotalTime()) + "\n";
buf += to_string(task->getId()) + " " + string(task->printState().getCharArray()) + " " + to_string(task->getTotalTime()) + "\n";
task->copyResults(pathRes);
continue;
}
@@ -187,10 +187,10 @@ public:
changeState();
//String outFile(pathRes + "/info.txt");
//File tmp(outFile, String(buf.c_str()));
String outFile(pathRes + "/info.txt");
File tmp(outFile, String(buf.c_str()));
Utils::ZipFolder(pathRes, pathRes + ".zip");
//Utils::ZipFolder(pathRes, pathRes + ".zip");
}
virtual void Finalize() { }

View File

@@ -201,10 +201,10 @@ public:
virtual String copyResults(const String& pathRes) {
String resultPath(packageWorkspace + "/" + pathRes + "/" + getId());
Utils::Mkdir(resultPath);
Utils::Copy(workspace + "/TaskState", resultPath + "/TaskState");
//Utils::Copy(workspace + "/TaskState", resultPath + "/TaskState");
Utils::Copy(workspace + "/out.txt", resultPath + "/out.txt");
Utils::Copy(workspace + "/err.txt", resultPath + "/err.txt");
Utils::Copy(workspace + "/total_time", resultPath + "/total_time");
//Utils::Copy(workspace + "/total_time", resultPath + "/total_time");
return resultPath;
}
};