[Swift-commit] r5193 - trunk/bin/grid

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Thu Sep 29 11:16:11 CDT 2011


Author: ketan
Date: 2011-09-29 11:16:11 -0500 (Thu, 29 Sep 2011)
New Revision: 5193

Modified:
   trunk/bin/grid/my-swift-workers
Log:
sanitized start-workers

Modified: trunk/bin/grid/my-swift-workers
===================================================================
--- trunk/bin/grid/my-swift-workers	2011-09-29 14:50:32 UTC (rev 5192)
+++ trunk/bin/grid/my-swift-workers	2011-09-29 16:16:11 UTC (rev 5193)
@@ -113,6 +113,12 @@
 if __FILE__ == $0
   raise "No greenlist file" if !ARGV[0]
 
+def dump(file, template, binding)
+ file_out = File.open(file, "w")
+ file_out.puts ERB.new(template, 0, "%<>").result(binding)
+ file_out.close
+end
+
   # **Ketan: Read the lines in greensites file and start that many services
   numlines = %x{wc -l #{ARGV[0]}}.split.first.to_i
 
@@ -206,20 +212,19 @@
    coaster_sites = %q[
       <config>
       <% ctr = 0
-        sites.each_key do |name|
-        jm       = sites[name].jm
-        url      = sites[name].url
-        app_dir  = sites[name].app_dir
-        data_dir = sites[name].data_dir
-        throttle = sites[name].throttle
+        sites.each do |asite|
+        gftp      = asite.gridftp
+        app_dir  = asite.app_dir
+        data_dir = asite.data_dir
+        sitename = asite.name
       %>
-      <pool handle="<%=name%>">
-       <execution provider="coaster-persistent" url="http://localhost:<%= coaster_service + ctr %>" jobmanager="local:local" />
+      <pool handle="<%=sitename%>">
+       <execution provider="coaster-persistent" url="http://localhost:<%= service_ports[ctr]%>" jobmanager="local:local" />
        <profile namespace="globus" key="workerManager">passive</profile>
        <profile namespace="karajan" key="initialScore">10000</profile>
-       <profile namespace="karajan" key="jobThrottle"><%=throttle%></profile>
+       <profile namespace="karajan" key="jobThrottle">2.99</profile>
        <profile namespace="globus" key="jobsPerNode">16</profile>
-       <gridftp  url="gsiftp://<%=url%>"/>
+       <gridftp  url="gsiftp://<%=gftp%>"/>
        <workdirectory><%=data_dir%>/swift_scratch</workdirectory>
       </pool>
       <% ctr += 1
@@ -227,18 +232,20 @@
       %>
      </config>
     ] 
-
+    
+    dump("coaster_osg.xml", coaster_sites, binding) 
+    
     # local per-site attributes:
     cores = (value.throttle * 100 + 2).to_i
     siteFraction = cores.to_f / totalCores.to_f
     siteTargetRunning = [ (swiftDemand.to_f * siteFraction), minSiteJobs ].max
     siteTargetQueued = [ (swiftDemand.to_f * siteFraction), minSiteJobs ].max
-
+    
     printf "site: %5d cores %2d%% %s\n", cores, siteFraction * 100, name
     targetQueued = 3
-
+    
     site.gen_submit
-
+    
     threads << Thread.new(name) do |job|
       trip=0
       while true do
@@ -325,11 +332,6 @@
      r=50 q=25
 =end
 
-def dump(file, template, binding)
-  file_out = File.open(file, "w")
-  file_out.puts ERB.new(template, 0, "%<>").result(binding)
-  file_out.close
-end
 
-dump("coaster_osg.xml", coaster_sites, binding)
+#dump("coaster_osg.xml", coaster_sites, binding)
 




More information about the Swift-commit mailing list