200{
201 int cnt=0;
int rw=0;
int cl=0;
202
203 for(
int j=rl-1;
j>=0;
j--)
204 {
207 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
209 }
211 {
212 WerrorS(
"format mismatch in CRT");
214 }
218
220 if (cpus<=1)
221
226 int parent_pid=getpid();
229
231 for(
int i=cnt-1;
i>=0;
i--)
232 {
234 }
235 for(
int i=cpus;
i>=0;
i--)
236 {
237 queue->enqueue(-1);
238 }
239
241 int *pids=(
int*)
omAlloc0(cpus*
sizeof(
int));
242 for (
int i=0;
i<cpus;
i++)
243 {
245 if (pid==0) break;
247 }
248 if (parent_pid!=getpid())
249 {
253 number *
x=(number *)
omAlloc(rl*
sizeof(number));
254 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
259 {
260 int ind=queue->dequeue();
261 if (ind== -1)
262 {
263 _exit(0);
264 }
265
266 for(
int j=rl-1;
j>=0;
j--)
267 {
270 else
272 }
275
277 char *
s=(
char*)msg->str();
279 rqueue->enqueue(msg);
281 }
282 }
283 else
284 {
287 while(cnt>0)
288 {
289 msg=rqueue->dequeue();
290 char *
s=(
char*)msg->str();
291 int ind;
294
297 cnt--;
298 }
300 int done=0;
301 while(done!=cpus)
302 {
305 {
306 int p=si_waitpid(pids[
i],
NULL,WNOHANG);
308 {
310 done++;
311 }
312 }
315 }
317
321 }
323}
static int si_min(const int a, const int b)
si_hdl_typ si_set_signal(int sig, si_hdl_typ signal_handler)
meta function for binding a signal to an handler
void sig_term_hdl_child(int)
void WerrorS(const char *s)
const char * feSetOptValue(feOptIndex opt, char *optarg)
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
static void vmem_deinit()
static Status vmem_init()
static VRef< VString > vstring(const char *s)
#define omFreeSize(addr, size)
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
void singular_close_links()