Package org.jamesii.core.experiments.tasks

Examples of org.jamesii.core.experiments.tasks.IComputationTask


                  + compTaskConfig.getConfigurationID() + "\n" + "Com: "
                  + compTaskConfig.getComputationTaskID());
      return new RunInformation(false);
    }

    IComputationTask currentComputationTask = task.getComputationTask();
    ExecutionMeasurements execMeasures =
        new ExecutionMeasurements(task.getRunInfo());

    // Execute the computation task
    execMeasures.startComputationTask();
    try {
      // TODO: check whether this works...
      if (compTaskConfig.isInteractive() && (interactiveConsole != null)
          && currentComputationTask instanceof SimulationRun) {
        interactiveConsole.setSimulation(currentComputationTask);
      }
      // If there is a master server defined by the parameters, start the
      // simulation there
      if (compTaskConfig.useMasterServer()) {

        RemoteComputationTaskRunnerRef remoteSimRunnerRef = null;

        try {
          remoteSimRunnerRef = new RemoteComputationTaskRunnerRef(taskRunner);
        } catch (RemoteException t) {
          SimSystem.report(t);
          task.getRunInfo().storeFailure("Remote computation failed.", t);
        }

        compTaskConfig.getMasterServer().execute(
            task.getRunInfo().getComputationTaskID(), remoteSimRunnerRef);
        // Otherwise start the simulation locally
      } else {
        if (currentComputationTask == null) {
          return task.getRunInfo();
        }
        currentComputationTask.start();
      }
    } catch (RemoteException t) {
      String msg =
          "Computation of task " + compTaskConfig.toString() + " FAILED !!! ";
      SimSystem.report(Level.SEVERE, msg, t);
View Full Code Here


          runConfig.getMasterServer().stop(currentTRI.getComputationTaskID());
        } catch (Exception e) {
          SimSystem.report(Level.SEVERE, "Couldn't stop computation!");
        }
      } else {
        IComputationTask sim = currentTRI.getComputationTask();
        if (sim != null) {
          sim.stopProcessor();
        }
      }
    }
  }
View Full Code Here

          } catch (Exception e) {
            SimSystem.report(Level.SEVERE,
                "Couldn't stop the computation task!");
          }
        } else {
          IComputationTask sim = currentTRTI.getComputationTask();
          if (sim != null) {
            sim.stopProcessor();
          }
        }
      }

      // Clear to-do list
View Full Code Here

        } else {
          abortCurrentConfig = true;
        }

        // Notify submitting experiment
        IComputationTask run = initComputationTask.getComputationTask();
        currentTRTI =
            new ComputationTaskRuntimeInformation(compTaskConfig, taskConfig,
                run, run != null ? run.getUniqueIdentifier() : null,
                currentResult);
      } catch (Exception t) {
        SimSystem.report(Level.SEVERE,
            "Problem in initializing execution task", t);
        handleAbort(taskConfig, currentResult, compTaskConfig, t);
View Full Code Here

  @Override
  public void run() {
    while (!end) {
      sem.p();
      IComputationTask t;
      synchronized (task) {
        t = task;
      }
      end = threadedPolicy.hasReachedEnd(t);
    }
View Full Code Here

    Object taskObj =
        ParameterBlocks.getSubBlockValue(selectionInformation.getParameter(),
            ComputationTaskStopPolicyFactory.COMPTASK);

    if (taskObj instanceof IComputationTask) {
      IComputationTask task = (IComputationTask) taskObj;
      IUniqueID newId = task.getUniqueIdentifier();
      moveTemporaryData(newId, threadId);
      threadToTaskMap.put(threadId, newId);
    }

    // In case there's no valid task ID yet
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    synchronized (this) {
      ComputationRuntimeState state = getSimRuntimeInfo().getState();
      IComputationTask task = getSimRuntimeInfo().getComputationTask();
      if (task == null) {
        // nothing to control
        return;
      }
      switch (state) {
      case RUNNING:
        if (!simControllingPossible()) {
          SimSystem.report(Level.INFO,
              "Pausing the computation is not possible.");
          break;
        }
        task.pauseProcessor();
        getSimRuntimeInfo().setState(ComputationRuntimeState.PAUSED);
        break;
      case PAUSED:
        if (!simControllingPossible()) {
          SimSystem.report(Level.INFO,
              "Unpausing the computation is not possible.");
          break;
        }
        // Pause twice to restart the simulation
        task.pauseProcessor();
        getSimRuntimeInfo().setState(ComputationRuntimeState.RUNNING);
        break;
      }
      refreshIcon(getSimRuntimeInfo());
      SimRunTableModel model = srtmRef.get();
View Full Code Here

TOP

Related Classes of org.jamesii.core.experiments.tasks.IComputationTask

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.