X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=engine%2Fcompbio%2Fengine%2Fcluster%2Fdrmaa%2FClusterRunner.java;fp=engine%2Fcompbio%2Fengine%2Fcluster%2Fdrmaa%2FJobRunner.java;h=d36ca899dd36541e24adf518ec15db42f9718ed1;hb=b56011664ec5d11bb5d0cd09395e646586888700;hp=516c3eb3d1a3ae9d09f6fb87ea528b8d2e1a05ab;hpb=1791d2710aba8bf012a83e5d18c5c1988ecc176b;p=jabaws.git diff --git a/engine/compbio/engine/cluster/drmaa/JobRunner.java b/engine/compbio/engine/cluster/drmaa/ClusterRunner.java similarity index 92% rename from engine/compbio/engine/cluster/drmaa/JobRunner.java rename to engine/compbio/engine/cluster/drmaa/ClusterRunner.java index 516c3eb..d36ca89 100644 --- a/engine/compbio/engine/cluster/drmaa/JobRunner.java +++ b/engine/compbio/engine/cluster/drmaa/ClusterRunner.java @@ -56,17 +56,17 @@ import compbio.metadata.ResultNotAvailableException; * template gets deleted, this needs to be taken into account in this * class design! */ -public class JobRunner implements SyncExecutor { +public class ClusterRunner implements SyncExecutor { final JobTemplate jobtempl; static ClusterSession clustSession = ClusterSession.getInstance(); static Session session = clustSession.getSession(); - static final Logger log = Logger.getLogger(JobRunner.class); + static final Logger log = Logger.getLogger(ClusterRunner.class); final ConfiguredExecutable confExecutable; private final String workDirectory; String jobId; - public JobRunner(ConfiguredExecutable confExec) + public ClusterRunner(ConfiguredExecutable confExec) throws JobSubmissionException { try { String command = confExec.getCommand(ExecProvider.Cluster); @@ -84,9 +84,7 @@ public class JobRunner implements SyncExecutor { // Tell the job where to get/put things jobtempl.setWorkingDirectory(this.workDirectory); - /* - * Set environment variables for the process if any - */ + // Set environment variables for the process if any Map jobEnv = confExec.getEnvironment(); if (jobEnv != null && !jobEnv.isEmpty()) { setJobEnvironmentVariables(jobEnv); @@ -97,20 +95,15 @@ public class JobRunner implements SyncExecutor { jobtempl.setArgs(args); } - /* - * If executable need in/out data to be piped into it - */ + //If executable need in/out data to be piped into it if (confExec.getExecutable() instanceof PipedExecutable) { setPipes(confExec); } - /* - * If executable require special cluster configuration parameters to - * be set e.g. queue, ram, time etc - */ + // If executable require special cluster configuration parameters to + // be set e.g. queue, ram, time etc setNativeSpecs(confExec.getExecutable()); - log.trace("using arguments: " + jobtempl.getArgs()); this.confExecutable = confExec; // Save run configuration @@ -368,7 +361,7 @@ public class JobRunner implements SyncExecutor { public ConfiguredExecutable waitForResult() throws JobExecutionException { ConfiguredExecutable confExec; try { - confExec = new AsyncJobRunner().getResults(this.jobId); + confExec = new AsyncClusterRunner().getResults(this.jobId); if (confExec == null) { log.warn("Could not find results of job " + this.jobId); } @@ -384,9 +377,9 @@ public class JobRunner implements SyncExecutor { return getJobStatus(this.jobId); } - public static JobRunner getInstance(ConfiguredExecutable executable) + public static ClusterRunner getInstance(ConfiguredExecutable executable) throws JobSubmissionException { - return new JobRunner(executable); + return new ClusterRunner(executable); } } // class end