Saturday, September 30, 2006

Removing multiple hyperlinks from MS Word; DBLP

Here's a nice keyboard shortcut for Windows: if you need to remove multiple hyperlinks from a word document, highlight the infected area and use cntrl-shift-f9. This is easier than the tedious procedure of right-mouse-clicking and selecting "remove hyperlink" for each link.

I find this useful because I often cut and paste references from DBLP into articles' citation lists. Google "DBLP Geoffrey Fox" or similar to see an example. Very useful but full of hyperlinks.

Tuesday, September 19, 2006

Mac Window Captures

I always forget this, so here it is: to capture a section of the Mac display, use apple+shift+4, where "apple" is the Apple command key. Drag the cursor and release to take your shot. It will be saved as a PNG file.

Got this from http://www-rohan.sdsu.edu/~scc/web/screencapt.html

Monday, September 18, 2006

Submitting Globus job through Condor SOAP API

(1) Download and install condor 6.8 from http://www.cs.wisc.edu/condor/

(2) Setup condor for SOAP by adding following lines in etc/condor_config file
WEB_ROOT_DIR=$(RELEASE_DIR)/web
ENABLE_SOAP = TRUE
ALLOW_SOAP = */*
ENABLE_WEB_SERVER = TRUE
QUEUE_ALL_USERS_TRUSTED = TRUE

(3) All condor's WSDL files are located under condor_installation_directory/lib/webservices. Now generate condor client library by using following commnads
java org.apache.axis.wsdl.WSDL2Java condorSchedd.wsdl and
java org.apache.axis.wsdl.WSDL2Java condorCollector.wsdl
Do not forget to include axis jar files into classpath for running above commands. Execution of this commands will generate condor folder under lib/webservices folder.

(4)Now compile all the classes generated under lib/webservices/condor folder by using follwoing command
javac condor/*.java

(5) Make birdbath1.jar file from lib/webservices/condor folder

(6)Also download birdbath.jar file from http://www.cs.wisc.edu/condor/birdbath/birdbath.jar.

(7) include birdbath.jar and birdbath1.jar file to classpath. My classpath looks like following
:/usr/local/axis/axis-1_4/lib/axis-ant.jar:/usr/local/axis/axis-1_4/lib/axis.jar:
/usr/local/axis/axis-1_4/lib/commons-discovery-0.2.jar:/usr/local/axis/axis-1_4/lib/commons-logging-1.0.4.jar:
/usr/local/axis/axis-1_4/lib/jaxrpc.jar:/usr/local/axis/axis-1_4/lib/log4j-1.2.8.jar:
/usr/local/axis/axis-1_4/lib/saaj.jar:/usr/local/axis/axis-1_4/lib/wsdl4j-1.5.1.jar:
/home/condor/condor/lib/webservice/birdbath1.jar:/home/condor/condor/lib/webservice/birdbath.jar:

(8)Now I have created following class SubmitExample3.java to submit globus job
import condor.ClassAdStructAttr;
import condor.ClassAdAttrType;
import condor.UniverseType;
import birdbath.*;
import java.rmi.*;
import java.io.*;
import java.net.*;
import javax.xml.rpc.*;

class SubmitExample3
{
public static void main(String[] arguments)
throws RemoteException, ServiceException, MalformedURLException, IOException
{
Schedd schedd = new Schedd(new URL(arguments[0]));
Transaction xact = schedd.createTransaction();
xact.begin(30);
int cluster = xact.createCluster();
int job = xact.createJob(cluster);
ClassAdStructAttr[] extraAttributes =
{
new ClassAdStructAttr("Out", ClassAdAttrType.value3,"/home/condor/temp.out"),
new ClassAdStructAttr("GridResource", ClassAdAttrType.value3,"gt2 login-co.ncsa.teragrid.org/jobmanager"),
new ClassAdStructAttr("x509userproxy", ClassAdAttrType.value3,"/tmp/x509up_u501")};
xact.submit(cluster, job,"condor",UniverseType.GLOBUS,"/home/condor/test.sh",null,"(TRUE)",extraAttributes,null);
xact.commit();
}
}
This example runs test.sh file located under /home/condor directory using globus universe at ncsa teragrid. It is necessary to specify GridResource and x509userproxy attributes to run globus job.
My test.sh file is simple
#!/bin/sh
echo $HOSTNAME
After execution of test.sh the output will generate under /home/condor/temp.out file

(9) Now compile this class using
javac SubmitExample3.java

(10) To run this example You need to specify Condor's schedd URL as an argument like this
java SubmitExample3 http://Schedd's IP Address:Schedd's Port Number

(11) you can check the status of job using condor_q command like this
condor_q
-- Submitter: 156-56-104-135.dhcp-bl.indiana.edu : <156.56.104.135:32773> : 156-56-104-135.dhcp-bl.indiana.edu
ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD
67.0 condor 9/18 10:02 0+00:00:00 I 0 9.8 test.sh

1 jobs; 1 idle, 0 running, 0 held

condor_q
-- Submitter: 156-56-104-135.dhcp-bl.indiana.edu : <156.56.104.135:32773> : 156-56-104-135.dhcp-bl.indiana.edu
ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD
67.0 condor 9/18 10:06 0+00:00:13 R 0 9.8 test.sh

1 jobs; 0 idle, 1 running, 0 held

condor_q
-- Submitter: 156-56-104-135.dhcp-bl.indiana.edu : <156.56.104.135:32773> : 156-56-104-135.dhcp-bl.indiana.edu
ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD
67.0 condor 9/18 10:06 0+00:02:53 C 0 9.8 test.sh

0 jobs; 0 idle, 0 running, 0 held

(12) After execution result will be displayed in temp.out file
co-login1.ncsa.uiuc.edu