File: remove_drmaa_support

package info (click to toggle)
logol 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,660 kB
  • ctags: 1,144
  • sloc: java: 10,613; perl: 2,651; ansic: 362; xml: 322; ruby: 280; sh: 115; makefile: 35
file content (166 lines) | stat: -rw-r--r-- 5,461 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Subject: libdrmaa-java removed from Debian (gridengine)
Description:  DRMAA job submission needs a Java drmaa library.
 libdrmaa-java has been removed from Debian, bug: 776131.
 This patch removes DRMAA related code waiting for library
 reintroduction.
 Logol will work on local mode only.
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2015-02-01
--- a/src/org/irisa/genouest/logol/dispatcher/Dispatch.java
+++ b/src/org/irisa/genouest/logol/dispatcher/Dispatch.java
@@ -230,7 +230,6 @@
 		 options.addOption("h",false,"get usage");		
 		
 		 options.addOption("s", true, "sequence database");
-		 options.addOption("sge", false, "use SGE");
 		 options.addOption("local", false, "use local system");
 		 options.addOption("dna", false, "analyse dna, is default");
 		 options.addOption("rna", false, "analyse rna");
@@ -290,7 +289,6 @@
 				usageOptions.addOption("s", true, "sequence database");
 				usageOptions.addOption("g", true, "grammar file to analyse");
 				usageOptions.addOption("m", true, "model file to analyse");
-				usageOptions.addOption("sge", false, "use SGE");
 				usageOptions.addOption("local", false, "use local system");
 				usageOptions.addOption("dna", false, "analyse dna, is default");
 				usageOptions.addOption("rna", false, "analyse rna");
@@ -355,11 +353,6 @@
 			   type=LOCAL;
 			   jobmngr = (JobManager) new LocalJobManager();
 		 }
-		 if( cmd.hasOption( "sge" ) ) {
-			 logger.info("Using sge system");
-			    type=SGE;
-			    jobmngr = (JobManager) new SGEJobManager();
-		 }
 		 if( cmd.hasOption( "dna" ) ) {			 
 			    format=1;			
 		 }
--- a/src/org/irisa/genouest/logol/dispatcher/SGEJobManager.java
+++ b/src/org/irisa/genouest/logol/dispatcher/SGEJobManager.java
@@ -5,10 +5,6 @@
 import java.util.Vector;
 
 import org.apache.log4j.Logger;
-import org.ggf.drmaa.DrmaaException;
-import org.ggf.drmaa.JobTemplate;
-import org.ggf.drmaa.Session;
-import org.ggf.drmaa.SessionFactory;
 import org.irisa.genouest.logol.Constants;
 
 /*
@@ -18,111 +14,30 @@
 
 	private static final Logger logger = Logger.getLogger(org.irisa.genouest.logol.dispatcher.SGEJobManager.class);
 	
-	private static String OS = System.getProperty("os.name").toLowerCase();
-
-	
-	Vector<String> jobs = new Vector<String>();
-	Vector<String> jobsOutput = new Vector<String>();
-	Vector<String> jobsArgs = new Vector<String>();
-	Vector<String> jobIds = new Vector<String>();
-	
-	String arguments = "";
-	
-	static SessionFactory factory = null;
-	static Session session=null; 
-	
-	
-	String jobId = null;
-	
-	String installPath=null;
-	
 	UUID uID = null;
 	
 	public SGEJobManager() {
-		logger.info("Init DRM communication");
-		if(factory==null) {
-			factory = SessionFactory.getFactory();
-		}
-		if(session==null) {
-			session = factory.getSession();		
-		}
-		if(session==null) {
-			logger.error(" Drm session could not open");
-		}
-		logger.info("DRM system: "+session.getDrmSystem());
-		try {
-			session.init("");
-		} catch (DrmaaException e) {
-			logger.error("Could not init the DRM session: "+e.getMessage());
-		}
+		logger.error("DRMAA not supported, libdrmaa-java not available in Debian");
 	}
 	
 	public int addJob(String sequence, String output,String jobArgs) {
-		jobs.add(sequence);
-		jobsArgs.add(jobArgs);
-		jobsOutput.add(output);
 		return 0;
 	}
 
 	public int runJobs(String nativeSpecifications) {
-		JobTemplate jt;
-		for(int i=0;i<jobs.size();i++) {
-		try {
-			jt = session.createJobTemplate();
-			if(nativeSpecifications!=null) {
-				jt.setNativeSpecification(nativeSpecifications);
-			}
-			
-			jt.setJobName("LogolMatch");
-			
-			String out = jobsOutput.get(i);
-			// Redirect DRM streams 
-		    jt.setOutputPath(":" + out+".out");		
-			jt.setErrorPath(":" + out + ".err");
-			if(OS.startsWith("win")) {
-				jt.setArgs(new String[] {installPath + System.getProperty(Constants.FILESEPARATORPROPERTY)+ "LogolExec.rb", arguments,jobsArgs.get(i)," -output "+jobsOutput.get(i)});
-			    jt.setRemoteCommand("ruby");				
-			}
-			else {
-				jt.setArgs(new String[] {arguments,jobsArgs.get(i)," -output "+jobsOutput.get(i)});
-				jt.setRemoteCommand(installPath + System.getProperty(Constants.FILESEPARATORPROPERTY)+ "LogolExec.sh");
-			}
-		    jobId = session.runJob(jt);
-		    logger.info("Executing job: "+jobId);
-		    jobIds.add(jobId);
-		    session.deleteJobTemplate(jt);
-		} catch (DrmaaException e) {			
-			logger.error("Error during job submission: "+e.getMessage());
-			return -1;
-		}
-		}
-
-
+		logger.error("DRMAA not supported, libdrmaa-java not available in Debian");
 		return 0;
 	}
 
 	public int waitForJobsOver() {
-		
-		try {
-			session.synchronize(jobIds, Session.TIMEOUT_WAIT_FOREVER, true);
-			session.exit();
-		} catch (DrmaaException e) {
-			logger.error("Error during job submission: "+e.getMessage());
-		}
-		logger.info("Each sequence in bank resulted in a specific result file.");
-		for(int i=0;i<jobs.size();i++) {			
-			logger.debug("Result file is available in work directory : "+jobsOutput.get(i));
-			}
+		logger.error("DRMAA not supported, libdrmaa-java not available in Debian");
 		return 0;
 	}
 	
 	public void setJobArgs(String args) {
-		arguments=args;
 	}
 
 	public void setInstallPath(String installDir) {
-		installPath = installDir;
-		
 	}
 
 }