Search in sources :

Example 51 with JobId

use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.

the class SchedulerEfficiencyMetricsTest method test.

@Test(timeout = 3600000)
public void test() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", taskNumber);
    final TaskFlowJob job = createJob(taskNumber, TASK_DURATION);
    long start = System.currentTimeMillis();
    jobId = schedulerHelper.submitJob(job);
    long submited = System.currentTimeMillis();
    schedulerHelper.waitForEventJobFinished(jobId);
    final JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobId);
    final long finished = jobState.getFinishedTime();
    long latestTaskStart = Long.MIN_VALUE;
    for (TaskState taskState : jobState.getTasks()) {
        if (taskState.getStartTime() > latestTaskStart) {
            latestTaskStart = taskState.getStartTime();
        }
    }
    long TCT = submited - start;
    long TST = latestTaskStart - submited;
    long TTT = finished - latestTaskStart - TASK_DURATION;
    logAndAssert("TaskCreationTimeTest", TCT);
    logAndAssert("TaskSchedulingTimeTest", TST);
    logAndAssert("TaskTerminationTimeTest", TTT);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JobState(org.ow2.proactive.scheduler.common.job.JobState) TaskState(org.ow2.proactive.scheduler.common.task.TaskState) Test(org.junit.Test)

Example 52 with JobId

use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.

the class TaskCreationTimeTest method taskCreationRate.

@Test(timeout = 3600000)
public void taskCreationRate() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", 1);
    final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(taskNumber, TASK_DURATION);
    final long start = System.currentTimeMillis();
    jobId = schedulerHelper.submitJob(job);
    final long anActualTime = System.currentTimeMillis() - start;
    LOGGER.info(makeCSVString(TaskCreationTimeTest.class.getSimpleName(), taskNumber, timeLimit, anActualTime, ((anActualTime < timeLimit) ? SUCCESS : FAILURE)));
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Example 53 with JobId

use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.

the class TaskSchedulingTimeTest method test.

@Test(timeout = 3600000)
public void test() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", numberOfExperiments);
    final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(1, 10);
    long totalTime = 0;
    for (int i = 0; i < numberOfExperiments; ++i) {
        JobId jobId = schedulerHelper.submitJob(job);
        jobIds.add(jobId);
        schedulerHelper.waitForEventJobFinished(jobId);
        final JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobId);
        final long submittedTime = jobState.getSubmittedTime();
        final long taskStartTime = jobState.getTasks().get(0).getStartTime();
        final long timeToScheduleTask = taskStartTime - submittedTime;
        totalTime += timeToScheduleTask;
    }
    long averageTime = totalTime / numberOfExperiments;
    LOGGER.info(makeCSVString("AverageTaskSchedulingTime", numberOfExperiments, timeLimit, averageTime, ((averageTime < timeLimit) ? SUCCESS : FAILURE)));
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JobState(org.ow2.proactive.scheduler.common.job.JobState) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 54 with JobId

use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.

the class JobRecoveryTest method startKillStartScheduler.

/**
 * This method tests performance of jobs recovery using local infrastructure.
 *
 * @throws Exception
 */
public void startKillStartScheduler() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START, NodeRecoveryTest.RM_CONFIGURATION_START, null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", jobsNumber);
    JobId[] jobIds = new JobId[jobsNumber];
    for (int i = 0; i < jobsNumber; ++i) {
        jobIds[i] = schedulerHelper.submitJob(new File(runningJob.toURI()).getAbsolutePath());
    }
    for (int i = 0; i < jobsNumber; ++i) {
        schedulerHelper.waitForEventJobRunning(jobIds[i]);
    }
    NodesRecoveryProcessHelper.findPidAndSendSigKill(SchedulerStartForFunctionalTest.class.getSimpleName());
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_RESTART, NodeRecoveryTest.RM_CONFIGURATION_RESTART, null);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) SchedulerStartForFunctionalTest(functionaltests.utils.SchedulerStartForFunctionalTest) File(java.io.File) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Example 55 with JobId

use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.

the class JobResultSchedulerListener method jobRunningToFinishedEvent.

private void jobRunningToFinishedEvent(NotificationData<JobInfo> jobNotification) {
    JobId jobId = jobNotification.getData().getJobId();
    logger.trace("Trying to get the job result for job " + jobId);
    try {
        logger.info("The result for job with ID " + jobId + " is " + this.daddy.getJobResult(jobId));
    } catch (SchedulerException e) {
        logger.error("Cannot get the job result for job with id " + jobId + " from the scheduler", e);
    }
}
Also used : SchedulerException(org.ow2.proactive.scheduler.common.exception.SchedulerException) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

JobId (org.ow2.proactive.scheduler.common.job.JobId)179 Test (org.junit.Test)121 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)73 File (java.io.File)58 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)57 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)55 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)55 JobState (org.ow2.proactive.scheduler.common.job.JobState)51 ArrayList (java.util.ArrayList)45 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)43 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)42 JobIdImpl (org.ow2.proactive.scheduler.job.JobIdImpl)40 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)38 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)37 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)36 Path (javax.ws.rs.Path)35 NotConnectedRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException)35 PermissionRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException)34 Produces (javax.ws.rs.Produces)33 UnknownJobRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.UnknownJobRestException)33