[BACK]Return to ox.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Doc

Annotation of OpenXM/src/kan96xx/Doc/ox.sm1, Revision 1.2

1.2     ! takayama    1: %%%%%%%%%%%  $OpenXM$
1.1       maekawa     2: %%%%%%%%%%%% Configuration: Specify your server path
                      3: %%%%% ox, ox_sm1, oxlog are contained in kxx.tgz
                      4: %%%%% These should be under /usr/local/lib/sm1 or LOAD_SM1_PATH
                      5: /oxpath.ox (bin/ox) def
                      6: /oxpath.oxsm1 (bin/ox_sm1) def
                      7: /oxpath.oxlog (bin/oxlog) def
                      8: /oxpath.xterm (/usr/X11R6/bin/xterm  -icon  -e ) def
                      9: /oxpath.null  (  ) def
                     10: /oxpath.null00  ( >& /dev/null ) def   %% cf oxNoX
1.2     ! takayama   11: %%%%%%%%%%%%%  The following is used only for sm1connectr-ssh.
        !            12: %%%%%%%%%%%%%  Configure path for ox and ox_sm1 on your remote machine.
        !            13: /oxpath.oxlog.xterm-ssh (/home/taka/OpenXM/bin/oxlog /usr/X11R6/bin/xterm -icon -e ) def
        !            14: /oxpath.oxsm1-ssh (/home/taka/OpenXM/bin/ox_sm1) def
        !            15: /oxpath.ox-ssh    (/home/taka/OpenXM/bin/ox) def
        !            16: /myhostname-ssh   (yama.math.kobe-u.ac.jp) def
        !            17: %% for debugging.
        !            18: %/oxpath.oxlog.xterm-ssh ( ) def
        !            19: %/oxpath.oxsm1-ssh (/home/nobuki/OpenXM/bin/ox_sm1) def
        !            20: %/oxpath.ox-ssh    (/home/nobuki/OpenXM/bin/ox) def
        !            21: %/myhostname-ssh   (localhost) def
1.1       maekawa    22: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     23: %% Old full path.
                     24: %/oxpath.ox (/home/nobuki/kxx/ox) def
                     25: %/oxpath.oxsm1 (/home/nobuki/kxx/ox_sm1) def
                     26: %/oxpath.oxlog (/home/nobuki/kxx/oxlog) def
                     27: %/oxpath.xterm (/usr/X11R6/bin/xterm  -icon  -e ) def
                     28:
                     29: %% This macro is invoked when this package is loaded.
                     30: /initializePathNamesForOx  {
                     31:    [oxpath.ox] getPathNameSm1 /oxpath.ox set
                     32:    [oxpath.oxsm1] getPathNameSm1 /oxpath.oxsm1 set
                     33:    [oxpath.oxlog] getPathNameSm1 /oxpath.oxlog set
                     34:    /oxpath.oxlog.xterm [oxpath.oxlog ( ) oxpath.xterm] cat def
                     35: } def
                     36:
                     37: %% Execute this macro, then xterm will not be executed and the output
                     38: %% will be redirected to /dev/null.
                     39: /oxNoX {
                     40:    /oxpath.null oxpath.null00 def
                     41:    /oxpath.oxlog.xterm [oxpath.oxlog ( )] cat def
                     42:    (oxpath.oxlog.xterm is set to ) messagen
                     43:    oxpath.oxlog.xterm message
                     44: } def
                     45:
                     46: /ox.ccc.init { ox.ccc ( [(oxPrintMessage) 0] extension pop ) oxsubmit } def
                     47:
                     48: /ox.verbose 0   def
                     49: /ox.version (2.981105) def
                     50: ox.version [(Version)] system_variable gt
                     51: { (This package requires the latest version of kan/sm1) message
                     52:   (Please get it from http://www.math.kobe-u.ac.jp/KAN) message
                     53:   error
                     54: } { } ifelse
                     55: (ox.sm1, --- open sm1 protocol module 10/1,1999  (C) N.Takayama. oxhelp for help) message-quiet
                     56:
                     57: /ox.ccc load isArray
                     58: { }
                     59: { /ox.ccc [ ] def } ifelse
                     60:
                     61:
                     62:
                     63: /ox.logsize 10 def
                     64: /ox.log [1 1 ox.logsize {pop 0} for ] def
                     65: /ox.mod { dup ox.logsize idiv ox.logsize mul sub } def
                     66: /ox.takelog 1 def
                     67:
                     68: /SM_executeStringByLocalParser 268 def
                     69: /SM_execute 268 def
                     70: /SM_popString  263  def
                     71: /SM_mathcap 264 def
                     72:
                     73: /SM_popCMO 262 def
                     74: /SM_executeFunction 269 def
                     75: /SM_DUMMY_sendcmo  280 def
                     76: /SM_sync_ball 281 def
                     77:
                     78: /SM_pops  265  def
                     79: /SM_setName 266  def
                     80: /SM_evalName 267  def
                     81:
                     82: /SM_setMathCap 273 def
                     83:
                     84: /SM_getsp     275  def
                     85: /SM_dupErrors 276  def
                     86:
                     87: /SM_control_kill 1024 def
                     88: /SM_control_reset_connection  1030 def
                     89:
                     90: /Etag_error 257 def
                     91:
                     92: /enginesList [
                     93:   [(localhost) 1300 1200]
                     94:   [(localhost) 2300 2200]
                     95: ] def
                     96: %% cf. startengines
                     97: /enginesList.2 [
                     98:   [(dc1) 1300 1200]
                     99:   [(dc2) 2300 2200]
                    100: ] def
                    101: %% cf. se12
                    102:
                    103: /oxconnect {
                    104:   /arg1 set
                    105:   [(oxCreateClient) arg1 aload pop] extension
                    106: } def
                    107: [(oxconnect)
                    108:  [([hostname data-port control-port] oxconnect pid)
                    109:   (oxconnect is used to connect this to a server on the hostname with data-port)
                    110:   (and control-port)
                    111:   (Example 1:  ox -ox ox_sm1 -data 1300 -control 1200    <== on server.)
                    112:   (            [$localhost$ 1300 1200] oxconnect /ox.ccc set  <== on client.)
                    113:   (Example 2:  ox -ox ox_sm1 -host s.OpenXM.org -insecure -data 1300 -control 1200    <== on server.)
                    114:   (            [$s.OpenXM.org$ 1300 1200] oxconnect /ox.ccc set  <== on client.)
                    115:   (Example 3:  ox -ox ox_sm1 -data 1300 -control 1200  >& /dev/null &<== on server.)
                    116:   (            [$localhost$ 1300 1200] oxconnect /ox.ccc set  <== on client.)
                    117:   (           cf. oxNoX)
                    118:   (See also ox)
                    119:  ]
                    120: ] putUsages
                    121:
                    122: [(ox)
                    123:  [
                    124:   (client aa oxpushcmo (oxsendcmo), client oxpopcmo dd, client popstring dd, client ss oxrpc)
                    125:  (Example: ox.ccc [1 2 3] oxpushcmo ox.ccc oxpopcmo /ff set  ff :: )
                    126:  (  )
                    127:  (client ss oxexecutestring(oxsubmit) <<executeString>>, client ss oxexec <<executeFunction>>)
                    128:
                    129:  (Example: ox.ccc (0 1 10 { pop $Hello$ message } for) oxexecutestring )
                    130:  (Example: ox.ccc (2).. oxpushcmo ox.ccc (10).. oxpushcmo )
                    131:  (         ox.ccc (power) oxexec  ox.ccc oxpopcmo :: )
                    132:  (  )
                    133:  (client str oxevalname, client str oxsetname, client num oxpops, client oxget)
                    134:  (   )
                    135:  (client oxmathcap, client oxsetmathcap, oxgenportfile, oxremoveportfile)
                    136:  (   )
                    137:  (client oxgetsp --- get stack pointer,  client oxgeterrors --- get all errors)
                    138:  (cleint oxisData, client oxreset, client oxshutdown)
                    139:  (oxhelp for this message, [(oxWatch) client] extension to start a log.)
                    140:  ([(oxSerial)] extension serial-number-of-out-going-ox-packet.)
                    141:  (oxpopcmo1, oxpopcmo2,  sm1connect2, sm1connect3)
                    142:  (sm1connectr )
                    143:  (oxNoX : set an environment to invoke oxlog without xterm and to call oxlog with >& /dev/null)
                    144:  $        ex 1.  (ox.sm1) run oxNoX sm1connectr $
                    145:  $        ex 2.  (oxasir.sm1) run oxNoX (x^2-1). fctr pmat ; $
                    146:  ]
                    147: ] putUsages
                    148:
                    149: /oxhelp {
                    150:  (oxconnect) usage
                    151:  (  ) message
                    152:  (ox) usage
                    153: } def
                    154: [(oxhelp)
                    155:  [(oxhelp  outputs help messages for ox commands.)
                    156: ]] putUsages
                    157:
                    158: ox.verbose { oxhelp } {  } ifelse
                    159:
                    160: /sm1connect2 {
                    161:  [oxpath.oxlog.xterm   oxpath.ox ( -ox ) oxpath.oxsm1
                    162:   oxpath.null
                    163:   ( &)] cat system
                    164: % (kterm -iconic -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_sm1 &) system
                    165: % For MSRI, or Eterm,
                    166: %(xterm -icon -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_sm1 &) system
                    167:  (If you start the server automatically, you may have a trouble to) message
                    168:  (oxreset. In order to avoid this trouble, start the server by hand.) message
                    169:  (sleep 5) system
                    170:   [(localhost) 1300 1200] oxconnect /ox.ccc set
                    171:  (The server is binded to the variable ox.ccc) message
                    172:  ox.ccc.init
                    173: } def
                    174:
                    175: /sm1connect3 {
                    176:  [oxpath.oxlog.xterm   oxpath.ox ( -ox ) oxpath.oxsm1
                    177:   (  -data 2300 -control 2200 )
                    178:   oxpath.null
                    179:   ( &)] cat system
                    180: % (kterm -iconic -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_sm1 -data 2300 -control 2200 &) system
                    181: % For MSRI
                    182: %(xterm -icon -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_sm1 -data 2300 -control 2200&) system
                    183:  (If you start the server automatically, you may have a trouble to) message
                    184:  (oxreset. In order to avoid this trouble, start the server by hand.) message
                    185:  (sleep 5) system
                    186:   [(localhost) 2300 2200] oxconnect /ox.ccc2 set
                    187:  (The server is binded to the variable ox.ccc2) message
                    188: } def
                    189:
                    190: /sm1connect4 {
                    191:  %% test version.
                    192:  /ox.ccc.portfile oxgenportfile def
                    193:  [oxpath.oxlog.xterm   oxpath.ox ( -ox ) oxpath.oxsm1
                    194:   ( -portfile ) ox.ccc.portfile
                    195:   oxpath.null
                    196:   ( &)] cat system
                    197:  (sleep 5) system
                    198:  [(oxReadPortFile) ox.ccc.portfile] extension /ox.ccc.control set
                    199:  ox.ccc.control message
                    200:  [(localhost) ox.ccc.control 1200] /ox.ccc set
                    201:  (The server is binded to the variable ox.ccc) message
                    202:  oxremoveportfile
                    203: } def
                    204:
                    205: /oxpushcmo { oxsendcmo } def
                    206: /oxsendcmo {
                    207:   /arg1 set
                    208:   /arg2 set
                    209:   ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put
                    210:   } {  } ifelse
                    211:   [(oxReq) arg2 SM_DUMMY_sendcmo arg1] extension pop
                    212: } def
                    213:
                    214: /oxpopcmo {
                    215:   /arg1 set
                    216:   [(oxReq) arg1 SM_popCMO ] extension pop
                    217:   [(oxGet) arg1] extension
                    218: } def
                    219:
                    220: /oxgetsp {
                    221:   /arg1 set
                    222:   [(oxReq) arg1 SM_getsp ] extension pop
                    223:   [(oxReq) arg1 SM_popCMO ] extension pop
                    224:   [(oxGet) arg1] extension
                    225: } def
                    226:
                    227: /oxgeterrors {
                    228:   /arg1 set
                    229:   [(oxReq) arg1 SM_dupErrors ] extension pop
                    230:   [(oxReq) arg1 SM_popCMO ] extension pop
                    231:   [(oxGet) arg1] extension
                    232: } def
                    233:
                    234: /oxmathcap0 {
                    235:   /arg1 set
                    236:   [(oxReq) arg1 SM_mathcap ] extension pop
                    237: } def
                    238: /oxmathcap {
                    239:   /arg1 set
                    240:   [/in-oxmathcap /mypeer /mmm] pushVariables
                    241:   [ /mypeer arg1 def
                    242:     mypeer oxmathcap0
                    243:     mypeer oxpopcmo /mmm set
                    244:     mypeer 10 mmm put  %% set math cap.
                    245:   ] pop
                    246:   popVariables
                    247: } def
                    248: /oxsetmathcap {
                    249:   /arg1 set
                    250:   [/in-oxsetmathcap /mypeer /mymathcap] pushVariables
                    251:   [
                    252:     /mypeer arg1 def
                    253:     /mymathcap     [(cmoMathCap)] extension (array) dc def
                    254:     [(oxReq)
                    255:       mypeer   SM_setMathCap
                    256:       mymathcap
                    257:     ] extension pop
                    258:   ] pop
                    259:   popVariables
                    260: } def
                    261: /oxsetmathcap.old {
                    262:   /arg1 set
                    263:   [(oxReq)
                    264:     arg1   SM_setMathCap
                    265:     [(mathcap-object)
                    266:      [[199901160 (sm1)]
                    267:       [2130706434 , 1 , 2 , 4 , 17 , 19 , 20 , 22 , 23 , 24 , 25 , 26 , 30 ]
                    268:       %% mathcap for sm1.
                    269:       %% [1 2 3 4 5]   %% for test.   cf. cmoCheckMathCap, Sm1_mathcap()
                    270:      ]
                    271:     ]  %% Never write a broken data here.
                    272:   ] extension pop
                    273: } def
                    274: /oxpopcmo1 {  %% ask of the transmission.
                    275:   /arg1 set
                    276:   [(oxReq) arg1 SM_popCMO ] extension pop
                    277: } def
                    278: /oxpopcmo2 {  %% wait the data.
                    279:   /arg1 set
                    280:   [(oxGet) arg1] extension
                    281: } def
                    282:
                    283:
                    284: /oxpopstring {
                    285:   /arg1 set
                    286:   [(oxReq) arg1 SM_popString ] extension pop
                    287:   [(oxGet) arg1] extension
                    288: } def
                    289:
                    290: /oxrpc {
                    291:   /arg1 set
                    292:   /arg2 set
                    293:   [/ans /ff] pushVariables
                    294:   [
                    295:    /ff arg2 def
                    296:    ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put
                    297:                 ox.log [(oxSerial)] extension 1 add ox.mod (executeString) put
                    298:    } {  } ifelse
                    299:    [(oxReq) ff SM_execute arg1] extension pop
                    300:    [(oxReq) ff SM_popCMO] extension pop
                    301:    [(oxGet) ff] extension /ans set
                    302:    ans etag Etag_error  eq {
                    303:      (Got an error object.) message
                    304:      /arg1 ans def
                    305:    }
                    306:    {  /arg1 ans def
                    307:     } ifelse
                    308:   ] pop
                    309:   popVariables
                    310:   arg1
                    311: } def
                    312:
                    313: /oxexecutestring { oxsubmit } def
                    314: /oxsubmit {
                    315:   /arg1 set
                    316:   /arg2 set
                    317:    ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put
                    318:                 ox.log [(oxSerial)] extension 1 add ox.mod (executeString) put
                    319:    } {  } ifelse
                    320:   [(oxReq) arg2 SM_execute arg1] extension pop
                    321: } def
                    322:
                    323: /oxexec {
                    324:   /arg1 set
                    325:   /arg2 set
                    326:    ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put
                    327:                 ox.log [(oxSerial)] extension 1 add ox.mod (executeFunction) put
                    328:    } {  } ifelse
                    329:   [(oxReq) arg2 SM_executeFunction arg1] extension pop
                    330: } def
                    331: /oxsubmit2 {
                    332:   oxexec
                    333: } def
                    334:
                    335: /oxpops {
                    336:   /arg1 set
                    337:   /arg2 set
                    338:   [(oxReq) arg2 SM_pops arg1] extension pop
                    339: } def
                    340:
                    341: /oxsetname {
                    342:   /arg1 set
                    343:   /arg2 set
                    344:   [(oxReq) arg2 SM_setName arg1] extension pop
                    345: } def
                    346:
                    347: /oxevalname {
                    348:   /arg1 set
                    349:   /arg2 set
                    350:   [(oxReq) arg2 SM_evalName arg1] extension pop
                    351: } def
                    352:
                    353:
                    354: /oxreset {
                    355:   /arg1 set
                    356:   [(oxReq) arg1 SM_control_reset_connection] extension pop
                    357:   [(oxGetFromControl) arg1 ] extension pop
                    358:   [(oxGet) arg1] extension message
                    359: } def
                    360:
                    361: /oxisData {
                    362:   /arg1 set
                    363:   [/pp /ff] pushVariables
                    364:   [
                    365:     /ff arg1 def
                    366:     [(oxMultiSelect) [ff] 10] extension /pp set
                    367:     pp message
                    368:     pp 0 get 1 eq {
                    369:       pp 1 get 0 get 1 eq {  %% data is in the data stream.
                    370:         /arg1 [(oxGet) ff] extension def
                    371:       } {/arg1 (no data) def  } ifelse
                    372:     }
                    373:     { /arg1 (no data) def }
                    374:     ifelse
                    375:   ] pop
                    376:   popVariables
                    377:   arg1
                    378: } def
                    379:
                    380: /oxget {
                    381:   oxisData
                    382: } def
                    383:
                    384:
                    385: /oxshutdown {
                    386:   /arg1 set
                    387:   [(fp2fclose) arg1 1 get] extension
                    388:   [(oxReq) arg1 SM_control_kill] extension
                    389:   arg1 0 (closed) put
                    390: } def
                    391:
                    392: /oxgenportfile {
                    393:   [(oxGenPortFile)] extension
                    394: }def
                    395: /oxremoveportfile {
                    396:   [(oxRemovePortFile)] extension
                    397: }def
                    398:
                    399: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                    400: /enginescmd
                    401:   $ /computesp {
                    402:        /arg1 set
                    403:        [arg1 myid] arg1 message
                    404:     } def
                    405:   $
                    406: def
                    407:
                    408:
                    409: /genPairs {
                    410:   /arg1 set
                    411:   [/n /i /j] pushVariables
                    412:   [
                    413:     /n arg1 def
                    414:     /genPairs.list [  ] def
                    415:     /genPairs.i 0 def
                    416:     0 1 n 1 sub {
                    417:       /i set
                    418:       i 1 add 1 n 1 sub {
                    419:          /j set
                    420:          genPairs.list [i j] append /genPairs.list set
                    421:       } for
                    422:     } for
                    423:     /genPairs.n genPairs.list length def
                    424:   ] pop
                    425:   popVariables
                    426: } def
                    427:
                    428: /getPair {
                    429:   [/i ] pushVariables
                    430:   [
                    431:     genPairs.i genPairs.n lt {
                    432:       genPairs.list genPairs.i get /ans set
                    433:       genPairs.i 1 add /genPairs.i set
                    434:     }
                    435:     { [-1 -1] /ans set} ifelse
                    436:     /arg1 ans def
                    437:   ] pop
                    438:   popVariables
                    439:   arg1
                    440: } def
                    441:
                    442: /sumUp {
                    443:   /arg1 set
                    444:   [/ans /v /i /n] pushVariables
                    445:   [
                    446:     /v arg1 def
                    447:     /n v length def
                    448:     /ans 0 def
                    449:     0 1 n 1 sub {
                    450:       /i set
                    451:       ans v i get add /ans set
                    452:     } for
                    453:     /arg1 ans def
                    454:    ] pop
                    455:    popVariables
                    456:    arg1
                    457: } def
                    458:
                    459:
                    460: /dist {
                    461:   /dist.debug 0 def
                    462:   /result [  ] def
                    463:   enginesList {oxconnect} map /engines set
                    464:   /enginesN engines length def
                    465:   % broadcast the program.
                    466:   (ox-1.sm1) pushfile /enginescmd set  %% read a file.
                    467:   [(parse) enginescmd] extension
                    468:   engines {enginescmd oxsubmit} map
                    469:   engines { (slave-start) oxsubmit} map    %% initialize slave codes.
                    470:                                            %% send pid.
                    471:   0 1 enginesN 1 sub {
                    472:     /i set
                    473:     engines i get i oxsendcmo
                    474:     engines i get (/myid set) oxsubmit
                    475:   } for
                    476:
                    477:   master-start %% initialize master codes
                    478:   %% gbsize genPairs   %% obsolete
                    479:   /gbsize ans length def
                    480:   ans makePairs /genPairs.list set
                    481:   /genPairs.i 0 def  /genPairs.n genPairs.list length def
                    482:
                    483:
                    484:   /exhausted 0 def
                    485:   % clear the busy flag.
                    486:   /busy [1 1 enginesN { pop 0 } for ] def
                    487:   (date) system
                    488:   {{
                    489:   exhausted 0 eq {
                    490:     0 1 enginesN 1 sub {
                    491:       /i set
                    492:       busy i get 0 eq {
                    493:         getPair /p set
                    494:         p 0 get -1 eq {/exhausted 1 def exit} { } ifelse
                    495:         busy i 1 put
                    496:         engines i get p oxsendcmo
                    497:         engines i get ( computesp ) oxsubmit
                    498:         engines i get oxpopcmo1
                    499:       } { } ifelse
                    500:     } for
                    501:   } {  } ifelse
                    502:   dist.debug { (busy=) messagen busy message } { } ifelse
                    503:   busy sumUp 0 eq { result message exit error  } {  } ifelse
                    504:   [(oxMultiSelect) engines -1] extension /status set
                    505:   /datastatus status 1 get def
                    506:   dist.debug { (datastatus=) messagen datastatus message } { } ifelse
                    507:   0 1 enginesN 1 sub {
                    508:     /i set
                    509:     datastatus i get 1 eq {
                    510:       engines i get oxpopcmo2 /ans set
                    511:       busy i 0 put
                    512:       result ans append /result set
                    513:     } { } ifelse
                    514:   } for
                    515:   } loop } timer
                    516:   (date) system
                    517:   (result is in result) message
                    518:   (Number of s-pairs checked is ) messagen result length message
                    519: } def
                    520:
                    521: ox.verbose {
                    522:  (dist for experiments for distributed computing. cf. startengines) message
                    523: } { } ifelse
                    524:
                    525: /oxIsServerReady {
                    526:   /arg1 set
                    527:   [/in-isServerReady /sdata /ans] pushVariables
                    528:   [
                    529:     /sdata arg1 def
                    530:     /ans 0 def
                    531:     sdata isArray {
                    532:      sdata length 1 gt {
                    533:        sdata 0 get (client) eq { /ans 1 def } { } ifelse
                    534:      } { } ifelse
                    535:     } { } ifelse
                    536:     /arg1 ans def
                    537:   ] pop
                    538:   popVariables
                    539:   arg1
                    540: } def
                    541:
                    542:
                    543: %%%%%%%%%%%%%%%  tests
                    544: ox.verbose {
                    545:   (test10 : test to read and write ox-data and ox-command to a file) message
                    546: } {  } ifelse
                    547:
                    548: /test10 {
                    549:   [(oxCreateClientFile) (afo) (w)] extension /ccc set
                    550:   [(oxWatch) ccc] extension
                    551:   ccc (x-1). oxsendcmo
                    552:   [(oxReq) ccc SM_executeStringByLocalParser
                    553:    ( dup add message )] extension pop
                    554:   ccc (quit) oxsendcmo
                    555:
                    556:   [(oxCloseClient) ccc] extension
                    557: } def
                    558:
                    559: /test11 {
                    560:   [(oxCreateClientFile) (afo) (r)] extension /ccc set
                    561:   [(oxGet) ccc] extension ::
                    562:   [(oxGet) ccc] extension ::
                    563: } def
                    564:
                    565: ox.verbose {
                    566:  (test12 : ccc is the client. ff poly in Q<x,y,z,dx,dy,dz>  ) message
                    567: } { } ifelse
                    568: /test12 {
                    569:   [(localhost) 1300 1200] oxconnect /ccc set
                    570:   [(x,y,z) ring_of_differential_operators ( ) elimination_order 0] define_ring
                    571:   (x+y). /ff set
                    572:   /eee (hello) (error) dc def
                    573:   /eee0 eee (error) dc def
                    574:   (eee is the CMO_ERROR2 object [CMO_ERROR2 hello], eee0 is the CMO_ERROR object) message
                    575: } def
                    576:
                    577: /sm1connectr {
                    578:  [/in-sm1connectr /pass /peer /data /control ] pushVariables
                    579:  [
                    580:  /pass [(oxGenPass)] extension def
                    581:  /peer [(oxGetPort) (localhost)] extension def
                    582:  /data peer 1 get toString def
                    583:  /control peer 3 get toString def
                    584:  peer message
                    585:  [oxpath.oxlog.xterm  oxpath.ox ( -reverse -ox ) oxpath.oxsm1
                    586:   ( -data ) data ( -control ) control  ( -pass ) pass
                    587:   oxpath.null
                    588:   ( &)] cat system
                    589:  [(oxCreateClient2) peer 0 pass] extension /ox.ccc set
                    590:                      %% 0 means connect from only localhost.
                    591:  (The server is binded to the variable ox.ccc) message
                    592:   ox.ccc.init
                    593:  ] pop
                    594:  popVariables
                    595: } def
1.2     ! takayama  596:
        !           597: /sm1connectr-ssh {
        !           598:  /arg1 set
        !           599:  [/in-sm1connectr /pass /peer /data /control /name /machine
        !           600:   /your-peer /comm
        !           601:  ] pushVariables
        !           602:  [
        !           603:  /machine arg1 0 get def
        !           604:  /name arg1 1 get def
        !           605:
        !           606:  /pass [(oxGenPass)] extension def
        !           607:  /peer [(oxGetPort) myhostname-ssh] extension def
        !           608:  /data peer 1 get toString def
        !           609:  /control peer 3 get toString def
        !           610:  peer message
        !           611:  [(ssh -f ) machine ( -l ) name ( ")
        !           612:   oxpath.oxlog.xterm-ssh  oxpath.ox-ssh ( -reverse -ox ) oxpath.oxsm1-ssh
        !           613:   ( -host ) myhostname-ssh
        !           614:   ( -data ) data ( -control ) control  ( -pass ) pass
        !           615:   oxpath.null
        !           616:   ( ")
        !           617:  ] cat /comm set
        !           618:  (Executing the command : ) messagen comm message message
        !           619:   comm system
        !           620:  (sleep 5) system
        !           621:  [(oxCreateClient2) peer 1 pass] extension /your-peer set
        !           622:  /arg1 your-peer def
        !           623:  ] pop
        !           624:  popVariables
        !           625:  arg1
        !           626: } def
        !           627: [(sm1connectr-ssh)
        !           628: [([hostname login-name] sm1connectr-ssh client)
        !           629:  (Starting oxpath.oxsm1-ssh by the launcher oxpath.ox-ssh on the "hostname".)
        !           630:  $Example: [(dc1.math.kobe-u.ac.jp) (taka)] sm1connectr-ssh /ox.ccc set  $
        !           631: ]] putUsages
1.1       maekawa   632:
                    633: /addSlash {
                    634:   /arg1 set
                    635:   [/in-addSlash /ss /aaa /ans] pushVariables
                    636:   [
                    637:     /ss arg1 def
                    638:     ss (array) dc /aaa set
                    639:     aaa length 0 eq {
                    640:       /ans (/) def
                    641:     }{
                    642:       aaa aaa length 1 sub get  47  eq %% The last equals / ?
                    643:       {
                    644:         /ans ss def
                    645:       }{
                    646:         /ans [ss (/)] cat def
                    647:       } ifelse
                    648:     } ifelse
                    649:     /arg1 ans def
                    650:   ] pop
                    651:   arg1
                    652: } def
                    653:
                    654: /getPathNameSm1 {
                    655:   /arg1 set
                    656:   [/in-getPathNameSm1 /fname /fullname /tname] pushVariables
                    657:   [
                    658:      /fname arg1 0 get def
                    659:      %% If fullname is given, use it.
                    660:      fname (array) dc 0 get
                    661:      (/) (array) dc 0 get eq
                    662:      {  /fullname fname def
                    663:         /getPathNameSm1.LLL goto
                    664:      } { } ifelse
                    665:
                    666:      %% Else first try to find it in LOAD_SM1_PATH
                    667:      [(getenv) (LOAD_SM1_PATH)] extension /tname set
                    668:      tname isString
                    669:      {
                    670:        tname addSlash /tname set
                    671:        [(stat) [tname fname] cat] extension
                    672:        0 get isInteger  %% The file was found.
                    673:        {  /fullname [tname fname] cat def
                    674:           /getPathNameSm1.LLL goto
                    675:        } { } ifelse
                    676:      } {  } ifelse
                    677:
                    678:      %% Else try to find it in /usr/local/lib/sm1
                    679:      [(stat) [(/usr/local/lib/sm1/) fname] cat] extension
                    680:      0 get isInteger  %% The file was found.
                    681:      {  /fullname [(/usr/local/lib/sm1/) fname] cat def
                    682:         /getPathNameSm1.LLL goto
                    683:      } { } ifelse
                    684:
                    685:      %% Otherwise error.
                    686:        [(getPathNameSm1: The file ) fname
                    687:         ( could not be found )
                    688:         (neigher in LOAD_SM1_PATH=)
                    689:         [(getenv) (LOAD_SM1_PATH)] extension
                    690:         ( nor in /usr/local/lib/sm1)
                    691:        ] cat /getPathNameSm1.errorMessage set
                    692:        getPathNameSm1.errorMessage message
                    693:      ] pop popVariables getPathNameSm1.errorMessage error
                    694:
                    695:      /getPathNameSm1.LLL
                    696:      /arg1 fullname def
                    697:   ] pop
                    698:   popVariables
                    699:   arg1
                    700: } def
                    701: [(getPathNameSm1)
                    702: [([fname] getPathNameSm1 fullname)
                    703:  (string fname, fullname)
                    704:  (This command searches the fname in /usr/local/lib/sm1 and LOAD_SM1_PATH)
                    705:  (and returns the fullname.)
                    706: ]] putUsages
                    707:
                    708: /getPathNameAsir {
                    709:   /arg1 set
                    710:   [/in-getPathNameAsir /fname /fullname /tname] pushVariables
                    711:   [
                    712:      /fname arg1 0 get def
                    713:      %% If fullname is given, use it.
                    714:      fname (array) dc 0 get
                    715:      (/) (array) dc 0 get eq
                    716:      {  /fullname fname def
                    717:         /getPathNameAsir.LLL goto
                    718:      } { } ifelse
                    719:
                    720:      %% Else first try to find it in /usr/local/lib/asir
                    721:      [(stat) [(/usr/local/lib/asir/) fname] cat] extension
                    722:      0 get isInteger  %% The file was found.
                    723:      {  /fullname [(/usr/local/lib/asir/) fname] cat def
                    724:         /getPathNameAsir.LLL goto
                    725:      } { } ifelse
                    726:
                    727:      %% Else try to find it in ASIR_LIBDIR
                    728:      [(getenv) (ASIR_LIBDIR)] extension /tname set
                    729:      tname isString
                    730:      {
                    731:        [(stat) [tname (/) fname] cat] extension
                    732:        0 get isInteger  %% The file was found.
                    733:        {  /fullname [tname (/) fname] cat def
                    734:           /getPathNameAsir.LLL goto
                    735:        } { } ifelse
                    736:
                    737:      } {  } ifelse
                    738:
                    739:      %% Otherwise error.
                    740:        [ (getPathNameAsir: The file )  fname
                    741:        ( could not be found )
                    742:        (neigher in /usr/local/lib/asir nor in ASIR_LIBDIR. )
                    743:        ] cat /getPathNameAsir.errorMessage set
                    744:        getPathNameAsir.errorMessage message
                    745:      ] pop popVariables getPathNameAsir.errorMessage error
                    746:
                    747:      /getPathNameAsir.LLL
                    748:      /arg1 fullname def
                    749:   ] pop
                    750:   popVariables
                    751:   arg1
                    752: } def
                    753: [(getPathNameAsir)
                    754: [([fname] getPathNameAsir fullname)
                    755:  (string fname, fullname)
                    756:  (This command searches the fname in /usr/local/lib/asir and ASIR_LIBDIR)
                    757:  (and returns the fullname.)
                    758: ]] putUsages
                    759:
                    760:
                    761:
                    762: initializePathNamesForOx  %% This should be

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>