[Swift-commit] r5648 - in SwiftApps/Cybershake: app etc swiftscripts

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Fri Feb 17 17:01:59 CST 2012


Author: ketan
Date: 2012-02-17 17:01:59 -0600 (Fri, 17 Feb 2012)
New Revision: 5648

Added:
   SwiftApps/Cybershake/app/cybershake.rb
   SwiftApps/Cybershake/app/getrupture.rb
   SwiftApps/Cybershake/app/getsgtvar.rb
   SwiftApps/Cybershake/app/getsite.rb
   SwiftApps/Cybershake/app/getsub.rb
   SwiftApps/Cybershake/app/mk_catalog.rb
   SwiftApps/Cybershake/app/mk_catalog_coasters.rb
   SwiftApps/Cybershake/app/offset.rb
   SwiftApps/Cybershake/app/variation_mapper.rb
   SwiftApps/Cybershake/etc/cf
   SwiftApps/Cybershake/etc/cf.gridftp
   SwiftApps/Cybershake/etc/cf.ps
   SwiftApps/Cybershake/etc/fs.data
   SwiftApps/Cybershake/etc/sites-ranger.xml
   SwiftApps/Cybershake/etc/sites.grid-ps.xml
   SwiftApps/Cybershake/etc/sites.xml
   SwiftApps/Cybershake/etc/tc-fix.data
   SwiftApps/Cybershake/etc/tc-provider-staging
   SwiftApps/Cybershake/etc/tc-ranger.data
   SwiftApps/Cybershake/etc/tc.data
   SwiftApps/Cybershake/swiftscripts/postproc-gridftp.swift
   SwiftApps/Cybershake/swiftscripts/postproc.invalidpath.swift
   SwiftApps/Cybershake/swiftscripts/postproc.swift
Log:
Adding stuff to cybershake svn

Added: SwiftApps/Cybershake/app/cybershake.rb
===================================================================
--- SwiftApps/Cybershake/app/cybershake.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/cybershake.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,85 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+require 'active_record'
+require 'logger'
+
+ActiveRecord::Base.establish_connection(
+  :adapter => "mysql",
+  :database => "CyberShake",
+  :host => "focal.usc.edu",
+  :username => "cybershk_ro",
+  :password => "CyberShake2007"
+)
+#ActiveRecord::Base.logger = Logger.new(STDERR)
+require 'composite_primary_keys'
+
+class Site < ActiveRecord::Base
+  set_table_name "CyberShake_Sites"
+  set_primary_key "CS_Site_ID"
+
+  def name
+    read_attribute(:CS_Short_Name)
+  end
+
+  def lat
+    read_attribute(:CS_Site_Lat)
+  end
+
+  def lon
+    read_attribute(:CS_Site_Lon)
+  end
+end
+
+class Run < ActiveRecord::Base
+  set_table_name "CyberShake_Runs"
+  set_primary_keys "Site_ID", "ERF_ID"
+  belongs_to :site, :foreign_key => "Site_ID"
+  has_many :ruptures, :foreign_key => ["CS_Site_ID", "ERF_ID"]
+
+  def erf
+    read_attribute(:ERF_ID)
+  end
+
+  def variation_scenario
+    read_attribute(:Rup_Var_Scenario_ID)
+  end
+end
+
+class Rupture < ActiveRecord::Base
+  set_table_name "CyberShake_Site_Ruptures"
+
+  def source
+    read_attribute(:Source_ID)
+  end
+
+  def index
+    read_attribute(:Rupture_ID)
+  end
+end
+
+class Variation < ActiveRecord::Base
+  set_table_name "Rupture_Variations"
+  set_primary_key "Rup_Var_ID"
+
+  def self.digest
+    Digest::MD5.hexdigest(self.to_s).to_s
+  end
+
+  def self.columns=(cached_columns)
+    @cached_columns= cached_columns
+    def self.columns
+      @cached_columns
+    end
+    @cached_columns
+  end
+end
+require 'memcached'
+require 'digest/md5'
+cache = Memcached.new
+begin
+  Variation.columns = cache.get(Variation.digest)
+rescue Memcached::NotFound
+  Variation.columns
+  cache.set(Variation.digest, Variation.columns)
+end
+cache = nil


Property changes on: SwiftApps/Cybershake/app/cybershake.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/getrupture.rb
===================================================================
--- SwiftApps/Cybershake/app/getrupture.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/getrupture.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,43 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+$LOAD_PATH << "/scratch/local/ketan/cybershake"
+require 'cybershake'
+require 'memcached'
+require 'digest/md5'
+
+runid = ARGV[0].to_i
+x = Run.find_by_Run_ID(runid)
+puts "source index size"
+
+digest = Digest::MD5.hexdigest(x.to_yaml).to_s
+cache = Memcached.new
+
+begin
+  x.ruptures = cache.get(digest)
+rescue Memcached::NotFound
+  x.ruptures
+  cache.set(digest, x.ruptures)
+end
+
+x.ruptures.each { |rup|
+  options = {}
+  options[:erf] = x.erf 
+  options[:variation_scenario] = x.variation_scenario
+  options[:source] = rup.source
+  options[:rupture] = rup.index
+  digest = Digest::MD5.hexdigest(options.to_s).to_s
+
+  begin
+    variations = cache.get(digest)
+  rescue Memcached::NotFound
+    variations = Variation.find(:all, :conditions => {
+        :Rup_Var_Scenario_ID => options[:variation_scenario],
+        :ERF_ID => options[:erf], 
+        :Source_ID => options[:source], :Rupture_ID => options[:rupture] },
+        :order => "Rup_Var_ID")
+    cache.set(digest, variations)
+  end
+  len = variations.size
+  puts "#{rup.source} #{rup.index} #{len}"
+}
+


Property changes on: SwiftApps/Cybershake/app/getrupture.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/getsgtvar.rb
===================================================================
--- SwiftApps/Cybershake/app/getsgtvar.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/getsgtvar.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,18 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+require 'optparse'
+
+options = {}
+OptionParser.new do |opts|
+  opts.on("-r", "-runid") { |v| options[:runid] = v}
+  opts.on("-l", "-location") { |v| options[:location] = v}
+  opts.on("-s", "-sitename") { |v| options[:sitename] = v}
+end.parse!
+
+if options[:location] == "NA" then
+  puts "x #{options[:sitename]}/#{options[:sitename]}_fx_#{options[:runid]}.sgt"
+  puts "y #{options[:sitename]}/#{options[:sitename]}_fy_#{options[:runid]}.sgt"
+else
+  puts "x #{options[:location]}/#{options[:sitename]}/#{options[:sitename]}_fx_#{options[:runid]}.sgt"
+  puts "y #{options[:location]}/#{options[:sitename]}/#{options[:sitename]}_fy_#{options[:runid]}.sgt"
+end


Property changes on: SwiftApps/Cybershake/app/getsgtvar.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/getsite.rb
===================================================================
--- SwiftApps/Cybershake/app/getsite.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/getsite.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,26 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+$LOAD_PATH << "/scratch/local/ketan/cybershake"
+require 'cybershake'
+require 'memcached'
+require 'digest/md5'
+
+cache = Memcached.new
+
+runid = ARGV[0].to_i
+x = nil
+begin
+  x = cache.get(runid.to_s)
+rescue Memcached::NotFound
+  x = Run.find_by_Run_ID(runid)
+  cache.set(runid.to_s, x)
+end
+digest = Digest::MD5.hexdigest(x.to_yaml).to_s + "site"
+begin
+  x.site = cache.get(digest)
+rescue Memcached::NotFound
+  x.site
+  cache.set(digest,x.site)
+end
+puts "name lat lon erf variation_scenario"
+puts "#{x.site.name} #{x.site.lat} #{x.site.lon} #{x.erf} #{x.variation_scenario}"


Property changes on: SwiftApps/Cybershake/app/getsite.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/getsub.rb
===================================================================
--- SwiftApps/Cybershake/app/getsub.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/getsub.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,15 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+require 'optparse'
+
+options = {}
+OptionParser.new do |opts|
+  opts.on("-l", "-location") { |v| options[:location] = v}
+  opts.on("-n", "-sitename") { |v| options[:sitename] = v}
+  opts.on("-s", "-source") { |v| options[:source] = v}
+  opts.on("-r", "-rupture") { |v| options[:rupture] = v}
+end.parse!
+
+puts "x #{options[:location]}/#{options[:sitename]}_#{options[:source]}_#{options[:rupture]}_subfx.sgt"
+puts "y #{options[:location]}/#{options[:sitename]}_#{options[:source]}_#{options[:rupture]}_subfy.sgt"
+


Property changes on: SwiftApps/Cybershake/app/getsub.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/mk_catalog.rb
===================================================================
--- SwiftApps/Cybershake/app/mk_catalog.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/mk_catalog.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,206 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+require 'erb'
+require 'ostruct'
+
+# File: mk_catalog.rb
+# Description: Generates sites.xml and tc.data for the cybershake workflow
+
+# starting ports for the templates
+coaster_service = 65000
+worker_service  = 64000
+
+swift_tc = %q[
+# Utility apps
+localhost getsite          /home/aespinosa/workflows/cybershake/getsite.rb          INSTALLED INTEL32::LINUX null
+localhost getrupture       /home/aespinosa/workflows/cybershake/getrupture.rb       INSTALLED INTEL32::LINUX null
+localhost variation_mapper /home/aespinosa/workflows/cybershake/variation_mapper.rb INSTALLED INTEL32::LINUX null
+localhost mkoffset         /home/aespinosa/workflows/cybershake/offset.rb           INSTALLED INTEL32::LINUX null
+
+# PADS
+PADS      extract        /gpfs/pads/swift/aespinosa/science/cybershake/apps/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+PADS      seispeak_local /home/aespinosa/Documents/cybershake/post/seispeak.sh                                             INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+
+
+<% 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 %>
+<%= name %> seismogram       <%= app_dir %>/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+<%= name %> surfeis_rspectra <%= app_dir %>/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+<%= name %> seispeak         <%= app_dir %>/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+<%= name %> seispeak_agg     <%= app_dir %>/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+<%   ctr += 1
+   end %>
+]
+
+coaster_sites = %q[
+<config>
+  <pool handle="localhost">
+    <filesystem provider="local" />
+    <execution provider="local" />
+    <workdirectory >/var/tmp</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">0.20</profile>
+  </pool>
+
+  <pool handle="PADS">
+    <execution provider="coaster-persistent" url="http://communicado.ci.uchicago.edu:<%= coaster_service - 1 %>" jobmanager="local:local" />
+
+    <profile namespace="globus" key="workerManager">passive</profile>
+
+    <profile namespace="karajan" key="initialScore">10000.0</profile>
+    <profile namespace="karajan" key="jobThrottle">3.66</profile>
+
+    <profile namespace="globus" key="lowOverallocation">36</profile>
+
+    <gridftp  url="local://localhost"/>
+    <workdirectory>/gpfs/pads/swift/aespinosa/swift-runs</workdirectory>
+  </pool>
+<% 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 %>
+
+  <pool handle="<%=name%>">
+    <execution provider="coaster-persistent" url="http://localhost:<%= coaster_service + 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="globus" key="jobsPerNode">16</profile>
+    <gridftp  url="gsiftp://<%=url%>"/>
+    <workdirectory><%=data_dir%>/swift_scratch</workdirectory>
+  </pool>
+<%   ctr += 1
+   end %>
+</config>
+]
+
+condor_sites = %q[
+<config>
+  <pool handle="localhost">
+    <filesystem provider="local" />
+    <execution provider="local" />
+    <workdirectory >/var/tmp</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">0.20</profile>
+  </pool>
+
+  <pool handle="PADS">
+    <execution provider="coaster-persistent" url="https://communicado.ci.uchicago.edu:<%= coaster_service - 1 %>"
+        jobmanager="local:local" />
+
+    <profile namespace="globus" key="workerManager">passive</profile>
+
+    <profile namespace="karajan" key="initialScore">10000.0</profile>
+    <profile namespace="karajan" key="jobThrottle">3.66</profile>
+
+    <profile namespace="globus" key="lowOverallocation">36</profile>
+
+    <gridftp  url="local://localhost"/>
+    <workdirectory>/gpfs/pads/swift/aespinosa/swift-runs</workdirectory>
+  </pool>
+<% 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 %>
+
+  <pool handle="<%=name%>">
+    <execution provider="condor" url="none"/>
+
+    <profile namespace="globus" key="jobType">grid</profile>
+    <profile namespace="globus" key="gridResource">gt2 <%=url%>/jobmanager-<%=jm%></profile>
+
+    <profile namespace="karajan" key="initialScore">20.0</profile>
+    <profile namespace="karajan" key="jobThrottle"><%=throttle%></profile>
+    <% if name =~ /FNAL_FERMIGRID/ %>
+      <profile namespace="globus" key="condor_requirements">GlueHostOperatingSystemRelease =?= "5.3" && GlueSubClusterName =!= GlueClusterName</profile>
+    <% end %>
+
+    <gridftp  url="gsiftp://<%=url%>"/>
+    <workdirectory><%=data_dir%>/swift_scratch</workdirectory>
+  </pool>
+<%   ctr += 1
+   end %>
+</config>
+]
+
+def ress_query(class_ads)
+  cmd = "condor_status -pool engage-central.renci.org"
+  class_ads[0..-2].each do |class_ad|
+    cmd << " -format \"%s|\" #{class_ad}"
+  end
+  cmd << " -format \"%s\\n\" #{class_ads[-1]}"
+  `#{cmd}`
+end
+
+def ress_parse
+  dir_suffix = "/engage/scec"
+  class_ads  = [
+    "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
+    "GlueCEInfoGatekeeperPort", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir",
+    "GlueCEInfoTotalCPUs"
+  ]
+  ress_query(class_ads).each_line do |line|
+    line.chomp!
+    next if line == ""
+    set = line.split("|")
+
+    value = OpenStruct.new
+
+    value.jm       = set[class_ads.index("GlueCEInfoJobManager")]
+    value.url      = set[class_ads.index("GlueCEInfoHostName")]
+    value.total    = set[class_ads.index("GlueCEInfoTotalCPUs")].to_i
+    next if value.total == 999999
+    value.throttle = (value.total.to_f - 2.0) / 100.0
+    name           = set[class_ads.index("GlueSiteUniqueID")] + "__" +  value.url
+
+    value.app_dir = set[class_ads.index("GlueCEInfoApplicationDir")]
+    value.app_dir.sub!(/\/$/, "")
+    value.data_dir = set[class_ads.index("GlueCEInfoDataDir")]
+    value.data_dir.sub!(/\/$/, "")
+
+    value.app_dir += dir_suffix
+    value.data_dir += dir_suffix
+
+    # Hard-wired exceptions
+    value.app_dir  = "/osg/app"                     if name =~ /GridUNESP_CENTRAL/
+    value.data_dir = "/osg/data"                    if name =~ /GridUNESP_CENTRAL/
+    value.app_dir.sub!(dir_suffix, "/engage-scec")  if name =~ /BNL-ATLAS/
+    value.data_dir.sub!(dir_suffix, "/engage-scec") if name =~ /BNL-ATLAS/
+
+    yield name, value
+  end
+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
+
+# Non-working sites
+blacklist = []
+# Only these sites
+whitelist = IO.readlines(ARGV[0]).map { |line| line.chomp }
+
+# Removes duplicate site entries (i.e. multilpe GRAM endpoints)
+sites = {}
+ress_parse do |name, value|
+  next if blacklist.index(name) and not blacklist.empty?
+  next if not whitelist.index(name) and not whitelist.empty?
+  sites[name] = value if sites[name] == nil
+end
+
+dump("coaster_osg.xml", coaster_sites, binding)
+dump("condor_osg.xml", condor_sites, binding)
+dump("tc.data", swift_tc, binding)


Property changes on: SwiftApps/Cybershake/app/mk_catalog.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/mk_catalog_coasters.rb
===================================================================
--- SwiftApps/Cybershake/app/mk_catalog_coasters.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/mk_catalog_coasters.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,272 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+require 'erb'
+require 'ostruct'
+
+# starting ports for the templates
+coaster_service = 65000
+worker_service  = 64000
+
+swift_workflow = %q[
+<% ctr = 0
+   sites.keys.sort.each 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 %>
+app (external o) worker<%= ctr %>() {
+/*  worker<%= ctr %> "http://128.135.125.17:<%= worker_service + ctr %>" "<%= name %>" "/tmp" "14400"; */
+  sleep<%= ctr %> "14400";
+}
+
+external rups<%= ctr %>[];
+int arr<%= ctr %>[];
+iterate i{
+  arr<%= ctr %>[i] = i;
+} until (i == <%= ((throttle * 100 + 2) * 2.5).to_i %>);
+
+foreach a,i in arr<%= ctr %> {
+  rups<%= ctr %>[i] = worker<%= ctr %>();
+}
+
+<%   ctr += 1
+   end %>
+]
+
+slave_workflow = %q[
+int t = 0;
+
+app (external o) sleep_pads(int time) {
+  sleep_pads time;
+}
+external o_pads;
+o_pads = sleep_pads(t);
+
+<% ctr = 0
+   sites.keys.sort.each 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 %>
+app (external o) sleep<%= ctr %>(int time) {
+  sleep<%= ctr %> time;
+}
+
+external o<%=ctr%>;
+o<%=ctr%> = sleep<%=ctr%>(t);
+
+<%   ctr += 1
+   end %>
+
+]
+
+swift_tc = %q[
+PADS  sleep_pads     /bin/sleep      INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+<% ctr = 0
+   sites.keys.sort.each 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 %>
+<%=name%>  worker<%= ctr %> <%=app_dir%>/worker.pl      INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+<%=name%>  sleep<%= ctr %>  /bin/sleep                  INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+<%=name%>  sleep            /bin/sleep                  INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+<%   ctr += 1
+   end %>
+]
+
+condor_sites = %q[
+<config>
+<% sites.keys.sort.each 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 %>
+
+  <pool handle="<%=name%>">
+    <execution provider="condor" url="none"/>
+
+    <profile namespace="globus" key="jobType">grid</profile>
+    <profile namespace="globus" key="gridResource">gt2 <%=url%>/jobmanager-<%=jm%></profile>
+
+    <profile namespace="karajan" key="initialScore">20.0</profile>
+    <profile namespace="karajan" key="jobThrottle"><%=throttle%></profile>
+    <% if name =~ /FNAL_FERMIGRID/ %>
+      <profile namespace="globus" key="condor_requirements">GlueHostOperatingSystemRelease =?= "5.3" && GlueSubClusterName =!= GlueClusterName</profile>
+    <% end %>
+
+    <gridftp  url="gsiftp://<%=url%>"/>
+    <workdirectory><%=data_dir%>/swift_scratch</workdirectory>
+  </pool>
+<% end %>
+</config>
+]
+
+# GT2 for installing the workers
+gt2_sites = %q[
+<config>
+<% sites.keys.sort.each 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 %>
+
+  <pool handle="<%=name%>">
+    <jobmanager universe="vanilla" url="<%=url%>/jobmanager-fork" major="2" />
+
+    <gridftp  url="gsiftp://<%=url%>"/>
+    <workdirectory><%= data_dir %>/swift_scratch</workdirectory>
+    <appdirectory><%= app_dir %></appdirectory>
+  </pool>
+<% end %>
+</config>
+]
+
+coaster_sites = %q[
+<config>
+  <pool handle="PADS">
+    <execution provider="coaster-persistent" url="https://communicado.ci.uchicago.edu:<%= coaster_service - 1 %>"
+        jobmanager="local:local" />
+
+    <profile namespace="globus" key="workerManager">passive</profile>
+
+    <profile namespace="karajan" key="initialScore">10000.0</profile>
+    <profile namespace="karajan" key="jobThrottle">3.66</profile>
+
+    <profile namespace="globus" key="lowOverallocation">36</profile>
+
+    <gridftp  url="local://localhost"/>
+    <workdirectory>/gpfs/pads/swift/aespinosa/swift-runs</workdirectory>
+  </pool>
+<% ctr = 0
+   sites.keys.sort.each 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
+     total    = sites[name].total %>
+
+  <pool handle="<%=name%>">
+    <execution provider="coaster-persistent" url="https://communicado.ci.uchicago.edu:<%= coaster_service + ctr %>"
+        jobmanager="local:local" />
+
+    <profile namespace="globus" key="workerManager">passive</profile>
+
+    <profile namespace="karajan" key="initialScore">20.0</profile>
+    <!-- CPUs: <%= total %> -->
+    <profile namespace="karajan" key="jobThrottle"><%=throttle%></profile>
+
+    <profile namespace="globus" key="lowOverallocation">36</profile>
+
+    <gridftp  url="gsiftp://<%=url%>"/>
+    <!--<workdirectory><%=data_dir%>/swift_scratch</workdirectory>-->
+    <workdirectory>/var/tmp/swift_scratch</workdirectory>
+  </pool>
+<%   ctr += 1
+   end %>
+</config>
+]
+
+def ress_query(class_ads)
+  cmd = "condor_status -pool engage-central.renci.org"
+  class_ads[0..-2].each do |class_ad|
+    cmd << " -format \"%s|\" #{class_ad}"
+  end
+  cmd << " -format \"%s\\n\" #{class_ads[-1]}"
+  `#{cmd}`
+end
+
+def ress_parse(app_name)
+  dir_suffix = "/engage/#{app_name}"
+  class_ads  = [
+    "GlueSiteUniqueID", "GlueCEInfoHostName", "GlueCEInfoJobManager",
+    "GlueCEInfoGatekeeperPort", "GlueCEInfoApplicationDir", "GlueCEInfoDataDir",
+    "GlueCEInfoTotalCPUs"
+  ]
+  ress_query(class_ads).each_line do |line|
+    line.chomp!
+    next if line == ""
+    set = line.split("|")
+
+    value = OpenStruct.new
+
+    value.jm       = set[class_ads.index("GlueCEInfoJobManager")]
+    value.url      = set[class_ads.index("GlueCEInfoHostName")]
+    value.total    = set[class_ads.index("GlueCEInfoTotalCPUs")].to_i
+    next if value.total == 999999
+    value.throttle = (value.total.to_f - 2.0) / 100.0
+    name           = set[class_ads.index("GlueSiteUniqueID")] + "__" +  value.url
+    value.name     = set[class_ads.index("GlueSiteUniqueID")]
+
+    value.app_dir = set[class_ads.index("GlueCEInfoApplicationDir")]
+    value.app_dir.sub!(/\/$/, "")
+    value.data_dir = set[class_ads.index("GlueCEInfoDataDir")]
+    value.data_dir.sub!(/\/$/, "")
+
+    value.app_dir += dir_suffix
+    value.data_dir += dir_suffix
+
+    # Hard-wired exceptions
+    value.app_dir  = "/osg/app/engage/#{app_name}"                     if name =~ /GridUNESP_CENTRAL/
+    value.data_dir = "/osg/data/engage/#{app_name}"                    if name =~ /GridUNESP_CENTRAL/
+    value.app_dir.sub!(dir_suffix, "/engage-#{app_name}")  if name =~ /BNL-ATLAS/
+    value.data_dir.sub!(dir_suffix, "/engage-#{app_name}") if name =~ /BNL-ATLAS/
+
+    yield name, value
+  end
+end
+
+if __FILE__ == $0 then
+  raise "No whitelist file" if !ARGV[0]
+
+  # Blacklist of non-working sites
+  blacklist = []
+  ARGV[1]   = "scec" if !ARGV[1]
+  whitelist = IO.readlines(ARGV[0]).map { |line| line.chomp! }
+
+  # Removes duplicate site entries (i.e. multilpe GRAM endpoints)
+  sites = {}
+  ress_parse(ARGV[1]) do |name, value|
+    next if blacklist.index(name) and not blacklist.empty?
+    next if not whitelist.index(name) and not whitelist.empty?
+    sites[name] = value if sites[name] == nil
+  end
+
+  condor_out = File.open("condor_osg.xml", "w")
+  gt2_out = File.open("gt2_osg.xml", "w")
+  coaster_out = File.open("coaster_osg.xml", "w")
+
+  tc_out     = File.open("tc.data", "w")
+  workflow_out = File.open("worker.swift", "w")
+  slave_out = File.open("slave.swift", "w")
+
+  condor = ERB.new(condor_sites, 0, "%<>")
+  gt2 = ERB.new(gt2_sites, 0, "%<>")
+  coaster = ERB.new(coaster_sites, 0, "%<>")
+
+  tc     = ERB.new(swift_tc, 0, "%<>")
+  workflow = ERB.new(swift_workflow, 0, "%<>")
+  slave = ERB.new(slave_workflow, 0, "%<>")
+
+  condor_out.puts condor.result(binding)
+  gt2_out.puts gt2.result(binding)
+  coaster_out.puts coaster.result(binding)
+
+  tc_out.puts tc.result(binding)
+  workflow_out.puts workflow.result(binding)
+  slave_out.puts slave.result(binding)
+
+  condor_out.close
+  gt2_out.close
+  coaster_out.close
+
+  tc_out.close
+  workflow_out.close
+  slave_out.close
+end


Property changes on: SwiftApps/Cybershake/app/mk_catalog_coasters.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/offset.rb
===================================================================
--- SwiftApps/Cybershake/app/offset.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/offset.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,9 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+size = ARGV[0].to_i
+group_size = ARGV[1].to_i # 60
+puts "off size"
+for offset in  0..(size / group_size) 
+  laki = [size - offset * group_size, group_size].min
+  puts "#{offset * group_size} #{laki}"
+end


Property changes on: SwiftApps/Cybershake/app/offset.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/app/variation_mapper.rb
===================================================================
--- SwiftApps/Cybershake/app/variation_mapper.rb	                        (rev 0)
+++ SwiftApps/Cybershake/app/variation_mapper.rb	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,34 @@
+#!/home/ketan/ruby-install/bin/ruby
+
+$: << "/scratch/local/ketan/cybershake"
+require 'cybershake'
+require 'optparse'
+require 'memcached'
+require 'digest/md5'
+
+options = {}
+OptionParser.new do |opts|
+  opts.on("-e", "-erf") { |v| options[:erf] = v.to_i}
+  opts.on("-v", "-var_scen") { |v| options[:variation_scenario] = v.to_i}
+  opts.on("-s", "-source") { |v| options[:source] = v.to_i}
+  opts.on("-r", "-rupture") { |v| options[:rupture] = v.to_i}
+  opts.on("-l", "-location") { |v| options[:location] = v }
+end.parse!
+
+cache = Memcached.new
+digest = Digest::MD5.hexdigest(options.to_s).to_s
+
+begin
+  variations = cache.get(digest)
+rescue Memcached::NotFound
+  variations = Variation.find(:all, :conditions => {
+      :Rup_Var_Scenario_ID => options[:variation_scenario],
+      :ERF_ID => options[:erf], 
+      :Source_ID => options[:source], :Rupture_ID => options[:rupture] },
+      :order => "Rup_Var_ID")
+  cache.set(digest, variations)
+end
+location = options[:location]
+variations.each do |var|
+  puts  "#{location}/#{options[:source]}/#{options[:rupture]}/#{var.Rup_Var_LFN.sub(/e35_rv3_/,'')}"
+end


Property changes on: SwiftApps/Cybershake/app/variation_mapper.rb
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/Cybershake/etc/cf
===================================================================
--- SwiftApps/Cybershake/etc/cf	                        (rev 0)
+++ SwiftApps/Cybershake/etc/cf	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,14 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=1
+lazy.errors=false
+#status.mode=provider
+status.mode=file
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+#clustering.enabled=false
+#clustering.queue.delay=10
+#clustering.min.time=86400
+foreach.max.threads=100
+provenance.log=false
+

Added: SwiftApps/Cybershake/etc/cf.gridftp
===================================================================
--- SwiftApps/Cybershake/etc/cf.gridftp	                        (rev 0)
+++ SwiftApps/Cybershake/etc/cf.gridftp	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,11 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=5
+lazy.errors=true
+status.mode=file
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+foreach.max.threads=200
+replication.enabled=true
+replication.min.queue.time=7200
+replication.limit=8

Added: SwiftApps/Cybershake/etc/cf.ps
===================================================================
--- SwiftApps/Cybershake/etc/cf.ps	                        (rev 0)
+++ SwiftApps/Cybershake/etc/cf.ps	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,8 @@
+wrapperlog.always.transfer=false
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+foreach.max.threads=40

Added: SwiftApps/Cybershake/etc/fs.data
===================================================================
--- SwiftApps/Cybershake/etc/fs.data	                        (rev 0)
+++ SwiftApps/Cybershake/etc/fs.data	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,7 @@
+rule .*TEST_f[x|y]_644.sgt DIRECT /
+#rule TEST_fx_644.sgt DIRECT /
+#rule TEST_fy_644.sgt DIRECT /
+rule .*LGU_f[x|y]_664.sgt DIRECT /
+#rule .*LGU.*subf[x|y].sgt DIRECT /
+#rule .*[0-9]+/[0-9]+/.*.txt.variation.* DIRECT /
+#rule .* DEFAULT

Added: SwiftApps/Cybershake/etc/sites-ranger.xml
===================================================================
--- SwiftApps/Cybershake/etc/sites-ranger.xml	                        (rev 0)
+++ SwiftApps/Cybershake/etc/sites-ranger.xml	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,21 @@
+<config>
+   <pool handle="RANGER">
+      <execution provider="coaster-persistent" url="http://localhost:50000" jobmanager="local:local"/>
+      <profile namespace="globus" key="workerManager">passive</profile>
+      <profile namespace="globus" key="jobsPerNode">16</profile>
+      <profile key="jobThrottle" namespace="karajan">1.27</profile>
+      <profile namespace="karajan" key="initialScore">10000</profile>
+      <!-- <filesystem provider="local" url="none" /> -->
+      <filesystem provider="gsiftp" url="gsiftp://gridftp.ranger.tacc.teragrid.org"/>
+      <profile namespace="swift" key="stagingMethod">proxy</profile>
+      <workdirectory>/tmp/ketan</workdirectory>
+    </pool>
+
+     <pool handle="localhost">
+     <filesystem provider="local" />
+     <execution provider="local" />
+     <workdirectory >/var/tmp</workdirectory>
+     <profile namespace="karajan" key="jobThrottle">0.20</profile>
+ </pool> 
+
+</config>

Added: SwiftApps/Cybershake/etc/sites.grid-ps.xml
===================================================================
--- SwiftApps/Cybershake/etc/sites.grid-ps.xml	                        (rev 0)
+++ SwiftApps/Cybershake/etc/sites.grid-ps.xml	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,36 @@
+  <config>
+  <!--  <pool handle="grid">
+      <execution provider="coaster-persistent" url="http://localhost:50000" jobmanager="local:local"/>
+      <profile namespace="globus" key="workerManager">passive</profile>
+      <profile namespace="globus" key="jobsPerNode">1</profile>
+      <profile key="jobThrottle" namespace="karajan">.04</profile>
+      <profile namespace="karajan" key="initialScore">10000</profile>
+      <profile namespace="swift" key="stagingMethod">proxy</profile>
+      <profile namespace="globus" key="workerLoggingLevel">DEBUG</profile>
+      <workdirectory>/tmp/ketan</workdirectory>
+    </pool> -->
+
+    <pool handle="mcs">
+      <execution provider="coaster-persistent" url="http://localhost:50000" jobmanager="local:local"/>
+      <profile namespace="globus" key="workerManager">passive</profile>
+      <profile namespace="globus" key="jobsPerNode">4</profile>
+      <profile key="jobThrottle" namespace="karajan">1.99</profile>
+      <profile namespace="karajan" key="initialScore">10000</profile>
+      <!-- <filesystem provider="local" url="none" /> -->
+      <profile namespace="swift" key="stagingMethod">proxy</profile>
+      <profile namespace="globus" key="workerLoggingLevel">DEBUG</profile>
+      <workdirectory>/home/ketan/swift.workdir</workdirectory>
+    </pool>
+    
+   <pool handle="localhost">
+      <execution provider="coaster-persistent" url="http://localhost:1984" jobmanager="local:local"/>
+      <profile namespace="globus" key="workerManager">passive</profile>
+      <profile namespace="globus" key="jobsPerNode">1</profile>
+      <profile key="jobThrottle" namespace="karajan">.08</profile>
+      <profile namespace="karajan" key="initialScore">10000</profile>
+      <filesystem provider="local" url="none" />
+      <profile namespace="globus" key="workerLoggingLevel">DEBUG</profile>
+      <profile namespace="swift" key="stagingMethod">proxy</profile>
+      <workdirectory>/scratch/local/ketan/swift.workdir</workdirectory>
+    </pool>
+  </config>

Added: SwiftApps/Cybershake/etc/sites.xml
===================================================================
--- SwiftApps/Cybershake/etc/sites.xml	                        (rev 0)
+++ SwiftApps/Cybershake/etc/sites.xml	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,8 @@
+<config>
+<pool handle="localhost">
+    <filesystem provider="local" />
+    <execution provider="local" />
+    <workdirectory >/scratch/local/ketan/swift.workdir</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">0.09</profile>
+</pool>
+</config>

Added: SwiftApps/Cybershake/etc/tc-fix.data
===================================================================
--- SwiftApps/Cybershake/etc/tc-fix.data	                        (rev 0)
+++ SwiftApps/Cybershake/etc/tc-fix.data	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,126 @@
+# Utility apps
+localhost getsite          /home/aespinosa/workflows/cybershake/getsite.rb          INSTALLED INTEL32::LINUX null
+localhost getrupture       /home/aespinosa/workflows/cybershake/getrupture.rb       INSTALLED INTEL32::LINUX null
+localhost variation_mapper /home/aespinosa/workflows/cybershake/variation_mapper.rb INSTALLED INTEL32::LINUX null
+localhost mkoffset         /home/aespinosa/workflows/cybershake/offset.rb           INSTALLED INTEL32::LINUX null
+#localhost extract  /home/ketan/osg-tg-effort/cybershake/apps/JBSim3d/bin/jbsim3d    INSTALLED INTEL32::LINUX null
+#localhost seispeak_local   /home/ketan/osg-tg-effort/cybershake/seispeak.sh                       INSTALLED INTEL32::LINUX null
+
+RANGER     extract   /share/home/01035/tg802895/science/cybershake/pp/JBSim3d/bin/jbsim3d    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:15:00"
+RANGER     seispeak_local   /work/01739/ketan/scec/seispeak.sh                       INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:30:00"
+#RANGER     mkoffset         /work/01739/ketan/scec/offset.rb                         INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+#RANGER     variation_mapper /work/01739/ketan/scec/variation_mapper.rb  INSTALLED INTEL32::LINUX null
+#RANGER     getsite          /work/01739/ketan/scec/getsite.rb          INSTALLED INTEL32::LINUX null
+#RANGER     getrupture       /work/01739/ketan/scec/getrupture.rb       INSTALLED INTEL32::LINUX null
+
+
+AGLT2__gate02.grid.umich.edu seismogram       /atlas/data08/OSG/APP/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+AGLT2__gate02.grid.umich.edu surfeis_rspectra /atlas/data08/OSG/APP/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+AGLT2__gate02.grid.umich.edu seispeak         /atlas/data08/OSG/APP/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+AGLT2__gate02.grid.umich.edu seispeak_agg     /atlas/data08/OSG/APP/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Clemson-Palmetto__osg-gw.clemson.edu seismogram       /common1/osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Clemson-Palmetto__osg-gw.clemson.edu surfeis_rspectra /common1/osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Clemson-Palmetto__osg-gw.clemson.edu seispeak         /common1/osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Clemson-Palmetto__osg-gw.clemson.edu seispeak_agg     /common1/osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seismogram       /grid/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov surfeis_rspectra /grid/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seispeak         /grid/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seispeak_agg     /grid/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Firefly__ff-grid.unl.edu seismogram       /panfs/panasas/CMS/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Firefly__ff-grid.unl.edu surfeis_rspectra /panfs/panasas/CMS/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Firefly__ff-grid.unl.edu seispeak         /panfs/panasas/CMS/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Firefly__ff-grid.unl.edu seispeak_agg     /panfs/panasas/CMS/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Firefly__ff-grid3.unl.edu seismogram       /panfs/panasas/CMS/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Firefly__ff-grid3.unl.edu surfeis_rspectra /panfs/panasas/CMS/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Firefly__ff-grid3.unl.edu seispeak         /panfs/panasas/CMS/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Firefly__ff-grid3.unl.edu seispeak_agg     /panfs/panasas/CMS/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+GridUNESP_CENTRAL__ce.grid.unesp.br seismogram       /osg/app/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br surfeis_rspectra /osg/app/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br seispeak         /osg/app/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br seispeak_agg     /osg/app/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+GridUNESP_SPO__ce.spo.grid.unesp.br seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seismogram       /opt/osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu surfeis_rspectra /opt/osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seispeak         /opt/osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seispeak_agg     /opt/osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+MIT_CMS__ce02.cmsaf.mit.edu seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MIT_CMS__ce02.cmsaf.mit.edu surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MIT_CMS__ce02.cmsaf.mit.edu seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+MIT_CMS__ce02.cmsaf.mit.edu seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+MWT2_UC__uct2-grid6.uchicago.edu seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2_UC__uct2-grid6.uchicago.edu surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2_UC__uct2-grid6.uchicago.edu seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+MWT2_UC__uct2-grid6.uchicago.edu seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+MWT2__osg-gk.mwt2.org seismogram       /osg/mwt2/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2__osg-gk.mwt2.org surfeis_rspectra /osg/mwt2/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2__osg-gk.mwt2.org seispeak         /osg/mwt2/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+MWT2__osg-gk.mwt2.org seispeak_agg     /osg/mwt2/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seismogram       /home/gridapp/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu surfeis_rspectra /home/gridapp/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seispeak         /home/gridapp/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seispeak_agg     /home/gridapp/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Purdue-RCAC__osg.rcac.purdue.edu seismogram       /apps/osg/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-RCAC__osg.rcac.purdue.edu surfeis_rspectra /apps/osg/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-RCAC__osg.rcac.purdue.edu seispeak         /apps/osg/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Purdue-RCAC__osg.rcac.purdue.edu seispeak_agg     /apps/osg/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seismogram       /apps/osg/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu surfeis_rspectra /apps/osg/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seispeak         /apps/osg/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seispeak_agg     /apps/osg/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Purdue-Steele__lepton.rcac.purdue.edu seismogram       /apps/osg/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Steele__lepton.rcac.purdue.edu surfeis_rspectra /apps/osg/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Steele__lepton.rcac.purdue.edu seispeak         /apps/osg/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Purdue-Steele__lepton.rcac.purdue.edu seispeak_agg     /apps/osg/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+RENCI-Engagement__belhaven-1.renci.org seismogram       /nfs/osg-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RENCI-Engagement__belhaven-1.renci.org surfeis_rspectra /nfs/osg-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RENCI-Engagement__belhaven-1.renci.org seispeak         /nfs/osg-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+RENCI-Engagement__belhaven-1.renci.org seispeak_agg     /nfs/osg-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+SPRACE__osg-ce.sprace.org.br seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+SPRACE__osg-ce.sprace.org.br surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+SPRACE__osg-ce.sprace.org.br seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+SPRACE__osg-ce.sprace.org.br seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+UCR-HEP__top.ucr.edu seismogram       /data/bottom/osg_app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UCR-HEP__top.ucr.edu surfeis_rspectra /data/bottom/osg_app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UCR-HEP__top.ucr.edu seispeak         /data/bottom/osg_app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+UCR-HEP__top.ucr.edu seispeak_agg     /data/bottom/osg_app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+UMissHEP__umiss001.hep.olemiss.edu seismogram       /osgremote/osg_app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UMissHEP__umiss001.hep.olemiss.edu surfeis_rspectra /osgremote/osg_app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UMissHEP__umiss001.hep.olemiss.edu seispeak         /osgremote/osg_app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+UMissHEP__umiss001.hep.olemiss.edu seispeak_agg     /osgremote/osg_app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+USCMS-FNAL-WC1__cmsosgce3.fnal.gov seismogram       /uscms_grid/osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+USCMS-FNAL-WC1__cmsosgce3.fnal.gov surfeis_rspectra /uscms_grid/osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+USCMS-FNAL-WC1__cmsosgce3.fnal.gov seispeak         /uscms_grid/osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+USCMS-FNAL-WC1__cmsosgce3.fnal.gov seispeak_agg     /uscms_grid/osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Vanderbilt__ce1.accre.vanderbilt.edu seismogram       /home/grid-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Vanderbilt__ce1.accre.vanderbilt.edu surfeis_rspectra /home/grid-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Vanderbilt__ce1.accre.vanderbilt.edu seispeak         /home/grid-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Vanderbilt__ce1.accre.vanderbilt.edu seispeak_agg     /home/grid-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+WQCG-Harvard-OSG__tuscany.med.harvard.edu seismogram       /osg/storage/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+WQCG-Harvard-OSG__tuscany.med.harvard.edu surfeis_rspectra /osg/storage/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+WQCG-Harvard-OSG__tuscany.med.harvard.edu seispeak         /osg/storage/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+WQCG-Harvard-OSG__tuscany.med.harvard.edu seispeak_agg     /osg/storage/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+

Added: SwiftApps/Cybershake/etc/tc-provider-staging
===================================================================
--- SwiftApps/Cybershake/etc/tc-provider-staging	                        (rev 0)
+++ SwiftApps/Cybershake/etc/tc-provider-staging	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,29 @@
+# Utility apps
+#
+#localhost cat /bin/cat null null null
+mcs cat /bin/cat null null null
+localhost getsite /scratch/local/ketan/cybershake/getsite.rb null null null
+localhost getrupture /scratch/local/ketan/cybershake/getrupture.rb null null null
+localhost variation_mapper /scratch/local/ketan/cybershake/variation_mapper.rb null null null
+localhost mkoffset /scratch/local/ketan/cybershake/offset.rb null null null
+localhost extract /scratch/local/ketan/cybershake/apps/JBSim3d/bin/jbsim3d null null null
+localhost seispeak_local /scratch/local/ketan/cybershake/seispeak.sh null null null
+
+#localhost getsite          /home/aespinosa/workflows/cybershake/getsite.rb          INSTALLED INTEL32::LINUX null
+#localhost getrupture       /home/aespinosa/workflows/cybershake/getrupture.rb       INSTALLED INTEL32::LINUX null
+#localhost variation_mapper /home/aespinosa/workflows/cybershake/variation_mapper.rb INSTALLED INTEL32::LINUX null
+#localhost mkoffset         /home/aespinosa/workflows/cybershake/offset.rb           INSTALLED INTEL32::LINUX null
+#localhost extract         /home/ketan/osg-tg-effort/cybershake/apps/JBSim3d/bin/jbsim3d    INSTALLED INTEL32::LINUX null
+#localhost seispeak_local  /home/ketan/osg-tg-effort/cybershake/seispeak.sh                       INSTALLED INTEL32::LINUX null
+
+grid seismogram       JBSim3d/bin/jbsim3d null null null
+grid surfeis_rspectra SpectralAcceleration/p2utils/surfseis_rspectra null null null
+grid seispeak         seispeak.sh null null null
+grid seispeak_agg     agg_seispeak.sh null null null
+
+
+mcs seismogram       /home/ketan/cybershake/post/JBSim3d/bin/jbsim3d null null null
+mcs surfeis_rspectra /home/ketan/cybershake/post/SpectralAcceleration/p2utils/surfseis_rspectra null null null
+mcs seispeak         /home/ketan/cybershake/post/seispeak.sh null null null
+mcs seispeak_agg     /home/ketan/cybershake/post/agg_seispeak.sh null null null
+

Added: SwiftApps/Cybershake/etc/tc-ranger.data
===================================================================
--- SwiftApps/Cybershake/etc/tc-ranger.data	                        (rev 0)
+++ SwiftApps/Cybershake/etc/tc-ranger.data	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,27 @@
+
+# Utility apps
+localhost getsite          /home/aespinosa/workflows/cybershake/getsite.rb          INSTALLED INTEL32::LINUX null
+localhost getrupture       /home/aespinosa/workflows/cybershake/getrupture.rb       INSTALLED INTEL32::LINUX null
+localhost variation_mapper /home/aespinosa/workflows/cybershake/variation_mapper.rb INSTALLED INTEL32::LINUX null
+localhost mkoffset         /home/aespinosa/workflows/cybershake/offset.rb           INSTALLED INTEL32::LINUX null
+
+# PADS
+#localhost      extract        /home/ketan/osg-tg-effort/cybershake/apps/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+#localhost    seispeak_local /home/aespinosa/Documents/cybershake/post/seispeak.sh            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+
+#jbsim3d on ranger /share/home/01035/tg802895/science/cybershake/pp/JBSim3d/bin/jbsim3d
+RANGER     extract   /share/home/01035/tg802895/science/cybershake/pp/JBSim3d/bin/jbsim3d    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RANGER     seispeak_local /work/01739/ketan/scec/seispeak.sh                       INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+
+RANGER     seismogram   /share/home/01035/tg802895/science/cybershake/pp/JBSim3d/bin/jbsim3d    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RANGER     seispeak  /work/01739/ketan/scec/seispeak.sh          INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+RANGER     surfeis_rspectra /share/home/01035/tg802895/science/cybershake/pp/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RANGER     seispeak_agg     /work/01739/ketan/scec/agg_seispeak.sh                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+
+#RANGER getsite          /work/01739/ketan/scec/getsite.rb          INSTALLED INTEL32::LINUX null
+#RANGER getrupture       /work/01739/ketan/scec/getrupture.rb       INSTALLED INTEL32::LINUX null
+#RANGER variation_mapper /work/01739/ketan/scec/variation_mapper.rb INSTALLED INTEL32::LINUX null
+#RANGER mkoffset         /work/01739/ketan/scec/offset.rb           INSTALLED INTEL32::LINUX null
+
+

Added: SwiftApps/Cybershake/etc/tc.data
===================================================================
--- SwiftApps/Cybershake/etc/tc.data	                        (rev 0)
+++ SwiftApps/Cybershake/etc/tc.data	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,93 @@
+localhost getsite /scratch/local/ketan/cybershake/getsite.rb
+localhost getrupture /scratch/local/ketan/cybershake/getrupture.rb
+localhost variation_mapper /scratch/local/ketan/cybershake/variation_mapper.rb
+localhost mkoffset /scratch/local/ketan/cybershake/offset.rb
+localhost extract /scratch/local/ketan/cybershake/apps/JBSim3d/bin/jbsim3d
+localhost seispeak_local /scratch/local/ketan/cybershake/seispeak.sh
+
+
+AGLT2__gate02.grid.umich.edu seismogram       /atlas/data08/OSG/APP/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+AGLT2__gate02.grid.umich.edu surfeis_rspectra /atlas/data08/OSG/APP/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+AGLT2__gate02.grid.umich.edu seispeak         /atlas/data08/OSG/APP/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+AGLT2__gate02.grid.umich.edu seispeak_agg     /atlas/data08/OSG/APP/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+CIT_CMS_T2__cit-gatekeeper.ultralight.org seismogram       /raid1/osg-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+CIT_CMS_T2__cit-gatekeeper.ultralight.org surfeis_rspectra /raid1/osg-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+CIT_CMS_T2__cit-gatekeeper.ultralight.org seispeak         /raid1/osg-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+CIT_CMS_T2__cit-gatekeeper.ultralight.org seispeak_agg     /raid1/osg-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+CIT_CMS_T2__cit-gatekeeper2.ultralight.org seismogram       /raid1/osg-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+CIT_CMS_T2__cit-gatekeeper2.ultralight.org surfeis_rspectra /raid1/osg-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+CIT_CMS_T2__cit-gatekeeper2.ultralight.org seispeak         /raid1/osg-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+CIT_CMS_T2__cit-gatekeeper2.ultralight.org seispeak_agg     /raid1/osg-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Clemson-Palmetto__osg-gw.clemson.edu seismogram       /common1/osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Clemson-Palmetto__osg-gw.clemson.edu surfeis_rspectra /common1/osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Clemson-Palmetto__osg-gw.clemson.edu seispeak         /common1/osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Clemson-Palmetto__osg-gw.clemson.edu seispeak_agg     /common1/osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seismogram       /grid/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov surfeis_rspectra /grid/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seispeak         /grid/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+FNAL_FERMIGRID__fermigridosg1.fnal.gov seispeak_agg     /grid/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+FNAL_GPGRID_1__fnpcosg1.fnal.gov seismogram       /grid/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_GPGRID_1__fnpcosg1.fnal.gov surfeis_rspectra /grid/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+FNAL_GPGRID_1__fnpcosg1.fnal.gov seispeak         /grid/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+FNAL_GPGRID_1__fnpcosg1.fnal.gov seispeak_agg     /grid/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+GridUNESP_CENTRAL__ce.grid.unesp.br seismogram       /osg/app/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br surfeis_rspectra /osg/app/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br seispeak         /osg/app/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+GridUNESP_CENTRAL__ce.grid.unesp.br seispeak_agg     /osg/app/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+GridUNESP_SPO__ce.spo.grid.unesp.br seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+GridUNESP_SPO__ce.spo.grid.unesp.br seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seismogram       /opt/osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu surfeis_rspectra /opt/osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seispeak         /opt/osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+LIGO_UWM_NEMO__osg-nemo-ce.phys.uwm.edu seispeak_agg     /opt/osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+MWT2_UC__uct2-grid6.uchicago.edu seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2_UC__uct2-grid6.uchicago.edu surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2_UC__uct2-grid6.uchicago.edu seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+MWT2_UC__uct2-grid6.uchicago.edu seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+MWT2__osg-gk.mwt2.org seismogram       /osg/mwt2/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2__osg-gk.mwt2.org surfeis_rspectra /osg/mwt2/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+MWT2__osg-gk.mwt2.org seispeak         /osg/mwt2/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+MWT2__osg-gk.mwt2.org seispeak_agg     /osg/mwt2/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seismogram       /home/gridapp/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu surfeis_rspectra /home/gridapp/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seispeak         /home/gridapp/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+OU_OSCER_ATLAS__grid1.oscer.ou.edu seispeak_agg     /home/gridapp/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seismogram       /apps/osg/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu surfeis_rspectra /apps/osg/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seispeak         /apps/osg/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Purdue-Rossmann__rossmann-osg.rcac.purdue.edu seispeak_agg     /apps/osg/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+RENCI-Engagement__belhaven-1.renci.org seismogram       /nfs/osg-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RENCI-Engagement__belhaven-1.renci.org surfeis_rspectra /nfs/osg-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+RENCI-Engagement__belhaven-1.renci.org seispeak         /nfs/osg-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+RENCI-Engagement__belhaven-1.renci.org seispeak_agg     /nfs/osg-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+SPRACE__osg-ce.sprace.org.br seismogram       /osg/app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+SPRACE__osg-ce.sprace.org.br surfeis_rspectra /osg/app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+SPRACE__osg-ce.sprace.org.br seispeak         /osg/app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+SPRACE__osg-ce.sprace.org.br seispeak_agg     /osg/app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+UMissHEP__umiss001.hep.olemiss.edu seismogram       /osgremote/osg_app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UMissHEP__umiss001.hep.olemiss.edu surfeis_rspectra /osgremote/osg_app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+UMissHEP__umiss001.hep.olemiss.edu seispeak         /osgremote/osg_app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+UMissHEP__umiss001.hep.olemiss.edu seispeak_agg     /osgremote/osg_app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+
+Vanderbilt__ce1.accre.vanderbilt.edu seismogram       /home/grid-app/engage/scec/JBSim3d/bin/jbsim3d                            INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Vanderbilt__ce1.accre.vanderbilt.edu surfeis_rspectra /home/grid-app/engage/scec/SpectralAcceleration/p2utils/surfseis_rspectra INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00"
+Vanderbilt__ce1.accre.vanderbilt.edu seispeak         /home/grid-app/engage/scec/seispeak.sh                                    INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:10:00"
+Vanderbilt__ce1.accre.vanderbilt.edu seispeak_agg     /home/grid-app/engage/scec/agg_seispeak.sh                                INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="04:00:00"
+

Added: SwiftApps/Cybershake/swiftscripts/postproc-gridftp.swift
===================================================================
--- SwiftApps/Cybershake/swiftscripts/postproc-gridftp.swift	                        (rev 0)
+++ SwiftApps/Cybershake/swiftscripts/postproc-gridftp.swift	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,254 @@
+/* == Type Declarations == */
+type SgtDim;
+type Variation;
+type Seismogram;
+type PeakValue;
+type StationFile;
+type RuptureFile;
+type VariationFile;
+type offset_file;
+
+type Station {
+    string name;
+    float lat;
+    float lon;
+    int erf;
+    int variation_scenario;
+}
+
+type Sgt {
+    SgtDim x;
+    SgtDim y;
+}
+
+type Rupture {
+    int source;
+    int index;
+    int size;
+}
+
+type offset {
+    int off;
+    int size;
+}
+
+/* == some constants used by the apps == */
+global int num_time_steps = 3000;
+global string spectra_period1 = "all";
+global float filter_highhz = 5.0;
+global float simulation_timeskip = 0.1;
+
+
+/* == app declarations == */
+app (Sgt _ext) extract(Sgt _sgt, Station _stat, Variation _var) {
+    extract @strcat("stat=", _stat.name) "extract_sgt=1"
+        @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+
+        @strcat("rupmodfile=", @filename(_var))
+        @strcat("sgt_xfile=", @filename(_sgt.x))
+        @strcat("sgt_yfile=", @filename(_sgt.y))
+        @strcat("extract_sgt_xfile=", @filename(_ext.x))
+        @strcat("extract_sgt_yfile=", @filename(_ext.y));
+}
+
+app (Seismogram _seis, PeakValue _peak)
+    seispeak(Sgt _sgt, Variation _var, Station _stat) {
+        seispeak
+            /* Args of seismogram synthesis     */
+            @strcat("stat=", _stat.name) "extract_sgt=0"
+            @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+            "outputBinary=1" "mergeOutput=1" @strcat("ntout=", num_time_steps)
+
+            @strcat("rupmodfile=", @filename(_var))
+            @strcat("sgt_xfile=", @filename(_sgt.x))
+            @strcat("sgt_yfile=", @filename(_sgt.y))
+            @strcat("seis_file=", @filename(_seis))
+
+            /* Args of peak ground acceleration */
+            "simulation_out_pointsX=2" "simulation_out_pointsY=1"
+            "surfseis_rspectra_seismogram_units=cmpersec"
+            "surfseis_rspectra_output_units=cmpersec2"
+            "surfseis_rspectra_output_type=aa"
+            "surfseis_rspectra_apply_byteswap=no"
+
+            @strcat("simulation_out_timesamples=", num_time_steps)
+            @strcat("simulation_out_timeskip=", simulation_timeskip)
+            @strcat("surfseis_rspectra_period=", spectra_period1)
+            @strcat(" surfseis_rspectra_apply_filter_highHZ=", filter_highhz)
+            @strcat("in=", @filename(_seis))
+            @strcat("out=", @filename(_peak));
+    }
+
+app (Seismogram _seis, PeakValue _peak)
+    seispeak_local(Sgt _sgt, Variation _var, Station _stat) {
+        seispeak_local
+            /* Args of seismogram synthesis     */
+            @strcat("stat=", _stat.name) "extract_sgt=0"
+            @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+            "outputBinary=1" "mergeOutput=1" @strcat("ntout=", num_time_steps)
+
+            @strcat("rupmodfile=", @filename(_var))
+            @strcat("sgt_xfile=", @filename(_sgt.x))
+            @strcat("sgt_yfile=", @filename(_sgt.y))
+            @strcat("seis_file=", @filename(_seis))
+
+            /* Args of peak ground acceleration */
+            "simulation_out_pointsX=2" "simulation_out_pointsY=1"
+            "surfseis_rspectra_seismogram_units=cmpersec"
+            "surfseis_rspectra_output_units=cmpersec2"
+            "surfseis_rspectra_output_type=aa"
+            "surfseis_rspectra_apply_byteswap=no"
+
+            @strcat("simulation_out_timesamples=", num_time_steps)
+            @strcat("simulation_out_timeskip=", simulation_timeskip)
+            @strcat("surfseis_rspectra_period=", spectra_period1)
+            @strcat(" surfseis_rspectra_apply_filter_highHZ=", filter_highhz)
+            @strcat("in=", @filename(_seis))
+            @strcat("out=", @filename(_peak));
+    }
+
+app (Seismogram _seis[], PeakValue _peak[])
+    seispeak_agg(Sgt _sgt, Variation _var[], Station _stat, int n) {
+        seispeak_agg
+            /* System args */
+            _stat.name _stat.lon _stat.lat num_time_steps
+            num_time_steps simulation_timeskip spectra_period1 filter_highhz
+
+            @filename(_sgt.x) @filename(_sgt.y)
+
+            n @filenames(_var) @filenames(_seis) @filenames(_peak);
+    }
+
+/* == Auxillary functions for the mappers == */
+
+app (StationFile _stat) getsite_file(int _run_id) {
+    getsite _run_id stdout=@filename(_stat);
+}
+
+(Station _stat) get_site(int _run_id) {
+    StationFile file<"/var/tmp/site_tmp">;
+    file = getsite_file(_run_id);
+    _stat = readData(file);
+}
+
+app (RuptureFile _rup) getrupture_file(int _run_id) {
+    getrupture _run_id stdout=@filename(_rup);
+}
+
+(Rupture _rup[]) get_ruptures(int _run_id, Station _site) {
+    RuptureFile file<single_file_mapper; file=@strcat(_site.name, "/rup_tmp")>;
+    file = getrupture_file(_run_id);
+    _rup = readData(file);
+}
+
+app (VariationFile _var) getvariation_file(Station _site, Rupture _rup,
+        string _loc) {
+    variation_mapper "-e" _site.erf "-v" _site.variation_scenario
+        "-l" _loc "-s" _rup.source "-r" _rup.index stdout=@_var;
+}
+
+(string _vars[]) get_variations(Station _site, Rupture _rup, string _loc){
+    string fname = @strcat(_rup.source, "_", _rup.index);
+    VariationFile file<single_file_mapper;
+    file=@strcat(_site.name, "/varlist/", _rup.source, "/", fname, ".txt")>;
+    file = getvariation_file(_site, _rup, _loc);
+    _vars = readData(file);
+}
+
+(offset _off[]) mkoffset(int _size, int _group_size) {
+    //offset_file file <single_file_mapper; file=@strcat("LGU/offset-",_size)>;
+    offset_file file <concurrent_mapper; file=@strcat("TEST/offset-",_size)>;
+    /*offset_file*/ file = mkoffset_file(_size, _group_size);
+    _off = readData(file);
+}
+
+app (offset_file _off) mkoffset_file(int _size, int _group_size) {
+    mkoffset _size _group_size stdout=@filename(_off);
+}
+
+/* TODO: data management zip jobs */
+
+/* Main program */
+int run_id = 644;
+int agg_size = 60;
+int loc_size = 20;
+string datadir =
+"gsiftp://gridftp.ranger.tacc.teragrid.org//work/01739/ketan/scec/Results";
+//"gsiftp://gridftp.pads.ci.uchicago.edu//gpfs/pads/swift/ketan/science/cybershake/Results";
+//"/gpfs/pads/swift/ketan/science/cybershake/Results";
+
+Station site = get_site(run_id);
+
+Sgt sgt_var <ext; exec="getsgtvar.rb", r=run_id, s=site.name,
+   // l="gsiftp://gridftp.pads.ci.uchicago.edu//gpfs/pads/swift/aespinosa/science/cybershake/SgtFiles">;
+    //l="/gpfs/pads/swift/aespinosa/science/cybershake/SgtFiles">;
+    l="gsiftp://gridftp.ranger.tacc.teragrid.org//work/01035/tg802895/science/cybershake/data/SgtFiles">;
+    
+    Rupture rups[] = get_ruptures(run_id, site);
+
+    foreach rup in rups {
+
+        string loc_sub = @strcat(datadir, "/", site.name, "/", rup.source, "/", rup.index);
+
+        Sgt sub <ext; exec="getsub.rb", l=loc_sub, n=site.name, s=rup.source, r=rup.index>;
+
+        string var_str[] = get_variations( site, rup,
+                //"gsiftp://gridftp.pads.ci.uchicago.edu//gpfs/pads/swift/aespinosa/science/cybershake/RuptureVariations" );
+                //"/gpfs/pads/swift/aespinosa/science/cybershake/RuptureVariations" );
+                "gsiftp://gridftp.ranger.tacc.teragrid.org//scratch/projects/tg/tera3d/CyberShake2007/ruptures/RuptureVariations_35_V2_3");
+
+        Variation vars[] <array_mapper; files=var_str>;
+
+        sub = extract(sgt_var, site, vars[rup.size-1]);
+
+        string seis_str[];
+        string peak_str[];
+        seis_str[-1] = "";
+        peak_str[-1] = "";
+
+        foreach var,i in vars {
+            seis_str[i] = @strcat(seis_str[i-1], loc_sub, "/Seismogram_", site.name,
+                    "_", rup.source, "_", rup.index, "_", i, ".grm, ");
+            peak_str[i] = @strcat(peak_str[i-1], loc_sub, "/PeakVals_", site.name, "_",
+                    rup.source, "_", rup.index, "_", i, ".bsa, ");
+        }
+
+        Seismogram seis[] <fixed_array_mapper; files=seis_str[rup.size-1]>;
+        PeakValue  peak[] <fixed_array_mapper; files=peak_str[rup.size-1]>;
+
+        if(rup.size <= loc_size) {
+            foreach var,i in vars {
+                (seis[i], peak[i]) = seispeak_local(sub, var, site);
+            }
+        } else {if(rup.size <= agg_size) {
+            (seis, peak) = seispeak_agg(sub, vars, site, rup.size);
+        } else {
+
+            offset offs[] = mkoffset(rup.size, agg_size);
+
+            foreach i in offs {
+                Variation  var_offset[];
+                string seis_str_off[];
+                string peak_str_off[];
+                seis_str_off[-1] = "";
+                peak_str_off[-1] = "";
+                foreach j in [i.off:i.off+i.size-1] {
+                    var_offset[j]  = vars[j];
+                    seis_str_off[j-i.off] = @strcat(seis_str_off[j-i.off-1], 
+                            loc_sub, "/Seismogram_", site.name, "_",
+                            rup.source, "_", rup.index, "_", j,
+                            ".grm, ");
+                    peak_str_off[j-i.off] = @strcat(peak_str_off[j-i.off-1],
+                            loc_sub, "/PeakVals_", site.name, "_",
+                            rup.source, "_", rup.index, "_", j,
+                            ".bsa, ");
+                } 
+                Seismogram seis_off[] <fixed_array_mapper; files=seis_str_off[i.size-1]>;
+                PeakValue  peak_off[] <fixed_array_mapper; files=peak_str_off[i.size-1]>;
+
+                (seis_off, peak_off) = seispeak_agg(sub,var_offset, site, i.size);
+            }
+        }
+        }
+    }
+

Added: SwiftApps/Cybershake/swiftscripts/postproc.invalidpath.swift
===================================================================
--- SwiftApps/Cybershake/swiftscripts/postproc.invalidpath.swift	                        (rev 0)
+++ SwiftApps/Cybershake/swiftscripts/postproc.invalidpath.swift	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,78 @@
+/* == Type Declarations == */
+type Variation;
+type StationFile;
+type RuptureFile;
+type VariationFile;
+
+type file;
+
+type Station {
+    string name;
+    float lat;
+    float lon;
+    int erf;
+    int variation_scenario;
+}
+
+type Rupture {
+    int source;
+    int index;
+    int size;
+}
+
+app (StationFile _stat) getsite_file(int _run_id) {
+    getsite _run_id stdout=@filename(_stat);
+}
+
+(Station _stat) get_site(int _run_id) {
+    StationFile file<"/var/tmp/site_tmp">;
+    file = getsite_file(_run_id);
+    _stat = readData(file);
+}
+
+app (RuptureFile _rup) getrupture_file(int _run_id) {
+    getrupture _run_id stdout=@filename(_rup);
+}
+
+(Rupture _rup[]) get_ruptures(int _run_id, Station _site) {
+    RuptureFile file<single_file_mapper; file=@strcat(_site.name, "/rup_tmp")>;
+    file = getrupture_file(_run_id);
+    _rup = readData(file);
+}
+
+app (VariationFile _var) getvariation_file(Station _site, Rupture _rup,
+        string _loc) {
+    variation_mapper "-e" _site.erf "-v" _site.variation_scenario
+        "-l" _loc "-s" _rup.source "-r" _rup.index stdout=@_var;
+}
+
+(string _vars[]) get_variations(Station _site, Rupture _rup, string _loc){
+    string fname = @strcat(_rup.source, "_", _rup.index);
+    VariationFile file<single_file_mapper;
+    file=@strcat(_site.name, "/varlist/", _rup.source, "/", fname, ".txt")>;
+    file = getvariation_file(_site, _rup, _loc);
+    _vars = readData(file);
+}
+
+app (file o) cat (Variation _var)
+{
+  cat @filename(_var) stdout=@o;
+}
+
+file outfile[]<simple_mapper; location="outdir", prefix="f.",suffix=".out">;
+
+
+/* Main program */
+int run_id = 644;
+
+Station site = get_site(run_id);
+
+Rupture rups[] = get_ruptures(run_id, site);
+
+foreach rup, rup_idx in rups {
+   string var_str[] = get_variations( site, rup, "/gpfs/pads/swift/aespinosa/science/cybershake/RuptureVariations" );
+    Variation vars[] <array_mapper; files=var_str>;
+   // trace(@filename(vars[rup.size-1]));
+    outfile[rup_idx] = cat(vars[rup.size-1]);            
+}
+

Added: SwiftApps/Cybershake/swiftscripts/postproc.swift
===================================================================
--- SwiftApps/Cybershake/swiftscripts/postproc.swift	                        (rev 0)
+++ SwiftApps/Cybershake/swiftscripts/postproc.swift	2012-02-17 23:01:59 UTC (rev 5648)
@@ -0,0 +1,247 @@
+/* == Type Declarations == */
+type SgtDim;
+type Variation;
+type Seismogram;
+type PeakValue;
+type StationFile;
+type RuptureFile;
+type VariationFile;
+type offset_file;
+
+type Station {
+    string name;
+    float lat;
+    float lon;
+    int erf;
+    int variation_scenario;
+}
+
+type Sgt {
+    SgtDim x;
+    SgtDim y;
+}
+
+type Rupture {
+    int source;
+    int index;
+    int size;
+}
+
+type offset {
+    int off;
+    int size;
+}
+
+/* == some constants used by the apps == */
+global int num_time_steps = 3000;
+global string spectra_period1 = "all";
+global float filter_highhz = 5.0;
+global float simulation_timeskip = 0.1;
+
+/* == app declarations == */
+app (Sgt _ext) extract(Sgt _sgt, Station _stat, Variation _var) {
+    extract @strcat("stat=", _stat.name) "extract_sgt=1"
+        @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+
+        @strcat("rupmodfile=", @filename(_var))
+        @strcat("sgt_xfile=", @filename(_sgt.x))
+        @strcat("sgt_yfile=", @filename(_sgt.y))
+        @strcat("extract_sgt_xfile=", @filename(_ext.x))
+        @strcat("extract_sgt_yfile=", @filename(_ext.y));
+}
+
+app (Seismogram _seis, PeakValue _peak)
+    seispeak(Sgt _sgt, Variation _var, Station _stat) {
+        seispeak
+            /* Args of seismogram synthesis     */
+            @strcat("stat=", _stat.name) "extract_sgt=0"
+            @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+            "outputBinary=1" "mergeOutput=1" @strcat("ntout=", num_time_steps)
+
+            @strcat("rupmodfile=", @filename(_var))
+            @strcat("sgt_xfile=", @filename(_sgt.x))
+            @strcat("sgt_yfile=", @filename(_sgt.y))
+            @strcat("seis_file=", @filename(_seis))
+
+            /* Args of peak ground acceleration */
+            "simulation_out_pointsX=2" "simulation_out_pointsY=1"
+            "surfseis_rspectra_seismogram_units=cmpersec"
+            "surfseis_rspectra_output_units=cmpersec2"
+            "surfseis_rspectra_output_type=aa"
+            "surfseis_rspectra_apply_byteswap=no"
+
+            @strcat("simulation_out_timesamples=", num_time_steps)
+            @strcat("simulation_out_timeskip=", simulation_timeskip)
+            @strcat("surfseis_rspectra_period=", spectra_period1)
+            @strcat(" surfseis_rspectra_apply_filter_highHZ=", filter_highhz)
+            @strcat("in=", @filename(_seis))
+            @strcat("out=", @filename(_peak));
+    }
+
+app (Seismogram _seis, PeakValue _peak)
+    seispeak_local(Sgt _sgt, Variation _var, Station _stat) {
+        seispeak_local
+            /* Args of seismogram synthesis     */
+            @strcat("stat=", _stat.name) "extract_sgt=0"
+            @strcat("slon=", _stat.lon) @strcat("slat=", _stat.lat)
+            "outputBinary=1" "mergeOutput=1" @strcat("ntout=", num_time_steps)
+
+            @strcat("rupmodfile=", @filename(_var))
+            @strcat("sgt_xfile=", @filename(_sgt.x))
+            @strcat("sgt_yfile=", @filename(_sgt.y))
+            @strcat("seis_file=", @filename(_seis))
+
+            /* Args of peak ground acceleration */
+            "simulation_out_pointsX=2" "simulation_out_pointsY=1"
+            "surfseis_rspectra_seismogram_units=cmpersec"
+            "surfseis_rspectra_output_units=cmpersec2"
+            "surfseis_rspectra_output_type=aa"
+            "surfseis_rspectra_apply_byteswap=no"
+
+            @strcat("simulation_out_timesamples=", num_time_steps)
+            @strcat("simulation_out_timeskip=", simulation_timeskip)
+            @strcat("surfseis_rspectra_period=", spectra_period1)
+            @strcat(" surfseis_rspectra_apply_filter_highHZ=", filter_highhz)
+            @strcat("in=", @filename(_seis))
+            @strcat("out=", @filename(_peak));
+    }
+
+app (Seismogram _seis[], PeakValue _peak[])
+    seispeak_agg(Sgt _sgt, Variation _var[], Station _stat, int n) {
+        // seispeak_agg(string sgtx, string sgty, Variation _var[], Station _stat, int n) {
+        seispeak_agg
+            /* System args */
+            _stat.name _stat.lon _stat.lat num_time_steps
+            num_time_steps simulation_timeskip spectra_period1 filter_highhz
+            @filename(_sgt.x) @filename(_sgt.y)
+            // sgtx sgty
+            n @filenames(_var) @filenames(_seis) @filenames(_peak);
+    }
+
+    /* == Auxillary functions for the mappers == */
+
+    app (StationFile _stat) getsite_file(int _run_id) {
+        getsite _run_id stdout=@filename(_stat);
+    }
+
+    (Station _stat) get_site(int _run_id) {
+        StationFile file<"/tmp/site_tmp">;
+        file = getsite_file(_run_id);
+        _stat = readData(file);
+    }
+
+    app (RuptureFile _rup) getrupture_file(int _run_id) {
+        getrupture _run_id stdout=@filename(_rup);
+    }
+
+    (Rupture _rup[]) get_ruptures(int _run_id, Station _site) {
+        RuptureFile file<single_file_mapper; file=@strcat(_site.name, "/rup_tmp")>;
+        file = getrupture_file(_run_id);
+        _rup = readData(file);
+    }
+
+    app (VariationFile _var) getvariation_file(Station _site, Rupture _rup,
+            string _loc) {
+        variation_mapper "-e" _site.erf "-v" _site.variation_scenario
+            "-l" _loc "-s" _rup.source "-r" _rup.index stdout=@_var;
+    }
+
+    (string _vars[]) get_variations(Station _site, Rupture _rup, string _loc){
+        string fname = @strcat(_rup.source, "_", _rup.index);
+        VariationFile file<single_file_mapper;
+        file=@strcat(_site.name, "/varlist/", _rup.source, "/", fname, ".txt")>;
+        file = getvariation_file(_site, _rup, _loc);
+        _vars = readData(file);
+    }
+
+    (offset _off[]) mkoffset(int _size, int _group_size) {
+        offset_file file <concurrent_mapper; file=@strcat("TEST/offset-",_size)>;
+        //offset_file file <concurrent_mapper; file=@strcat("LGU/offset-",_size)>;
+        /*offset_file*/ file = mkoffset_file(_size, _group_size);
+        _off = readData(file);
+    }
+
+    app (offset_file _off) mkoffset_file(int _size, int _group_size) {
+        mkoffset _size _group_size stdout=@filename(_off);
+    }
+
+    /* Main program */
+    int run_id = 644;
+    //int run_id = 664;
+    int agg_size = 60;
+    int loc_size = 20;
+    //string datadir = "/gpfs/pads/swift/ketan/science/cybershake/Results";
+    string datadir = "/scratch/local/ketan/cybershake/Results";
+
+    Station site = get_site(run_id);
+
+    Sgt sgt_var <ext; exec="getsgtvar.rb", r=run_id, s=site.name, l="/gpfs/pads/swift/aespinosa/science/cybershake/SgtFiles">;
+    //Sgt sgt_var <ext; exec="getsgtvar.rb", r=run_id, s=site.name, l="/home/ketan/cybershake/SgtFiles">;
+
+    Rupture rups[] = get_ruptures(run_id, site);
+
+    foreach rup, rup_idx in rups {
+        string loc_sub = @strcat(datadir, "/", site.name, "/", rup.source, "/", rup.index);
+
+        Sgt sub <ext; exec="getsub.rb", l=loc_sub, n=site.name, s=rup.source, r=rup.index>;
+
+        string var_str[] = get_variations(site, rup, "/gpfs/pads/swift/aespinosa/science/cybershake/RuptureVariations");
+
+        Variation vars[] <array_mapper; files=var_str>;
+
+        sub = extract(sgt_var, site, vars[rup.size-1]);
+ 
+        string seis_str[];
+        string peak_str[];
+        seis_str[-1] = "";
+        peak_str[-1] = "";
+
+        foreach var,i in vars {
+            seis_str[i] = @strcat(seis_str[i-1], loc_sub, "/Seismogram_", site.name,
+                    "_", rup.source, "_", rup.index, "_", i, ".grm, ");
+            peak_str[i] = @strcat(peak_str[i-1], loc_sub, "/PeakVals_", site.name, "_",
+                    rup.source, "_", rup.index, "_", i, ".bsa, ");
+        }
+
+        Seismogram seis[] <fixed_array_mapper; files=seis_str[rup.size-1]>;
+        PeakValue  peak[] <fixed_array_mapper; files=peak_str[rup.size-1]>;
+
+          if(rup.size <= loc_size) {
+              foreach var,i in vars {
+              (seis[i], peak[i]) = seispeak_local(sub, var, site);
+              }
+              } else {
+
+        if(rup.size <= agg_size) {
+            (seis, peak) = seispeak_agg(sub, vars, site, rup.size);
+        }
+
+        else {
+
+            offset offs[] = mkoffset(rup.size, agg_size);
+
+            foreach i in offs {
+                Variation  var_offset[];
+                string seis_str_off[];
+                string peak_str_off[];
+                seis_str_off[-1] = "";
+                peak_str_off[-1] = "";
+                foreach j in [i.off:i.off+i.size-1] {
+                    var_offset[j]  = vars[j];
+                    seis_str_off[j-i.off] = @strcat(seis_str_off[j-i.off-1], 
+                            loc_sub, "/Seismogram_", site.name, "_",
+                            rup.source, "_", rup.index, "_", j, ".grm, ");
+
+                    peak_str_off[j-i.off] = @strcat(peak_str_off[j-i.off-1],
+                            loc_sub, "/PeakVals_", site.name, "_",
+                            rup.source, "_", rup.index, "_", j, ".bsa, ");
+                } 
+                Seismogram seis_off[] <fixed_array_mapper; files=seis_str_off[i.size-1]>;
+                PeakValue  peak_off[] <fixed_array_mapper; files=peak_str_off[i.size-1]>;
+
+                (seis_off, peak_off) = seispeak_agg(sub,var_offset, site, i.size);
+            }
+        }
+    }
+    }
+




More information about the Swift-commit mailing list