Changes between Version 18 and Version 19 of Software/eTutorialSupport


Ignore:
Timestamp:
06/28/16 13:45:16 (18 months ago)
Author:
ffund01
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Software/eTutorialSupport

    v18 v19  
    124124=== Scheduler utility script === 
    125125 
     126Retrieve the scheduler utility script with 
     127 
     128{{{ 
     129wget http://witestlab.poly.edu/repos/misc/omf 
     130}}} 
     131 
     132then make it executable 
     133 
     134{{{ 
     135chmod a+x omf 
     136}}} 
     137 
     138You may run it locally ({{{.omf}}}) or put it in {{{/usr/local/bin}}} or similar location. 
     139 
    126140=== Enabling/disabling "scheduled" experiments === 
    127141 
    128 The easiest way to turn the scheduler on and off is to put the scheduler utility script in {{{/usr/local/bin/omf}}}. When you want it to be turned on, make it executable: 
     142The easiest way to turn the scheduler on and off is to put the scheduler utility script in {{{/usr/local/bin/omf}}} (assuming the "real" {{{omf}}} is in {{{/usr/bin}}}). When you want it to be turned on, make it executable: 
    129143 
    130144{{{ 
     
    151165{{{ 
    152166defProperty('prefix', '', "Prefix for HRN") 
    153 defProperty('suffix', '.grid.orbit-lab.org', "Suffix for HRN") 
     167defProperty('suffix', '.grid.orbit-lab.org', "Suffix for HRN")another 
    154168defProperty('node', 'node3-19', "ID of sender node, will be passed by job scheduler") 
    155169 
     
    160174}}} 
    161175 
     176To report status to the dashboard, the OMF experiment script should define an {{{EXP_SUCCESS}}} event. For example: 
     177 
     178{{{ 
     179require 'sqlite3'  
     180# OMF 5.4.1+ no longer has the 'ms' to access experiment data so we need to use 
     181# this workaround, which is not so nice because of database locking :( 
     182defEvent(:EXP_SUCCESS, 5) do |event| 
     183  sq3Filename= "/var/lib/oml2/#{Experiment.ID}.sq3"  
     184  if File.file?(sq3Filename) 
     185    db = SQLite3::Database.new(sq3Filename) 
     186    begin 
     187      if db.get_first_value( "SELECT COUNT(seq_no) FROM otr2_udp_in;" ).to_i > 10 
     188        event.fire(:comment=>"Received at least 10 measurements",:node=>"#{property.node.value}") 
     189      end 
     190    rescue 
     191      # Do nothing in case database is locked or table doesn't exist yet 
     192    end 
     193  end 
     194end 
     195 
     196onEvent(:EXP_SUCCESS) do |event| 
     197  info "Experiment success (measured ten incoming UDP packets)" 
     198end 
     199}}}  
    162200 
    163201