200{
202 if (cpus<1)
203 {
204 WerrorS(
"no sub-processes allowed");
206 }
207 int cnt=0;
int rw=0;
int cl=0;
208
209 for(
int j=rl-1;
j>=0;
j--)
210 {
213 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
215 }
217 {
218 WerrorS(
"format mismatch in CRT");
220 }
223
225 if (cpus<=1)
226
231 int parent_pid=getpid();
234
236 for(
int i=cnt-1;
i>=0;
i--)
237 {
239 }
240 for(
int i=cpus;
i>=0;
i--)
241 {
242 queue->enqueue(-1);
243 }
244
246 int *pids=(
int*)
omAlloc0(cpus*
sizeof(
int));
247 for (
int i=0;
i<cpus;
i++)
248 {
250 if (pid==0) break;
252 }
253 if (parent_pid!=getpid())
254 {
258 number *
x=(number *)
omAlloc(rl*
sizeof(number));
259 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
264 {
265 int ind=queue->dequeue();
266 if (ind== -1)
267 {
268 _exit(0);
269 }
270
271 for(
int j=rl-1;
j>=0;
j--)
272 {
275 else
277 }
280
282 char *
s=(
char*)msg->str();
284 rqueue->enqueue(msg);
286 }
287 }
288 else
289 {
292 while(cnt>0)
293 {
294 msg=rqueue->dequeue();
295 char *
s=(
char*)msg->str();
296 int ind;
299
302 cnt--;
303 }
305 int done=0;
306 while(done!=cpus)
307 {
310 {
311 int p=si_waitpid(pids[
i],
NULL,WNOHANG);
313 {
315 done++;
316 }
317 }
320 }
322
326 }
328}
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)
const CanonicalForm int s
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()