Skip to content
Snippets Groups Projects
Commit ad20e456 authored by Olivier Langella's avatar Olivier Langella
Browse files

tries to launch condor jobs with the number of cpus requested in X!Tandem model

parent 26e595a7
No related branches found
No related tags found
No related merge requests found
......@@ -41,12 +41,8 @@ public class XtandemCondorAnalysis extends xtandem_analysis {
logger.info("Corrected xtandem preset error");
xtandem_params params = new xtandem_params();
params.load_xml(model);
xtandem_param paramThreads = params.get_param_to("spectrum, threads");
//don't use threads in condor analysis
paramThreads.setValue("1");
params.save_to_xml(model);
File condorSubmitFile = newCondorSubmitFile();
File condorSubmitFile = newCondorSubmitFile(params);
base_shell pipe = new base_shell();
pipe.set_commande(new String[] {
......@@ -72,7 +68,16 @@ public class XtandemCondorAnalysis extends xtandem_analysis {
}
private File newCondorSubmitFile() throws MSMSException {
private File newCondorSubmitFile(xtandem_params params)
throws MSMSException {
xtandem_param paramThreads = params.get_param_to("spectrum, threads");
int requestedCpus = 0;
if (paramThreads != null) {
// get requested number of cpus from model :
requestedCpus = Integer.valueOf(paramThreads.getValue());
}
createTempDirectoryForCondor();
XtandemDatabaseXmlFile databasexml = new XtandemDatabaseXmlFile(tmpDir,
databases);
......@@ -88,14 +93,6 @@ public class XtandemCondorAnalysis extends xtandem_analysis {
XtandemModelFile modelTmp = new XtandemModelFile(new File(
tmpDir.getAbsolutePath() + System.getProperty("file.separator")
+ model.getName()));
try {
xtandem_params params = new xtandem_params();
params.load_xml(model);
params.get_param_to("spectrum, threads").setValue("1");
params.save_to_xml(modelTmp);
} catch (Exception e) {
throw new MSMSException("Unable to copy model\n" + e.getMessage());
}
/*
* copy database.xml xtandem_param3542072178348339854.xml
......@@ -107,6 +104,10 @@ public class XtandemCondorAnalysis extends xtandem_analysis {
out.open(condorSubmitTxtFile.getAbsolutePath());
out.write("Universe = vanilla" + "\n");
out.write("Rank = Mips" + "\n");
if ((requestedCpus > 0) && (requestedCpus < 200)) {
out.write("request_cpus = " + requestedCpus + "\n");
}
out.write("Executable = " + conf.getXtandem_link().getAbsolutePath()
+ "\n");
out.write("Log = " + condorTandemLogFile.getAbsolutePath()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment