196{
197 int cnt=0;
int rw=0;
int cl=0;
198
199 for(
int j=rl-1;
j>=0;
j--)
200 {
203 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
205 }
207 {
208 WerrorS(
"format mismatch in CRT");
210 }
212 if ((cpus==1) || (2*cpus>=cnt))
213
218 int parent_pid=getpid();
220 vmem_init();
221
223 for(
int i=cnt-1;
i>=0;
i--)
224 {
226 }
227 for(
int i=cpus;
i>=0;
i--)
228 {
229 queue->enqueue(-1);
230 }
231
233 for (
int i=0;
i<cpus;
i++)
234 {
236 if (pid==0) break;
237 }
238 if (parent_pid!=getpid())
239 {
240 number *
x=(number *)
omAlloc(rl*
sizeof(number));
241 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
246 {
247 int ind=queue->dequeue();
248 if (ind== -1)
249 {
250 exit(0);
251 }
252
253 for(
int j=rl-1;
j>=0;
j--)
254 {
257 else
259 }
262
264 char *
s=(
char*)msg->str();
266 rqueue->enqueue(msg);
268 }
269 }
270 else
271 {
274 while(cnt>0)
275 {
276 msg=rqueue->dequeue();
277 char *
s=(
char*)msg->str();
278 int ind;
281
284 cnt--;
285 }
286
289 vmem_deinit();
290 }
292}
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)
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)