当前位置: 首页>>代码示例>>Java>>正文


Java JobTemplate.setNativeSpecification方法代码示例

本文整理汇总了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;
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:19,代码来源:DRMAAExecutor.java

示例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);
	}
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:11,代码来源:ProductPatternSpecificationBuilder.java

示例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);
}
 
开发者ID:Bibliome,项目名称:bibliome-java-utils,代码行数:10,代码来源:FileJobSpecificationBuilder.java

示例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);
    }
}
 
开发者ID:cloudkeeper-project,项目名称:cloudkeeper,代码行数:35,代码来源:DrmaaSimpleModuleExecutor.java


注:本文中的org.ggf.drmaa.JobTemplate.setNativeSpecification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。