Wednesday Jun 20, 2007
Wednesday Jun 20, 2007
Friday Nov 10, 2006
// Submit jobs to run
for (int i = 0; i < 50; i++) {
System.out.println("Creating Remote Command: " + i);
jt[i] = session.createJobTemplate();
jt[i].setRemoteCommand(exec);
ids[i] = session.runJob(jt[i]);
}
A full example is provided on the Developer Network site by Fay Salwen, one of our Grid experts.
Thursday Nov 09, 2006
> ./cog-4_1_4/bin/grid-cert-request -cn "Pascal Ledru" >scp .globus/usercert_request.pem root@myserver.central.sun.com:usercert_request.ledru.pem
> /usr/local/globus-4.0.3/bin/grid-ca-sign -in usercert_request.ledru.pem -out usercert.ledru.pem
> scp root@myserver.central.sun.com:usercert.ledru.pem .globus/usercert.pem > ./install/cog-4_1_4/bin/grid-proxy-init
"/O=Grid/OU=GlobusTest/OU=simpleCA-myserver/CN=Pascal Ledru" globus
./cog-file-transfer -s file:///home/pl108086/test.txt -d gridftp://myserver.central.sun.com:2811/tmp/TEST.txt
> printenv HZ= SHELL=/bin/bash TERM=xterm LC_ALL=C MAIL=/var/mail/globus PATH=/usr/local/bin:/usr/bin:/usr/sfw/bin:/usr/dist/share/devpro/5.x-i386/bin:/usr/ccs/bin:/usr/dist/exe PWD=/etc/grid-security LANG=C TZ=US/Mountain SHLVL=2 HOME=/users/globus LOGNAME=globus LC_CTYPE=C _=/usr/bin/tcsh HOSTTYPE=i86pc VENDOR=sun OSTYPE=solaris MACHTYPE=i386 USER=globus GROUP=other HOST=myhost GPT_LOCATION=/usr/local/globus-4.0.3 CC=/usr/dist/share/devpro/5.x-i386/bin/cc GLOBUS_LOCATION=/usr/local/globus-4.0.3 GCC=/usr/sfw/bin/gcc
./configure --prefix=$GLOBUS_LOCATION --with-flavor=gcc32dbg
make
/usr/ccs/bin:/usr/dist/exe
file:/tmp/testgt/gt4.0.3-all-source-installer/source-trees/wsrf/java/core/source/build.xml:211: Compile failed; see the compiler error output for details.
import org.apache.axus.enum.Scope;I edited the build file to add the -source 1.4 option such as:
source="1.4"
echo "Your build completed successfully. Please run make install." Your build completed successfully. Please run make install.
> make install /usr/local/globus-4.0.3/sbin/gpt-postinstall running /usr/local/globus-4.0.3/setup/globus/setup-globus-common..[ Changing to /usr/local/globus-4.0.3/setup/globus ] creating globus-sh-tools-vars.sh running /usr/local/globus-4.0.3/setup/globus/setup-globus-job-manager-fork..[ Changing to /usr/local/globus-4.0.3/setup/globus ] find-fork-tools: WARNING: "Cannot locate mpiexec" find-fork-tools: WARNING: "Cannot locate mpirun" checking for mpiexec... no checking for mpirun... no find-fork-tools: creating ./config.status config.status: creating fork.pm ..Done
> $GLOBUS_LOCATION/setup/globus/setup-simple-ca
creating CA config package... /usr/local/globus-4.0.3/setup/globus/setup-simple-ca: GLOBUS_LOCATION=/usr/local/globus-4.0.3: is not an identifier
#! /bin/shto
#! /bin/bash
creating CA config package... ERROR: Unable to configure the simple_ca 9a7cd758 setup packageCorrected GPT_LOCATION such as:
setenv GPT_LOCATION /usr/local/globus-4.0.3Then ran as root:
> $GLOBUS_LOCATION/setup/globus_simple_ca_9a7cd758_setup/setup-gsi -default > $GLOBUS_LOCATION/bin/grid-cert-request -host myhost.central.sun.com
Wednesday Sep 27, 2006
cat cs_master.o68935.2
Sleeping for 0 seconds
Your job-array 68936.4-102:1 ("cs_ephemeralworker -ephemeral") has been submitted
Sep 27, 2006 4:43:43 PM com.sun.computeserver.master.Master run
INFO: Master starting
Sep 27, 2006 4:44:05 PM com.sun.computeserver.integralpi.PiGenerator done
INFO: Master PI:3.1415906524138111994160239945727946065207750695568908515112969308267806110
10577374635946745511251244209674355608893092721700668334960937500
Sep 27, 2006 4:44:05 PM com.sun.computeserver.master.Master doWaitForFeedback
INFO: Master exiting via WAIT
Sep 27, 2006 4:44:05 PM com.sun.computeserver.mm.MasterAspect doOutput
INFO:
Job Succeeded
Sep 27, 2006 4:44:05 PM com.sun.computeserver.mm.MasterAspect doOutput
INFO:
Master Job Start Time : 2006-09-27 16:43:43.674
Master Job End Time : 2006-09-27 16:44:05.187
Total Job Execution Time : 21.513 Seconds
Total Processed Tasks : 100
Total Failed Tasks : 0
Total Submitted Tasks : 100
Generated : 100
Fissioned : 0
Task Throughput : 4.7 Tasks per Second
Average Task Execution Time : 0.215 Seconds per Task
cat cs_ephemeralworker.o68936.86 Sleeping for 8 seconds Sep 27, 2006 4:44:03 PM com.sun.computeserver.worker.WorkerWatcher init INFO: Worker active on nyc1r226cpn06.retail.nyc1.sungrid.net Sep 27, 2006 4:44:09 PM com.sun.computeserver.worker.WorkerWatcher goAway INFO: Worker exiting nyc1r226cpn06.retail.nyc1.sungrid.net
Monday Sep 18, 2006
1 node: Average: 3.1411545250056307 with 1 nodes. 2 nodes: Average: 3.141313165330142 with 2 nodes. 20 nodes: Average: 3.1416765781116878 with 20 nodes. 200 nodes: Average: 3.141568127864779 with 200 nodes.Actually 3.1415 is a fairly good approximation: π to one MILLION decimal places
#!/bin/ksh
#$ -N Buffon
#$ -cwd
# Set the environment variables
if [ -f $HOME/.profile ]; then
. $HOME/.profile
fi
numClients=$1
echo "Starting the server..."
echo "Number of clients: "$numClients
svrResp=$(qsub -N server startServers.ksh)
echo svrResp is $svrResp
svrJobId=$(echo "$svrResp" | awk '{print $3}')
echo svrJobId is $svrJobId
# Wait until the server is started
status="not running"
until [ "$status" == "r" ]
do
status=$( qstat | nawk '/'$svrJobId'/ {print $5}' )
echo Server job status is $status
sleep 10
done
#Wait until the serverhost file is created
filename="$HOME/serverhost"
until test -f $filename
do
sleep 10
done
# then pull the server node name from the file
servernode=$(cat $filename)
rm $filename
echo "Server is running on" $servernode "Submitting a set of clients to the grid for remote execution..."
qsub -N clients -t 1-$numClients startClient.ksh $servernode
echo "Submitting a cleanup job that will wait until the clients are complete"
qsub -hold_jid clients cleanup.ksh $svrJobId
Tuesday Sep 12, 2006
Wednesday Sep 06, 2006
Friday Sep 01, 2006
Thursday Aug 31, 2006
public interface MersenneServer extends Remote {
public int[] getInterval() throws RemoteException;
public void postResult(Result result) throws RemoteException;
public String getStatus() throws RemoteException;
}
svrResp=$(qsub -N mserv08 startServers.ksh)
job-ID prior name user state submit/start at queue slots ja-task-ID ----------------------------------------------------------------------------------------------------------------- 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r213cpn21.retail.nyc 1 8 58642 0.60500 start user0104 r 08/27/2006 00:50:38 all.q@nyc1r213cpn24.retail.nyc 102 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r213cpn32.retail.nyc 1 12 59914 0.50500 clients user0105 r 08/31/2006 00:04:37 all.q@nyc1r214cpn14.retail.nyc 1 5 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r214cpn15.retail.nyc 1 16 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r214cpn20.retail.nyc 1 1 59917 0.50500 Admin user0107 r 08/31/2006 00:05:37 all.q@nyc1r219cpn24.retail.nyc 1 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r219cpn28.retail.nyc 1 11 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r220cpn04.retail.nyc 1 13 59913 0.50500 mserv08 user0105 r 08/31/2006 00:04:07 all.q@nyc1r220cpn17.retail.nyc 1 58219 0.50500 clients user0103 r 08/25/2006 16:51:22 all.q@nyc1r220cpn21.retail.nyc 1 14
Local host: nyc1r219cpn24.retail.nyc1.sungrid.net Looking for host where process: mserv08 is running Host is: nyc1r220cpn17.retail.nyc1.sungrid.net Looking up rmi://nyc1r220cpn17.retail.nyc1.sungrid.net/MersenneSolver... Status: ....
Friday Aug 18, 2006
cat Mersenne.ksh
#!/bin/ksh
#$ -N Mersenne
#$ -cwd
# Set the environment variables
if [ -f $HOME/.profile ]; then
. $HOME/.profile
fi
numClients=5
echo "Starting the server..."
svrResp=$(qsub -N server startServers.ksh)
echo svrResp is $svrResp
svrJobId=$(echo "$svrResp" | awk '{print $3}')
echo svrJobId is $svrJobId
# Wait until the server is started
status="not running"
until [ "$status" == "r" ]
do
status=$( qstat | nawk '/'$svrJobId'/ {print $5}' )
echo Server job status is $status
sleep 10
done
#Wait until the serverhost file is created
filename="$HOME/serverhost"
until test -f $filename
do
sleep 10
done
# then pull the server node name from the file
servernode=$(cat $filename)
rm $filename
echo "Server is running on" $servernode "Submitting a set of clients to the grid for remote execution..."
qsub -N clients -t 1-$numClients startClient.ksh $servernode
echo "Submitting a cleanup job that will wait until the clients are complete"
qsub -hold_jid clients cleanup.ksh $svrJobId
cat startServers.ksh #!/bin/ksh #$ -N startServers #$ -cwd echo "Starting the registry in the background..." rmiregistry & # Wait until the registry is started proc=0 while [ "$proc" == 0 ] do proc=$( ps -ef | grep "[r]miregistry" ) echo $proc is running sleep 10 done # Place the name of this host in a file, so that clients can read it hostname > $HOME/serverhost echo "The servers location is" $(hostname) echo "Starting the server..." java MersenneServerImpl
cat startClient.ksh #!/bin/ksh #$ -N startClient #$ -cwd servernode=$1 echo "Starting a client on $(hostname) to talk to server running on" $servernode java MersenneClient $servernode
cat cleanup.ksh #!/bin/ksh #$ -N cleanup #$ -cwd # Set the environment variables if [ -f $HOME/.profile ]; then . $HOME/.profile fi echo Killing the server, job number $1 ... qdel $1
#!/bin/ksh #$ -N Test_qstat #$ -cwd SGETOOLS=/home/sgeadmin/n1ge60/bin/sol-x86 export SGETOOLS echo "Starting Test program..." $SGETOOLS/qstat echo "End Test program..."
#!/bin/ksh #$ -N Test_qstat #$ -cwd # Set the environment variables if [ -f $HOME/.profile ]; then . $HOME/.profile fi echo "Starting Test program..." echo `which qstat` qstat echo "End Test program..."
Wednesday Aug 16, 2006
cat startServer.ksh #!/bin/ksh SGETOOLS=/home/sgeadmin/N1GE/bin/sol-amd64 export SGETOOLS numClients=10 $SGETOOLS/qsub -N client -t 1-$numClients startClient.ksh
> cat startClient.ksh #!/bin/ksh host=$( hostname ) echo "Starting client on" $host with ID $SGE_TASK_ID >> /home/pascal/test1/file$host proc=0 while [ "$proc" == 0 ] do echo $proc donethe output of qstat looks like:
> qstat job-ID prior name user state submit/start at queue slots ja-task-ID ----------------------------------------------------------------------------------------------------------------- 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node01a 1 1 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node01b 1 2 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node02a 1 3 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node02b 1 10 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node03a 1 9 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node04a 1 7 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node04b 1 5 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node05a 1 8 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node05b 1 6 1221 0.55500 client pascal r 08/16/2006 17:39:50 all.q@node06b 1 4
Tuesday Aug 15, 2006
import java.rmi.*;
public interface MersenneServer extends Remote {
public int[] getInterval() throws RemoteException;
public void postResult(int[] values) throws RemoteException;
}
import java.math.*;
import java.rmi.*;
import java.rmi.server.*;
import java.util.ArrayList;
public class MersenneClient {
static final BigInteger one = new BigInteger("1");
static final BigInteger two = new BigInteger("2");
static final BigInteger four = new BigInteger("4");
public MersenneClient() throws RemoteException {
}
private static boolean LucasLehmerTest(int p) {
BigInteger s = four;
BigInteger n = one.shiftLeft(p).subtract(one);
for (int i = 3; i <= p; i++) {
s = s.multiply(s).subtract(two).mod(n);
}
if (s.bitCount() == 0) {
return true;
} else {
return false;
}
}
public static void main(String[] args) {
String host = args[0];
String name = "rmi://" + host + "/MersenneSolver";
System.out.println("Looking up " + name + "...");
MersenneServer server = null;
try {
server = (MersenneServer)Naming.lookup(name);
} catch (Exception ex) {
System.out.println("Caught an exception looking up Solver.");
ex.printStackTrace();
System.exit(1);
}
while (true) {
try {
int[] interval = server.getInterval();
if (interval == null) break; // no more intervals
ArrayList list = new ArrayList();
for (int i = interval[0]; i <= interval[1]; i++) {
if (LucasLehmerTest(i)) {
list.add(i);
}
}
int[] values = new int[list.size()];
for (int i = 0; i < list.size(); i++) values[i] = list.get(i);
server.postResult(values);
} catch (RemoteException ex) {
System.out.println("Caught remote exception.");
System.out.println("Probably server shutdown as all intervals are evaluated");
System.exit(1);
}
}
}
}
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class MersenneServerImpl extends UnicastRemoteObject implements MersenneServer {
private int i = 1;
private int interval = 100;
//private int totalInterval = 40;
private int totalInterval = 80;
public MersenneServerImpl() throws RemoteException {
}
// calcuate the Mersenne primes up to 5000
// break the range into small intervals
// each client will test the primes within a given interval
public synchronized int[] getInterval() throws RemoteException {
if (i >= 5000) return null;
//if (i >= 3000) return null;
if (i >= 2000) interval = 50;
int j = i;
int k = i + interval-1;
i = i + interval;
return new int[] {j, k};
}
public synchronized void postResult(int[] values) throws RemoteException {
for (int i = 0; i < values.length; i++) {
System.out.println("2^" + values[i] + "-1 is prime");
}
// check if we should exit
totalInterval--;
if (totalInterval == 0) System.exit(0);
}
public static void main(String[] args) {
try {
String name = "MersenneSolver";
System.out.println("Registering Mersenne Solver");
MersenneServerImpl solver = new MersenneServerImpl();
Naming.rebind(name, solver);
System.out.println("Remote Solver ready...");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
#!/bin/ksh echo "Starting registry" rmiregistry & # Wait until the registry is started proc=0 while [ "$proc" == 0 ] do proc=$( ps -ef | grep "[r]miregistry" ) echo $proc is running sleep 10 done echo "Starting server" java MersenneServerImpl & sleep 10 echo "Starting client" java MersenneClient localhost & sleep 2 echo "Starting client" java MersenneClient localhost &