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