Changes between Version 3 and Version 4 of ComputeStartExample7


Ignore:
Timestamp:
2010-11-11T14:58:23+01:00 (14 years ago)
Author:
george
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ComputeStartExample7

    v3 v4  
    11= Job Monitoring =
    22
    3 Job execution is monitored by reading a log file of the job. A job consists of a number of steps which consists of a number of operations ([http://www.molgenis.org/wiki/ComputeStartDataModel MCF Data Model]). A step of the job can be started when all operations of a previous step are finished. Operations in a step can be executed in parallel. Every operation writes to a job log file. Monitoring is implemented by reading job log files. Monitoring is called from [http://www.molgenis.org/svn/sandbox/molgenis_processing/3.3.galaxy/ScriptbasedComputePlatform/src/scriptserver/PipelineThread.java PipelineThread] after step is submitted for execution:
     3Job execution is monitored by reading a log file of the job. A job consists of a number of steps which consists of a number of operations ([http://www.molgenis.org/wiki/ComputeStartDataModel MCF Data Model]). A step of the job can be started when all operations of a previous step are finished. Operations in a step can be executed in parallel. Every operation writes to a job log file. Monitoring is implemented by reading job log files. Monitoring is called from [http://www.molgenis.org/svn/sandbox/molgenis_processing/3.3.galaxy/ScriptbasedComputePlatform/src/scriptserver/PipelineThread.java PipelineThread] after the step is submitted for execution:
    44
    55{{{
     
    3333}}}
    3434
    35    
     35In actual reading of the remote logging file is done using gridgain in the next method of [http://www.molgenis.org/svn/sandbox/molgenis_processing/3.3.galaxy/ScriptbasedComputePlatform/src/monitor/LoggingReader.java LoggingReader]
     36 
     37{{{
     38public void checkStepStatus()
     39    {
     40        Future<RemoteResult> future = exec.submit(new RemoteLoggingReader(log_location));
     41
     42        RemoteResult back = null;
     43
     44        try
     45        {
     46            back = future.get();
     47        }
     48       
     49        ...
     50
     51        String logging = new String(back.getData());
     52
     53        summary.scripts_started = 0;
     54        summary.scripts_finished = 0;
     55        summary.scripts_all = currentStep.getNumberOfScripts();
     56
     57        for (int i = 0; i < summary.scripts_all; i++)
     58        {
     59            String script_id = currentStep.getScript(i).getID();
     60
     61            int index_started = logging.indexOf(script_id + _STARTED);
     62            int index_finished = logging.indexOf(script_id + _FINISHED);
     63
     64            if (index_started > 0) summary.scripts_started++;
     65            if (index_finished > 0) summary.scripts_finished++;
     66        }
     67
     68        if (summary.scripts_finished == summary.scripts_all)
     69            isStepFinished = true;
     70       ...
     71
     72}}}
     73