Search in sources :

Example 6 with VCellServerID

use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.

the class AddNewServiceDialog method getServiceSpec.

/**
 * Insert the method's description here.
 * Creation date: (8/22/2003 4:07:31 PM)
 * @return cbit.vcell.messaging.admin.VCellServiceConfig
 */
public ServiceSpec getServiceSpec() {
    VCellServerID site = VCellServerID.getServerID(getSiteField().getText());
    ServiceType stype = (ServiceType) getTypeCombo().getSelectedItem();
    int ordinal = 0;
    try {
        ordinal = Integer.parseInt("" + getOrdinalCombo().getSelectedItem());
    } catch (NumberFormatException ex) {
        throw new RuntimeException("Ordinal must be a number!");
    }
    ServiceStartupType startup = ServiceStartupType.fromDescription((String) getStartupCombo().getSelectedItem());
    int memoryMB = Integer.parseInt(getMemoryMBField().getText());
    return new ServiceSpec(site, stype, ordinal, startup, memoryMB);
}
Also used : VCellServerID(org.vcell.util.document.VCellServerID) ServiceType(cbit.vcell.message.server.bootstrap.ServiceType) ServiceSpec(cbit.vcell.message.server.ServiceSpec) ServiceStartupType(cbit.vcell.message.server.ServiceSpec.ServiceStartupType)

Example 7 with VCellServerID

use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.

the class SimulationDatabaseDirect method translateToSimulationJobStatusPersistent.

private SimulationJobStatusPersistent translateToSimulationJobStatusPersistent(SimulationJobStatus simJobStatus) {
    VCellServerID serverID = simJobStatus.getServerID();
    VCSimulationIdentifier vcSimID = simJobStatus.getVCSimulationIdentifier();
    int jobIndex = simJobStatus.getJobIndex();
    Date submitDate = simJobStatus.getSubmitDate();
    SimulationJobStatusPersistent.SchedulerStatus schedulerStatus = SimulationJobStatusPersistent.SchedulerStatus.valueOf(simJobStatus.getSchedulerStatus().name());
    int taskID = simJobStatus.getTaskID();
    SimulationMessagePersistent simMessage = SimulationMessagePersistent.fromSerializedMessage(simJobStatus.getSimulationMessage().toSerialization());
    Date queueDate = simJobStatus.getSimulationQueueEntryStatus().getQueueDate();
    int queuePriority = simJobStatus.getSimulationQueueEntryStatus().getQueuePriority();
    SimulationJobStatusPersistent.SimulationQueueID queueId = SimulationJobStatusPersistent.SimulationQueueID.valueOf(simJobStatus.getSimulationQueueEntryStatus().getQueueID().name());
    SimulationQueueEntryStatusPersistent simQueueStatus = new SimulationQueueEntryStatusPersistent(queueDate, queuePriority, queueId);
    SimulationExecutionStatusPersistent simExecStatus = new SimulationExecutionStatusPersistent(simJobStatus.getSimulationExecutionStatus().getStartDate(), simJobStatus.getSimulationExecutionStatus().getComputeHost(), simJobStatus.getSimulationExecutionStatus().getLatestUpdateDate(), simJobStatus.getSimulationExecutionStatus().getEndDate(), simJobStatus.getSimulationExecutionStatus().hasData(), simJobStatus.getSimulationExecutionStatus().getHtcJobID());
    SimulationJobStatusPersistent simJobStatusPersistent = new SimulationJobStatusPersistent(serverID, vcSimID, jobIndex, submitDate, schedulerStatus, taskID, simMessage, simQueueStatus, simExecStatus);
    return simJobStatusPersistent;
}
Also used : VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) VCellServerID(org.vcell.util.document.VCellServerID) SimulationQueueEntryStatusPersistent(cbit.vcell.server.SimulationQueueEntryStatusPersistent) SimulationExecutionStatusPersistent(cbit.vcell.server.SimulationExecutionStatusPersistent) SimulationJobStatusPersistent(cbit.vcell.server.SimulationJobStatusPersistent) Date(java.util.Date) SimulationMessagePersistent(cbit.vcell.solver.server.SimulationMessagePersistent)

Example 8 with VCellServerID

use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.

the class SimulationStateMachine method onSystemAbort.

public synchronized void onSystemAbort(SimulationJobStatus oldJobStatus, String failureMessage, SimulationDatabase simulationDatabase, VCMessageSession session) throws VCMessagingException, UpdateSynchronizationException, DataAccessException, SQLException {
    updateSolverProcessTimestamp();
    int taskID = oldJobStatus.getTaskID();
    // 
    // status information (initialized as if new record)
    // 
    Date startDate = null;
    boolean hasData = false;
    HtcJobID htcJobID = null;
    String computeHost = null;
    VCellServerID vcServerID = VCellServerID.getSystemServerID();
    Date submitDate = null;
    Date queueDate = null;
    int queuePriority = PRIORITY_DEFAULT;
    // 
    // update using previously stored status (if available).
    // 
    SimulationExecutionStatus oldSimExeStatus = oldJobStatus.getSimulationExecutionStatus();
    if (oldSimExeStatus != null && oldSimExeStatus.getStartDate() != null) {
        startDate = oldSimExeStatus.getStartDate();
    }
    if (oldSimExeStatus != null && oldSimExeStatus.hasData()) {
        hasData = true;
    }
    if (oldSimExeStatus != null && oldSimExeStatus.getComputeHost() != null) {
        computeHost = oldSimExeStatus.getComputeHost();
    }
    if (oldSimExeStatus != null && oldSimExeStatus.getHtcJobID() != null) {
        htcJobID = oldSimExeStatus.getHtcJobID();
    }
    vcServerID = oldJobStatus.getServerID();
    submitDate = oldJobStatus.getSubmitDate();
    SimulationQueueEntryStatus oldQueueStatus = oldJobStatus.getSimulationQueueEntryStatus();
    if (oldQueueStatus != null && oldQueueStatus.getQueueDate() != null) {
        queueDate = oldQueueStatus.getQueueDate();
    }
    if (oldQueueStatus != null) {
        queuePriority = oldQueueStatus.getQueuePriority();
    }
    SimulationQueueEntryStatus newQueueStatus = new SimulationQueueEntryStatus(queueDate, queuePriority, SimulationJobStatus.SimulationQueueID.QUEUE_ID_NULL);
    Date endDate = new Date();
    Date lastUpdateDate = new Date();
    SimulationExecutionStatus newExeStatus = new SimulationExecutionStatus(startDate, computeHost, lastUpdateDate, endDate, hasData, htcJobID);
    SimulationJobStatus newJobStatus = new SimulationJobStatus(vcServerID, oldJobStatus.getVCSimulationIdentifier(), jobIndex, submitDate, SchedulerStatus.FAILED, taskID, SimulationMessage.jobFailed(failureMessage), newQueueStatus, newExeStatus);
    simulationDatabase.updateSimulationJobStatus(newJobStatus);
    // addStateMachineTransition(new StateMachineTransition(new AbortStateMachineEvent(taskID, failureMessage), oldJobStatus, newJobStatus));
    String userName = VCMessagingConstants.USERNAME_PROPERTY_VALUE_ALL;
    StatusMessage msgForClient = new StatusMessage(newJobStatus, userName, null, null);
    msgForClient.sendToClient(session);
    if (lg.isTraceEnabled())
        lg.trace("Send status to client: " + msgForClient);
}
Also used : SimulationExecutionStatus(cbit.vcell.server.SimulationExecutionStatus) VCellServerID(org.vcell.util.document.VCellServerID) SimulationJobStatus(cbit.vcell.server.SimulationJobStatus) HtcJobID(cbit.vcell.server.HtcJobID) SimulationQueueEntryStatus(cbit.vcell.server.SimulationQueueEntryStatus) Date(java.util.Date) StatusMessage(cbit.vcell.message.messages.StatusMessage)

Aggregations

VCellServerID (org.vcell.util.document.VCellServerID)8 Date (java.util.Date)6 HtcJobID (cbit.vcell.server.HtcJobID)5 SimulationExecutionStatus (cbit.vcell.server.SimulationExecutionStatus)5 SimulationJobStatus (cbit.vcell.server.SimulationJobStatus)5 SimulationQueueEntryStatus (cbit.vcell.server.SimulationQueueEntryStatus)5 StatusMessage (cbit.vcell.message.messages.StatusMessage)3 SchedulerStatus (cbit.vcell.server.SimulationJobStatus.SchedulerStatus)3 VCSimulationIdentifier (cbit.vcell.solver.VCSimulationIdentifier)3 SimulationMessage (cbit.vcell.solver.server.SimulationMessage)3 ServiceSpec (cbit.vcell.message.server.ServiceSpec)2 KeyValue (org.vcell.util.document.KeyValue)2 WorkerEventMessage (cbit.vcell.message.messages.WorkerEventMessage)1 ServiceStartupType (cbit.vcell.message.server.ServiceSpec.ServiceStartupType)1 ServiceStatus (cbit.vcell.message.server.ServiceStatus)1 ServiceType (cbit.vcell.message.server.bootstrap.ServiceType)1 RunningStateInfo (cbit.vcell.server.RunningStateInfo)1 SimulationExecutionStatusPersistent (cbit.vcell.server.SimulationExecutionStatusPersistent)1 SimulationQueueID (cbit.vcell.server.SimulationJobStatus.SimulationQueueID)1 SimulationJobStatusPersistent (cbit.vcell.server.SimulationJobStatusPersistent)1