197{
198 int cnt=0;
int rw=0;
int cl=0;
199
200 for(
int j=rl-1;
j>=0;
j--)
201 {
204 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
206 }
208 {
209 WerrorS(
"format mismatch in CRT");
211 }
215
216 if ((cpus==1) || (2*cpus>=cnt))
217
222 int parent_pid=getpid();
224 vmem_init();
225
227 for(
int i=cnt-1;
i>=0;
i--)
228 {
230 }
231 for(
int i=cpus;
i>=0;
i--)
232 {
233 queue->enqueue(-1);
234 }
235
237 for (
int i=0;
i<cpus;
i++)
238 {
240 if (pid==0) break;
241 }
242 if (parent_pid!=getpid())
243 {
244 number *
x=(number *)
omAlloc(rl*
sizeof(number));
245 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
250 {
251 int ind=queue->dequeue();
252 if (ind== -1)
253 {
254 exit(0);
255 }
256
257 for(
int j=rl-1;
j>=0;
j--)
258 {
261 else
263 }
266
268 char *
s=(
char*)msg->str();
270 rqueue->enqueue(msg);
272 }
273 }
274 else
275 {
278 while(cnt>0)
279 {
280 msg=rqueue->dequeue();
281 char *
s=(
char*)msg->str();
282 int ind;
285
288 cnt--;
289 }
290
293 vmem_deinit();
294 }
296}
const CanonicalForm int s
void WerrorS(const char *s)
static void * feOptValue(feOptIndex opt)
static char * get_poly(char *s, int &ind, poly *p, const ring r)
static long size_poly(poly p, const ring r)
static char * send_poly(char *s, int ind, poly p, const ring r)
poly p_ChineseRemainder(poly *xx, mpz_ptr *x, mpz_ptr *q, int rl, mpz_ptr *C, const ring R)
static const int MAX_PROCESS
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)