Wednesday, April 30, 2008

Running PaCE via Teragrid Job submission service

To submit PaCE job through the Teragrid Job submission service, you need,

-- input files (fasta format file(s) and .cfs file) with valid URL(s)
-- number of clusters

Here is the sample java code to access TJSS.
====================================================================
import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import org.ogce.jobsubmissionservice.databean.*;

public class SubmitPaCEJob{
public static void main(String[] args) throws AxisFault {
int option = 0;
String serviceLoc = "http://localhost:8080/axis2/services/JobSubmissionService";
String serviceMethod = "submitJob";
String myproxy_username = null;
String myproxy_passwd = null;
for (int j = 0; j < argval =" args[j];" option ="1;" option =" 2;" option =" 3;"> 0){
if (option ==1)
serviceLoc = argVal;
else if (option ==2)
myproxy_username = argVal;

else if (option ==3)
myproxy_passwd = argVal;
}
}

String [] inputFileString ={
"http://validURLS:8080/tmp/PaCEexample/Brassica_rapa.mRNA.EST.fasta.PaCE",
"http://validURLS:8080/tmp/PaCEexample/Phase.cfg"
};
String rslString =
"(jobtype=mpi)"+
"(count=4)"+
"(hostCount=2)"+
"(maxWallTime=00:15)"+
"(queue=DEBUG)"+
"(arguments= Brassica_rapa.mRNA.EST.fasta.PaCE 33316 Phase.cfg)";

String [] outputFileString = {
"estClust.33316.3.PaCE",
"ContainedESTs.33316.PaCE",
"estClustSize.33316.3.PaCE",
"large_merges.33316.9.PaCE"};

try{
CondorJob cj = new CondorJob();
cj.setExecutable("/N/u/leesangm/BigRed/bin/PaCE_v9");
cj.setTransfer_input_files(inputFileString);
cj.setGrid_resource("gt2 gatekeeper.bigred.iu.teragrid.org/jobmanager-loadleveler");
cj.setTransfer_output_files(outputFileString);
cj.setGlobusrsl(rslString);
cj.setMyProxyHost("myproxy.teragrid.org:7512");
cj.setMyProxyNewProxyLifetime("7200");
cj.setMyProxyCredentialName(myproxy_username);
cj.setMyProxyPassword(myproxy_passwd);
cj.setMyProxyRefreshThreshold("3600");


System.out.println(cj.toString());

RPCServiceClient serviceClient = new RPCServiceClient();

Options options = serviceClient.getOptions();

EndpointReference targetEPR = new EndpointReference(serviceLoc);

options.setTo(targetEPR);

QName query = new QName("http://jobsubmissionservice.ogce.org/xsd", serviceMethod);
Class [] returnTypes = new Class []{JobMessage[].class};
Object[] queryArgs = new Object[] {cj};
Object [] response = serviceClient.invokeBlocking(query,queryArgs,returnTypes);
JobMessage[] result = (JobMessage[])response[0];

System.out.println(result[0].toString());
}catch (Exception e){
e.printStackTrace();
}
}


private static void usage(){
System.out.println("Usage: submit_job -s \n"+
"-l \n"+
"-p \n"+
"==========================================================="+
"\n[Example]:\n"+
"submit_job "+
"-s http://localhost:8080/axis2/services/JobSubmissionService "+
"-l yourusername "+
"-p yourpassword ");
return;
}
}

No comments: