no message
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -10,11 +10,12 @@
|
|||||||
<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$/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/files/Global.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Global.h" 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/files/RunTask.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/RunTask.h" 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/files/String.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/String.h" 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/Utils.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Utils.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/planner.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/planner.cpp" 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" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"ServerUserPassword": "mprit_2011",
|
"ServerUserPassword": "mprit_2011",
|
||||||
"OfferRegistrationOnStart": true,
|
"OfferRegistrationOnStart": true,
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "E:\\Tests",
|
"ProjectsSearchDirectory": "E:\\Tests\\Downloads",
|
||||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ 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 = 1208;
|
||||||
public static final int planner_version = 16;
|
public static final int planner_version = 18;
|
||||||
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";
|
||||||
|
|||||||
@@ -262,8 +262,10 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
|
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
|
/*
|
||||||
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,8 +276,8 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
|||||||
if (!testingPackage.PID.isEmpty()) {
|
if (!testingPackage.PID.isEmpty()) {
|
||||||
user.connection.Command("kill -9 " + testingPackage.PID);
|
user.connection.Command("kill -9 " + testingPackage.PID);
|
||||||
//очистка после прерывания.
|
//очистка после прерывания.
|
||||||
if (user.connection.Exists(packageRemoteWorkspace))
|
// if (user.connection.Exists(packageRemoteWorkspace))
|
||||||
user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
// user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ public class UserConnection {
|
|||||||
commands_.add("cd " + Utils_.DQuotes(directory.full_name));
|
commands_.add("cd " + Utils_.DQuotes(directory.full_name));
|
||||||
for (int i = 0; i < commands.length; ++i) {
|
for (int i = 0; i < commands.length; ++i) {
|
||||||
if (i == commands.length - 1) {
|
if (i == commands.length - 1) {
|
||||||
commands_.add(commands[i] + " 1>" + Utils_.DQuotes(outFileName));
|
commands_.add(commands[i] + " 1>" + Utils_.DQuotes(outFileName) +" 2>err.txt");
|
||||||
} else {
|
} else {
|
||||||
commands_.add(commands[i]);
|
commands_.add(commands[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public:
|
|||||||
if (checkKilled()) {
|
if (checkKilled()) {
|
||||||
printf("killed\n");
|
printf("killed\n");
|
||||||
|
|
||||||
while (activeTasks) {
|
while (busyKernels) {
|
||||||
printf("waiting for activeTasks %lu\n", activeTasks);
|
printf("waiting for activeTasks %lu\n", activeTasks);
|
||||||
checkTasksFinish(activeTaskSet, toDel, activeTasks, done, busyKernels, buf);
|
checkTasksFinish(activeTaskSet, toDel, activeTasks, done, busyKernels, buf);
|
||||||
Utils::Sleep(5);
|
Utils::Sleep(5);
|
||||||
@@ -289,9 +289,7 @@ public:
|
|||||||
activeTasks--;
|
activeTasks--;
|
||||||
done += task->getKernels();
|
done += task->getKernels();
|
||||||
busyKernels -= task->getKernels();
|
busyKernels -= task->getKernels();
|
||||||
#if DEB
|
|
||||||
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());
|
||||||
#endif
|
|
||||||
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";
|
||||||
//copy after end of while
|
//copy after end of while
|
||||||
//task->copyResults(pathRes);
|
//task->copyResults(pathRes);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "Process_r.h"
|
#include "Process_r.h"
|
||||||
|
|
||||||
Process_r task; //задача
|
Process_r task; //задача
|
||||||
char* coup_de_grace=NULL;
|
char* coup_de_grace=NULL; //команда добивания.
|
||||||
|
|
||||||
void hdl_abort_by_user(int sig)
|
void hdl_abort_by_user(int sig)
|
||||||
{
|
{
|
||||||
@@ -38,96 +38,43 @@ void set_handlers(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//argv[0] - имя программы
|
|
||||||
//argv[0] - время
|
|
||||||
//argv[1] путь к драйверу dvm
|
|
||||||
//argv[2] f/c(компиляция) или run(запуск)
|
|
||||||
//argv[3] имя программы
|
|
||||||
//argv[4] .. argv [argc-1] либо флаги компиляции, либо измерения решетки по одному
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char ** argv){
|
int main(int argc, char ** argv){
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
time_t time1;
|
time_t time1;
|
||||||
time_t time2;
|
time_t time2;
|
||||||
|
char ** args = new char* [argc];
|
||||||
// for (i=0; i<argc; ++i){
|
|
||||||
// printf(("argv["+String_::ToString(i)+"] = '%s'\n").string,argv[i]);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// printf("\n");
|
|
||||||
char ** args = new char* [argc] ;
|
|
||||||
|
|
||||||
int maxtime = atoi(argv[0]);
|
int maxtime = atoi(argv[0]);
|
||||||
coup_de_grace =argv[1];
|
coup_de_grace =argv[1];
|
||||||
/*
|
|
||||||
printf("\nmaxtime = %d\n",maxtime);
|
|
||||||
printf("\ncoup_de_grace = %'s'\n",coup_de_grace);
|
|
||||||
printf("dvm_drv = %'s'\n",argv[2]);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ( i=2; i<argc; ++i)
|
for ( i=2; i<argc; ++i)
|
||||||
args [i-2] = argv[i];
|
args [i-2] = argv[i];
|
||||||
|
|
||||||
args[argc-2] = NULL;
|
args[argc-2] = NULL;
|
||||||
args[argc-1] = NULL;
|
args[argc-1] = NULL;
|
||||||
/*
|
//------------
|
||||||
for (i=0; i<argc; ++i){
|
|
||||||
printf("args %d = '%s'\n",i,args[i]);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
int pid = getpid();
|
int pid = getpid();
|
||||||
|
|
||||||
task.Start();
|
task.Start();
|
||||||
|
|
||||||
//потомок - задача
|
//потомок - задача
|
||||||
if (task.pid ==0 )
|
if (task.pid ==0 )
|
||||||
execvp (argv[2],args);
|
execvp (argv[2],args);
|
||||||
|
|
||||||
|
|
||||||
time1 = time((time_t *)0);
|
time1 = time((time_t *)0);
|
||||||
|
|
||||||
|
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
double total_time = 0.;
|
double total_time = 0.;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int timer_pid = fork();
|
int timer_pid = fork();
|
||||||
|
|
||||||
if (timer_pid ==0){
|
if (timer_pid ==0){
|
||||||
|
|
||||||
sleep(maxtime);
|
sleep(maxtime);
|
||||||
|
|
||||||
FILE * killed = fopen("TIMEOUT","w");
|
FILE * killed = fopen("TIMEOUT","w");
|
||||||
fprintf(killed,"task was killed by timer\n");
|
fprintf(killed,"task was killed by timer\n");
|
||||||
fclose(killed);
|
fclose(killed);
|
||||||
|
|
||||||
kill(pid,SIGINT);
|
kill(pid,SIGINT);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_handlers();
|
set_handlers();
|
||||||
|
|
||||||
waitpid(task.pid,&s,WUNTRACED);
|
waitpid(task.pid,&s,WUNTRACED);
|
||||||
kill(timer_pid,SIGKILL);
|
kill(timer_pid,SIGKILL);
|
||||||
|
|
||||||
|
|
||||||
time2 = time((time_t *)0);
|
time2 = time((time_t *)0);
|
||||||
|
|
||||||
total_time = difftime(time2, time1);
|
total_time = difftime(time2, time1);
|
||||||
|
|
||||||
|
|
||||||
FILE * tt = fopen("total_time","w");
|
FILE * tt = fopen("total_time","w");
|
||||||
fprintf(tt,"%.5lf",total_time);
|
fprintf(tt,"%.5lf",total_time);
|
||||||
fclose(tt);
|
fclose(tt);
|
||||||
@@ -140,8 +87,6 @@ int main(int argc, char ** argv){
|
|||||||
if ((coup_de_grace!=NULL)&&strlen(coup_de_grace)!=0)
|
if ((coup_de_grace!=NULL)&&strlen(coup_de_grace)!=0)
|
||||||
system(coup_de_grace);
|
system(coup_de_grace);
|
||||||
killpg(0, SIGKILL);
|
killpg(0, SIGKILL);
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,57 +18,23 @@
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, char ** argv){
|
int main(int argc, char ** argv){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
char ** args = new char* [argc];
|
||||||
// for (i=0; i<argc; ++i){
|
|
||||||
// printf(("argv["+String_::ToString(i)+"] = '%s'\n").string,argv[i]);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
char ** args = new char* [argc] ;
|
|
||||||
//argv[1] путь к исполнителю
|
|
||||||
for ( i=2; i<argc; ++i)
|
for ( i=2; i<argc; ++i)
|
||||||
args [i-2] = argv[i];
|
args [i-2] = argv[i];
|
||||||
|
|
||||||
// for (i=0; i<argc; ++i){
|
|
||||||
// printf(("args["+String_::ToString(i)+"] = '%s'\n").string,args[i]);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
args[argc-1] = NULL;
|
args[argc-1] = NULL;
|
||||||
|
|
||||||
// printf("parent pid = %d\n",getpid());
|
|
||||||
|
|
||||||
setpgid(0,0);
|
setpgid(0,0);
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
|
|
||||||
if (pid == 0)
|
if (pid == 0)
|
||||||
execvp( argv[1],args);
|
execvp( argv[1],args);
|
||||||
else {
|
|
||||||
// setpgid(pid, 0);
|
|
||||||
printf("%d\n",pid);}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (const char * exception){
|
catch (const char * exception){
|
||||||
|
|
||||||
// printf("Exception!\n");
|
|
||||||
FILE * ExceptionLog = fopen ( "Exception.txt", "w" );
|
FILE * ExceptionLog = fopen ( "Exception.txt", "w" );
|
||||||
fprintf(ExceptionLog,exception);
|
fprintf(ExceptionLog,exception);
|
||||||
fclose(ExceptionLog);
|
fclose(ExceptionLog);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
17
|
18
|
||||||
Reference in New Issue
Block a user