spark-connector
aien-dev/spark-connector
Brought by drakestapleton
spark-connector / gates / celldrv.om
| 1 | note gates/celldrv.om -- test tool (never shipped): run the runner's own cell code (runner/30cell.om, |
| 2 | note r_check) on one job directory, as a job would. |
| 3 | note Composed: om2, om/tls sha2, runner/00base.om, runner/30cell.om, this unit. |
| 4 | note argv: job directory holding source.om and stdin. The compiler is <state>/bin/omc |
| 5 | note (state = $INTERPLANE_RUNNER_HOME). Prints "exit <outcome> binary <hex> stdout <hex>". |
| 6 | text cdusage "usage: celldrv JOBDIR\n" |
| 7 | text cdex "exit " |
| 8 | text cdbin " binary " |
| 9 | text cdout " stdout " |
| 10 | text cdfail "celldrv: a stage could not be started\n" |
| 11 | |
| 12 | fn main to int |
| 13 | p = new uchar 4096 0 |
| 14 | if ne argcnt 2 |
| 15 | r_say cdusage |
| 16 | ret 2 |
| 17 | end |
| 18 | if not r_home |
| 19 | ret 2 |
| 20 | end |
| 21 | n = argread 1 p 0 4000 |
| 22 | if le n 0 |
| 23 | ret 2 |
| 24 | end |
| 25 | for i ulong ulong n bound 4096 |
| 26 | put rjd i get p i |
| 27 | end |
| 28 | put rgv rjdl ulong n |
| 29 | if not r_check |
| 30 | r_say cdfail |
| 31 | ret 3 |
| 32 | end |
| 33 | r_say cdex |
| 34 | w = write 1 rjf rfexit get rgv rexl |
| 35 | r_say cdbin |
| 36 | w = write 1 rjf rfbin 64 |
| 37 | r_say cdout |
| 38 | w = write 1 rjf rfout 64 |
| 39 | r_say rtnl |
| 40 | ret 0 |
| 41 | end |