public synchronized String submitBatchJobWithScript(String scriptPath, String workingDirectory) throws SSHApiException { this.scpTo(workingDirectory, scriptPath); // since this is a constant we do not ask users to fill this // RawCommandInfo rawCommandInfo = new RawCommandInfo(this.installedPath + this.jobManagerConfiguration.getSubmitCommand() + " " + // workingDirectory + File.separator + FilenameUtils.getName(scriptPath)); RawCommandInfo rawCommandInfo = jobManagerConfiguration.getSubmitCommand(workingDirectory,scriptPath); StandardOutReader standardOutReader = new StandardOutReader(); log.info("Executing RawCommand : " + rawCommandInfo.getCommand()); CommandExecutor.executeCommand(rawCommandInfo, this.session, standardOutReader); //Check whether pbs submission is successful or not, if it failed throw and exception in submitJob method // with the error thrown in qsub command // String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading output of job submission",jobManagerConfiguration.getBaseSubmitCommand()); log.info("Job Submission SSH Command Output: " + outputifAvailable); OutputParser outputParser = jobManagerConfiguration.getParser(); return outputParser.parseJobSubmission(outputifAvailable); }