Locked History Actions

attachment:JobArray.py of InfolabClusterComputeHowtoJobArray

Attachment 'JobArray.py'

Download

   1 #!/usr/bin/python2.7
   2 
   3 import socket, datetime, time, getpass, sys
   4 
   5 arrayid = sys.argv[1]
   6 
   7 # We're using just using a simple list here but you can
   8 # easily imagine this getting read from a file or sth ...
   9 arguments = [ 
  10   [ "myarg1-0", "myarg2-0", "myarg3-0" ],
  11   [ "myarg1-1", "myarg2-1", "myarg3-1" ],  
  12   [ "myarg1-2", "myarg2-2", "myarg3-2" ],
  13   [ "myarg1-3", "myarg2-3", "myarg3-3" ]
  14 ]
  15 
  16 start = datetime.datetime.now()
  17 hostname = socket.gethostname().split('.')[0]
  18 username = getpass.getuser()
  19 time.sleep(10)
  20 end = datetime.datetime.now()
  21 
  22 dfmt = "%Y-%m-%d %H:%M:%S"
  23 print "Started: %s Finished: %s Host: %s User: %s" % (start.strftime(dfmt), end.strftime(dfmt), hostname, username)
  24 print "My arguments:"
  25 print arguments [int(arrayid)]

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-01-10 13:03:31, 0.7 KB) [[attachment:JobArray.py]]
  • [get | view] (2013-01-10 13:03:31, 0.1 KB) [[attachment:JobArray.qsub.sh]]

You are not allowed to attach a file to this page.