public Job runJob()

in src/main/java/com/epam/grid/engine/provider/job/slurm/SlurmJobProvider.java [124:150]


    public Job runJob(final JobOptions options, final String logDir) {
        if (options.getParallelEnvOptions() != null) {
            throw new UnsupportedOperationException("Parallel Environment is not supported for SLURM engine,"
                    + " please use ParallelExecutionOptions");
        }
        if (checkParallelExecutionOptions(options.getParallelExecutionOptions())) {
            throw new GridEngineException(HttpStatus.BAD_REQUEST, "All Parallel execution options except Exclusive "
                    + "should be greater than 0!");
        }
        if (options.getPriority() != null && (options.getPriority() < 0 || options.getPriority() > MAX_SENT_PRIORITY)) {
            throw new GridEngineException(HttpStatus.BAD_REQUEST, "Priority should be between 0 and 4_294_967_294");
        }
        final CommandResult result = simpleCmdExecutor.execute(makeSbatchCommand(options, logDir));
        if (result.getExitCode() != 0 || result.getStdOut().isEmpty()) {
            CommandsUtils.throwExecutionDetails(result, HttpStatus.INTERNAL_SERVER_ERROR);
        }
        final Matcher matcher = SUBMITTED_JOB_PATTERN.matcher(result.getStdOut().get(0));
        if (!matcher.find()) {
            CommandsUtils.throwExecutionDetails(result, HttpStatus.INTERNAL_SERVER_ERROR);
        }
        return Job.builder()
                .id(Long.parseLong(matcher.group(1)))
                .state(JobState.builder()
                        .category(JobState.Category.PENDING)
                        .build())
                .build();
    }