本文整理汇总了Java中org.ggf.drmaa.JobTemplate.setNativeSpecification方法的典型用法代码示例。如果您正苦于以下问题:Java JobTemplate.setNativeSpecification方法的具体用法?Java JobTemplate.setNativeSpecification怎么用?Java JobTemplate.setNativeSpecification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ggf.drmaa.JobTemplate
的用法示例。
在下文中一共展示了JobTemplate.setNativeSpecification方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJobTemplate
import org.ggf.drmaa.JobTemplate; //导入方法依赖的package包/类
private static JobTemplate createJobTemplate(ServletContext servletContext, Session session, Run run) throws DrmaaException {
JobTemplate result = session.createJobTemplate();
result.setRemoteCommand("java");
result.setArgs(Arrays.asList(
"-cp",
DRMAAContextParameter.JARS_PATH.getStringValue(servletContext),
DRMAAExecutor.class.getCanonicalName(),
AlvisNLPContextParameter.ROOT_PROCESSING_DIR.getStringValue(servletContext),
AlvisNLPContextParameter.RESOURCE_DIR.getStringValue(servletContext),
AlvisNLPContextParameter.PLAN_DIR.getStringValue(servletContext),
run.getId()
));
String nativeSpecification = DRMAAContextParameter.NATIVE_SPECIFICATION.getStringValue(servletContext);
if (nativeSpecification != null && !nativeSpecification.isEmpty()) {
result.setNativeSpecification(nativeSpecification);
}
return result;
}
示例2: setJobTemplateSpecs
import org.ggf.drmaa.JobTemplate; //导入方法依赖的package包/类
private void setJobTemplateSpecs(JobTemplate jt, Map<String,String> vars) throws DrmaaException {
String cmd = commandFormat.build(vars, null);
jt.setRemoteCommand(cmd);
List<String> args = getArgs(vars);
jt.setArgs(args);
if (geOptionsFormat != null) {
String geOpts = geOptionsFormat.build(vars, null);
jt.setNativeSpecification(geOpts);
}
}
示例3: setJobTemplateSpecs
import org.ggf.drmaa.JobTemplate; //导入方法依赖的package包/类
private static void setJobTemplateSpecs(JobTemplate jt, String line) throws DrmaaException, IOException {
int ddash = line.indexOf("--");
if (ddash != -1) {
String geOpts = line.substring(0, ddash);
jt.setNativeSpecification(geOpts);
line = line.substring(ddash + 2);
}
setJobTemplateCommand(jt, line);
}
示例4: submitJob
import org.ggf.drmaa.JobTemplate; //导入方法依赖的package包/类
private SubmittedJob submitJob(RuntimeStateProvider runtimeStateProvider, RuntimeContext runtimeContext,
Timing timing) throws IOException, DrmaaException, InstanceProvisionException, LinkerException {
RuntimeAnnotatedExecutionTrace executionTrace = runtimeStateProvider.provideExecutionTrace(runtimeContext);
RuntimeProxyModule module = (RuntimeProxyModule) executionTrace.getModule();
String declarationName = module.getDeclaration().getQualifiedName().toString();
Path ioPath = Files.createTempDirectory(jobIOBasePath, declarationName);
timing.ioPath = ioPath;
try (ObjectOutputStream objectOutputStream
= new ObjectOutputStream(Files.newOutputStream(stdinPath(ioPath)))) {
objectOutputStream.writeObject(runtimeStateProvider);
}
JobTemplate jobTemplate = drmaaSession.createJobTemplate();
try {
jobTemplate.setJobName(getJobName(declarationName));
ImmutableList<String> command = ImmutableList.copyOf(commandProvider.getCommand(executionTrace));
timing.commandLine = command;
jobTemplate.setRemoteCommand(command.get(0));
jobTemplate.setArgs(command.subList(1, command.size()));
jobTemplate.setTransferFiles(TRANSFER_FILES);
jobTemplate.setInputPath(":" + stdinPath(ioPath));
jobTemplate.setOutputPath(":" + stdoutPath(ioPath));
jobTemplate.setErrorPath(":" + stderrPath(ioPath));
String nativeSpecification = nativeSpecificationProvider.getNativeSpecification(executionTrace);
timing.nativeArguments = nativeSpecification;
jobTemplate.setNativeSpecification(nativeSpecification);
timing.drmaaSubmissionTimeMillis = System.currentTimeMillis();
SubmittedJob submittedJob = new SubmittedJob(executionTrace, drmaaSession.runJob(jobTemplate));
timing.submittedJob = submittedJob;
log.debug("{}, command: {}, native: {}", submittedJob, command, nativeSpecification);
return submittedJob;
} finally {
drmaaSession.deleteJobTemplate(jobTemplate);
}
}