Compare commits
5 Commits
8d5cf5fa4c
...
786d702c72
| Author | SHA1 | Date | |
|---|---|---|---|
| 786d702c72 | |||
| 81e584f352 | |||
| 019977ac92 | |||
| 74df6ffa7d | |||
| ef09715d0e |
7
.idea/workspace.xml
generated
7
.idea/workspace.xml
generated
@@ -6,12 +6,7 @@
|
|||||||
</artifacts-to-build>
|
</artifacts-to-build>
|
||||||
</component>
|
</component>
|
||||||
<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$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/TestsSupervisor_2022.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/TestsSupervisor_2022.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartTests.java" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include "String.h"
|
||||||
|
#include "Text.h"
|
||||||
|
|
||||||
#include "Text.h"
|
|
||||||
class File {
|
class File {
|
||||||
FILE* ptr;
|
FILE* ptr;
|
||||||
public:
|
public:
|
||||||
@@ -15,6 +16,9 @@ public:
|
|||||||
fprintf(ptr, "%s\n", text.getCharArray());
|
fprintf(ptr, "%s\n", text.getCharArray());
|
||||||
}
|
}
|
||||||
~File() {
|
~File() {
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
void Close() {
|
||||||
if (ptr != NULL) {
|
if (ptr != NULL) {
|
||||||
fclose(ptr);
|
fclose(ptr);
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
|
|||||||
@@ -3,19 +3,99 @@ using namespace std;
|
|||||||
|
|
||||||
#if __cplusplus >= 201703L
|
#if __cplusplus >= 201703L
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "CompilationSupervisor.h"
|
#include "CompilationSupervisor.h"
|
||||||
#include "RunSupervisor.h"
|
#include "RunSupervisor.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
//https://ru.wikipedia.org/wiki/%D0%A1%D0%B8%D0%B3%D0%BD%D0%B0%D0%BB_(Unix)
|
||||||
|
void hdl(int sig)
|
||||||
|
{
|
||||||
|
String file_name = "GOT_SIGNAL_AT_"+ String(Utils::getAbsoluteTime());
|
||||||
|
FILE * res = fopen(file_name.getCharArray(),"w");
|
||||||
|
fprintf(res,"%d\n", sig);
|
||||||
|
fclose(res);
|
||||||
|
}
|
||||||
|
void set_handlers() {
|
||||||
|
#ifndef _WIN32
|
||||||
|
struct sigaction act;
|
||||||
|
memset(&act, 0, sizeof(act));
|
||||||
|
act.sa_handler = hdl;
|
||||||
|
sigset_t set;
|
||||||
|
sigemptyset(&set);
|
||||||
|
//---
|
||||||
|
sigaddset(&set, SIGABRT);
|
||||||
|
sigaddset(&set, SIGALRM);
|
||||||
|
sigaddset(&set, SIGBUS);
|
||||||
|
sigaddset(&set, SIGVTALRM);
|
||||||
|
sigaddset(&set, SIGFPE);
|
||||||
|
sigaddset(&set, SIGHUP);
|
||||||
|
sigaddset(&set, SIGILL);
|
||||||
|
sigaddset(&set, SIGINT);
|
||||||
|
sigaddset(&set, SIGPIPE);
|
||||||
|
sigaddset(&set, SIGQUIT);
|
||||||
|
sigaddset(&set, SIGSEGV);
|
||||||
|
sigaddset(&set, SIGTERM);
|
||||||
|
sigaddset(&set, SIGTSTP);
|
||||||
|
sigaddset(&set, SIGTTIN);
|
||||||
|
sigaddset(&set, SIGTTOU);
|
||||||
|
sigaddset(&set, SIGUSR1);
|
||||||
|
sigaddset(&set, SIGUSR2);
|
||||||
|
sigaddset(&set, SIGPOLL);
|
||||||
|
sigaddset(&set, SIGPROF);
|
||||||
|
sigaddset(&set, SIGSYS);
|
||||||
|
sigaddset(&set, SIGTRAP);
|
||||||
|
//sigaddset(&set, SIGURG);
|
||||||
|
//sigaddset(&set, SIGCHLD);
|
||||||
|
//sigaddset(&set, SIGCONT);
|
||||||
|
sigaddset(&set, SIGVTALRM);
|
||||||
|
sigaddset(&set, SIGXCPU);
|
||||||
|
sigaddset(&set, SIGXFSZ);
|
||||||
|
//---
|
||||||
|
act.sa_mask = set;
|
||||||
|
//---
|
||||||
|
sigaction(SIGABRT, &act, 0);
|
||||||
|
sigaction(SIGALRM, &act, 0);
|
||||||
|
sigaction(SIGBUS, &act, 0);
|
||||||
|
sigaction(SIGVTALRM, &act, 0);
|
||||||
|
sigaction(SIGFPE, &act, 0);
|
||||||
|
sigaction(SIGHUP, &act, 0);
|
||||||
|
sigaction(SIGILL, &act, 0);
|
||||||
|
sigaction(SIGINT, &act, 0);
|
||||||
|
sigaction(SIGPIPE, &act, 0);
|
||||||
|
sigaction(SIGQUIT, &act, 0);
|
||||||
|
sigaction(SIGSEGV, &act, 0);
|
||||||
|
sigaction(SIGTERM, &act, 0);
|
||||||
|
sigaction(SIGTSTP, &act, 0);
|
||||||
|
sigaction(SIGTTIN, &act, 0);
|
||||||
|
sigaction(SIGTTOU, &act, 0);
|
||||||
|
sigaction(SIGUSR1, &act, 0);
|
||||||
|
sigaction(SIGUSR2, &act, 0);
|
||||||
|
sigaction(SIGPOLL, &act, 0);
|
||||||
|
sigaction(SIGPROF, &act, 0);
|
||||||
|
sigaction(SIGSYS, &act, 0);
|
||||||
|
sigaction(SIGTRAP, &act, 0);
|
||||||
|
sigaction(SIGVTALRM, &act, 0);
|
||||||
|
sigaction(SIGXCPU, &act, 0);
|
||||||
|
sigaction(SIGXFSZ, &act, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
//+
|
||||||
|
set_handlers();
|
||||||
|
//-
|
||||||
userWorkspace = String(argv[1]);
|
userWorkspace = String(argv[1]);
|
||||||
packageWorkspace = String(argv[2]);
|
packageWorkspace = String(argv[2]);
|
||||||
maxKernels = atoi(argv[3]);
|
maxKernels = atoi(argv[3]);
|
||||||
dvm_drv = String(argv[4]);
|
dvm_drv = String(argv[4]);
|
||||||
//--
|
//--
|
||||||
freeKernels = maxKernels;
|
freeKernels = maxKernels;
|
||||||
busyKernels= 0;
|
busyKernels= 0;
|
||||||
//--
|
//--
|
||||||
|
|
||||||
@@ -27,8 +107,21 @@ int main(int argc, char ** argv)
|
|||||||
|
|
||||||
userWorkspace.println();
|
userWorkspace.println();
|
||||||
packageWorkspace.println();
|
packageWorkspace.println();
|
||||||
printf("%d\n", maxKernels);
|
printf("%d\n", maxKernels);
|
||||||
|
#ifndef _WIN32
|
||||||
|
int pid = getpid();
|
||||||
|
#else
|
||||||
|
int pid = _getpid();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf("PID=%d\n", pid);
|
||||||
|
File pidFile("PID", String(pid));
|
||||||
|
pidFile.Close();
|
||||||
|
//---
|
||||||
|
File startFile("STARTED", "+");
|
||||||
|
startFile.Close();
|
||||||
|
//---
|
||||||
|
printf(">>>>\n");
|
||||||
CompilationSupervisor * compilationSupervisor = new CompilationSupervisor();
|
CompilationSupervisor * compilationSupervisor = new CompilationSupervisor();
|
||||||
printf("%ld\n", compilationSupervisor->getLength());
|
printf("%ld\n", compilationSupervisor->getLength());
|
||||||
compilationSupervisor->Do();
|
compilationSupervisor->Do();
|
||||||
|
|||||||
@@ -22,12 +22,14 @@ public:
|
|||||||
virtual String getStatePrefix() {
|
virtual String getStatePrefix() {
|
||||||
return String("Running");
|
return String("Running");
|
||||||
}
|
}
|
||||||
virtual void Finalize() {
|
|
||||||
|
/*
|
||||||
|
virtual void Finalize(){
|
||||||
this->state = Archivation;
|
this->state = Archivation;
|
||||||
saveState();
|
saveState();
|
||||||
printf("Archivation started\n");
|
printf("Archivation started\n");
|
||||||
Utils::ZipFolder(String("./"), String("archive.zip"));
|
Utils::ZipFolder(String("./"),String("archive.zip"));
|
||||||
printf("Archivation ended\n");
|
printf("Archivation ended\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -74,7 +74,12 @@ public:
|
|||||||
sprintf(body, "%d", s);
|
sprintf(body, "%d", s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String(long s) {
|
String(long s) {
|
||||||
|
String((long long)s);
|
||||||
|
}
|
||||||
|
|
||||||
|
String(long long s) {
|
||||||
length = 0;
|
length = 0;
|
||||||
body = new char[1];
|
body = new char[1];
|
||||||
body[0] = '\0';
|
body[0] = '\0';
|
||||||
@@ -87,7 +92,7 @@ public:
|
|||||||
}
|
}
|
||||||
length = size;
|
length = size;
|
||||||
body = new char[size + 1];
|
body = new char[size + 1];
|
||||||
sprintf(body, "%ld", s);
|
sprintf(body, "%lld", s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Task.h"
|
#include "Task.h"
|
||||||
|
#include "Array.h"
|
||||||
|
|
||||||
enum SupervisorState {
|
enum SupervisorState {
|
||||||
WorkspacesCreation, //0
|
WorkspacesCreation, //0
|
||||||
@@ -87,8 +88,8 @@ public:
|
|||||||
//todo обязательно убрать отладочную печать.
|
//todo обязательно убрать отладочную печать.
|
||||||
printf("tasks count = %ld\n", this->getLength());
|
printf("tasks count = %ld\n", this->getLength());
|
||||||
while (this->state != End) {
|
while (this->state != End) {
|
||||||
// printf("state=%d\n", this->state);
|
// printf("state=%d\n", this->state);
|
||||||
// printf("max=%d; busy=%d; free=%d\n", maxKernels, busyKernels, freeKernels);
|
// printf("max=%d; busy=%d; free=%d\n", maxKernels, busyKernels, freeKernels);
|
||||||
activeCount = 0;
|
activeCount = 0;
|
||||||
for (long i = 0; i < this->getLength(); ++i) {
|
for (long i = 0; i < this->getLength(); ++i) {
|
||||||
T* task = this->get(i);
|
T* task = this->get(i);
|
||||||
@@ -111,6 +112,7 @@ public:
|
|||||||
case Execution:
|
case Execution:
|
||||||
if (task->getState() == WorkspaceReady) {
|
if (task->getState() == WorkspaceReady) {
|
||||||
activeCount++;
|
activeCount++;
|
||||||
|
task->start_time = Utils::getAbsoluteTime();
|
||||||
task->Start();
|
task->Start();
|
||||||
}
|
}
|
||||||
else if (task->getState() == Running) {
|
else if (task->getState() == Running) {
|
||||||
@@ -119,17 +121,18 @@ public:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// printf("id = %ld; state = %d\n", task->getId(), task->getState());
|
// printf("id = %ld; state = %d\n", task->getId(), task->getState());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// printf("active count = %d\n", activeCount);
|
// printf("active count = %d\n", activeCount);
|
||||||
if (activeCount == 0)
|
if (activeCount == 0)
|
||||||
changeState();
|
changeState();
|
||||||
Utils::Sleep(2);
|
Utils::Sleep(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DoWithSchedule(int maxKernels) {
|
void DoWithSchedule(int maxKernels) {
|
||||||
saveState();
|
saveState();
|
||||||
|
|
||||||
@@ -161,7 +164,8 @@ public:
|
|||||||
map<int, queue<T*>, std::greater<int>> sortedByKernelNeeds;
|
map<int, queue<T*>, std::greater<int>> sortedByKernelNeeds;
|
||||||
|
|
||||||
long activeTasks = 0;
|
long activeTasks = 0;
|
||||||
for (auto& task : this->getElements()) {
|
long done = 0;
|
||||||
|
for (auto& task : this->getElements()) {
|
||||||
if (task->getState() == WorkspaceReady) {
|
if (task->getState() == WorkspaceReady) {
|
||||||
activeTasks++;
|
activeTasks++;
|
||||||
sortedByKernelNeeds[task->getKernels()].push(task);
|
sortedByKernelNeeds[task->getKernels()].push(task);
|
||||||
@@ -175,13 +179,14 @@ public:
|
|||||||
bool ignoreCheck = true;
|
bool ignoreCheck = true;
|
||||||
|
|
||||||
while (activeTasks) {
|
while (activeTasks) {
|
||||||
|
long oldActiveTasks = activeTasks;
|
||||||
vector<int> emptyKeys;
|
vector<int> emptyKeys;
|
||||||
|
|
||||||
//ставим задачи от больших к меньшему по ядрам
|
//ставим задачи от больших к меньшему по ядрам
|
||||||
for (auto& elem : sortedByKernelNeeds) {
|
for (auto& elem : sortedByKernelNeeds) {
|
||||||
int freeKernels = maxKernels - busyKernels;
|
int freeKernels = maxKernels - busyKernels;
|
||||||
int kernelsNeeded = elem.first;
|
int kernelsNeeded = elem.first;
|
||||||
|
|
||||||
while (kernelsNeeded <= freeKernels && elem.second.size()) {
|
while (kernelsNeeded <= freeKernels && elem.second.size()) {
|
||||||
T* task = elem.second.front();
|
T* task = elem.second.front();
|
||||||
elem.second.pop();
|
elem.second.pop();
|
||||||
@@ -199,22 +204,23 @@ public:
|
|||||||
|
|
||||||
//если ядер не осталось, то нет смысла дальше смотреть
|
//если ядер не осталось, то нет смысла дальше смотреть
|
||||||
if (freeKernels == 0)
|
if (freeKernels == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// очищаем от пустых ключей
|
// очищаем от пустых ключей
|
||||||
for (auto& empty : emptyKeys)
|
for (auto& empty : emptyKeys)
|
||||||
sortedByKernelNeeds.erase(empty);
|
sortedByKernelNeeds.erase(empty);
|
||||||
|
|
||||||
// проверяем нет ли завершившихся задач
|
// проверяем нет ли завершившихся задач
|
||||||
for (auto it = activeTaskSet.begin(); it != activeTaskSet.end(); )
|
for (auto it = activeTaskSet.begin(); it != activeTaskSet.end(); )
|
||||||
{
|
{
|
||||||
T* task = *(it);
|
T* task = *(it);
|
||||||
|
|
||||||
if (task->Check()) {
|
if (task->Check()) {
|
||||||
it++;
|
it++;
|
||||||
activeTaskSet.erase(task);
|
activeTaskSet.erase(task);
|
||||||
activeTasks--;
|
activeTasks--;
|
||||||
|
done++;
|
||||||
busyKernels -= task->getKernels();
|
busyKernels -= task->getKernels();
|
||||||
printf(" done task with %d kernels and id %ld\n", task->getKernels(), task->getId());
|
printf(" done task with %d kernels and id %ld\n", task->getKernels(), task->getId());
|
||||||
|
|
||||||
@@ -222,16 +228,20 @@ public:
|
|||||||
}
|
}
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldActiveTasks != activeTasks)
|
||||||
|
printf("done %ld / %ld\n", done, this->getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
changeState();
|
changeState();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Finalize() {}
|
virtual void Finalize() {}
|
||||||
|
|
||||||
void saveState() {
|
void saveState() {
|
||||||
Utils::Sleep(1); //чтобы не было одинаковых по дате файлов.
|
Utils::Sleep(1); //чтобы не было одинаковых по дате файлов.
|
||||||
String stateFile = packageWorkspace + "/state/" + getStatePrefix() + printState();
|
String stateFile = packageWorkspace + "/state/" + getStatePrefix() + printState();
|
||||||
//printf("stateFile=<%s>\n", stateFile.getCharArray());
|
//printf("stateFile=<%s>\n", stateFile.getCharArray());
|
||||||
File tmp(stateFile, Utils::getDate());
|
File(stateFile, Utils::getDate());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
123
Planner/Task.h
123
Planner/Task.h
@@ -32,61 +32,64 @@ enum TestType {
|
|||||||
Correctness, //1
|
Correctness, //1
|
||||||
Performance, //2
|
Performance, //2
|
||||||
};
|
};
|
||||||
|
|
||||||
class Task {
|
class Task {
|
||||||
protected:
|
protected:
|
||||||
long id;
|
long id;
|
||||||
int maxtime;
|
|
||||||
|
int maxtime;
|
||||||
int kernels; //получение зависит от типа задачи.
|
int kernels; //получение зависит от типа задачи.
|
||||||
String workspace;
|
String workspace;
|
||||||
TaskState state;
|
TaskState state;
|
||||||
public:
|
public:
|
||||||
String printState() {
|
long start_time;
|
||||||
switch (state) {
|
String printState(){
|
||||||
case Inactive:
|
switch(state){
|
||||||
return String("Inactive");
|
case Inactive:
|
||||||
case Waiting:
|
return String("Inactive");
|
||||||
return String("Waiting");
|
case Waiting:
|
||||||
case WorkspaceCreated:
|
return String("Waiting");
|
||||||
return String("WorkspaceCreated");
|
case WorkspaceCreated:
|
||||||
case WorkspaceReady:
|
return String("WorkspaceCreated");
|
||||||
return String("WorkspaceReady");
|
case WorkspaceReady:
|
||||||
case Running:
|
return String("WorkspaceReady");
|
||||||
return String("Running");
|
case Running:
|
||||||
case Canceled:
|
return String("Running");
|
||||||
return String("Canceled");
|
case Canceled:
|
||||||
case Finished:
|
return String("Canceled");
|
||||||
return String("Finished");
|
case Finished:
|
||||||
case FinishedAbortedByTimeout:
|
return String("Finished");
|
||||||
return String("FinishedAbortedByTimeout");
|
case FinishedAbortedByTimeout:
|
||||||
case FinishedAbortedByUser:
|
return String("FinishedAbortedByTimeout");
|
||||||
return String("FinishedAbortedByUser");
|
case FinishedAbortedByUser:
|
||||||
case Done:
|
return String("FinishedAbortedByUser");
|
||||||
return String("Done");
|
case Done:
|
||||||
case DoneWithErrors:
|
return String("Done");
|
||||||
return String("DoneWithErrors");
|
case DoneWithErrors:
|
||||||
case AbortedByTimeout:
|
return String("DoneWithErrors");
|
||||||
return String("AbortedByTimeout");
|
case AbortedByTimeout:
|
||||||
case AbortedByUser:
|
return String("AbortedByTimeout");
|
||||||
return String("AbortedByUser");
|
case AbortedByUser:
|
||||||
case Crushed:
|
return String("AbortedByUser");
|
||||||
return String("Crushed");
|
case Crushed:
|
||||||
case WrongTestFormat:
|
return String("Crushed");
|
||||||
return String("WrongTestFormat");
|
case WrongTestFormat:
|
||||||
case InternalError:
|
return String("WrongTestFormat");
|
||||||
return String("InternalError");
|
case InternalError:
|
||||||
case Queued:
|
return String("InternalError");
|
||||||
return String("Queued");
|
case Queued:
|
||||||
case NoSuchTask:
|
return String("Queued");
|
||||||
return String("NoSuchTask");
|
case NoSuchTask:
|
||||||
case FailedToQueue:
|
return String("NoSuchTask");
|
||||||
return String("FailedToQueue");
|
case FailedToQueue:
|
||||||
case AbortingByUser:
|
return String("FailedToQueue");
|
||||||
return String("AbortingByUser");
|
case AbortingByUser:
|
||||||
default:
|
return String("AbortingByUser");
|
||||||
return "?";
|
default:
|
||||||
}
|
return "?";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-------------->>
|
//-------------->>
|
||||||
long getId() { return id; }
|
long getId() { return id; }
|
||||||
long setId(String* id_s) {
|
long setId(String* id_s) {
|
||||||
@@ -146,13 +149,17 @@ public:
|
|||||||
if (Utils::Exists(workspace + "/TIMEOUT")) {
|
if (Utils::Exists(workspace + "/TIMEOUT")) {
|
||||||
state = AbortedByTimeout;
|
state = AbortedByTimeout;
|
||||||
//todo определить по интервалу времени на всякий случай.
|
//todo определить по интервалу времени на всякий случай.
|
||||||
|
}else if (Utils::Exists(workspace+"/INTERRUPT")){
|
||||||
|
state=AbortedByUser;
|
||||||
|
} else {
|
||||||
|
long now = Utils::getAbsoluteTime();
|
||||||
|
long delta = now-start_time;
|
||||||
|
if (maxtime<delta){
|
||||||
|
state=AbortedByTimeout;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (Utils::Exists(workspace + "/INTERRUPT")) {
|
}
|
||||||
state = AbortedByUser;
|
if (state!=Running){
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state != Running) {
|
|
||||||
//-
|
//-
|
||||||
busyKernels = Utils::min(busyKernels - kernels, maxKernels);
|
busyKernels = Utils::min(busyKernels - kernels, maxKernels);
|
||||||
freeKernels = Utils::max(0, maxKernels - busyKernels);
|
freeKernels = Utils::max(0, maxKernels - busyKernels);
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ void set_handlers(){
|
|||||||
}
|
}
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
//+
|
||||||
set_handlers();
|
set_handlers();
|
||||||
//-
|
//-
|
||||||
userWorkspace = String(argv[1]);
|
userWorkspace = String(argv[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user