This HOWTO describes how to run a single core job on the Infolab Compute Cluster.
1. The program
We are going to use just a simple Python script as our main program for this HOWTO:
import socket, datetime, time, getpass start = datetime.datetime.now() hostname = socket.gethostname().split('.')[0] username = getpass.getuser() time.sleep(10) end = datetime.datetime.now() dfmt = "%Y-%m-%d %H:%M:%S" print "Started: %s Finished: %s Host: %s User: %s" % (start.strftime(dfmt), end.strftime(dfmt), hostname, username)
The script starts, records the current time, figures out the hostname it is running on and the username it is running as. Then it sleeps for 10 seconds (so we at least have some impact on the cluster), records the time again and prints out a string that may look a little something like this:
Started: 2012-10-16 15:56:55 Finished: 2012-10-16 15:57:05 Host: ilhead1 User: akrevl