[Swift-commit] r7343 - in SwiftApps/swiftrun-demo: . 04-service-localworkers
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Fri Nov 29 01:17:55 CST 2013
Author: davidk
Date: 2013-11-29 01:17:48 -0600 (Fri, 29 Nov 2013)
New Revision: 7343
Added:
SwiftApps/swiftrun-demo/04-service-localworkers/
SwiftApps/swiftrun-demo/04-service-localworkers/README
SwiftApps/swiftrun-demo/04-service-localworkers/catsn.swift
SwiftApps/swiftrun-demo/04-service-localworkers/data.txt
SwiftApps/swiftrun-demo/04-service-localworkers/swift.properties
Log:
Example of running with a service and a local worker
Added: SwiftApps/swiftrun-demo/04-service-localworkers/README
===================================================================
--- SwiftApps/swiftrun-demo/04-service-localworkers/README (rev 0)
+++ SwiftApps/swiftrun-demo/04-service-localworkers/README 2013-11-29 07:17:48 UTC (rev 7343)
@@ -0,0 +1,40 @@
+This is an example of using swift-service to keep workers running in a persistent state.
+Here is the service definition that is being used:
+
+service.myservice {
+ mode=local
+ jobsPerNode=12
+ jobThrottle=10
+ work=/scratch/midway/$USER/swiftwork
+}
+
+The mode defines how the workers are started. The "local" mode means it starts the worker on the machine where you are running.
+The other valid modes are "ssh" and "scheduler".
+
+Since services are persistent, they need to be started and stopped by the user. You do this with the swift-service command.
+Run "swift-service -help" for more info.
+
+Here is an example of starting the service, running swift, and stopping the service.
+
+$ swift-service -start myservice
+Starting Swift service..
+
+Name: myservice
+PID: 23530
+Status: Running
+Service URL: http://127.0.0.1:52970
+Local URL: http://172.25.181.1:33982,http://128.135.112.73:33982,http://10.50.181.1:33982
+Worker script: /home/davidkelly999/swift-trunk/cog/modules/swift/dist/swift-svn/bin/worker.pl
+Nodes: 1
+Cores: 12
+
+$ swift -site myservice catsn.swift
+Swift trunk swift-r7339 (swift modified locally) cog-r3844 (cog modified locally)
+RunID: 20131129-0708-afyajp5g
+Progress: Fri, 29 Nov 2013 07:08:28+0000
+Progress: Fri, 29 Nov 2013 07:08:29+0000 Submitted:26 Active:12 Finished successfully:62
+Final status:Fri, 29 Nov 2013 07:08:30+0000 Finished successfully:100
+
+$ swift-service -stop
+Stopping service myservice
+
Added: SwiftApps/swiftrun-demo/04-service-localworkers/catsn.swift
===================================================================
--- SwiftApps/swiftrun-demo/04-service-localworkers/catsn.swift (rev 0)
+++ SwiftApps/swiftrun-demo/04-service-localworkers/catsn.swift 2013-11-29 07:17:48 UTC (rev 7343)
@@ -0,0 +1,13 @@
+type file;
+
+app (file o) cat (file i)
+{
+ cat @i stdout=@o;
+}
+
+file out[]<simple_mapper; location="output", prefix="catsn.",suffix=".out">;
+
+foreach j in [1:toInt(arg("n","100"))] {
+ file data <"data.txt">;
+ out[j] = cat(data);
+}
Added: SwiftApps/swiftrun-demo/04-service-localworkers/data.txt
===================================================================
--- SwiftApps/swiftrun-demo/04-service-localworkers/data.txt (rev 0)
+++ SwiftApps/swiftrun-demo/04-service-localworkers/data.txt 2013-11-29 07:17:48 UTC (rev 7343)
@@ -0,0 +1 @@
+fdjklfjldsfjlkds
Added: SwiftApps/swiftrun-demo/04-service-localworkers/swift.properties
===================================================================
--- SwiftApps/swiftrun-demo/04-service-localworkers/swift.properties (rev 0)
+++ SwiftApps/swiftrun-demo/04-service-localworkers/swift.properties 2013-11-29 07:17:48 UTC (rev 7343)
@@ -0,0 +1,6 @@
+service.myservice {
+ mode=local
+ jobsPerNode=12
+ jobThrottle=10
+ work=/scratch/midway/$USER/swiftwork
+}
More information about the Swift-commit
mailing list