Thursday, July 12, 2007

GRAM Authentication test failure

If getting this:
[afgane@everest00 afgane]$ globusrun -r everest.cis.uab.edu -a

GRAM Authentication test failure: connecting to the job manager failed. Possible reasons: job terminated, invalid job contact, network problems, ...

After making sure you have current grid proxy (through grid-proxy-init), check that the globus-gatekeeper is running by telneting to port 2119 by executing:
telnet [hostname] 2119

If you get an error such as the following, read on...
telnet localhost 2119
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused


2119 is globus-gatekeeper default port. If a different port is being used, you can check it by examining file usr/local/globus-4.0.2/etc/globus-gatekeeper.conf first.
Continue by examining /etc/xinetd.d/globus-gatekeeper. This is service startup file that looks something like this (make sure first line is giving the name of the service (i.e., globus-gatekeeper, in this case)):
service globus-gatekeeper
{
socket_type = stream
protocol = tcp
wait = no
user = root
env = LD_LIBRARY_PATH=/usr/local/globus-4.0.2/lib
server = /usr/local/globus-4.0.2/sbin/globus-gatekeeper
server_args = -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf
disable = no
}

In this file find the globus-gatekeeper config file (e.g., line: server_args = -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf) and then examine it next. This file looks something like this:
[root@everest00 xinetd.d]# cat /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf
-x509_cert_dir /etc/grid-security/certificates
-x509_user_cert /etc/grid-security/hostcert.pem
-x509_user_key /etc/grid-security/hostkey.pem
-gridmap /etc/grid-security/grid-mapfile
-home /usr/local/globus-4.0.2/
-e libexec
-logfile var/globus-gatekeeper.log
-port 2119
-grid_services etc/grid-services
-inetd

Here you can find which port the gatekeeper is running on and then go back to telnet.

If any changes were made to the two files just mentioned, you must restart xinetd. This is done as root by executing:
/etc/rc.d/init.d/xinetd restart
If this still does not work, execute: netstat -lt
This will print a list of all service currentl running. You can also try starting globus-gatekeeper manually by starting the server. Path and parameters for the server can be found in /etc/xinetd.d/globus-gatekeeper again under server and server_args (e.g., $ /usr/local/globus-4.0.2/sbin/globus-gatekeeper -conf /usr/local/globus-4.0.2/etc/globus-gatekeeper.conf)

If you can succesfully telnet into to machine, gatekeeper is running and next steps would include checking host certificates and making sure permissions are set correctly and that they are still valid (in /etc/grid-security/):
-rw-r--r-- 1 root root 1.4K Mar 8 13:50 hostcert.pem
-r-------- 1 root root 887 Mar 8 13:49 hostkey.pem

gridmap file needs to hold distinguished names of individual users that map to local user names. (e.g.: "/C=US/ST=Alabama/L=Birmingham/O=University of Alabama at Birmingham/OU=UABgrid/CN=jpr/emailAddress=jpr@uab.edu" afgane).

Finally, /etc/grid-security/certificates directory must hold currently valid CA certificates for participating resources/organizations.


Additional (excellent) documentation can be gotten from Georgia Tech at http://www.hpcc.ttu.edu/Globus.html and http://www.sdsc.edu/~tkaiser/globus/build/. Information on globus-personal-gatekeeper is also included at the second link.

Wednesday, July 11, 2007

Globus simple tests

Test GRAM authentication only:
globusrun -r everest.cis.uab.edu -a
GRAM Authentication test successful

Submit simple (non-WS) job:
globusrun -o -r everest.cis.uab.edu/jobmanager '&(executable=/bin/date)'

Using Threads in Java

The way threads work in Java is that there has to be a class implementing either Runnable interface of extends Thread class. Either way, run method must be overridden wihh desired functionality. From the client class, a new thread must be created (as below) where the first argument passed is an an instance of the class you want executed as a separate thread. Once this is done, the thread can be started by invoking start method.

Thread thrd = new Thread(new ClassImplementingThreadFunc(param1,param2));
Thread thrd2 = new Thread(new ClassImplementingThreadFunc(newParam1,newParam2));
thrd.start();
thrd2.start();

Tuesday, July 10, 2007

Numerical sort in Perl

If trying to sort a hash based on key where keys are numerical, using just
foreach $Key (sort keys %Output_Hash) will sort/output values as follows:
1
10
11
...
2
20
21
...

In order to get proper numerical sort, modify above code as this:
foreach $Key (sort {$a <=> $b} keys %Output_Hash)
This will make a comparison on each of the keys and result will be what is needed:
1
2
3
...
10
11

Friday, July 06, 2007

Change reference indentation in Endnote

To change indentation in references when using EndNote (v8). For example:
Change from this:
[1] The Grid: Blueprint for a New Computing Infrastructure, 1st ed: Morgan Kaufmann Publishers, 1998.
To this:
[1] [TAB] The Grid: Blueprint for a New Computing Infrastructure, 1st ed: Morgan Kaufmann Publishers, 1998.

Go to EndNote, Edit->Output style->Edit "style"
Go to Bibliography->Templates and change EVERY entry to include tab in front of Author field (insert tab by clicking on 'Insert Filed' on the top right and selecting 'Tab'). For example:
Journal Article
[TAB] Author, "Title," Journal|, vol. Volume|, pp. Pages|, Year|.

As a side note, in EndNote style editing window, Citations are referring to in-text citations, while Bibliography is referring to the References/Bibliography at the end of the document.