修改:hpc任务执行代码优化
This commit is contained in:
@@ -276,7 +276,9 @@ public class ProcessController implements IFlowableFeignClient {
|
||||
@PostMapping("/testHpc")
|
||||
public String testHpc(@RequestBody Map<String, Object> params) {
|
||||
String beforeNodeId = params.get("beforeNodeId").toString();
|
||||
String appuuid = params.get("appuuid").toString();
|
||||
HPCExecuteConfig config=new HPCExecuteConfig();
|
||||
config.setUuid(appuuid);
|
||||
config.setBeforeNodeId(beforeNodeId);
|
||||
if(!Objects.isNull(params.get("masterFileRegularStr"))){
|
||||
config.setMasterFileRegularStr(params.get("masterFileRegularStr").toString());
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
|
||||
req.setComsolResultName(substring+"_result.mph");
|
||||
// 2.处理命令拼接和参数替换
|
||||
CommandResult commandResult = buildAndReplaceHpcCommand(req, masterFilePath);
|
||||
if (StringUtils.isBlank(commandResult.getCommand())) {
|
||||
if (StringUtils.isBlank(commandResult.getFormatCommand())) {
|
||||
log.error("Hpc执行失败,command命令不能为空{}",JSONObject.toJSONString(req));
|
||||
throw new RuntimeException("Hpc执行失败,command命令不能为空");
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
|
||||
// 拼接逻辑
|
||||
String subDirPrefix = Objects.isNull(userId) ? "" : (String.valueOf(userId) + "\\");
|
||||
// spdm 开头
|
||||
String subDir = workDirPrePath+subDirPrefix + req.getJobName() + "\\" + System.currentTimeMillis();
|
||||
String subDir = workDirPrePath + "\\"+subDirPrefix + req.getJobName() + "\\" + System.currentTimeMillis();
|
||||
log.info("Hpc任务执行开始,结果输出目录:{}", subDir);
|
||||
return subDir;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
|
||||
throw new RuntimeException("该应用没有初始化配置command");
|
||||
}
|
||||
command = simulationHpcCommand.getCommand();
|
||||
|
||||
formatCommand=command;
|
||||
// 命令中动态参数的处理替换
|
||||
for (SimulationHpcCommandPlaceholder placeholder : placeholders) {
|
||||
String keyEnName = placeholder.getKeyEnName();
|
||||
@@ -246,7 +246,7 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
|
||||
}
|
||||
}
|
||||
|
||||
command = CommandReplaceUtil.replaceCommandPlaceholder(command, keyEnName, replaceValue);
|
||||
formatCommand = CommandReplaceUtil.replaceCommandPlaceholder(formatCommand, keyEnName, replaceValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user