Return to ox.sm1 CVS log | Up to [local] / OpenXM / src / kan96xx / Doc |
version 1.8, 2000/01/19 08:33:27 | version 1.18, 2001/12/28 01:20:25 | ||
---|---|---|---|
|
|
||
%%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.7 2000/01/19 06:41:02 takayama Exp $ | %%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.17 2001/08/22 03:23:25 takayama Exp $ | ||
/ox.sm1.loaded 1 def | |||
%%%%%%%%%%%% Configuration: Specify your server path | %%%%%%%%%%%% Configuration: Specify your server path | ||
%%%%% ox, ox_sm1, oxlog are contained in kxx.tgz | %%%%% ox, ox_sm1, oxlog are contained in kxx.tgz | ||
%%%%% These should be under /usr/local/lib/sm1 or LOAD_SM1_PATH | %%%%% These should be under /usr/local/lib/sm1 or LOAD_SM1_PATH | ||
|
|
||
(Please get it from http://www.math.kobe-u.ac.jp/KAN) message | (Please get it from http://www.math.kobe-u.ac.jp/KAN) message | ||
error | error | ||
} { } ifelse | } { } ifelse | ||
(ox.sm1, --- open sm1 protocol module 11/11,1999 (C) N.Takayama. oxhelp for help) message-quiet | (ox.sm1, ---OpenXM protocol module 08/22, 2001 (C) N.Takayama. oxhelp for help) message-quiet | ||
/ox.ccc load isArray | /ox.ccc load isArray | ||
{ } | { } | ||
|
|
||
/SM_popCMO 262 def | /SM_popCMO 262 def | ||
/SM_executeFunction 269 def | /SM_executeFunction 269 def | ||
/SM_DUMMY_sendcmo 280 def | /SM_DUMMY_sendcmo 2147418112 1 add def %%% SM_PRIVATE+1 | ||
/SM_sync_ball 281 def | /SM_sync_ball 281 def | ||
/SM_pops 265 def | /SM_pops 265 def | ||
|
|
||
/SM_control_kill 1024 def | /SM_control_kill 1024 def | ||
/SM_control_reset_connection 1030 def | /SM_control_reset_connection 1030 def | ||
/SM_control_spawn_server 1027 def | |||
/Etag_error 257 def | /Etag_error 257 def | ||
|
|
||
/oxreset { | /oxreset { | ||
/arg1 set | /arg1 set | ||
[(oxReq) arg1 SM_control_reset_connection] extension pop | [(oxReq) arg1 SM_control_reset_connection] extension pop | ||
[(oxGetFromControl) arg1 ] extension pop | %% [(oxGetFromControl) arg1 ] extension pop | ||
[(oxGet) arg1] extension message | [(oxGet) arg1] extension message | ||
} def | } def | ||
|
|
||
/getPathNameAsir.LLL goto | /getPathNameAsir.LLL goto | ||
} { } ifelse | } { } ifelse | ||
%% Else first try to find it in /usr/local/lib/asir | |||
[(stat) [(/usr/local/lib/asir/) fname] cat] extension | |||
0 get isInteger %% The file was found. | |||
{ /fullname [(/usr/local/lib/asir/) fname] cat def | |||
/getPathNameAsir.LLL goto | |||
} { } ifelse | |||
%% Else try to find it in ASIR_LIBDIR | %% Else try to find it in ASIR_LIBDIR | ||
[(getenv) (ASIR_LIBDIR)] extension /tname set | [(getenv) (ASIR_LIBDIR)] extension /tname set | ||
tname isString | tname isString | ||
|
|
||
} { } ifelse | } { } ifelse | ||
%% Else try to find it in /usr/local/lib/asir | |||
[(stat) [(/usr/local/lib/asir/) fname] cat] extension | |||
0 get isInteger %% The file was found. | |||
{ /fullname [(/usr/local/lib/asir/) fname] cat def | |||
/getPathNameAsir.LLL goto | |||
} { } ifelse | |||
%% Otherwise error. | %% Otherwise error. | ||
[ (getPathNameAsir: The file ) | [ (getPathNameAsir: The file ) | ||
fname (ox_asir) eq | fname (ox_asir) eq | ||
|
|
||
/arg1 set | /arg1 set | ||
[/in-launch_nox /pass /peer /data /control /name /machine | [/in-launch_nox /pass /peer /data /control /name /machine | ||
/your-peer /comm /remoteOpenXMbin /remoteServer /myhost | /your-peer /comm /remoteOpenXMbin /remoteServer /myhost | ||
/argNumber /aaa | |||
] pushVariables | ] pushVariables | ||
[ | [ | ||
/machine arg1 0 get def | /aaa arg1 def | ||
/remoteOpenXMbin arg1 1 get def | /argNumber aaa length def | ||
/remoteServer arg1 2 get def | /machine aaa 0 get def | ||
/name arg1 3 get def | machine (localhost) eq argNumber 5 lt and { | ||
/myhost arg1 4 get def | aaa 1 get ox_launch_localhost /your-peer set | ||
/LLL.end goto | |||
} { | |||
/remoteOpenXMbin aaa 1 get def | |||
/remoteServer aaa 2 get def | |||
/name aaa 3 get def | |||
/myhost aaa 4 get def | |||
} ifelse | |||
/pass [(oxGenPass)] extension def | /pass [(oxGenPass)] extension def | ||
/peer [(oxGetPort) myhost] extension def | /peer [(oxGetPort) myhost] extension def | ||
|
|
||
comm system | comm system | ||
(sleep 5) system-csh | (sleep 5) system-csh | ||
[(oxCreateClient2) peer 1 pass] extension /your-peer set | [(oxCreateClient2) peer 1 pass] extension /your-peer set | ||
/LLL.end | |||
/arg1 your-peer def | /arg1 your-peer def | ||
] pop | ] pop | ||
popVariables | popVariables | ||
|
|
||
[(ox_launch) | [(ox_launch) | ||
[( [remote remote-OpenXM-bin remote-ox-server remote-login-name myhostname] ) | [( [remote remote-OpenXM-bin remote-ox-server remote-login-name myhostname] ) | ||
( ox_launch client ) | ( ox_launch client ) | ||
$or $ | |||
$ [(localhost) ox-server-name] ox_launch client$ | |||
(Example 1: ) | (Example 1: ) | ||
$ [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) $ | $ [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) $ | ||
$ (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (dc4.math.kobe-u.ac.jp) $ | $ (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (dc4.math.kobe-u.ac.jp) $ | ||
|
|
||
popVariables | popVariables | ||
} def | } def | ||
/ox_launch_localhost { | |||
/arg1 set | |||
[/in-ox_launch_localhost /pass /peer /data /control /oxserver | |||
/my-peer] pushVariables | |||
[ | |||
/oxserver arg1 def | |||
/pass [(oxGenPass)] extension def | |||
/peer [(oxGetPort) (localhost)] extension def | |||
/data peer 1 get toString def | |||
/control peer 3 get toString def | |||
peer message | |||
[oxpath.oxlog.xterm oxpath.ox ( -reverse -ox ) oxserver | |||
( -data ) data ( -control ) control ( -pass ) pass | |||
oxpath.null | |||
( &)] cat system-csh | |||
[(oxCreateClient2) peer 0 pass] extension /my-peer set | |||
%% 0 means connect from only localhost. | |||
(The server is binded to the variable ox.ccc) message | |||
/arg1 my-peer def | |||
] pop | |||
popVariables | |||
arg1 | |||
} def | |||
initializePathNamesForOx %% This should be | %% Test code for oxCreateControl_RFC_101 | ||
/sm1StartControl101 { | |||
[/in-sm1connectr /pass /peer /data /control ] pushVariables | |||
[ | |||
/pass [(oxGenPass)] extension def | |||
/peer [(oxGetPort1) (localhost)] extension def | |||
/data peer 1 get toString def | |||
peer message | |||
[(/home/nobuki/OpenXM/src/oxc/oxc) | |||
( -c ) pass ( -h ) (localhost) ( -p ) data ( -x ) | |||
oxpath.null | |||
( &)] cat system-csh | |||
[(oxCreateControl_RFC_101) peer 0 pass] extension /ox.ccc set | |||
%% 0 means connect from only localhost. | |||
(The server is binded to the variable ox.ccc) message | |||
ox.ccc | |||
] pop | |||
popVariables | |||
} def | |||
/sm1StartEngine101 { | |||
[/in-sm1StartEngine101 /peer /data /control /engineID] pushVariables | |||
[ | |||
/peer [(oxGetPort1) (localhost)] extension def | |||
/data peer 1 get def | |||
ox.ccc data oxpushcmo | |||
ox.ccc (/home/nobuki/OpenXM/bin/ox_sm1) oxpushcmo | |||
[(oxPushCMD) ox.ccc SM_control_spawn_server] extension | |||
ox.ccc oxpopcmo /engineID set | |||
[(oxCreateEngine_RFC_101) peer 0 (Empty) engineID] extension | |||
/ox.ddd set | |||
(The engine is binded to the variables ox.ddd) message | |||
] pop | |||
popVariables | |||
arg1 | |||
} def | |||
/OxWorkDirCreated false def | |||
/oxWorkDir { | |||
[/in-oxWorkDir /workHome /work] pushVariables | |||
[ | |||
[(getenv) (OpenXM_tmp)] extension tag 0 eq { | |||
/workHome [ | |||
[(getenv) (HOME)] extension | |||
(/OpenXM_tmp) | |||
] cat def | |||
}{ | |||
/workHome | |||
[(getenv) (OpenXM_tmp)] extension | |||
def | |||
}ifelse | |||
/work [workHome (/) [(getpid)] extension toString] cat def | |||
OxWorkDirCreated not { | |||
[(stat) workHome] extension 0 get tag 0 eq { | |||
[(Working directory ) workHome ( will be created.)] cat | |||
message | |||
[(mkdir ) workHome] cat system | |||
}{ | |||
} ifelse | |||
[(stat) work] extension 0 get tag 0 eq { | |||
[(Working directory ) work ( will be created.)] cat | |||
message | |||
[(mkdir ) work] cat system | |||
}{ | |||
} ifelse | |||
/OxWorkDirCreated true def | |||
}{ } ifelse | |||
/arg1 work def | |||
] pop | |||
popVariables | |||
arg1 | |||
} def | |||
[(oxWorkDir) | |||
[(oxWorkDir returns a name of working directory for OpenXM processes.) | |||
(If the working direcotry does not exist, it creates ~/OpenXM_tmp/[pid].) | |||
(The name can be changed by setting a value to the environmental variable) | |||
(OpenXM_tmp. cf. oxNewFileName) | |||
] | |||
] putUsages | |||
/OxFileName 0 def | |||
/oxNewFileName { | |||
[/in-oxNewFileName /name] pushVariables | |||
[ | |||
/name [(work) OxFileName toString] cat def | |||
/OxFileName OxFileName 1 add def | |||
/arg1 name def | |||
] pop | |||
popVariables | |||
arg1 | |||
} def | |||
[(oxNewFileName) | |||
[(oxNewFileName returns a unique file name for a working file.) | |||
(cf. oxWorkDir) | |||
] | |||
] putUsages | |||
[(ostype)] extension 0 get | |||
(windows) eq { | |||
/ox-win.sm1.loaded boundp { | |||
}{ | |||
[(parse) (ox-win.sm1) pushfile] extension | |||
} ifelse | |||
}{ | |||
initializePathNamesForOx %% This should be | |||
} ifelse |