++
исправления планировщика
This commit is contained in:
7
.idea/workspace.xml
generated
7
.idea/workspace.xml
generated
@@ -8,14 +8,11 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/UserConnection.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/UserConnection.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/files/File.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/File.h" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/files/Supervisor.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Supervisor.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/files/Supervisor.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Supervisor.h" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/files/launcher.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/launcher.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/files/starter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/starter.cpp" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/files/version.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/version.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/files/version.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/version.h" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Common.Utils.Vector_;
|
|||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int version = 1208;
|
public static final int version = 1209;
|
||||||
public static final int planner_version = 18;
|
public static final int planner_version = 20;
|
||||||
public static final int testingMaxKernels = 64;
|
public static final int testingMaxKernels = 64;
|
||||||
//--
|
//--
|
||||||
public static final String ApplicationFileName = "VisualSapfor.jar";
|
public static final String ApplicationFileName = "VisualSapfor.jar";
|
||||||
@@ -469,7 +469,7 @@ public class Constants {
|
|||||||
};
|
};
|
||||||
public static Vector<String> admins_mails = new Vector_<>(
|
public static Vector<String> admins_mails = new Vector_<>(
|
||||||
"sapfor.tracker@internet.ru",
|
"sapfor.tracker@internet.ru",
|
||||||
"vmk-post@yandex.ru",
|
"vmk-post@yandex.ru"
|
||||||
"79854210702@ya.ru"
|
,"79854210702@ya.ru"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ public abstract class TestingPlanner<P extends TestingPackage> extends TestingCl
|
|||||||
break;
|
break;
|
||||||
case RunningEnd:
|
case RunningEnd:
|
||||||
DownloadResults();
|
DownloadResults();
|
||||||
UpdatePackageState(TasksPackageState.Analysis);
|
|
||||||
break;
|
break;
|
||||||
case Paused:
|
case Paused:
|
||||||
if (!checkIfPaused() && CheckNextState())
|
if (!checkIfPaused() && CheckNextState())
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
switch (testingPackage.state) {
|
switch (testingPackage.state) {
|
||||||
case CompilationExecution:
|
case CompilationExecution:
|
||||||
case RunningExecution:
|
case RunningExecution:
|
||||||
|
case Aborted:
|
||||||
EmailPackage();
|
EmailPackage();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -252,6 +253,10 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
@Override
|
@Override
|
||||||
protected void DownloadResults() throws Exception {
|
protected void DownloadResults() throws Exception {
|
||||||
Utils_.CheckDirectory(packageLocalWorkspace);
|
Utils_.CheckDirectory(packageLocalWorkspace);
|
||||||
|
RemoteFile killedFile = new RemoteFile(packageRemoteWorkspace,"kill");
|
||||||
|
if (user.connection.Exists(killedFile)){
|
||||||
|
UpdatePackageState(TasksPackageState.Aborted);
|
||||||
|
}else {
|
||||||
RemoteFile remote_results_archive = new RemoteFile(packageRemoteWorkspace, "results.zip");
|
RemoteFile remote_results_archive = new RemoteFile(packageRemoteWorkspace, "results.zip");
|
||||||
File results_archive = new File(packageLocalWorkspace, "results.zip");
|
File results_archive = new File(packageLocalWorkspace, "results.zip");
|
||||||
user.connection.performScript(packageRemoteWorkspace, "zip -r " + Utils_.DQuotes("results.zip") + " " + Utils_.DQuotes("results"));
|
user.connection.performScript(packageRemoteWorkspace, "zip -r " + Utils_.DQuotes("results.zip") + " " + Utils_.DQuotes("results"));
|
||||||
@@ -261,11 +266,11 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
UnzipFolderPass unzipFolderPass = new UnzipFolderPass();
|
UnzipFolderPass unzipFolderPass = new UnzipFolderPass();
|
||||||
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
|
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
|
||||||
}
|
}
|
||||||
|
UpdatePackageState(TasksPackageState.Analysis);
|
||||||
|
}
|
||||||
//---
|
//---
|
||||||
/*
|
|
||||||
if (user.connection.Exists(packageRemoteWorkspace))
|
if (user.connection.Exists(packageRemoteWorkspace))
|
||||||
user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void MachineConnectionError() {
|
protected void MachineConnectionError() {
|
||||||
@@ -274,10 +279,8 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
@Override
|
@Override
|
||||||
protected void Kill() throws Exception {
|
protected void Kill() throws Exception {
|
||||||
if (!testingPackage.PID.isEmpty()) {
|
if (!testingPackage.PID.isEmpty()) {
|
||||||
user.connection.Command("kill -9 " + testingPackage.PID);
|
RemoteFile killFile = new RemoteFile(packageRemoteWorkspace, "kill");
|
||||||
//очистка после прерывания.
|
user.connection.writeToFile("fatality", killFile);
|
||||||
// if (user.connection.Exists(packageRemoteWorkspace))
|
|
||||||
// user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void DownloadResults() throws Exception {
|
protected void DownloadResults() throws Exception {
|
||||||
//не требуется.
|
UpdatePackageState(TasksPackageState.Analysis);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void AnalyseResults() throws Exception {
|
protected void AnalyseResults() throws Exception {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ template <class T>
|
|||||||
class Supervisor : public Array <T> {
|
class Supervisor : public Array <T> {
|
||||||
protected:
|
protected:
|
||||||
SupervisorState state;
|
SupervisorState state;
|
||||||
|
bool killed;
|
||||||
public:
|
public:
|
||||||
virtual String getStatePrefix() {
|
virtual String getStatePrefix() {
|
||||||
return String("");
|
return String("");
|
||||||
@@ -48,11 +48,16 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
|
void ToLog(const String& text){
|
||||||
|
FILE * pfile = fopen("planner_log.txt", "a");
|
||||||
|
fprintf(pfile, "%s\n", text.getCharArray());
|
||||||
|
fclose(pfile);
|
||||||
|
}
|
||||||
|
//--
|
||||||
void print() {
|
void print() {
|
||||||
for (auto& elem : this->getElements())
|
for (auto& elem : this->getElements())
|
||||||
elem->print();
|
elem->print();
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(const char* fileName, int recordSize) {
|
void init(const char* fileName, int recordSize) {
|
||||||
state = WorkspacesCreation;
|
state = WorkspacesCreation;
|
||||||
File* packedTasks = new File(fileName);
|
File* packedTasks = new File(fileName);
|
||||||
@@ -162,7 +167,7 @@ public:
|
|||||||
|
|
||||||
auto timer_pause = Utils::getAbsoluteTime();
|
auto timer_pause = Utils::getAbsoluteTime();
|
||||||
auto timer_killed = Utils::getAbsoluteTime();
|
auto timer_killed = Utils::getAbsoluteTime();
|
||||||
bool killed = false;
|
killed = false;
|
||||||
|
|
||||||
while (activeTasks) {
|
while (activeTasks) {
|
||||||
long oldActiveTasks = activeTasks;
|
long oldActiveTasks = activeTasks;
|
||||||
@@ -231,15 +236,17 @@ public:
|
|||||||
// прошло больше 10 секунд, проверяем нужно ли завершиться
|
// прошло больше 10 секунд, проверяем нужно ли завершиться
|
||||||
if (Utils::getAbsoluteTime() - timer_killed > 10) {
|
if (Utils::getAbsoluteTime() - timer_killed > 10) {
|
||||||
if (checkKilled()) {
|
if (checkKilled()) {
|
||||||
printf("killed\n");
|
ToLog("killed");
|
||||||
|
|
||||||
while (busyKernels) {
|
while (busyKernels) {
|
||||||
printf("waiting for activeTasks %lu\n", activeTasks);
|
ToLog("activeTasks="+ String((int)activeTasks)+";busyKernels="+String((int)busyKernels));
|
||||||
checkTasksFinish(activeTaskSet, toDel, activeTasks, done, busyKernels, buf);
|
checkTasksFinish(activeTaskSet, toDel, activeTasks, done, busyKernels, buf);
|
||||||
|
// очищаем завершенные задачи
|
||||||
|
for (auto& del : toDel)
|
||||||
|
activeTaskSet.erase(del);
|
||||||
|
toDel.clear();
|
||||||
Utils::Sleep(5);
|
Utils::Sleep(5);
|
||||||
}
|
}
|
||||||
|
ToLog("exit for main while");
|
||||||
printf("exit for main while\n");
|
|
||||||
killed = true;
|
killed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -251,17 +258,19 @@ public:
|
|||||||
for (auto& task : taskList)
|
for (auto& task : taskList)
|
||||||
task->copyResults(pathRes);
|
task->copyResults(pathRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeState();
|
changeState();
|
||||||
String outFile(pathRes + "/" + getStatePrefix() + "Info.txt");
|
String outFile(pathRes + "/" + getStatePrefix() + "Info.txt");
|
||||||
File tmp(outFile, String(buf.c_str()));
|
File tmp(outFile, String(buf.c_str()));
|
||||||
|
//скопировать в результаты лог планировщика.
|
||||||
|
if (killed){
|
||||||
|
ToLog("quit application");
|
||||||
|
std::exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveState() {
|
void saveState() {
|
||||||
String stateFile = packageWorkspace + "/state/" + getStatePrefix() + printState();
|
String stateFile = packageWorkspace + "/state/" + getStatePrefix() + printState();
|
||||||
File tmp(stateFile, Utils::getDate());
|
File tmp(stateFile, Utils::getDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveProgress(long long persentDone) {
|
void saveProgress(long long persentDone) {
|
||||||
FILE* f = fopen("progress", "w");
|
FILE* f = fopen("progress", "w");
|
||||||
if (f) {
|
if (f) {
|
||||||
@@ -270,15 +279,12 @@ public:
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkPause() const {
|
bool checkPause() const {
|
||||||
return Utils::Exists("pause");
|
return Utils::Exists("pause");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkKilled() const {
|
bool checkKilled() const {
|
||||||
return Utils::Exists("kill");
|
return Utils::Exists("kill");
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkTasksFinish(const set<T*>& activeTaskSet, vector<T*>& toDel, size_t& activeTasks,
|
void checkTasksFinish(const set<T*>& activeTaskSet, vector<T*>& toDel, size_t& activeTasks,
|
||||||
size_t& done, int& busyKernels, string& buf) {
|
size_t& done, int& busyKernels, string& buf) {
|
||||||
// проверяем нет ли завершившихся задач
|
// проверяем нет ли завершившихся задач
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
18
|
20
|
||||||
Reference in New Issue
Block a user