extern Proc1,Proc2$ Proc1 = -1$ Proc2 = -1$ /* G:set of polys; V:list of variables */ /* Mod: the Ground field GF(Mod); O:type of order */ def dgr(G,V,Mod,O) { /* invoke servers if necessary */ if ( Proc1 == -1 ) Proc1 = ox_launch(); if ( Proc2 == -1 ) Proc2 = ox_launch(); P = [Proc1,Proc2]; map(ox_reset,P); /* reset servers */ /* P0 executes Buchberger algorithm over GF(Mod) */ ox_cmo_rpc(P[0],"dp_gr_mod_main",G,V,0,Mod,O); /* P1 executes F4 algorithm over GF(Mod) */ ox_cmo_rpc(P[1],"dp_f4_mod_main",G,V,Mod,O); map(ox_push_cmd,P,262); /* 262 = OX_popCMO */ F = ox_select(P); /* wait for data */ /* F[0] is a server's id which is ready */ R = ox_get(F[0]); if ( F[0] == P[0] ) { Win = "Buchberger"; Lose = P[1]; } else { Win = "F4"; Lose = P[0]; } ox_reset(Lose); /* reset the loser */ return [Win,R]; } /* Try dgr(katsura(5),vars(katsura(5)),113,2); dgr(katsura(7),vars(katsura(7)),113,0); */ end$