Date: | Tue, 28 May 2013 10:55:48 +0530 |
---|---|
From: | Shibaji Chakraborty <shibaji.chakraborty@xxxxxxx> |
Subject: | [HTCondor-devel] Condor Web Service call issue. |
Hi , While calling HTCondor web service to submit a job I got one issue, though job is submitted successfully yet I found that the job is 'Idle' in the condor pool with some ambiguous status of the job. Job doesn't show any owner or the job Id associated with it though I deliberately set one user which is exists in "condor_credd". Can anybody help me out from this situation, the code snippet is given below: import java.net.URL; import condor.ClassAdAttrType; import condor.ClassAdStructAndStatus; import condor.ClassAdStructAttr; import condor.CondorScheddLocator; import condor.CondorScheddPortType; import condor.IntAndStatus; import condor.RequirementsAndStatus; import condor.Status; import condor.Transaction; import condor.TransactionAndStatus; import condor.UniverseType; public class Tmp { /** * @param args */ public static void main(String[] args) { try { //URL to the service URL scheddLocation = new URL("http://192.168.161.52:9666"); //Creating condor_schedd locator CondorScheddLocator scheddLocator = new CondorScheddLocator(); //Get condor_schedd CondorScheddPortType schedd = scheddLocator.getcondorSchedd(scheddLocation); //Bigin transaction TransactionAndStatus transactionAndStatus = schedd.beginTransaction(60); //Get Tx Transaction transaction = transactionAndStatus.getTransaction(); //Create new Cluster IntAndStatus clusterIdAndStatus = schedd.newCluster(transaction); int clusterId = clusterIdAndStatus.getInteger(); //Create new Job IntAndStatus jobIdAndStatus = schedd.newJob(transaction, clusterId); int jobId = jobIdAndStatus.getInteger(); //Create templet Job Ads ClassAdStructAndStatus xClassAd = schedd.createJobTemplate(clusterId, jobId, "condortest",UniverseType.JAVA, null, "OpSys = LINUX", null); //Modify the Jobs with some custom values ClassAdStructAttr[] ads = mergeAttributes(xClassAd.getClassAd()); //Submit the Job RequirementsAndStatus status = schedd.submit(transaction, clusterId,jobId, ads); //Call Rescheuler to run the job Status star = schedd.requestReschedule(); // Commit Tx Status cmt = schedd.commitTransaction(transaction); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } //Method to modify the job ads. public static ClassAdStructAttr[] mergeAttributes(ClassAdStructAttr[] pClassAd) { ClassAdStructAttr[] xJobAd = new ClassAdStructAttr[pClassAd.length + 2]; xJobAd[0] = new ClassAdStructAttr(); xJobAd[0].setValue("/home/condortest/condor-test/sample.log"); xJobAd[0].setName("Log"); xJobAd[0].setType(ClassAdAttrType.value3); xJobAd[1] = new ClassAdStructAttr(); xJobAd[1].setValue("/home/condortest/condor-test/sample.class"); xJobAd[1].setName("Executable"); xJobAd[1].setType(ClassAdAttrType.value3); xJobAd[2] = new ClassAdStructAttr(); xJobAd[2].setValue("condortest"); xJobAd[2].setName("Owner"); xJobAd[2].setType(ClassAdAttrType.value3); System.out.println(pClassAd.length); // Overwrite any existing attributes for (int x = 3; x < xJobAd.length; x++) { if (pClassAd[x - 3].getName().equalsIgnoreCase("Arguments")) { pClassAd[x - 3].setValue("sample 4 10"); } else if (pClassAd[x - 3].getName().equalsIgnoreCase("In")) { // pClassAd[x - // 2].setValue("/home/condortst/condor-test/sample.in"); pClassAd[x - 3].setValue(""); } else if (pClassAd[x - 3].getName().equalsIgnoreCase("Out")) { pClassAd[x - 3] .setValue("/home/condortest/condor-test/sample.out"); } else if (pClassAd[x - 3].getName().equalsIgnoreCase("Err")) { pClassAd[x - 3] .setValue("/home/condortest/condor-test/sample.error"); } xJobAd[x] = new ClassAdStructAttr(); xJobAd[x].setValue(pClassAd[x - 3].getValue()); xJobAd[x].setName(pClassAd[x - 3].getName()); xJobAd[x].setType(pClassAd[x - 3].getType()); } return xJobAd; } } Again in the server side condor_q gives me the following result: [root@streams ~]# condor_q -- Submitter: streams : <192.168.161.52:9666> : streams ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD --- ???? --- 1 jobs; 0 completed, 0 removed, 1 idle, 0 running, 0 held, 0 suspended Again condor_q -analyze gives me the following result: [root@streams ~]# condor_q -analyze 2.0 -- Submitter: streams : <192.168.161.52:9666> : streams --- 002.000: Request has not yet been considered by the matchmaker. If any one have any idea regarding the issue please reply. Best Regards, Shibaji Chakraborty =====-----=====-----===== |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | Re: [HTCondor-devel] Thinking of ripping out MPI universe - folks should be using Parallel Universe by now..., Matthew Farrellee |
---|---|
Next by Date: | [HTCondor-devel] Examining in-memory representation of ClassAds, Brian Bockelman |
Previous by Thread: | Re: [HTCondor-devel] Chirp.jar support, John (TJ) Knoeller |
Next by Thread: | [HTCondor-devel] Conflicting hold codes?, Brian Bockelman |
Indexes: | [Date] [Thread] |