[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5 分散計算に関する関数


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.1 ox_launch, ox_launch_nox, ox_shutdown

ox_launch([host[,dir],command])
ox_launch_nox([host[,dir],command])

:: 遠隔プロセスの起動および通信を開始する.

ox_shutdown(id)

:: 遠隔プロセスを終了させ, 通信を終了する.

return

整数

host

文字列または 0

dir command

文字列

id

整数

[219] ox_launch();
0
[220] ox_rpc(0,"fctr",x^10-y^10);      
0
[221] ox_pop_local(0);
[[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1],
[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
[222] ox_shutdown(0);    
0
参照

ox_rpc, ox_cmo_rpc, ox_execute_string, ox_pop_cmo, ox_pop_local, ifplot, conplot, plot, polarplot, plotover


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.2 ox_launch_generic

ox_launch_generic(host,launch,server,use_unix,use_ssh,use_x,conn_to_serv)

:: 遠隔プロセスの起動および通信を開始する.

return

整数

host

文字列または 0

launcher server

文字列

use_unix use_ssh use_x conn_to_serv

整数

[342] LIB=get_rootdir();
/export/home/noro/ca/Kobe/build/OpenXM/lib/asir
[343] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",0,0,0,0);
1
[344] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,0,0,0);
2
[345] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,0);
3
[346] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,0);
4
[347] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,1,1);
5
[348] ox_launch_generic(0,LIB+"/ox_launch",LIB+"/ox_asir",1,1,0,1);
6
参照

ox_launch, ox_launch_nox, ox_shutdown, ox_launch_generic


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.3 generate_port, try_bind_listen, try_connect, try_accept, register_server

generate_port([use_unix])

:: port の生成

try_bind_listen(port)

:: port に対して bind, listen

try_connect(host,port)

:: port に対して connect

try_accept(socket,port)

:: connect 要求を accept

register_server(control_socket,control_port,server_socket,server_port)

:: connection の成立した control socket, server socket の登録

return

generate_port() のみ整数または文字列. その他は整数.

use_unix

0 または 1

host

文字列

port control_port server_port

整数または文字列

socket control_socket server_socket

整数

[340] CPort=generate_port();
39896
[341] SPort=generate_port();
37222
[342] CSocket=try_bind_listen(CPort);
3
[343] SSocket=try_bind_listen(SPort);
5

/*
ここで, ox_launch を起動 :
%  ox_launch "127.1" 0 39716 37043 ox_asir "shio:0"
*/

[344] CSocket=try_accept(CSocket,CPort);
6
[345] SSocket=try_accept(SSocket,SPort);  
3
[346] register_server(CSocket,CPort,SSocket,SPort);
0
参照

ox_launch, ox_launch_nox, ox_shutdown, ox_launch_generic, shell, ox_push_cmo, ox_push_local


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.4 ‘ox_asir

ox_asir’ は, Asir のほぼ全ての機能を OpenXM サーバ として提供する. ‘ox_asir’ は, ox_launch または ox_launch_nox で 起動する. 後者は X 環境を用いない場合のために用意されている.

[5] ox_launch();
0
[5] ox_launch_nox("127.0.0.1","/usr/local/lib/asir",
"/usr/local/lib/asir/ox_asir");
0
[7] RemoteLibDir = "/usr/local/lib/asir/"$
[8] Machines = ["sumire","rokkaku","genkotsu","shinpuku"];
[sumire,rokkaku,genkotsu,shinpuku]
[9] Servers = map(ox_launch,Machines,RemoteLibDir,
RemoteLibDir+"ox_asir");
[0,1,2,3]
参照

ox_launch, ox_launch_nox, ox_shutdown


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.5 ox_rpc, ox_cmo_rpc, ox_execute_string

ox_rpc(number,"func",arg0,...)
ox_cmo_rpc(number,"func",arg0,...)
ox_execute_string(number,"command",...)

:: プロセスの函数呼び出し

return

0

number

数 (プロセス識別子)

func

函数名

command

文字列

arg0 ...

任意 (引数)

[234] ox_cmo_rpc(0,"dp_ht",dp_ptod((x+y)^10,[x,y]));
0
[235] ox_pop_cmo(0);
(1)*<<10,0>>
[236] ox_execute_string(0,"12345 % 678;");
0
[237] ox_pop_cmo(0);
141
参照

ox_pop_cmo, ox_pop_local


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.6 ox_reset,ox_intr,register_handler

ox_reset(number)

:: プロセスのリセット

ox_intr(number)

:: プロセスのに SIGINT 送付

register_handler(func)

:: プロセスのリセットのための関数登録

return

1

number

数 (プロセス識別子)

func

関数子または 0

[10] ox_launch();
0
[11] ox_rpc(0,"fctr",x^100-y^100);
0
[12] ox_reset(0); /* xterm のウィンドウには                             */
1                 /* usr1 : return to toplevel by SIGUSR1 が表示される. */
[340] Procs=[ox_launch(),ox_launch()];
[0,1]
[341] def reset() { extern Procs; map(ox_reset,Procs);}
[342] map(ox_rpc,Procs,"fctr",x^100-y^100);
[0,0]
[343] register_handler(reset);
1
[344] interrupt ?(q/t/c/d/u/w/?) u
Abort this computation? (y or n) y
Calling the registered exception handler...done.
return to toplevel
参照

ox_rpc, ox_cmo_rpc, ox_execute_string


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.7 ox_push_cmo, ox_push_local

ox_push_cmo(number,obj)
ox_push_local(number,obj)

:: obj を識別子 number のプロセスに送信

return

0

number

数(プロセス識別子)

obj

オブジェクト

参照

ox_rpc, ox_cmo_rpc, ox_execute_string, ox_pop_cmo, ox_pop_local


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.8 ox_pop_cmo, ox_pop_local

ox_pop_local(number)

:: プロセス識別子 number からデータを受信する.

return

受信データ

number

数 (プロセス識別子)

[341] ox_cmo_rpc(0,"fctr",x^2-1);
0
[342] ox_pop_cmo(0);
[[1,1],[x-1,1],[x+1,1]]
[343] ox_cmo_rpc(0,"newvect",3);
0
[344] ox_pop_cmo(0);
error([41,cannot convert to CMO object])
[345] ox_pop_local(0);
[ 0 0 0 ]
参照

ox_rpc, ox_cmo_rpc, ox_execute_string, ox_push_cmd, ox_sync, ox_select, ox_get


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.9 ox_push_cmd, ox_sync

ox_push_cmd(number,command)

:: プロセス識別子 number のプロセスにコマンド command を送信する.

ox_sync(number)

:: プロセス識別子 number のプロセスに OX_SYNC_BALL を送信する.

return

0

number

数 (プロセス識別子)

command

数 (コマンド識別子)

[3] ox_rpc(0,"fctr",x^100-y^100);
0
[4] ox_push_cmd(0,258);
0
[5] ox_select([0]);
[0]
[6] ox_get(0);
[[1,1],[x^2+y^2,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],...]
参照

ox_rpc, ox_cmo_rpc, ox_execute_string, ox_reset,ox_intr,register_handler


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.10 ox_get

ox_get(number)

:: プロセス識別子 number のプロセスからデータを受信する.

return

受信データ

number

数(プロセス識別子)

[11] ox_push_cmo(0,123);
0
[12] ox_push_cmd(0,262); /* 262=OX_popCMO */
0
[13] ox_get(0);
123
参照

ox_pop_cmo, ox_pop_local, ox_push_cmd, ox_sync


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.11 ox_pops

ox_pops(number[,nitem])

:: プロセス識別子 number のプロセスのスタックからデータを取り除く.

return

0

number

数 (プロセス識別子)

nitem

自然数

[69] for(I=1;I<=10;I++)ox_push_cmo(0,I);
[70] ox_pops(0,4);  
0
[71] ox_pop_cmo(0);
6
参照

ox_pop_cmo, ox_pop_local


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.12 ox_select

ox_select(nlist[,timeout])

:: 読み出し可能なプロセスの識別子を返す.

return

リスト

nlist

数 (子プロセス識別子) のリスト

timeout

ox_launch();
0
[220] ox_launch();
1
[221] ox_launch();
2
[222] ox_rpc(2,"fctr",x^500-y^500);
0
[223] ox_rpc(1,"fctr",x^100-y^100);
0
[224] ox_rpc(0,"fctr",x^10-y^10);  
0
[225] P=[0,1,2];
[0,1,2]
[226] map(ox_push_cmd,P,258);
[0,0,0]
[227] ox_select(P);
[0]
[228] ox_get(0);   
[[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1],
[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
参照

ox_pop_cmo, ox_pop_local, ox_push_cmd, ox_sync, ox_get


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.13 ox_flush

ox_flush(id)

:: 送信バッファの強制 flush

return

1

id

子プロセス識別子

[340] ox_launch_nox();
0
[341] cputime(1);
0
7e-05sec + gc : 4.8e-05sec(0.000119sec)
[342] for(I=0;I<10000;I++)ox_push_cmo(0,I);
0.232sec + gc : 0.006821sec(0.6878sec)
[343] ctrl("ox_batch",1);
1
4.5e-05sec(3.302e-05sec)
[344] for(I=0;I<10000;I++)ox_push_cmo(0,I); ox_flush(0);
0.08063sec + gc : 0.06388sec(0.4408sec)
[345] 1
9.6e-05sec(0.01317sec)
参照

ox_pop_cmo, ox_pop_local, ctrl


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.14 ox_get_serverinfo

ox_get_serverinfo([id])

:: server の Mathcap, 動作中のプロセス識別子の取得

return

リスト

id

子プロセス識別子

[343] ox_get_serverinfo(0);
[[199909080,Ox_system=ox_sm1.plain,Version=2.991118,HOSTTYPE=FreeBSD],
[262,263,264,265,266,268,269,272,273,275,276],
[[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27,
33,40,16,34]]]
[344] ox_get_serverinfo(); 
[[0,[[199909080,Ox_system=ox_sm1.plain,Version=2.991118,
HOSTTYPE=FreeBSD],
[262,263,264,265,266,268,269,272,273,275,276],
[[514],[2130706434,1,2,4,5,17,19,20,22,23,24,25,26,30,31,60,61,27,33,
40,16,34]]]],
[1,[[199901160,ox_asir],
[276,275,258,262,263,266,267,268,274,269,272,265,264,273,300,270,271],
[[514,2144202544],
[1,2,3,4,5,2130706433,2130706434,17,19,20,21,22,24,25,26,31,27,33,60],
[0,1]]]]]
参照

Mathcap.


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.15 ifplot, conplot, plot, polarplot, plotover

ifplot(func [,geometry] [,xrange] [,yrange] [,id] [,name])

:: 2 変数関数の実数上での零点を表示する.

conplot(func [,geometry] [,xrange] [,yrange] [,zrange] [,id] [,name])

:: 2 変数関数の実数上での等高線を表示する.

plot(func [,geometry] [,xrange] [,id] [,name])

:: 1 変数関数のグラフを表示する.

polarplot(func [,geometry] [,thetarange] [,id] [,name])

:: 極形式で与えられた曲線を表示する.

plotover(func,id,number)

:: すでに存在しているウィンドウへ描画する.

return

整数

func

多項式

geometry xrange yrange zrange

リスト

id number

整数

name

文字列

参照

ox_launch, ox_launch_nox, ox_shutdown, ox_reset,ox_intr,register_handler


[ << ] [ < ] [] [ > ] [ >> ]         [冒頭] [目次] [見出し] [ ? ]

7.5.16 open_canvas, clear_canvas, draw_obj, draw_string

open_canvas(id[,geometry])

:: 描画用ウィンドウ (キャンバス) を生成する.

clear_canvas(id,index)

:: キャンバスをクリアする.

draw_obj(id,index,pointorsegment [,color])

:: キャンバス上に点または線分を描画する.

draw_string(id,index,[x,y],string [,color])

:: キャンバス上に文字列を描画する.

return

0

id index color x y

整数

pointorsegment

リスト

string

文字列

[182] Id=ox_launch_nox(0,"ox_plot");
0
[183] open_canvas(Id);
0
[184] Ind=ox_pop_cmo(Id);
0
[185] draw_obj(Id,Ind,[100,100]);
0
[186] draw_obj(Id,Ind,[200,200],0xffff);
0
[187] draw_obj(Id,Ind,[10,10,50,50],0xff00ff);
0
[187] draw_string(Id,Ind,[100,50],"hello",0xffff00);
0
[189] clear_canvas(Id,Ind);
0
参照

ox_launch, ox_launch_nox, ox_shutdown, ox_reset,ox_intr,register_handler, ox_pop_cmo, ox_pop_local.


[ << ] [ < ] [] [ > ] [ >> ]

この文書は12月 21, 2024texi2html 5.0を用いて生成されました。