Repository: airavata Updated Branches: refs/heads/master 9a6eaaae2 -> c6c935438
adding LSF support to airavata Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c6c93543 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c6c93543 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c6c93543 Branch: refs/heads/master Commit: c6c93543856a02e7bf8e58227b67dbcb902550eb Parents: 9a6eaaa Author: Lahiru Gunathilake <[email protected]> Authored: Wed Feb 25 12:31:20 2015 -0500 Committer: Lahiru Gunathilake <[email protected]> Committed: Wed Feb 25 12:31:20 2015 -0500 ---------------------------------------------------------------------- .../server/src/main/resources/LSFTemplate.xslt | 80 ++++++++++++++ .../impl/pull/qstat/ResourceConnection.java | 4 +- .../airavata/gfac/ssh/util/GFACSSHUtils.java | 4 + .../airavata/orchestrator/cpi/Orchestrator.java | 2 +- .../airavata/gsi/ssh/api/job/JobDescriptor.java | 14 +++ .../gsi/ssh/api/job/LSFJobConfiguration.java | 100 +++++++++++++++++ .../gsi/ssh/api/job/LSFOutputParser.java | 108 +++++++++++++++++++ .../airavata/gsi/ssh/api/job/OutputParser.java | 14 +-- .../gsi/ssh/api/job/PBSOutputParser.java | 8 +- .../gsi/ssh/api/job/SGEOutputParser.java | 8 +- .../gsi/ssh/api/job/SlurmOutputParser.java | 10 +- .../gsi/ssh/impl/GSISSHAbstractCluster.java | 62 ++++++++++- .../apache/airavata/gsi/ssh/impl/JobStatus.java | 20 +++- .../airavata/gsi/ssh/impl/PBSCluster.java | 4 + .../gsi/ssh/listener/JobSubmissionListener.java | 2 +- .../airavata/gsi/ssh/util/CommonUtils.java | 13 +++ .../gsissh/src/main/resources/LSFTemplate.xslt | 93 ++++++++++++++++ .../main/resources/schemas/PBSJobDescriptor.xsd | 3 +- .../gsi/ssh/impl/VanilaTestWithSSHAuth.java | 44 ++++++++ 19 files changed, 561 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/modules/configuration/server/src/main/resources/LSFTemplate.xslt ---------------------------------------------------------------------- diff --git a/modules/configuration/server/src/main/resources/LSFTemplate.xslt b/modules/configuration/server/src/main/resources/LSFTemplate.xslt new file mode 100644 index 0000000..ab9fbbd --- /dev/null +++ b/modules/configuration/server/src/main/resources/LSFTemplate.xslt @@ -0,0 +1,80 @@ +<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file + distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under + the Apache License, Version 2.0 (theà "License"); you may not use this file except in compliance with the License. You may + obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to + in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF + ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under + the License. --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://airavata.apache.org/gsi/ssh/2012/12"> + <xsl:output method="text" /> + <xsl:template match="/ns:JobDescriptor"> + <xsl:param name="quote">"</xsl:param> + #! /bin/bash + # LSF batch job submission script generated by Apache Airavata + # + <xsl:choose> + <xsl:when test="ns:queueName"> + #BSUB -n <xsl:value-of select="ns:queueName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:mailAddress"> + #BSUB -u <xsl:value-of select="ns:mailAddress"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:jobName"> + #BSUB -J <xsl:value-of select="ns:jobName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:acountString"> + #BSUB -P <xsl:value-of select="ns:acountString"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:maxWallTime"> + #BSUB -W<xsl:value-of select="ns:maxWallTime"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> + #BSUB -o <xsl:value-of select="ns:standardOutFile"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> + #BSUB -e <xsl:value-of select="ns:standardErrorFile"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:usedMem"> + #BSUB -R rusage[mem=<xsl:value-of select="ns:usedMem"/>] + </xsl:when> + </xsl:choose> + + <xsl:text>
</xsl:text> + + <xsl:text>
</xsl:text> + <xsl:for-each select="ns:moduleLoadCommands/ns:command"> + <xsl:text>
</xsl:text> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + + <xsl:for-each select="ns:preJobCommands/ns:command"> + <xsl:value-of select="."/><xsl:text> </xsl:text> + <xsl:text>
</xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + <xsl:choose><xsl:when test="ns:jobSubmitterCommand != ''"> + <xsl:value-of select="ns:jobSubmitterCommand"/><xsl:text> </xsl:text> + </xsl:when></xsl:choose><xsl:value-of select="ns:executablePath"/><xsl:text> </xsl:text> + <xsl:for-each select="ns:inputs/ns:input"> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + ~/rabbitmq-java-client-bin-3.3.5/runjava.sh com.rabbitmq.examples.SimpleProducer amqp://<xsl:value-of select="ns:callBackIp"/><xsl:text> </xsl:text><xsl:value-of select="ns:userName"/>,<xsl:value-of select="ns:jobName"/><xsl:text> </xsl:text><xsl:value-of select="$quote"/><xsl:value-of select="$quote"/><xsl:text> </xsl:text><xsl:value-of select="ns:callBackPort"/> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java index 1a76c3d..e13d907 100644 --- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java +++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java @@ -87,7 +87,7 @@ public class ResourceConnection { public JobState getJobStatus(MonitorID monitorID) throws SSHApiException { String jobID = monitorID.getJobID(); //todo so currently we execute the qstat for each job but we can use user based monitoring - //todo or we should concatenate all the commands and execute them in one go and parse the response + //todo or we should concatenate all the commands and execute them in one go and parseSingleJob the response return getStatusFromString(cluster.getJobStatus(jobID).toString()); } @@ -101,7 +101,7 @@ public class ResourceConnection { } String userName = cluster.getServerInfo().getUserName(); //todo so currently we execute the qstat for each job but we can use user based monitoring - //todo or we should concatenate all the commands and execute them in one go and parse the response + //todo or we should concatenate all the commands and execute them in one go and parseSingleJob the response // cluster.getJobStatuses(userName, treeMap); for (String key : treeMap.keySet()) { http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java index d4292d9..a9e08d3 100644 --- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java +++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java @@ -66,6 +66,8 @@ public class GFACSSHUtils { public static final String PBS_JOB_MANAGER = "pbs"; public static final String SLURM_JOB_MANAGER = "slurm"; public static final String SUN_GRID_ENGINE_JOB_MANAGER = "UGE"; + public static final String LSF_JOB_MANAGER = "LSF"; + public static int maxClusterCount = 5; /** @@ -232,6 +234,8 @@ public class GFACSSHUtils { jConfig = CommonUtils.getSLURMJobManager(installedParentPath); } else if (SUN_GRID_ENGINE_JOB_MANAGER.equalsIgnoreCase(jobManager)) { jConfig = CommonUtils.getSGEJobManager(installedParentPath); + } else if(LSF_JOB_MANAGER.equals(jobManager)) { + jConfig = CommonUtils.getLSFJobManager(installedParentPath); } } pbsCluster = new PBSCluster(sshAuth.getServerInfo(), sshAuth.getAuthenticationInfo(),jConfig); http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java index 89393a8..5ba98ba 100644 --- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java +++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/Orchestrator.java @@ -61,7 +61,7 @@ public interface Orchestrator { /** - * This method will parse the ExperimentConfiguration and based on the configuration + * This method will parseSingleJob the ExperimentConfiguration and based on the configuration * we create a single or multiple tasks for the experiment. * @param experimentId * @return http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobDescriptor.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobDescriptor.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobDescriptor.java index 23b3efe..9a34a47 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobDescriptor.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobDescriptor.java @@ -146,6 +146,12 @@ public class JobDescriptor { } + + public void setMaxWallTimeForLSF(String minutes) { + this.getJobDescriptorDocument().getJobDescriptor().setMaxWallTime( + CommonUtils.maxWallTimeCalculatorForLSF(Integer.parseInt(minutes))); + + } public void setAcountString(String name) { this.getJobDescriptorDocument().getJobDescriptor().setAcountString(name); } @@ -453,6 +459,14 @@ public class JobDescriptor { public String getMailAddress() { return this.getJobDescriptorDocument().getJobDescriptor().getMailAddress(); } + + public String getChassisName() { + return this.getJobDescriptorDocument().getJobDescriptor().getChassisName(); + } + + public void setChassisName(String chassisName){ + this.getJobDescriptorDocument().getJobDescriptor().setChassisName(chassisName); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java new file mode 100644 index 0000000..018d49d --- /dev/null +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFJobConfiguration.java @@ -0,0 +1,100 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.gsi.ssh.api.job; + +import org.apache.airavata.gsi.ssh.impl.RawCommandInfo; +import org.apache.commons.io.FilenameUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; + +public class LSFJobConfiguration implements JobManagerConfiguration { + private final static Logger logger = LoggerFactory.getLogger(LSFJobConfiguration.class); + + private String jobDescriptionTemplateName; + + private String scriptExtension; + + private String installedPath; + + private OutputParser parser; + + public LSFJobConfiguration(){ + // this can be used to construct and use setter methods to set all the params in order + } + public LSFJobConfiguration(String jobDescriptionTemplateName, + String scriptExtension,String installedPath,OutputParser parser) { + this.jobDescriptionTemplateName = jobDescriptionTemplateName; + this.scriptExtension = scriptExtension; + this.parser = parser; + if (installedPath.endsWith("/") || installedPath.isEmpty()) { + this.installedPath = installedPath; + } else { + this.installedPath = installedPath + "/"; + } + } + + @Override + public RawCommandInfo getCancelCommand(String jobID) { + return new RawCommandInfo(this.installedPath + "bkill " + jobID); + } + + @Override + public String getJobDescriptionTemplateName() { + return jobDescriptionTemplateName; + } + + @Override + public RawCommandInfo getMonitorCommand(String jobID) { + return new RawCommandInfo(this.installedPath + "bjobs " + jobID); + } + + @Override + public RawCommandInfo getUserBasedMonitorCommand(String userName) { + return new RawCommandInfo(this.installedPath + "bjobs -u " + userName); + } + + @Override + public String getScriptExtension() { + return scriptExtension; + } + + @Override + public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath) { + return new RawCommandInfo(this.installedPath + "bsub <" + + workingDirectory + File.separator + FilenameUtils.getName(pbsFilePath)); + } + + @Override + public OutputParser getParser() { + return parser; + } + + public void setParser(OutputParser parser) { + this.parser = parser; + } + + @Override + public String getInstalledPath() { + return installedPath; + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java new file mode 100644 index 0000000..5490ff6 --- /dev/null +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/LSFOutputParser.java @@ -0,0 +1,108 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.gsi.ssh.api.job; + +import org.apache.airavata.gsi.ssh.api.SSHApiException; +import org.apache.airavata.gsi.ssh.impl.JobStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LSFOutputParser implements OutputParser { + private final static Logger logger = LoggerFactory.getLogger(LSFOutputParser.class); + + @Override + public void parseSingleJob(JobDescriptor jobDescriptor, String rawOutput) throws SSHApiException { + logger.debug(rawOutput); + //todo we need to implement this but we are not using it airavata runtime + // if someone is using the gsissh as a tool this will be useful to get a descriptive information about a single job + } + + @Override + public String parseJobSubmission(String rawOutput) throws SSHApiException { + logger.debug(rawOutput); + return rawOutput.substring(rawOutput.indexOf("<")+1,rawOutput.indexOf(">")); + } + + @Override + public JobStatus parseJobStatus(String jobID, String rawOutput) throws SSHApiException { + boolean jobFount = false; + logger.debug(rawOutput); + //todo this is not used anymore + return JobStatus.C; + } + + @Override + public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput) throws SSHApiException { + logger.debug(rawOutput); + String[] info = rawOutput.split("\n"); +// int lastStop = 0; + for (String jobID : statusMap.keySet()) { + String jobName = jobID.split(",")[1]; + boolean found = false; + for (int i = 0; i < info.length; i++) { + if (info[i].contains(jobName.substring(0,8))) { + // now starts processing this line + logger.info(info[i]); + String correctLine = info[i]; + String[] columns = correctLine.split(" "); + List<String> columnList = new ArrayList<String>(); + for (String s : columns) { + if (!"".equals(s)) { + columnList.add(s); + } + } +// lastStop = i + 1; + try { + statusMap.put(jobID, JobStatus.valueOf(columnList.get(2))); + }catch(IndexOutOfBoundsException e){ + statusMap.put(jobID, JobStatus.valueOf("U")); + } + found = true; + break; + } + } + if(!found) + logger.error("Couldn't find the status of the Job with JobName: " + jobName + "Job Id: " + jobID.split(",")[0]); + } + } + + public static void main(String[] args) { + String test = "Job <2477982> is submitted to queue <short>."; + System.out.println(test.substring(test.indexOf("<")+1, test.indexOf(">"))); + String test1 = "JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME\n" + + "2477983 cjh RUN short ghpcc05 c17b06 *sleep_300 Feb 25 10:25"; + Map<String, JobStatus> statusMap = new HashMap<String, JobStatus>(); + statusMap.put("2477983,*sleep_300", JobStatus.U); + LSFOutputParser lsfOutputParser = new LSFOutputParser(); + try { + lsfOutputParser.parseJobStatuses("cjh", statusMap, test1); + } catch (SSHApiException e) { + logger.error(e.getMessage(), e); + } + System.out.println(statusMap.get("2477983,*sleep_300")); + + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/OutputParser.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/OutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/OutputParser.java index 0c1b2ad..b6f5f0a 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/OutputParser.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/OutputParser.java @@ -33,27 +33,27 @@ public interface OutputParser { * @param descriptor * @return */ - public void parse(JobDescriptor descriptor,String rawOutput)throws SSHApiException; + public void parseSingleJob(JobDescriptor descriptor, String rawOutput)throws SSHApiException; /** - * This can be used to parse the result of a job submission to get the JobID + * This can be used to parseSingleJob the result of a job submission to get the JobID * @param rawOutput * @return */ - public String parse(String rawOutput)throws SSHApiException; + public String parseJobSubmission(String rawOutput)throws SSHApiException; /** - * This can be used to get the job status from the putput + * This can be used to get the job status from the output * @param jobID * @param rawOutput */ - public JobStatus parse(String jobID, String rawOutput)throws SSHApiException; + public JobStatus parseJobStatus(String jobID, String rawOutput)throws SSHApiException; /** - * This can be used to parse a big output and get multipleJob statuses + * This can be used to parseSingleJob a big output and get multipleJob statuses * @param statusMap list of status map will return and key will be the job ID * @param rawOutput */ - public void parse(String userName,Map<String,JobStatus> statusMap, String rawOutput)throws SSHApiException; + public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput)throws SSHApiException; } http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java index 6d695b7..8f2a606 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java @@ -34,7 +34,7 @@ import java.util.Map; public class PBSOutputParser implements OutputParser { private static final Logger log = LoggerFactory.getLogger(PBSOutputParser.class); - public void parse(JobDescriptor jobDescriptor, String rawOutput) { + public void parseSingleJob(JobDescriptor jobDescriptor, String rawOutput) { log.debug(rawOutput); String[] info = rawOutput.split("\n"); String[] line; @@ -120,12 +120,12 @@ public class PBSOutputParser implements OutputParser { } } - public String parse(String rawOutput) { + public String parseJobSubmission(String rawOutput) { log.debug(rawOutput); return rawOutput; //In PBS stdout is going to be directly the jobID } - public JobStatus parse(String jobID, String rawOutput) { + public JobStatus parseJobStatus(String jobID, String rawOutput) { boolean jobFount = false; log.debug(rawOutput); String[] info = rawOutput.split("\n"); @@ -156,7 +156,7 @@ public class PBSOutputParser implements OutputParser { return null; } - public void parse(String userName, Map<String, JobStatus> statusMap, String rawOutput) { + public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput) { log.debug(rawOutput); String[] info = rawOutput.split("\n"); // int lastStop = 0; http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SGEOutputParser.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SGEOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SGEOutputParser.java index bcef43b..3fb5874 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SGEOutputParser.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SGEOutputParser.java @@ -31,7 +31,7 @@ import java.util.Map; public class SGEOutputParser implements OutputParser{ private static final Logger log = LoggerFactory.getLogger(PBSOutputParser.class); - public void parse(JobDescriptor jobDescriptor, String rawOutput) { + public void parseSingleJob(JobDescriptor jobDescriptor, String rawOutput) { log.debug(rawOutput); String[] info = rawOutput.split("\n"); String[] line; @@ -117,7 +117,7 @@ public class SGEOutputParser implements OutputParser{ } } - public String parse(String rawOutput) { + public String parseJobSubmission(String rawOutput) { log.debug(rawOutput); if (rawOutput != null && !rawOutput.isEmpty()) { String[] info = rawOutput.split("\n"); @@ -128,12 +128,12 @@ public class SGEOutputParser implements OutputParser{ } } - public JobStatus parse(String jobID, String rawOutput) { + public JobStatus parseJobStatus(String jobID, String rawOutput) { // not implemented to sun grid engine return JobStatus.U; } - public void parse(String userName, Map<String, JobStatus> statusMap, String rawOutput) { + public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput) { log.debug(rawOutput); String[] info = rawOutput.split("\n"); int lastStop = 0; http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java index 54135c5..44a1068 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java @@ -33,7 +33,7 @@ import java.util.Map; public class SlurmOutputParser implements OutputParser { private static final Logger log = LoggerFactory.getLogger(SlurmOutputParser.class); - public void parse(JobDescriptor descriptor, String rawOutput) throws SSHApiException { + public void parseSingleJob(JobDescriptor descriptor, String rawOutput) throws SSHApiException { log.info(rawOutput); String[] info = rawOutput.split("\n"); String lastString = info[info.length - 1]; @@ -88,12 +88,12 @@ public class SlurmOutputParser implements OutputParser { } /** - * This can be used to parse the outpu of sbatch and extrac the jobID from the content + * This can be used to parseSingleJob the outpu of sbatch and extrac the jobID from the content * * @param rawOutput * @return */ - public String parse(String rawOutput) throws SSHApiException { + public String parseJobSubmission(String rawOutput) throws SSHApiException { log.info(rawOutput); String[] info = rawOutput.split("\n"); for (String anInfo : info) { @@ -106,7 +106,7 @@ public class SlurmOutputParser implements OutputParser { // throw new SSHApiException(rawOutput); //todo//To change body of implemented methods use File | Settings | File Templates. } - public JobStatus parse(String jobID, String rawOutput) throws SSHApiException { + public JobStatus parseJobStatus(String jobID, String rawOutput) throws SSHApiException { log.info(rawOutput); String[] info = rawOutput.split("\n"); String lastString = info[info.length - 1]; @@ -148,7 +148,7 @@ public class SlurmOutputParser implements OutputParser { return JobStatus.valueOf("U"); } - public void parse(String userName, Map<String, JobStatus> statusMap, String rawOutput) throws SSHApiException { + public void parseJobStatuses(String userName, Map<String, JobStatus> statusMap, String rawOutput) throws SSHApiException { log.debug(rawOutput); String[] info = rawOutput.split("\n"); String lastString = info[info.length - 1]; http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java index f6f3247..dd7f2d9 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.io.StringWriter; import java.net.URL; import java.security.SecureRandom; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -101,6 +100,9 @@ public class GSISSHAbstractCluster implements Cluster { reconnect(serverInfo, authenticationInfo); } + public GSISSHAbstractCluster(JobManagerConfiguration config) { + this.jobManagerConfiguration = config; + } private synchronized void reconnect(ServerInfo serverInfo, AuthenticationInfo authenticationInfo) throws SSHApiException { this.serverInfo = serverInfo; @@ -274,7 +276,7 @@ public class GSISSHAbstractCluster implements Cluster { // String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading output of job submission",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath())); OutputParser outputParser = jobManagerConfiguration.getParser(); - return outputParser.parse(outputifAvailable); + return outputParser.parseJobSubmission(outputifAvailable); } public synchronized String submitBatchJob(JobDescriptor jobDescriptor) throws SSHApiException { @@ -354,6 +356,56 @@ public class GSISSHAbstractCluster implements Cluster { } + public void generateJobScript(JobDescriptor jobDescriptor) throws SSHApiException { + TransformerFactory factory = TransformerFactory.newInstance(); + URL resource = this.getClass().getClassLoader().getResource(jobManagerConfiguration.getJobDescriptionTemplateName()); + + if (resource == null) { + String error = "System configuration file '" + jobManagerConfiguration.getJobDescriptionTemplateName() + + "' not found in the classpath"; + throw new SSHApiException(error); + } + + Source xslt = new StreamSource(new File(resource.getPath())); + Transformer transformer; + StringWriter results = new StringWriter(); + File tempPBSFile = null; + try { + // generate the pbs script using xslt + transformer = factory.newTransformer(xslt); + Source text = new StreamSource(new ByteArrayInputStream(jobDescriptor.toXML().getBytes())); + transformer.transform(text, new StreamResult(results)); + String scriptContent = results.toString().replaceAll("^[ |\t]*\n$", ""); + if (scriptContent.startsWith("\n")) { + scriptContent = scriptContent.substring(1); + } +// log.debug("generated PBS:" + results.toString()); + + // creating a temporary file using pbs script generated above + int number = new SecureRandom().nextInt(); + number = (number < 0 ? -number : number); + + tempPBSFile = new File(Integer.toString(number) + jobManagerConfiguration.getScriptExtension()); + log.info("File Path: " + tempPBSFile.getAbsolutePath()); + log.info("File Content: " + scriptContent); + FileUtils.writeStringToFile(tempPBSFile, scriptContent); + } catch (TransformerConfigurationException e) { + throw new SSHApiException("Error parsing PBS transformation", e); + } catch (TransformerException e) { + throw new SSHApiException("Error generating PBS script", e); + } catch (IOException e) { + throw new SSHApiException("An exception occurred while connecting to server." + + "Connecting server - " + serverInfo.getHost() + ":" + serverInfo.getPort() + + " connecting user name - " + + serverInfo.getUserName(), e); + } finally { + if (tempPBSFile != null) { + tempPBSFile.delete(); + } + } + } + + public synchronized JobDescriptor getJobDescriptorById(String jobID) throws SSHApiException { RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID); @@ -361,7 +413,7 @@ public class GSISSHAbstractCluster implements Cluster { CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader); String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath())); JobDescriptor jobDescriptor = new JobDescriptor(); - jobManagerConfiguration.getParser().parse(jobDescriptor,result); + jobManagerConfiguration.getParser().parseSingleJob(jobDescriptor, result); return jobDescriptor; } @@ -370,7 +422,7 @@ public class GSISSHAbstractCluster implements Cluster { StandardOutReader stdOutReader = new StandardOutReader(); CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader); String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath())); - return jobManagerConfiguration.getParser().parse(jobID, result); + return jobManagerConfiguration.getParser().parseJobStatus(jobID, result); } private static void logDebug(String message) { @@ -587,7 +639,7 @@ public class GSISSHAbstractCluster implements Cluster { } } String result = getOutputifAvailable(stdOutReader, "Error getting job information from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath())); - jobManagerConfiguration.getParser().parse(userName,jobIDs, result); + jobManagerConfiguration.getParser().parseJobStatuses(userName, jobIDs, result); } public ServerInfo getServerInfo() { http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/JobStatus.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/JobStatus.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/JobStatus.java index 044ac13..66c5e62 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/JobStatus.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/JobStatus.java @@ -24,7 +24,7 @@ /** * This will contains all the PBS specific job statuses. - * C - Job is completed after having run/ + * C - Job is completed after having run/ * E - Job is exiting after having run. * H - Job is held. * Q - job is queued, eligible to run or routed. @@ -35,7 +35,7 @@ * S - (Unicos only) job is suspend. */ public enum JobStatus { - C, E, H, Q, R, T, W, S,U,F,CA,CD,CF,CG,NF,PD,PR,TO,qw,t,r,h,Er,Eqw; + C, E, H, Q, R, T, W, S,U,F,CA,CD,CF,CG,NF,PD,PR,TO,qw,t,r,h,Er,Eqw,PEND,RUN,PSUSP,USUSP,SSUSP,DONE,EXIT,UNKWN,ZOMBI; public static JobStatus fromString(String status){ if(status != null){ @@ -89,6 +89,22 @@ return JobStatus.Er; }else if("Eqw".equals(status)){ return JobStatus.Er; + }else if("RUN".equals(status)){ // LSF starts here + return JobStatus.RUN; + }else if("PEND".equals(status)){ + return JobStatus.PEND; + }else if("DONE".equals(status)){ + return JobStatus.DONE; + }else if("PSUSP".equals(status)){ + return JobStatus.PSUSP; + }else if("USUSP".equals(status)){ + return JobStatus.USUSP; + }else if("SSUSP".equals(status)){ + return JobStatus.SSUSP; + }else if("EXIT".equals(status)){ + return JobStatus.EXIT; + }else if("ZOMBI".equals(status)){ + return JobStatus.ZOMBI; } } return JobStatus.U; http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/PBSCluster.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/PBSCluster.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/PBSCluster.java index 4efeef1..58d6a3f 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/PBSCluster.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/PBSCluster.java @@ -36,6 +36,10 @@ import org.slf4j.LoggerFactory; public class PBSCluster extends GSISSHAbstractCluster { private static final Logger log = LoggerFactory.getLogger(PBSCluster.class); + + public PBSCluster(JobManagerConfiguration jobManagerConfiguration) { + super(jobManagerConfiguration); + } public PBSCluster(ServerInfo serverInfo, AuthenticationInfo authenticationInfo, JobManagerConfiguration config) throws SSHApiException { super(serverInfo, authenticationInfo,config); } http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/listener/JobSubmissionListener.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/listener/JobSubmissionListener.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/listener/JobSubmissionListener.java index 1e8cde4..426cf20 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/listener/JobSubmissionListener.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/listener/JobSubmissionListener.java @@ -28,7 +28,7 @@ import org.apache.airavata.gsi.ssh.impl.JobStatus; * This interface can be implemented by the end user of the API * to do desired operations based on the job status change. API has a * default joblistener which can be used by the end users, but its - * configurable and can be parse to jobsubmission methods. + * configurable and can be parseSingleJob to jobsubmission methods. */ public abstract class JobSubmissionListener { http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/CommonUtils.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/CommonUtils.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/CommonUtils.java index 1aca77b..f400661 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/CommonUtils.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/util/CommonUtils.java @@ -55,6 +55,15 @@ public class CommonUtils { return hours + ":" + minutes + ":00"; } } + public static String maxWallTimeCalculatorForLSF(int maxWalltime) { + if (maxWalltime < 60) { + return "00:" + maxWalltime; + } else { + int minutes = maxWalltime % 60; + int hours = maxWalltime / 60; + return hours + ":" + minutes; + } + } public static JobManagerConfiguration getPBSJobManager(String installedPath) { return new PBSJobConfiguration("PBSTemplate.xslt",".pbs", installedPath, new PBSOutputParser()); } @@ -66,4 +75,8 @@ public class CommonUtils { public static JobManagerConfiguration getSGEJobManager(String installedPath) { return new PBSJobConfiguration("SGETemplate.xslt", ".pbs", installedPath, new SGEOutputParser()); } + + public static JobManagerConfiguration getLSFJobManager(String installedPath) { + return new LSFJobConfiguration("LSFTemplate.xslt", ".lsf", installedPath, new SGEOutputParser()); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/resources/LSFTemplate.xslt ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/resources/LSFTemplate.xslt b/tools/gsissh/src/main/resources/LSFTemplate.xslt new file mode 100644 index 0000000..7081260 --- /dev/null +++ b/tools/gsissh/src/main/resources/LSFTemplate.xslt @@ -0,0 +1,93 @@ +<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file + distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under + the Apache License, Version 2.0 (theà "License"); you may not use this file except in compliance with the License. You may + obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to + in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF + ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under + the License. --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://airavata.apache.org/gsi/ssh/2012/12"> + <xsl:output method="text" /> + <xsl:template match="/ns:JobDescriptor"> + <xsl:param name="quote">"</xsl:param> +#! /bin/bash +# LSF batch job submission script generated by Apache Airavata +# + <xsl:choose> + <xsl:when test="ns:shellName"> +#BSUB -L <xsl:value-of select="ns:shellName"/> + </xsl:when></xsl:choose> + <xsl:choose> + <xsl:when test="ns:queueName"> +#BSUB -q <xsl:value-of select="ns:queueName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:nodes"> +#BSUB -n <xsl:value-of select="ns:nodes"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:mailAddress"> +#BSUB -u <xsl:value-of select="ns:mailAddress"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:jobName"> +#BSUB -J <xsl:value-of select="ns:jobName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:acountString"> +#BSUB -P <xsl:value-of select="ns:acountString"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:maxWallTime"> +#BSUB -W <xsl:value-of select="ns:maxWallTime"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> +#BSUB -o "<xsl:value-of select="ns:standardOutFile"/>" + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> +#BSUB -e "<xsl:value-of select="ns:standardErrorFile"/>" + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:chassisName"> +#BSUB -m c<xsl:value-of select="ns:chassisName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:usedMem"> +#BSUB -R rusage[mem=<xsl:value-of select="ns:usedMem"/>] + </xsl:when> + </xsl:choose> + + <xsl:text>
</xsl:text> + + <xsl:text>
</xsl:text> + <xsl:for-each select="ns:moduleLoadCommands/ns:command"> + <xsl:text>
</xsl:text> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + + <xsl:for-each select="ns:preJobCommands/ns:command"> + <xsl:value-of select="."/><xsl:text> </xsl:text> + <xsl:text>
</xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + <xsl:choose><xsl:when test="ns:jobSubmitterCommand != ''"> + <xsl:value-of select="ns:jobSubmitterCommand"/><xsl:text> </xsl:text> + </xsl:when></xsl:choose><xsl:value-of select="ns:executablePath"/><xsl:text> </xsl:text> + <xsl:for-each select="ns:inputs/ns:input"> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>
</xsl:text> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/main/resources/schemas/PBSJobDescriptor.xsd ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/resources/schemas/PBSJobDescriptor.xsd b/tools/gsissh/src/main/resources/schemas/PBSJobDescriptor.xsd index 2e56edb..d5c5992 100644 --- a/tools/gsissh/src/main/resources/schemas/PBSJobDescriptor.xsd +++ b/tools/gsissh/src/main/resources/schemas/PBSJobDescriptor.xsd @@ -59,7 +59,8 @@ <element name="jobSubmitterCommand" type="xsd:string" minOccurs="0" maxOccurs="1"/> <element name="callBackIp" type="xsd:string" minOccurs="0" maxOccurs="1"/> <element name="callBackPort" type="xsd:string" minOccurs="0" maxOccurs="1"/> - </sequence> + <element name="chassisName" type="xsd:string" minOccurs="0" maxOccurs="1"/> + </sequence> </complexType> <complexType name="moduleLoadCommands"> http://git-wip-us.apache.org/repos/asf/airavata/blob/c6c93543/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java index 7437419..8d70a21 100644 --- a/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java +++ b/tools/gsissh/src/test/java/org/apache/airavata/gsi/ssh/impl/VanilaTestWithSSHAuth.java @@ -185,6 +185,49 @@ public class VanilaTestWithSSHAuth { } @Test + public void testSimpleLSFJob() throws Exception { + + AuthenticationInfo authenticationInfo = null; + if (password != null) { + authenticationInfo = new DefaultPasswordAuthenticationInfo(this.password); + } else { + authenticationInfo = new DefaultPublicKeyFileAuthentication(this.publicKeyPath, this.privateKeyPath, + this.passPhrase); + } + // Server info + ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName); + + + // constructing the job object + JobDescriptor jobDescriptor = new JobDescriptor(); + jobDescriptor.setWorkingDirectory(workingDirectory); + jobDescriptor.setShellName("/bin/bash"); + jobDescriptor.setJobName("GSI_SSH_SLEEP_JOB"); + jobDescriptor.setExecutablePath("/bin/echo"); + jobDescriptor.setAllEnvExport(true); + jobDescriptor.setMailOptions("n"); + jobDescriptor.setMailAddress("[email protected]"); + jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out"); + jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err"); + jobDescriptor.setNodes(1); + jobDescriptor.setProcessesPerNode(1); + jobDescriptor.setQueueName("long"); + jobDescriptor.setMaxWallTimeForLSF("5"); + jobDescriptor.setJobSubmitter("mpiexec"); + jobDescriptor.setModuleLoadCommands(new String[]{"module load openmpi/1.6.5"}); + jobDescriptor.setUsedMemory("1000"); + jobDescriptor.setChassisName("01"); + + //jobDescriptor.setJobSubmitter("aprun -n 1"); + List<String> inputs = new ArrayList<String>(); + jobDescriptor.setInputValues(inputs); + //finished construction of job object + System.out.println(jobDescriptor.toXML()); + Cluster pbsCluster = new PBSCluster(CommonUtils.getLSFJobManager("")); + ((PBSCluster) pbsCluster).generateJobScript(jobDescriptor); + } + + @Test public void testSCPFromAndSCPTo() throws Exception { AuthenticationInfo authenticationInfo = null; @@ -197,6 +240,7 @@ public class VanilaTestWithSSHAuth { // Server info ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName); Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager(path)); + new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager(path));; String date = new Date().toString(); date = date.replaceAll(" ", "_");
