Changeset 188de86 in git


Ignore:
Timestamp:
Aug 2, 2012, 4:09:13 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
Children:
4f9652847609cefd5ff3b91d14f34611592ab699
Parents:
0419aba8292e7109329604d8ad03b70f8ef6542344a1c2199e33375a631289eaab7a81954c8383e2
Message:
Merge pull request #158 from alexanderdreyer/spielwiese

Transfering newstruct and pyobject fixes to Spielwiese
Files:
3 added
16 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.am

    r44a1c2 r188de86  
    6868   minpoly.cc\
    6969   misc_ip.cc\
    70    mpsr_Error.cc\
    71    mpsr_Get.cc\
    72    mpsr_GetMisc.cc\
    73    mpsr_GetPoly.cc\
    74    mpsr_Put.cc\
    75    mpsr_PutPoly.cc\
    76    mpsr_Timer.cc\
    77    mpsr_Tok.cc\
    78    mpsr_sl.cc\
    7970   ndbm.cc\
    8071   newstruct.cc\
     
    132123   mmalloc.h \
    133124   omSingularConfig.h \
    134    mpsr.h \
    135    mpsr_Get.h \
    136    mpsr_Put.h \
    137    mpsr_Timer.h \
    138    mpsr_Tok.h \
    139    mpsr_sl.h \
    140125   ndbm.h \
    141126   newstruct.h \
     
    158143
    159144# plural_cmd.inc
    160 nodist_libSingular_la_SOURCES = mpsr_Tok.inc iparith.inc
    161 nodist_libSingular_g_la_SOURCES = mpsr_Tok.inc iparith.inc
     145nodist_libSingular_la_SOURCES = iparith.inc
     146nodist_libSingular_g_la_SOURCES = iparith.inc
    162147
    163148noinst_HEADERS = version.h
     
    176161# handle all the generated *.inc
    177162
    178 noinst_PROGRAMS = gentable2 gentable1 feOptGen feOptES feOptTS
    179 
    180 gentable2_SOURCES = gentable2.cc grammar.h tok.h table.h
    181 gentable2_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
    182 gentable2_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
    183 gentable2_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
    184 
     163noinst_PROGRAMS = gentable1 feOptGen feOptES feOptTS
    185164
    186165gentable1_SOURCES = gentable.cc grammar.h tok.h table.h
     
    364343
    365344# These files are built first
    366 BUILT_SOURCES = feOpt.inc feOptTS.inc feOptES.inc mpsr_Tok.inc iparith.inc LIB/all.lib plural_cmd.inc \
     345BUILT_SOURCES = feOpt.inc feOptTS.inc feOptES.inc iparith.inc LIB/all.lib plural_cmd.inc \
    367346                gftables MOD
    368347
     
    384363# plural_cmd.inc: iparith.inc
    385364
    386 mpsr_Tok.inc: gentable2
    387         ${abs_builddir}/gentable2
    388 
    389 
    390365
    391366gftables: ${abs_top_srcdir}/factory/gftables
  • Singular/blackbox.h

    r0419ab r188de86  
    5757BOOLEAN blackboxDefaultOp2(int op,leftv l, leftv r1, leftv r2);
    5858
     59/// default procedure blackboxDefaultOp3, to be called as "default:" branch
     60BOOLEAN blackboxDefaultOp3(int op,leftv l, leftv r1,leftv r2, leftv r3);
     61
    5962/// default procedure blackboxDefaultOpM, to be called as "default:" branch
    6063BOOLEAN blackbox_default_OpM(int op,leftv l, leftv r);
  • Singular/extra.cc

    r44a1c2 r188de86  
    434434            //TEST_FOR("libfac")
    435435          #endif
    436           #ifdef HAVE_MPSR
    437             TEST_FOR("MP")
    438           #endif
    439436          #ifdef HAVE_READLINE
    440437            TEST_FOR("readline")
     
    22372234#    include <hc_newton.h>
    22382235#  endif
    2239 #  include <mpsr.h>
    22402236#  include <polys/mod_raw.h>
    22412237#  include <polys/monomials/ring.h>
  • Singular/feOptTab.h

    r44a1c2 r188de86  
    140140   "LINK",     "Use LINK for connections",                             feOptString,    0,   0},
    141141
    142 #ifdef HAVE_MPSR
    143   {"MPrsh",           required_argument,   LONG_OPTION_RETURN,
    144    "RSH",     "Use RSH for MP connections",                            feOptString,    0,   0},
    145 #endif
    146 
    147142  {"ticks-per-sec",     required_argument,  LONG_OPTION_RETURN,
    148143   "TICKS",     "Sets unit of timer to TICKS per second",               feOptInt,    (void*)1,      0},
    149 
    150 // undocumented options
    151 #ifdef HAVE_MPSR
    152   {"MPtransp",         required_argument,   LONG_OPTION_RETURN,
    153    "TRANSP",    "// Use TRANSP for MP connections",                     feOptString,    0,   0},
    154 
    155   {"MPmode",           required_argument,   LONG_OPTION_RETURN,
    156    "MODE",      "// Use MODE for MP connections",                       feOptString,    0,   0},
    157 #endif
    158144
    159145// terminator -- do NOT remove
  • Singular/misc_ip.cc

    r44a1c2 r188de86  
    367367
    368368
    369 /* version strings */
    370 #ifdef HAVE_MPSR
    371 #include <MP_Config.h>
    372 #endif
    373 
    374369/*2
    375370* the renice routine for very large jobs
     
    761756              StringAppend("NTL(%s),",NTL_VERSION);
    762757#endif
    763 #ifdef HAVE_MPSR
    764               StringAppend("MP(%s),",MP_VERSION);
    765 #endif
    766758#if SIZEOF_VOIDP == 8
    767759              StringAppendS("64bit,");
     
    1003995* the global exit routine of Singular
    1004996*/
    1005 #ifdef HAVE_MPSR
    1006 void (*MP_Exit_Env_Ptr)()=NULL;
    1007 #endif
    1008 
    1009997extern "C" {
    1010998
     
    10541042    }
    10551043  }
    1056   #ifdef HAVE_MPSR
    1057   if (MP_Exit_Env_Ptr!=NULL) (*MP_Exit_Env_Ptr)();
    1058   #endif
    10591044  exit(i);
    10601045}
  • Singular/newstruct.cc

    r0419ab r188de86  
    3939};
    4040
     41int newstruct_desc_size()
     42{
     43  return sizeof(newstruct_desc_s);
     44}
    4145
    4246char * newstruct_String(blackbox *b, void *d)
     
    4650  {
    4751    newstruct_desc ad=(newstruct_desc)(b->data);
     52
     53    newstruct_proc p=ad->procs;
     54    while((p!=NULL)&&(p->t!=STRING_CMD))
     55      p=p->next;
     56
     57    if (p!=NULL)
     58    {
     59      leftv sl;
     60      sleftv tmp;
     61      memset(&tmp,0,sizeof(tmp));
     62      tmp.rtyp=ad->id;
     63      void * newstruct_Copy(blackbox*, void *); //forward declaration
     64      tmp.data=(void*)newstruct_Copy(b,d);
     65      idrec hh;
     66      memset(&hh,0,sizeof(hh));
     67      hh.id=Tok2Cmdname(p->t);
     68      hh.typ=PROC_CMD;
     69      hh.data.pinf=p->p;
     70      sl=iiMake_proc(&hh,NULL,&tmp);
     71
     72      if (sl->Typ() == STRING_CMD)
     73      {
     74        char *res = omStrDup((char*)sl->Data());
     75        sl->CleanUp();
     76        return res;
     77      }
     78      else
     79        sl->CleanUp();     
     80    }
     81
    4882    lists l=(lists)d;
    4983    newstruct_member a=ad->member;
     
    130164}
    131165
     166// Used by newstruct_Assign for overloaded '='
     167BOOLEAN newstruct_equal(int op, leftv l, leftv r)
     168{
     169  blackbox *ll=getBlackboxStuff(op);
     170  assume(ll->data != NULL);
     171  newstruct_desc nt=(newstruct_desc)ll->data;
     172  newstruct_proc p=nt->procs;
     173 
     174  while( (p!=NULL) && ((p->t!='=')||(p->args!=1)) ) p=p->next;
     175
     176  if (p!=NULL)
     177  {
     178    idrec hh;
     179    memset(&hh,0,sizeof(hh));
     180    hh.id=Tok2Cmdname(p->t);
     181    hh.typ=PROC_CMD;
     182    hh.data.pinf=p->p;
     183    sleftv tmp;
     184    memset(&tmp,0,sizeof(sleftv));
     185    tmp.Copy(r);
     186    leftv sl = iiMake_proc(&hh, NULL, &tmp);
     187    if (sl != NULL)
     188    {
     189      if (sl->Typ() == op) { l->Copy(sl); return FALSE;}
     190      else sl->CleanUp();
     191    }
     192  }
     193  return TRUE;
     194}
     195
    132196BOOLEAN newstruct_Assign(leftv l, leftv r)
    133197{
     
    138202    {
    139203      newstruct_desc rrn=(newstruct_desc)rr->data;
     204
     205      if (!rrn)
     206      {
     207        Werror("custom type %s(%d) cannot be assigned to newstruct %s(%d)",
     208               Tok2Cmdname(r->Typ()), r->Typ(), Tok2Cmdname(l->Typ()), l->Typ());
     209        return TRUE;
     210      }
     211
    140212      newstruct_desc rrp=rrn->parent;
    141213      while ((rrp!=NULL)&&(rrp->id!=l->Typ())) rrp=rrp->parent;
     
    151223        }
    152224      }
     225      else                      // unrelated types - look for custom conversion
     226      {
     227        sleftv tmp;
     228        BOOLEAN newstruct_Op1(int, leftv, leftv);  // forward declaration
     229        if (! newstruct_Op1(l->Typ(), &tmp, r))  return newstruct_Assign(l, &tmp);
     230      }
    153231    }
    154232    if (l->Typ()==r->Typ())
     
    172250    }
    173251  }
     252
     253  else if(l->Typ() > MAX_TOK)
     254  {
     255    assume(l->Typ() > MAX_TOK);
     256    sleftv tmp;
     257    if(!newstruct_equal(l->Typ(), &tmp, r)) return newstruct_Assign(l, &tmp);
     258  }
    174259  Werror("assign %s(%d) = %s(%d)",
    175260        Tok2Cmdname(l->Typ()),l->Typ(),Tok2Cmdname(r->Typ()),r->Typ());
    176261  return TRUE;
    177262}
     263
     264BOOLEAN newstruct_Op1(int op, leftv res, leftv arg)
     265{
     266  // interpreter: arg is newstruct
     267  blackbox *a=getBlackboxStuff(arg->Typ());
     268  newstruct_desc nt=(newstruct_desc)a->data;
     269  newstruct_proc p=nt->procs;
     270
     271  while((p!=NULL) &&( (p->t!=op) || (p->args!=1) )) p=p->next;
     272
     273  if (p!=NULL)
     274  {
     275    leftv sl;
     276    sleftv tmp;
     277    memset(&tmp,0,sizeof(sleftv));
     278    tmp.Copy(arg);
     279    idrec hh;
     280    memset(&hh,0,sizeof(hh));
     281    hh.id=Tok2Cmdname(p->t);
     282    hh.typ=PROC_CMD;
     283    hh.data.pinf=p->p;
     284    sl=iiMake_proc(&hh,NULL,&tmp);
     285    if (sl==NULL) return TRUE;
     286    else
     287    {
     288      res->Copy(sl);
     289      return FALSE;
     290    }
     291  }
     292  return blackboxDefaultOp1(op,res,arg);
     293}
     294
     295
    178296
    179297BOOLEAN newstruct_Op2(int op, leftv res, leftv a1, leftv a2)
     
    280398  }
    281399  newstruct_proc p=nt->procs;
    282   while((p!=NULL) &&(p->t=op)&&(p->args!=2)) p=p->next;
     400  while((p!=NULL) && ( (p->t!=op) || (p->args!=2) )) p=p->next;
    283401  if (p!=NULL)
    284402  {
     
    323441  }
    324442  newstruct_proc p=nt->procs;
    325   while((p!=NULL) &&(p->t=op)&&(p->args!=4)) p=p->next;
     443 
     444  while((p!=NULL) &&( (p->t!=op) || (p->args!=4) )) p=p->next;
     445
    326446  if (p!=NULL)
    327447  {
     
    474594  b->blackbox_Copy=newstruct_Copy;
    475595  b->blackbox_Assign=newstruct_Assign;
    476   //b->blackbox_Op1=blackboxDefaultOp1;
     596  b->blackbox_Op1=newstruct_Op1;
    477597  b->blackbox_Op2=newstruct_Op2;
    478598  //b->blackbox_Op3=blackbox_default_Op3;
     
    617737  newstruct_proc p=(newstruct_proc)omAlloc(sizeof(*p));
    618738  p->next=desc->procs; desc->procs=p;
     739
     740  idhdl save_ring=currRingHdl;
     741  currRingHdl=(idhdl)1; // fake ring detection
     742
    619743  if(!IsCmd(func,p->t))
    620744  {
     
    628752    {
    629753      Werror(">>%s<< is not a kernel command",func);
     754      currRingHdl = save_ring;
    630755      return TRUE;
    631756    }
     
    633758  p->args=args;
    634759  p->p=pr; pr->ref++;
     760  currRingHdl = save_ring;
    635761  return FALSE;
    636762}
  • Singular/newstruct.h

    r0419ab r188de86  
    55
    66void newstruct_setup(const char * name, newstruct_desc d);
     7int newstruct_desc_size();
    78newstruct_desc newstructFromString(const char *s);
    89newstruct_desc newstructChildFromString(const char *p, const char *s);
  • Singular/pyobject.cc

    r0419ab r188de86  
    1616#include <kernel/mod2.h>
    1717#include <misc/auxiliary.h>
     18#include "newstruct.h"
    1819
    1920#include <omalloc/omalloc.h>
    2021
    2122#include <kernel/febase.h>
    22 // #include <kernel/longrat.h>
     23#include <kernel/intvec.h>
    2324
    2425#include "subexpr.h"
     
    110111
    111112  PythonObject(): m_ptr(Py_None) { }
    112   PythonObject(ptr_type ptr): m_ptr(ptr) {if (!ptr) handle_exception();}
     113  PythonObject(ptr_type ptr): m_ptr(ptr) {
     114    if (!ptr && handle_exception()) m_ptr = Py_None;
     115  }
    113116
    114117  ptr_type check_context(ptr_type ptr) const {
     
    129132      return *this;
    130133
    131     Werror("unary op %d not implemented for pyobject", op);
    132     return self();
     134    return self(NULL);
    133135  }
    134136
     
    149151      case '.': case COLONCOLON: case ATTRIB_CMD: return attr(arg);
    150152    }
    151     Werror("binary op %d not implemented for pyobject!", op);
    152 
    153     return self();
     153    return self(NULL);
    154154  }
    155155
     
    159159    switch(op)
    160160    {
    161       case ATTRIB_CMD: PyObject_SetAttr(*this, arg1, arg2); return self();
    162     }
    163 
    164     Werror("ternary op %d not implemented for pyobject!", op);
    165     return self();
     161      case ATTRIB_CMD:
     162        if(PyObject_SetAttr(*this, arg1, arg2) == -1) handle_exception();
     163        return self();
     164    }
     165    return self(NULL);
    166166  }
    167167
     
    186186  BOOLEAN assign_to(leftv result)
    187187  {
    188     return (m_ptr == Py_None? none_to(result): python_to(result));
     188    return (m_ptr? (m_ptr == Py_None? none_to(result): python_to(result)): TRUE);
    189189  }
    190190
     
    229229  }
    230230
    231   void handle_exception() {
     231  BOOLEAN handle_exception() const {
     232
     233    if(!PyErr_Occurred()) return FALSE;
    232234   
    233235    PyObject *pType, *pMessage, *pTraceback;
     
    242244   
    243245    PyErr_Clear();
     246    return TRUE;
    244247  }
    245248
     
    268271  BOOLEAN none_to(leftv result) const
    269272  {
     273    Py_XDECREF(m_ptr);
    270274    result->data = NULL;
    271275    result->rtyp = NONE;
     
    276280  {
    277281    result->data = m_ptr;
     282    Py_XINCREF(m_ptr);
    278283    result->rtyp = PythonInterpreter::id();
    279284    return !m_ptr;
     
    295300class PythonCastStatic:
    296301  public PythonObject {
     302  typedef PythonCastStatic self;
    297303public:
    298304
     
    306312  ptr_type get(ptr_type value)       { return value; }
    307313  ptr_type get(long value)           { return PyInt_FromLong(value); }
     314  ptr_type get(int value)            { return PyInt_FromLong((long)value); }
    308315  ptr_type get(const char* value)    { return PyString_FromString(value); }
    309316  ptr_type get(char* value) { return get(const_cast<const char*>(value)); }
     317  ptr_type get(intvec* value);       // inlined below
    310318  ptr_type get(lists value);         // inlined after PythonObjectDynamic
    311319};
    312320
    313 
     321template <class CastType>
     322inline PythonObject::ptr_type
     323PythonCastStatic<CastType>::get(intvec* value)
     324{
     325  ptr_type pylist(PyList_New(0));
     326  for (int idx = 0; idx < value->length(); ++idx)
     327    PyList_Append(pylist, self::get((*value)[idx]));
     328
     329  return pylist;
     330}
    314331
    315332/** @class PythonCastDynamic
     
    334351    case STRING_CMD: return PythonCastStatic<const char*>(value);
    335352    case LIST_CMD:   return PythonCastStatic<lists>(value);
    336       //    case UNKNOWN:    return PythonCastStatic<const char*>((void*)value->Name());
    337     }
    338    
    339     Werror("type # %d incompatible with pyobject", typeId);
     353    case INTVEC_CMD: return PythonCastStatic<intvec*>(value);
     354    }
     355
     356    sleftv tmp;
     357    BOOLEAN newstruct_equal(int, leftv, leftv); // declaring overloaded '='
     358    if (!newstruct_equal(PythonInterpreter::id(), &tmp, value)) 
     359      return PythonCastStatic<>(&tmp);       
     360
     361    if (typeId > MAX_TOK)       // custom types
     362    {
     363      blackbox *bbx = getBlackboxStuff(typeId);
     364      assume(bbx != NULL);
     365      if (! bbx->blackbox_Op1(PythonInterpreter::id(), &tmp, value))
     366        return PythonCastStatic<>(&tmp);       
     367    }
     368
     369    Werror("type '%s` incompatible with 'pyobject`", iiTwoOps(typeId));
    340370    return PythonObject();
    341371  }
     
    347377{
    348378  ptr_type pylist(PyList_New(0));
    349   for (size_t i = 0; i <= value->nr; ++i)
     379  for (int i = 0; i <= value->nr; ++i)
    350380    PyList_Append(pylist, PythonCastDynamic((value->m) + i));
    351381
     
    416446  PyRun_SimpleString(reinterpret_cast<const char*>(arg->Data()));
    417447  sync_contexts();
     448
     449  Py_XINCREF(Py_None);
    418450  return PythonCastStatic<>(Py_None).assign_to(result);
    419451}
     
    448480  sync_contexts();
    449481
     482  Py_XINCREF(Py_None);
    450483  return PythonCastStatic<>(Py_None).assign_to(result);
    451484}
     
    454487void* pyobject_Init(blackbox*)
    455488{
     489  Py_XINCREF(Py_None);
    456490  return Py_None;
    457491}
     
    495529      long value = PyInt_AsLong(PythonCastStatic<>(head));
    496530      if( (value == -1) &&  PyErr_Occurred() ) {
    497         Werror("pyobject cannot be converted to integer");
     531        Werror("'pyobject` cannot be converted to integer");
    498532        PyErr_Clear();
    499533        return TRUE;
     
    506540      res->data = (void*) omStrDup("pyobject");
    507541      res->rtyp = STRING_CMD; 
    508       return FALSE;
    509 
    510   case LIST_CMD:
     542      return FALSE;
     543  }
     544
     545  if (!PythonCastStatic<>(head)(op).assign_to(res))
    511546    return FALSE;
    512547
    513   }
    514   return PythonCastStatic<>(head)(op).assign_to(res);
     548  BOOLEAN newstruct_Op1(int, leftv, leftv); // forward declaration
     549  return newstruct_Op1(op, res, head);
    515550}
    516551
     
    532567      return lhs.attr(get_attrib_name(arg2)).assign_to(res);
    533568  }
     569
    534570  PythonCastDynamic rhs(arg2);
    535   return lhs(op, rhs).assign_to(res);
     571  if (!lhs(op, rhs).assign_to(res))
     572    return FALSE;
     573
     574  BOOLEAN newstruct_Op2(int, leftv, leftv, leftv); // forward declaration
     575  return newstruct_Op2(op, res, arg1, arg2);
     576
    536577}
    537578
     
    543584  PythonCastDynamic rhs2(arg3);
    544585
    545   return lhs(op, rhs1, rhs2).assign_to(res);
     586  if (!lhs(op, rhs1, rhs2).assign_to(res))
     587    return FALSE;
     588
     589  return blackboxDefaultOp3(op, res, arg1, arg2, arg3);
    546590}
    547591
     
    550594BOOLEAN pyobject_OpM(int op, leftv res, leftv args)
    551595{
    552   typedef PythonCastStatic<PythonObject::sequence_tag> seq_type;
    553 
    554596  switch(op)                    // built-in return types first
    555597  {
     
    561603      return FALSE;
    562604    }
    563   }
    564 
     605
     606    case INTVEC_CMD:
     607      PythonObject obj = PythonCastStatic<>(args->Data());
     608      unsigned long len = obj.size();
     609
     610      intvec* vec = new intvec(len);
     611      for(unsigned long idx = 0; idx != len; ++idx) {
     612        long value = PyInt_AsLong(obj[idx]);
     613        (*vec)[idx] = static_cast<int>(value);
     614
     615        if ((value == -1) &&  PyErr_Occurred()) {
     616          value = 0;
     617          PyErr_Clear();
     618        }
     619        if (value != long((*vec)[idx])) {
     620          delete vec;
     621          Werror("'pyobject` cannot be converted to intvec");
     622          return TRUE;
     623        }
     624      }
     625      res->data = (void *)vec;
     626      res->rtyp = op;
     627      return FALSE;
     628  }
    565629  typedef PythonCastStatic<PythonObject::sequence_tag> seq_type;
    566   return PythonCastStatic<>(args)(op, seq_type(args->next)).assign_to(res);
     630  if (! PythonCastStatic<>(args)(op, seq_type(args->next)).assign_to(res))
     631    return FALSE;
     632
     633  BOOLEAN newstruct_OpM(int, leftv, leftv); // forward declaration
     634  return newstruct_OpM(op, res, args);
    567635}
    568636
     
    637705  b->blackbox_Op3     = pyobject_Op3;
    638706  b->blackbox_OpM     = pyobject_OpM;
     707  b->data             = omAlloc0(newstruct_desc_size());
    639708
    640709  PythonInterpreter::init(setBlackboxStuff(b,"pyobject"));
  • Singular/silink.cc

    r44a1c2 r188de86  
    834834
    835835  if (0) 0;
    836 #ifdef HAVE_MPSR
    837   else if (strcmp(type, "MPfile") == 0)
    838     s->next = slInitMPFileExtension(ns);
    839   else if (strcmp(type, "MPtcp") == 0)
    840     s->next = slInitMPTcpExtension(ns);
    841 #endif
    842836#ifdef HAVE_DBM
    843837  else if (strcmp(type, "DBM") == 0)
  • Singular/slInit.h

    r44a1c2 r188de86  
    1313#include <Singular/silink.h>
    1414
    15 #ifdef HAVE_MPSR
    16 si_link_extension slInitMPFileExtension(si_link_extension s);
    17 si_link_extension slInitMPTcpExtension(si_link_extension s);
    18 
    19 typedef int (*BatchDoProc)(const char* port, const char* host);
    20 BatchDoProc slInitMPBatchDo();
    21 #endif // HAVE_MPSR
    22 
    2315#ifdef HAVE_DBM
    2416si_link_extension slInitDBMExtension(si_link_extension s);
  • Singular/slInit_Dynamic.cc

    r44a1c2 r188de86  
    99 *******************************************************************/
    1010
    11 /***************************************************************
    12  *
    13  * MP link Extension inits
    14  *
    15  ***************************************************************/
    1611#include "config.h"
    1712#include <kernel/mod2.h>
     
    2116
    2217#ifdef HAVE_DL
    23 #ifdef HAVE_MPSR
    24 #include <MP.h>
    25 #include "mpsr_sl.h"
    26 
    27 static void* mpsr_so_handle = NULL;
    28 typedef void (*voidProc)();
    29 
    30 static void* slInitMPSRHandle()
    31 {
    32   if (mpsr_so_handle == NULL)
    33   {
    34     mpsr_so_handle = dynl_open_binary_warn("mpsr");
    35     if (mpsr_so_handle != NULL)
    36     {
    37       voidProc init_proc = (voidProc)
    38         dynl_sym_warn(mpsr_so_handle, "mpsr_Init");
    39       if (init_proc != NULL)
    40         (*init_proc)();
    41       else
    42         mpsr_so_handle = NULL;
    43     }
    44   }
    45   return mpsr_so_handle;
    46 }
    47 
    48 si_link_extension slInitMPFileExtension(si_link_extension s)
    49 {
    50   void* handle = slInitMPSRHandle();
    51 
    52   if (handle == NULL) return NULL;
    53 
    54   s->Open = (slOpenProc) dynl_sym_warn(handle, "slOpenMPFile");
    55   s->Close = (slCloseProc) dynl_sym_warn(handle, "slCloseMP");
    56   s->Kill = (slKillProc) s->Close;
    57   s->Read = (slReadProc) dynl_sym_warn(handle, "slReadMP");
    58   s->Dump = (slDumpProc) dynl_sym_warn(handle, "slDumpMP");
    59   s->GetDump = (slGetDumpProc) dynl_sym_warn(handle, "slGetDumpMP");
    60   s->Write = (slWriteProc) dynl_sym_warn(handle, "slWriteMP");
    61   s->Status = (slStatusProc) dynl_sym_warn(handle, "slStatusMP");
    62   if (s->Open == NULL || s->Close == NULL || s->Kill == NULL ||
    63       s->Read == NULL || s->Dump == NULL || s->GetDump == NULL ||
    64       s->Write == NULL || s->Status == NULL)
    65     return NULL;
    66 
    67   s->type="MPfile";
    68   return s;
    69 }
    70 
    71 si_link_extension slInitMPTcpExtension(si_link_extension s)
    72 {
    73   void* handle = slInitMPSRHandle();
    74 
    75   if (handle == NULL) return NULL;
    76 
    77   s->Open = (slOpenProc) dynl_sym_warn(handle, "slOpenMPTcp");
    78   s->Close = (slCloseProc) dynl_sym_warn(handle, "slCloseMP");
    79   s->Kill = (slKillProc) dynl_sym_warn(handle, "slKillMP");
    80   s->Read = (slReadProc) dynl_sym_warn(handle, "slReadMP");
    81   s->Dump = (slDumpProc) dynl_sym_warn(handle, "slDumpMP");
    82   s->GetDump = (slGetDumpProc) dynl_sym_warn(handle, "slGetDumpMP");
    83   s->Write = (slWriteProc) dynl_sym_warn(handle, "slWriteMP");
    84   s->Status = (slStatusProc) dynl_sym_warn(handle, "slStatusMP");
    85 
    86   if (s->Open == NULL || s->Close == NULL || s->Kill == NULL ||
    87       s->Read == NULL || s->Dump == NULL || s->GetDump == NULL ||
    88       s->Write == NULL || s->Status == NULL)
    89     return NULL;
    90 
    91   s->type="MPtcp";
    92   return s;
    93 }
    94 
    95 BatchDoProc slInitMPBatchDo()
    96 {
    97   void* handle = slInitMPSRHandle();
    98 
    99   if (handle == NULL) return NULL;
    100   return (BatchDoProc) dynl_sym_warn(handle, "Batch_do");
    101 }
    102 #endif
    10318
    10419#ifdef HAVE_DBM
  • Singular/slInit_Static.cc

    r44a1c2 r188de86  
    99 *******************************************************************/
    1010
    11 /***************************************************************
    12  *
    13  * MP link Extension inits
    14  *
    15  ***************************************************************/
    1611#include "config.h"
    1712#include <kernel/mod2.h>
     
    1914#include <Singular/silink.h>
    2015#include <Singular/slInit.h>
    21 
    22 #ifdef HAVE_MPSR
    23 
    24 #include <MP.h>
    25 #include <Singular/mpsr_sl.h>
    26 
    27 extern void mpsr_Init();
    28 
    29 si_link_extension slInitMPFileExtension(si_link_extension s)
    30 {
    31   mpsr_Init();
    32   s->Open=slOpenMPFile;
    33   s->Close=slCloseMP;
    34   s->Kill=slCloseMP;
    35   s->Read=slReadMP;
    36   s->Dump=slDumpMP;
    37   s->GetDump=slGetDumpMP;
    38   s->Write=slWriteMP;
    39   s->Status=slStatusMP;
    40   s->type="MPfile";
    41   return s;
    42 }
    43 
    44 si_link_extension slInitMPTcpExtension(si_link_extension s)
    45 {
    46   mpsr_Init();
    47   s->Open=slOpenMPTcp;
    48   s->Close=slCloseMP;
    49   s->Kill=slKillMP;
    50   s->Read=slReadMP;
    51   s->Dump=slDumpMP;
    52   s->GetDump=slGetDumpMP;
    53   s->Write=slWriteMP;
    54   s->Status=slStatusMP;
    55   s->type="MPtcp";
    56   return s;
    57 }
    58 
    59 BatchDoProc slInitMPBatchDo()
    60 {
    61   mpsr_Init();
    62   return Batch_do;
    63 }
    64 #endif
    6516
    6617#ifdef HAVE_DBM
  • Singular/ssiLink.cc

    r44a1c2 r188de86  
    4444#include <Singular/blackbox.h>
    4545#include <Singular/ssiLink.h>
    46 
    47 #ifdef HAVE_MPSR
    48 #include <Singular/mpsr.h>
    49 #endif
    5046
    5147struct snumber_dummy
     
    14141410  si_link l;
    14151411  ssiInfo *d;
    1416   #ifdef HAVE_MPSR
    1417   MP_Link_pt dd;
    1418   #endif
    14191412  int d_fd;
    14201413  fd_set  mask, fdmask;
     
    14851478        return -2;
    14861479      }
    1487     #ifdef HAVE_MPSR
    1488       if (strcmp(l->m->type,"ssi")==0)
    1489       {
    1490         d=(ssiInfo*)l->data;
    1491         d_fd=d->fd_read;
    1492         if (d->ungetc_buf=='\0')
    1493         {
    1494           FD_SET(d_fd, &fdmask);
    1495           if (d_fd > max_fd) max_fd=d_fd;
    1496         }
    1497         else
    1498           return i+1;
    1499       }
    1500       else
    1501       {
    1502         dd=(MP_Link_pt)l->data;
    1503         d_fd=((MP_TCP_t *)dd->transp.private1)->sock;
    1504         FD_SET(d_fd, &fdmask);
    1505         if (d_fd > max_fd) max_fd=d_fd;
    1506       }
    1507     #else
    15081480      d=(ssiInfo*)l->data;
    15091481      d_fd=d->fd_read;
     
    15151487      else
    15161488        return i+1;
    1517     #endif
    15181489    }
    15191490  }
     
    15581529      {
    15591530        l=(si_link)L->m[i].Data();
    1560         #ifdef HAVE_MPSR
    1561         if (strcmp(l->m->type,"ssi")!=0)
    1562         {
    1563           // for MP links, return here:
    1564           dd=(MP_Link_pt)l->data;
    1565           d_fd=((MP_TCP_t *)dd->transp.private1)->sock;
    1566           if(j==d_fd) return i+1;
    1567         }
    1568         else
    1569         {
    1570           d=(ssiInfo*)l->data;
    1571           d_fd=d->fd_read;
    1572           if(j==d_fd) break;
    1573         }
    1574         #else
    15751531        d=(ssiInfo*)l->data;
    15761532        d_fd=d->fd_read;
    15771533        if(j==d_fd) break;
    1578         #endif
    15791534      }
    15801535    }
  • Singular/tesths.cc

    r44a1c2 r188de86  
    237237      //exit(0);
    238238    }
    239     else
    240     {
    241     #ifdef HAVE_MPSR
    242       BatchDoProc batch_do = slInitMPBatchDo();
    243       if (batch_do != NULL)
    244         return (*batch_do)((char*) feOptValue(FE_OPT_MPPORT),
    245                          (char*) feOptValue(FE_OPT_MPHOST));
    246       else
    247         return 1;
    248     #else
    249       // assume(0); // commented out as MP was deprecated!!!
    250     #endif
    251     }
    252239  }
    253240  setjmp(si_start_jmpbuf);
  • Tst/Short/pyobject.res.gz.uu

    r0419ab r188de86  
    1 begin 640 pyobject.res.gz
    2 M'XL("`^0/DT``W!Y;V)J96-T+G)E<P#M&6MOVS;PNW\%9PRPD[BN]9:3QD/;
    3 M#5N!(1N6`OO098HL,[$6230DN8G[ZW<GDD?ZT63IAP$%VJ(I>2_>'>]%Y?+]
    4 MC^\N&&/.C/WZ[@WKMTT[+O)Y_ZQWJ3#NC`$PR:N\'1Z=]?!_-INQU4;,_^%9
    5 M.Z[X_;AITY88O!FCM3]F+U^RUTV3WU8EKUHF;EC3UGEURXJ\Y75:-"RM%BRO
    6 M6G[+ZX88@S&=``M@8>>LG^[P6EJ&,YM>5!SH'8..+)WBL5E/QU+Z66^P*WR@
    7 MB9S)3(H\ZSD$<XQ`QS4"':\S^.V29W<H:[5IEZ)BO*Z%,<[QU:GL1`L&57XP
    8 M!G3D3&39NN8+B<O2JA(MRT25I2VOX!\;@(1!Y[T!N&_`)',CZ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&VA0V*4+\.`B93,\<C58C=84/!XE3HNR9+Z(-[
     62MLL"@L8^DT!NTS8W:04"[,?+<V,\[VG6-+R_H3<JF!BV`HR9#"O7P+!0NHDV^
     63MN7D]`9^?DP/H-.SC)R*0.U=PH!MA??!"?'V25;MN2G`PQ"-&,;:,*2$61;;\
     64MLJ@V\Q_KH(\?5"D.Q@Y>%(8#="%1U>3[,.D/E'54FPL_Q++VT:L[(Y;+:E6#
     65M9(M":C=R%0MM5,)#-/M<(/13MIU3?BQQF=93KR'UL;1HV*87(K\3GGE#K/?U
     66MTH03'I;<^48<=F!#_`+K.!/KT"\ENA!;\6X0??WA5UKQTQ\&+DV%<*D\=&@"
     67MID?S7(@=6$9$D2'4'P!9`AX90O894!CN1$/UBM[3[_Z/Q\.>M\K;%AQMT'LN
     68M'H;A&^*A6FO')+KO:J.).IK'B\$06ZX:0;_2?:W$&XH^24]-D)!]=11B-Q8_
     6967L3O$]>MQZ4"^__NY#_R48`L_B@`````
    4670`
    4771end
  • Tst/Short/pyobject.stat

    r0419ab r188de86  
    1 1 >> tst_memory_0 :: 1295945736:3120- exported :3-1-2:ix86-Linux:mamawutz:185276
    2 1 >> tst_memory_1 :: 1295945736:3120- exported :3-1-2:ix86-Linux:mamawutz:1466368
    3 1 >> tst_memory_2 :: 1295945736:3120- exported :3-1-2:ix86-Linux:mamawutz:1466368
    4 1 >> tst_timer_1 :: 1295945736:3120- exported :3-1-2:ix86-Linux:mamawutz:11
     11 >> tst_memory_0 :: 1340804707:3144- exported :3-1-4:x86_64-Linux:lts035:227368
     21 >> tst_memory_1 :: 1340804707:3144- exported :3-1-4:x86_64-Linux:lts035:3239936
     31 >> tst_memory_2 :: 1340804707:3144- exported :3-1-4:x86_64-Linux:lts035:3239936
     41 >> tst_timer_1 :: 1340804707:3144- exported :3-1-4:x86_64-Linux:lts035:9
  • Tst/Short/pyobject.tst

    r0419ab r188de86  
    138138attrib(new_pyobj, "new_attr");     // -> error message
    139139
     140// python list from empty Singular list (bug fixed?)
     141pyobject ll_empty = list();
     142ll_empty;
     143
     144// converting to and from intvec
     145intvec v0;
     146v0;
     147pyobject obj0 = v0;
     148obj0;
     149
     150intvec v=(1,2,3);
     151pyobject obj = v;
     152obj;
     153intvec(obj);
     154
     155intvec(python_eval("[1,2,9999999999]")); // -> error
     156intvec(python_eval("[1,2,list()]"));     // -> error
     157
     158ring r=0,x,lp;
     159def rl = ringlist(r);
     160
     161python_eval("tuple")(list(rl[1..3]));
     162
     163// interaction with newstruct'ed type
     164newstruct("wrapping","pyobject p");
     165wrapping wrapped;
     166
     167pyobject seventeen = 17;
     168wrapped.p = seventeen;
     169wrapped;
     170
     171proc unwrap(wrapping arg) { return (arg.p); }
     172system("install", "wrapping", "pyobject", unwrap, 1);
     173
     174pyobject released = wrapped;
     175released;
     176
     177proc wrap(pyobject arg) { wrapping res; res.p = arg; return (res); }
     178system("install", "pyobject", "wrapping", wrap, 1);
     179
     180pyobject nineteen = 19;
     181wrapped = nineteen;
     182wrapped;
     183
     184
     185// interaction with built-ins
     186proc to_poly(pyobject arg) { return (poly(23)); }
     187system("install", "pyobject", "poly", to_poly, 1);
     188
     189pyobject for_poly="4poly";
     190poly(for_poly);
     191
     192proc from_poly(poly arg) { pyobject res = string(arg); return (res); }
     193system("install", "pyobject", "=", from_poly, 1);
     194
     195poly p = x+1;
     196for_poly = p;
     197for_poly;
     198
     199
     200// interaction with both built-ins and newstructs
     201newstruct("another","pyobject p");
     202another other;
     203other.p = seventeen;
     204other;
     205
     206released = other;  // -> error
     207released;
     208
     209proc from_types(def arg) {
     210  if (typeof(arg) == "poly") { return (from_poly(arg)); }
     211  if (typeof(arg) == "another") { return (arg.p); }
     212}
     213system("install", "pyobject", "=", from_types, 1);
     214
     215released = other;
     216released;
     217released = p;
     218released;
     219
     220proc from_ideal(ideal arg) { pyobject res = "(missing)"; return (res); }
     221system("install", "pyobject", "=", from_ideal, 1);
     222pyobject ported = ringlist(r);
     223ported;
     224
    140225tst_status(1);
    141226$
  • Tst/regress.cmd

    r0419ab r188de86  
    1 #!/usr/bin/perl -CS
     1#!/usr/bin/perl
    22
    33#################################################################
     
    88
    99use Env;
     10
     11# equivalent to command line options -CS, whihc is not supported any more
     12use open ':std', ':utf8';
     13use open IO => ':bytes';
    1014 
    1115#################################################################
  • kernel/misc.cc

    r44a1c2 r188de86  
    2121#include <coeffs/si_gmp.h>
    2222#include <omalloc/omalloc.h>
    23 
    24 #ifdef HAVE_MPSR
    25 #include <MP_Config.h>
    26 #endif
    2723
    2824/* init bins */
  • kernel/mod2.h

    r44a1c2 r188de86  
    319319#define YYDEBUG 1
    320320
    321 /* Undefine to disable debugging of MP stuff */
    322 #ifdef HAVE_MPSR
    323 #undef HAVE_MPSR
    324 // #define MPSR_DEBUG
    325 #endif
    326 
    327 #ifdef MPSR_DEBUG
    328 #undef MPSR_DEBUG
    329 #endif
    330 
    331 
    332321/* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */
    333322/* define SPECTRUM_IOSTREAM to use C++ iostream for error messages          */
Note: See TracChangeset for help on using the changeset viewer.