Changeset 930719 in git


Ignore:
Timestamp:
Nov 17, 2020, 1:58:52 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
9423058a6c6c15f2436061ded858654af6c902ac
Parents:
e324f51573c3a0db123f5473c70ad06029c9768a
Message:
separate serial/parallel kVerify*, avoid fork on cygwin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    re324f51 r930719  
    6767#include "kernel/GBEngine/syz.h"
    6868#include "kernel/GBEngine/kutil.h"
     69#include "kernel/GBEngine/kverify.h"
    6970
    7071#include "kernel/linear_algebra/linearAlgebra.h"
     
    38783879      }
    38793880      ideal F=(ideal)h->Data();
    3880       res->data=(char*)(long) kVerify(F,currRing->qideal);
     3881      res->data=(char*)(long) kVerify2(F,currRing->qideal);
    38813882      res->rtyp=INT_CMD;
    38823883      return FALSE;
  • kernel/GBEngine/kverify.cc

    re324f51 r930719  
    77#include "polys/monomials/ring.h"
    88#include "kernel/GBEngine/kutil.h"
     9#include "kernel/GBEngine/kverify.h"
    910#include "Singular/feOpt.h"
    1011#include <stdlib.h>
    1112#include <string.h>
    1213
    13 #define MULTIPROCESS 1
    14 #ifdef MULTIPROCESS
     14#if !defined(__CYGWIN__)
    1515#include "kernel/oswrapper/vspace.h"
    1616#include <sys/types.h>
     
    1818#endif
    1919
    20 BOOLEAN kVerify(ideal F, ideal Q)
     20BOOLEAN kVerify1(ideal F, ideal Q)
    2121{
    2222  kStrategy strat=new skStrategy;
     
    7373  /*---------------------------------------------------------------------*/
    7474  BOOLEAN all_okay=TRUE;
    75   #ifndef MULTIPROCESS /* seriell */
    7675  for(int i=strat->Ll;i>=0; i--)
    7776  {
     
    117116  }
    118117  return all_okay;
    119   #endif
     118}
     119
     120BOOLEAN kVerify2(ideal F, ideal Q)
     121{
     122#if !defined(__CYGWIN__)
     123  kStrategy strat=new skStrategy;
     124  strat->ak = id_RankFreeModule(F,currRing);
     125  strat->kModW=kModW=NULL;
     126  strat->kHomW=kHomW=NULL;
     127  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
     128  initBuchMoraPos(strat);
     129  initBba(strat);
     130  initBuchMora(F, Q,strat);
     131  /*initBuchMora:*/
     132    strat->tail = pInit();
     133    /*- set s -*/
     134    strat->sl = -1;
     135    /*- set L -*/
     136    strat->Lmax = ((IDELEMS(F)+setmaxLinc-1)/setmaxLinc)*setmaxLinc;
     137    strat->Ll = -1;
     138    strat->L = initL(strat->Lmax);
     139    /*- set B -*/
     140    strat->Bmax = setmaxL;
     141    strat->Bl = -1;
     142    strat->B = initL();
     143    /*- set T -*/
     144    strat->tl = -1;
     145    strat->tmax = setmaxT;
     146    strat->T = initT();
     147    strat->R = initR();
     148    strat->sevT = initsevT();
     149    /*- init local data struct.---------------------------------------- -*/
     150    strat->P.ecart=0;
     151    strat->P.length=0;
     152    strat->P.pLength=0;
     153    initS(F, Q,strat); /*sets also S, ecartS, fromQ */
     154    strat->fromT = FALSE;
     155    strat->noTailReduction = FALSE;
     156  /*----------------------------------------------------------------------*/
     157  /* build pairs */
     158  if (strat->fromQ!=NULL)
     159  {
     160    for(int i=1; i<=strat->sl;i++)
     161    {
     162      initenterpairs(strat->S[i],i-1,0,strat->fromQ[i],strat);
     163    }
     164  }
     165  else
     166  {
     167    for(int i=1; i<=strat->sl;i++)
     168    {
     169      initenterpairs(strat->S[i],i-1,0,FALSE,strat);
     170    }
     171  }
     172  if (TEST_OPT_PROT) printf("%d pairs created\n",strat->Ll+1);
     173  if (TEST_OPT_DEBUG) messageSets(strat);
    120174  /*---------------------------------------------------------------------*/
    121   #ifdef MULTIPROCESS
     175  BOOLEAN all_okay=TRUE;
    122176  int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
    123177  int parent_pid=getpid();
     
    232286    return all_okay;
    233287  }
    234   #endif
     288#else
     289  return kVerify1(F,Q);
     290#endif
    235291}
  • kernel/GBEngine/kverify.h

    re324f51 r930719  
    1 BOOLEAN kVerify(ideal F, ideal Q);
     1#ifndef KVERIFY_H
     2#define KVERIFY_H
     3#include "polys/simpleideals.h"
     4BOOLEAN kVerify1(ideal F, ideal Q); /* seriell*/
     5BOOLEAN kVerify2(ideal F, ideal Q); /* parallel */
     6#endif
  • kernel/oswrapper/vspace.cc

    re324f51 r930719  
    11// https://github.com/rbehrends/vspace
    22#include "vspace.h"
     3
     4#if !defined(__CYGWIN__)
    35
    46#ifdef HAVE_CPP_THREADS
     
    552554
    553555} // namespace vspace
     556#endif
  • kernel/oswrapper/vspace.h

    re324f51 r930719  
     1#ifndef VSPACE_H
     2#define VSPACE_H
    13#include <fcntl.h>
    24#include <stddef.h>
     
    911#include <assert.h>
    1012#include <new> // for placement new
     13
     14#if !defined(__CYGWIN__)
    1115
    1216#if __cplusplus >= 201100
     
    13341338
    13351339}; // namespace vspace
     1340#endif
     1341#endif
Note: See TracChangeset for help on using the changeset viewer.