Package weka.experiment

Examples of weka.experiment.TaskStatusInfo


      // assess the status of the sub-exp
      notifyListeners(false,true,false,
          Messages.getInstance().getString("BoundaryPanelDistributed_LaunchNext_Run_StartingRow_Text_Front") + wtask + Messages.getInstance().getString("BoundaryPanelDistributed_LaunchNext_Run_StartingRow_Text_End") + ((String)m_remoteHosts.elementAt(ah)));
      Object subTaskId = comp.executeTask(vSubTask);
      boolean finished = false;
      TaskStatusInfo is = null;
      long startTime = System.currentTimeMillis();
      while (!finished) {
        try {
    Thread.sleep(Math.max(m_minTaskPollTime,
              m_hostPollingTime[ah]));
   
    TaskStatusInfo cs = (TaskStatusInfo)comp.
      checkStatus(subTaskId);
    if (cs.getExecutionStatus() == TaskStatusInfo.FINISHED) {
      // push host back onto queue and try launching any waiting
      // sub-experiments
      long runTime = System.currentTimeMillis() - startTime;
      runTime /= 4;
      if (runTime < 1000) {
        runTime = 1000;
      }
      m_hostPollingTime[ah] = (int)runTime;

      // Extract the row from the result
      RemoteResult rr =  (RemoteResult)cs.getTaskResult();
      double [][] probs = rr.getProbabilities();
     
      for (int i = 0; i < m_panelWidth; i++) {
        m_probabilityCache[wtask][i] = probs[i];
        if (i < m_panelWidth-1) {
          plotPoint(i, wtask, probs[i], false);
        } else {
          plotPoint(i, wtask, probs[i], true);
        }
      }
      notifyListeners(false, true, false,  cs.getStatusMessage());
      m_remoteHostsStatus[ah] = AVAILABLE;
      incrementFinished();
      availableHost(ah);
      finished = true;
    } else if (cs.getExecutionStatus() ==
         TaskStatusInfo.FAILED) {
      // a non connection related error---possibly host doesn't have
      // access to data sets or security policy is not set up
      // correctly or classifier(s) failed for some reason
      notifyListeners(false, true, false, 
          cs.getStatusMessage());
      m_remoteHostsStatus[ah] = SOME_OTHER_FAILURE;
      //      m_subExpComplete[wexp] = TaskStatusInfo.FAILED;
      notifyListeners(false,true,false,Messages.getInstance().getString("BoundaryPanelDistributed_LaunchNext_Run_SchedulingRow_Text_Front") + wtask + " " + cs.getStatusMessage() + Messages.getInstance().getString("BoundaryPanelDistributed_LaunchNext_Run_SchedulingRow_Text_End"));
      incrementFailed(ah);
      // push experiment back onto queue
      waitingTask(wtask)
      // push host back onto queue and try launching any waiting
      // Tasks. Host is pushed back on the queue as the
      // failure may be temporary.
      availableHost(ah);
      finished = true;
    } else {
      if (is == null) {
        is = cs;
        notifyListeners(false, true, false, cs.getStatusMessage());
      } else {
        RemoteResult rr = (RemoteResult)cs.getTaskResult();
        if (rr != null) {
          int percentComplete = rr.getPercentCompleted();
          String timeRemaining = "";
          if (percentComplete > 0 && percentComplete < 100) {
      double timeSoFar = (double)System.currentTimeMillis() -
View Full Code Here


          +wtask
          +" on host "
          +((String)m_remoteHosts.elementAt(ah)));
      Object subTaskId = comp.executeTask(vSubTask);
      boolean finished = false;
      TaskStatusInfo is = null;
      long startTime = System.currentTimeMillis();
      while (!finished) {
        try {
    Thread.sleep(Math.max(m_minTaskPollTime,
              m_hostPollingTime[ah]));
   
    TaskStatusInfo cs = (TaskStatusInfo)comp.
      checkStatus(subTaskId);
    if (cs.getExecutionStatus() == TaskStatusInfo.FINISHED) {
      // push host back onto queue and try launching any waiting
      // sub-experiments
      long runTime = System.currentTimeMillis() - startTime;
      runTime /= 4;
      if (runTime < 1000) {
        runTime = 1000;
      }
      m_hostPollingTime[ah] = (int)runTime;

      // Extract the row from the result
      RemoteResult rr =  (RemoteResult)cs.getTaskResult();
      double [][] probs = rr.getProbabilities();
     
      for (int i = 0; i < m_panelWidth; i++) {
        m_probabilityCache[wtask][i] = probs[i];
        if (i < m_panelWidth-1) {
          plotPoint(i, wtask, probs[i], false);
        } else {
          plotPoint(i, wtask, probs[i], true);
        }
      }
      notifyListeners(false, true, false,  cs.getStatusMessage());
      m_remoteHostsStatus[ah] = AVAILABLE;
      incrementFinished();
      availableHost(ah);
      finished = true;
    } else if (cs.getExecutionStatus() ==
         TaskStatusInfo.FAILED) {
      // a non connection related error---possibly host doesn't have
      // access to data sets or security policy is not set up
      // correctly or classifier(s) failed for some reason
      notifyListeners(false, true, false, 
          cs.getStatusMessage());
      m_remoteHostsStatus[ah] = SOME_OTHER_FAILURE;
      //      m_subExpComplete[wexp] = TaskStatusInfo.FAILED;
      notifyListeners(false,true,false,"Row "+wtask
          +" "+cs.getStatusMessage()
          +". Scheduling for execution on another host.");
      incrementFailed(ah);
      // push experiment back onto queue
      waitingTask(wtask)
      // push host back onto queue and try launching any waiting
      // Tasks. Host is pushed back on the queue as the
      // failure may be temporary.
      availableHost(ah);
      finished = true;
    } else {
      if (is == null) {
        is = cs;
        notifyListeners(false, true, false, cs.getStatusMessage());
      } else {
        RemoteResult rr = (RemoteResult)cs.getTaskResult();
        if (rr != null) {
          int percentComplete = rr.getPercentCompleted();
          String timeRemaining = "";
          if (percentComplete > 0 && percentComplete < 100) {
      double timeSoFar = (double)System.currentTimeMillis() -
View Full Code Here

          +wtask
          +" on host "
          +((String)m_remoteHosts.elementAt(ah)));
      Object subTaskId = comp.executeTask(vSubTask);
      boolean finished = false;
      TaskStatusInfo is = null;
      long startTime = System.currentTimeMillis();
      while (!finished) {
        try {
    Thread.sleep(Math.max(m_minTaskPollTime,
              m_hostPollingTime[ah]));
   
    TaskStatusInfo cs = (TaskStatusInfo)comp.
      checkStatus(subTaskId);
    if (cs.getExecutionStatus() == TaskStatusInfo.FINISHED) {
      // push host back onto queue and try launching any waiting
      // sub-experiments
      long runTime = System.currentTimeMillis() - startTime;
      runTime /= 4;
      if (runTime < 1000) {
        runTime = 1000;
      }
      m_hostPollingTime[ah] = (int)runTime;

      // Extract the row from the result
      RemoteResult rr =  (RemoteResult)cs.getTaskResult();
      double [][] probs = rr.getProbabilities();
     
      for (int i = 0; i < m_panelWidth; i++) {
        m_probabilityCache[wtask][i] = probs[i];
        if (i < m_panelWidth-1) {
          plotPoint(i, wtask, probs[i], false);
        } else {
          plotPoint(i, wtask, probs[i], true);
        }
      }
      notifyListeners(false, true, false,  cs.getStatusMessage());
      m_remoteHostsStatus[ah] = AVAILABLE;
      incrementFinished();
      availableHost(ah);
      finished = true;
    } else if (cs.getExecutionStatus() ==
         TaskStatusInfo.FAILED) {
      // a non connection related error---possibly host doesn't have
      // access to data sets or security policy is not set up
      // correctly or classifier(s) failed for some reason
      notifyListeners(false, true, false, 
          cs.getStatusMessage());
      m_remoteHostsStatus[ah] = SOME_OTHER_FAILURE;
      //      m_subExpComplete[wexp] = TaskStatusInfo.FAILED;
      notifyListeners(false,true,false,"Row "+wtask
          +" "+cs.getStatusMessage()
          +". Scheduling for execution on another host.");
      incrementFailed(ah);
      // push experiment back onto queue
      waitingTask(wtask)
      // push host back onto queue and try launching any waiting
      // Tasks. Host is pushed back on the queue as the
      // failure may be temporary.
      availableHost(ah);
      finished = true;
    } else {
      if (is == null) {
        is = cs;
        notifyListeners(false, true, false, cs.getStatusMessage());
      } else {
        RemoteResult rr = (RemoteResult)cs.getTaskResult();
        if (rr != null) {
          int percentComplete = rr.getPercentCompleted();
          String timeRemaining = "";
          if (percentComplete > 0 && percentComplete < 100) {
      double timeSoFar = (double)System.currentTimeMillis() -
View Full Code Here

TOP

Related Classes of weka.experiment.TaskStatusInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.