[Swift-commit] r7205 - in SwiftTutorials/swift-cloud-tutorial: app doc part02

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Tue Oct 22 11:39:56 CDT 2013


Author: davidk
Date: 2013-10-22 11:39:56 -0500 (Tue, 22 Oct 2013)
New Revision: 7205

Modified:
   SwiftTutorials/swift-cloud-tutorial/app/simulate.py
   SwiftTutorials/swift-cloud-tutorial/doc/README
   SwiftTutorials/swift-cloud-tutorial/part02/apps
Log:
Python example


Modified: SwiftTutorials/swift-cloud-tutorial/app/simulate.py
===================================================================
--- SwiftTutorials/swift-cloud-tutorial/app/simulate.py	2013-10-22 15:59:07 UTC (rev 7204)
+++ SwiftTutorials/swift-cloud-tutorial/app/simulate.py	2013-10-22 16:39:56 UTC (rev 7205)
@@ -5,6 +5,7 @@
 import time
 import math
 import random
+import getpass
 
 def parse():
     from optparse import OptionParser
@@ -48,7 +49,7 @@
     print >> sys.stderr, "Called as: ", str(sys.argv)
     print >> sys.stderr, "Start time: ", datetime.datetime.now()
     print >> sys.stderr, "Running on node: ", socket.gethostname()
-    print >> sys.stderr, "Running as user: ",os.getlogin()
+    print >> sys.stderr, "Running as user: ", getpass.getuser()
     print >> sys.stderr, "\nEnvironment:\n\n"
     print >> sys.stderr, os.environ
 

Modified: SwiftTutorials/swift-cloud-tutorial/doc/README
===================================================================
--- SwiftTutorials/swift-cloud-tutorial/doc/README	2013-10-22 15:59:07 UTC (rev 7204)
+++ SwiftTutorials/swift-cloud-tutorial/doc/README	2013-10-22 16:39:56 UTC (rev 7205)
@@ -345,6 +345,16 @@
 example of naming the output files of an ensemble run. In this case, the output files will be named
 `output/sim_N.out`.
 
+In part 2, we also update the apps file. Instead of using shell script (simulate.sh), we use
+the equivalent python version (simulate.py). The new apps file now looks like this:
+
+-----
+localhost simulate simulate.py
+-----
+
+Swift does not need to know anything about the language an application is written in. The application 
+can be written in Perl, Python, Java, Fortran, or any other language.
+
 To run the script and view the output:
 -----
 $ cd ../part02

Modified: SwiftTutorials/swift-cloud-tutorial/part02/apps
===================================================================
--- SwiftTutorials/swift-cloud-tutorial/part02/apps	2013-10-22 15:59:07 UTC (rev 7204)
+++ SwiftTutorials/swift-cloud-tutorial/part02/apps	2013-10-22 16:39:56 UTC (rev 7205)
@@ -1 +1 @@
-localhost simulate simulate.sh
+localhost simulate simulate.py




More information about the Swift-commit mailing list