Changes between Version 18 and Version 19 of Software/eTutorialSupport
- Timestamp:
- Jun 28, 2016, 5:45:16 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Software/eTutorialSupport
v18 v19 124 124 === Scheduler utility script === 125 125 126 Retrieve the scheduler utility script with 127 128 {{{ 129 wget http://witestlab.poly.edu/repos/misc/omf 130 }}} 131 132 then make it executable 133 134 {{{ 135 chmod a+x omf 136 }}} 137 138 You may run it locally ({{{.omf}}}) or put it in {{{/usr/local/bin}}} or similar location. 139 126 140 === Enabling/disabling "scheduled" experiments === 127 141 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:142 The 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: 129 143 130 144 {{{ … … 151 165 {{{ 152 166 defProperty('prefix', '', "Prefix for HRN") 153 defProperty('suffix', '.grid.orbit-lab.org', "Suffix for HRN") 167 defProperty('suffix', '.grid.orbit-lab.org', "Suffix for HRN")another 154 168 defProperty('node', 'node3-19', "ID of sender node, will be passed by job scheduler") 155 169 … … 160 174 }}} 161 175 176 To report status to the dashboard, the OMF experiment script should define an {{{EXP_SUCCESS}}} event. For example: 177 178 {{{ 179 require '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 :( 182 defEvent(: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 194 end 195 196 onEvent(:EXP_SUCCESS) do |event| 197 info "Experiment success (measured ten incoming UDP packets)" 198 end 199 }}} 162 200 163 201