Annotation of OpenXM/doc/Papers/job-pool.asir, Revision 1.1
1.1 ! takayama 1: /* $OpenXM$ */
! 2: /* For ohp-metro.tex */
! 3: #define SM_popCMO 262
! 4: def pool() {
! 5: P = [ox_launch(), ox_launch(), ox_launch()];
! 6: map(ox_push_cmo,P,0);
! 7: map(ox_push_cmd,P,SM_popCMO);
! 8: /* map(ox_get,P); mistake */
! 9:
! 10: I = 50;
! 11: Jobs = [x^(I)-y^(I),x^(I+1)-y^(I+1),x^(I+2)-y^(I+2),x^(I+3)-y^(I+3),
! 12: x^(I+4)-y^(I+4),x^(I+5)-y^(I+5)];
! 13: N = length(Jobs);
! 14: Ans = [ ];
! 15: print("------ started -----");
! 16: /* while (length(Jobs) != 0) { mistake */
! 17: while (length(Ans) != N) {
! 18: Q = ox_select(P)[0];
! 19: F = ox_get(Q);
! 20: /* print([Q,F]); */
! 21: if (F != 0) {
! 22: Ans = append(Ans,[F]);
! 23: print(Q);
! 24: }
! 25: if (length(Jobs) > 0) {
! 26: Job = car(Jobs); Jobs=cdr(Jobs);
! 27: ox_rpc(Q,"fctr",Job); ox_push_cmd(Q,SM_popCMO);
! 28: }
! 29: }
! 30: return(Ans);
! 31: }
! 32:
! 33:
! 34: #define SM_executeFunction 269
! 35: def ex1() {
! 36: P = ox_launch();
! 37: ox_push_cmo(P,13);
! 38: ox_push_cmo(P,8);
! 39: ox_push_cmo(P,ntoint32(2));
! 40: ox_push_cmo(P,"igcd");
! 41: ox_push_cmd(P,SM_executeFunction);
! 42: return(ox_pop_cmo(P));
! 43: }
! 44: /*
! 45: ox_execute_string(P,"igcd(13,8);");
! 46: ox_rpc(P,"igcd",13,8);
! 47: */
! 48:
! 49: def ex2() {
! 50: P = ox_launch();
! 51: Ans = [ ];
! 52: for (I=0; I<1.0; I=I+0.1) {
! 53: /* ox_execute_string(P,"pari(dilog,0.3);"); */
! 54: ox_execute_string(P,"pari(dilog,"+rtostr(I)+");");
! 55: Ans = append(Ans,[ox_pop_local(P)]);
! 56: }
! 57: return(Ans);
! 58: }
! 59:
! 60: end$
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>