use of cbit.rmi.event.WorkerEvent in project vcell by virtualcell.
the class WorkerEventMessage method sendWorkerExitError.
public static WorkerEventMessage sendWorkerExitError(VCMessageSession session, Object source, String hostName, VCSimulationIdentifier vcSimID, int jobIndex, int taskID, int solverExitCode) throws VCMessagingException {
WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_WORKER_EXIT_ERROR, source, vcSimID, jobIndex, hostName, taskID, null, null, SimulationMessage.WorkerExited(solverExitCode));
WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent);
workerEventMessage.sendWorkerEvent(session);
return workerEventMessage;
}
use of cbit.rmi.event.WorkerEvent in project vcell by virtualcell.
the class WorkerEventMessage method sendNewData.
/**
* Insert the method's description here.
* Creation date: (12/31/2003 12:53:34 PM)
* @param param javax.jms.Message
*/
public static WorkerEventMessage sendNewData(VCMessageSession session, Object source, SimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException {
WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_DATA, source, simTask, hostName, new Double(progress), new Double(timePoint), simulationMessage);
WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent);
workerEventMessage.sendWorkerEvent(session);
return workerEventMessage;
}
use of cbit.rmi.event.WorkerEvent in project vcell by virtualcell.
the class WorkerEventMessage method sendProgress.
/**
* Insert the method's description here.
* Creation date: (12/31/2003 12:53:34 PM)
* @param param javax.jms.Message
*/
public static WorkerEventMessage sendProgress(VCMessageSession session, Object source, SimulationTask simTask, String hostName, double progress, double timePoint, SimulationMessage simulationMessage) throws VCMessagingException {
WorkerEvent workerEvent = new WorkerEvent(WorkerEvent.JOB_PROGRESS, source, simTask, hostName, new Double(progress), new Double(timePoint), simulationMessage);
WorkerEventMessage workerEventMessage = new WorkerEventMessage(workerEvent);
workerEventMessage.sendWorkerEvent(session);
return workerEventMessage;
}
use of cbit.rmi.event.WorkerEvent in project vcell by virtualcell.
the class LocalSolverController method solverStarting.
/**
* Invoked when the solver begins a calculation.
* @param event indicates the solver and the event type
*/
public void solverStarting(SolverEvent event) {
try {
if (lg.isTraceEnabled())
lg.trace("LocalSolverController Caught solverStarting(" + event.getSource().toString() + ")");
if (serialParameterScanJobIndex >= 0) {
SimulationTask newSimTask = new SimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()), getSimulationTask().getTaskID());
fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_STARTING, this, newSimTask, hostname, event.getSimulationMessage()));
} else {
fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_STARTING, this, getSimulationTask(), hostname, event.getSimulationMessage()));
}
} catch (Throwable e) {
lg.error(e.getMessage(), e);
}
}
use of cbit.rmi.event.WorkerEvent in project vcell by virtualcell.
the class LocalSolverController method solverProgress.
/**
* Invoked when the solver stores values in the result set.
* @param event indicates the solver and the event type
*/
public void solverProgress(SolverEvent event) {
try {
// don't log progress and data events
if (System.currentTimeMillis() - timeOfLastProgressMessage > 1000 * getMessagingInterval()) {
if (serialParameterScanJobIndex >= 0) {
SimulationTask newSimTask = new SimulationTask(new SimulationJob(getSimulationTask().getSimulation(), serialParameterScanJobIndex, getSimulationTask().getSimulationJob().getFieldDataIdentifierSpecs()), getSimulationTask().getTaskID());
fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_PROGRESS, this, newSimTask, hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), event.getSimulationMessage()));
if (event.getProgress() >= 1) {
fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_COMPLETED, this, newSimTask, hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), SimulationMessage.MESSAGE_JOB_COMPLETED));
serialParameterScanJobIndex++;
}
} else {
fireWorkerEvent(new WorkerEvent(WorkerEvent.JOB_PROGRESS, this, getSimulationTask(), hostname, new Double(event.getProgress()), new Double(event.getTimePoint()), event.getSimulationMessage()));
}
}
} catch (Throwable e) {
lg.error(e.getMessage(), e);
}
}
Aggregations