Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/f10570153cf7
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 00:47:35 2012
Кодировка: UTF-8
allpy: f10570153cf7

allpy

changeset 549:f10570153cf7

Automated merge with ssh://kodomo/allpy
author boris <bnagaev@gmail.com>
date Tue, 01 Mar 2011 00:17:13 +0300
parents 8c7e5c16b2f4 0bae5c1f726b
children 08d8abfb5ba4 fb1fb5d5327f
files
diffstat 4 files changed, 18 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/blocks3d/wt/blocks3d-wt-widget.C	Mon Feb 28 22:20:59 2011 +0300
     1.2 +++ b/blocks3d/wt/blocks3d-wt-widget.C	Tue Mar 01 00:17:13 2011 +0300
     1.3 @@ -117,6 +117,11 @@
     1.4  
     1.5  Blocks3DWidget::~Blocks3DWidget()
     1.6  {
     1.7 +    if (!tempfile_ppid.empty() && !is_completed(tempfile_check))
     1.8 +    {
     1.9 +        system(str(boost::format("pkill -9 -P `cat %s` %s")
    1.10 +            % tempfile_ppid % Malakite::blocks3d_call).c_str());
    1.11 +    }
    1.12      drop_tempfiles();
    1.13  }
    1.14  
    1.15 @@ -233,6 +238,7 @@
    1.16      tempfile_html = temp_dir + "/html";
    1.17      tempfile_check = temp_dir + "/check";
    1.18      tempfile_sh = temp_dir + "/run.sh";
    1.19 +    tempfile_ppid = temp_dir + "/ppid";
    1.20  
    1.21      temp_dirs.push_back(temp_dir);
    1.22  
    1.23 @@ -257,10 +263,8 @@
    1.24      }
    1.25  
    1.26      std::string cmd = str(
    1.27 -    boost::format("cd %s ; "
    1.28 -    "%s -i %s %s -H %s -d %s -m %s -t %s -T %s; "
    1.29 +    boost::format("%s -i %s %s -H %s -d %s -m %s -t %s -T %s; "
    1.30      "echo 'f' > %s;")
    1.31 -    % Malakite::temp_path
    1.32      % Malakite::blocks3d_call
    1.33      % tempfile_alignment
    1.34      % conformity_option
    1.35 @@ -272,15 +276,14 @@
    1.36      % tempfile_check
    1.37      );
    1.38  
    1.39 -    std::cout << cmd << std::endl;
    1.40 -
    1.41      std::ofstream tempfile_sh_file;
    1.42      tempfile_sh_file.open(tempfile_sh.c_str());
    1.43 +    tempfile_sh_file << "echo $$ > " << tempfile_ppid << ";";
    1.44      tempfile_sh_file << cmd;
    1.45      tempfile_sh_file.close();
    1.46  
    1.47      // security???
    1.48 -    system(str(boost::format("sh %s &") % tempfile_sh.c_str()).c_str());
    1.49 +    system(str(boost::format("sh %s &") % tempfile_sh).c_str());
    1.50      new Wt::WBreak(results_panel);
    1.51      new Wt::WText(tr("task_start"), results_panel);
    1.52  
     2.1 --- a/blocks3d/wt/blocks3d-wt-widget.h	Mon Feb 28 22:20:59 2011 +0300
     2.2 +++ b/blocks3d/wt/blocks3d-wt-widget.h	Tue Mar 01 00:17:13 2011 +0300
     2.3 @@ -6,15 +6,10 @@
     2.4  
     2.5  #include <Wt/WContainerWidget>
     2.6  #include <Wt/WFileUpload>
     2.7 -#include <Wt/WHBoxLayout>
     2.8 -#include <Wt/WImage>
     2.9  #include <Wt/WLineEdit>
    2.10 -#include <Wt/WPanel>
    2.11  #include <Wt/WPushButton>
    2.12 -#include <Wt/WString>
    2.13  #include <Wt/WTextArea>
    2.14  #include <Wt/WTimer>
    2.15 -#include <Wt/WVBoxLayout>
    2.16  
    2.17  #include "config.h"
    2.18  #include "work-time.h"
    2.19 @@ -53,6 +48,7 @@
    2.20      std::string tempfile_html;
    2.21      std::string tempfile_check;
    2.22      std::string tempfile_sh;
    2.23 +    std::string tempfile_ppid;
    2.24  
    2.25      static bool is_completed(std::string tempfile_check);
    2.26  
     3.1 --- a/blocks3d/wt/locales/blocks3d.xml	Mon Feb 28 22:20:59 2011 +0300
     3.2 +++ b/blocks3d/wt/locales/blocks3d.xml	Tue Mar 01 00:17:13 2011 +0300
     3.3 @@ -5,8 +5,12 @@
     3.4      <message id='conformity_file'>Conformity file</message>
     3.5      <message id='delta'>Distance spreading</message>
     3.6      <message id='min_block_width'>Min block width</message>
     3.7 -    <message id='timeout'>Bron-Kerbosh (couple cores) timeout</message>
     3.8 -    <message id='timeout2'>Bron-Kerbosh (blocks) timeout</message>
     3.9 +    <message id='timeout'>
    3.10 +        Bron-Kerbosh (couple cores) timeout (seconds, -1 - unlimited)
    3.11 +    </message>
    3.12 +    <message id='timeout2'>
    3.13 +        Bron-Kerbosh (blocks) timeout (seconds, -1 - unlimited)
    3.14 +    </message>
    3.15      <message id='Run'>Run</message>
    3.16      <message id='Reset'>Reset</message>
    3.17      <message id='enter_delta'>Enter delta parameter</message>
     4.1 --- a/blocks3d/wt/locales/blocks3d_ru.xml	Mon Feb 28 22:20:59 2011 +0300
     4.2 +++ b/blocks3d/wt/locales/blocks3d_ru.xml	Tue Mar 01 00:17:13 2011 +0300
     4.3 @@ -6,11 +6,11 @@
     4.4      <message id='min_block_width'>Минимальная ширина блока</message>
     4.5      <message id='timeout'>
     4.6          Ограничение по времени на работу алгоритма Брона-Кербоша
     4.7 -        для парных ядер (в секундах)
     4.8 +        для парных ядер (в секундах, -1 - без ограничения)
     4.9      </message>
    4.10      <message id='timeout2'>
    4.11          Ограничение по времени на работу алгоритма Брона-Кербоша
    4.12 -        для блоков (в секундах)
    4.13 +        для блоков (в секундах, -1 - без ограничения)
    4.14      </message>
    4.15      <message id='Run'>Запустить</message>
    4.16      <message id='Reset'>Сбросить</message>