Changeset cc0296 in git


Ignore:
Timestamp:
Mar 20, 1997, 5:59:58 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
577d19f4587e2341d9a42d6800fc5576fceed84d
Parents:
0e184696d061294efc7e95f66a996a5d96f19738
Message:
Various minor bug-fixes in mpsr interface

Thu Mar 20 11:57:00 1997  Olaf Bachmann  <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)>

	* sing_mp.cc (slInitBatchLink): initialized silink such that
	  l->argv[0] == "MP:connect" (otherwise, slInitMP failed)

Wed Mar 19 15:38:08 1997  Olaf Bachmann  <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)>

	* hannes fixed maFindPerm to reflect new names <->parameter scheme

	* sing_mp.cc (mpsr_IsMPLink): fixed it

	* Makefile (tags): added target tags


git-svn-id: file:///usr/local/Singular/svn/trunk@61 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/cntrlc.cc

    r0e1846 rcc0296  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/cntrlc.cc,v 1.1.1.1 1997-03-19 13:18:44 obachman Exp $";
     4static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/cntrlc.cc,v 1.2 1997-03-20 16:59:30 obachman Exp $";
    55/* $Log: not supported by cvs2svn $
     6// Revision 1.1.1.1  1997/03/19  13:18:44  obachman
     7// Imported Singular sources
     8//
    69*/
    710/*
     
    2528
    2629#ifdef unix
    27 #ifndef hpux
    2830#include <unistd.h>
    2931#include <sys/types.h>
     
    3234#define INTERACTIVE 0
    3335#define STACK_TRACE 1
     36#undef __OPTIMIZE__
    3437#ifndef __OPTIMIZE__
    35 static void debug (int);
     38void debug (int);
    3639static void debug_stop (char **);
    3740static void stack_trace (char **);
    3841static void stack_trace_sigchld (int);
    39 #endif
    4042#endif
    4143#endif
     
    375377
    376378#ifdef unix
    377 #ifndef hpux
    378379#ifndef __OPTIMIZE__
    379380#ifndef MSDOS
    380381int si_stop_stack_trace_x;
    381382
    382 static void debug (int method)
     383void debug (int method)
    383384{
    384385  int pid;
    385386  char buf[16];
     387
     388#define HANNES 
     389#ifdef HANNES 
    386390  char *args[4] = { "gdb", "Singularg", NULL, NULL };
    387 
     391#else
     392  char *args[4] = { "ddd", "Singularg", NULL, NULL };
     393#endif 
    388394  sprintf (buf, "%d", getpid ());
    389395
     
    535541#endif
    536542#endif
    537 #endif
  • Singular/ffields.cc

    r0e1846 rcc0296  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/ffields.cc,v 1.1.1.1 1997-03-19 13:18:44 obachman Exp $";
     4static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/ffields.cc,v 1.2 1997-03-20 16:59:31 obachman Exp $";
    55/* $Log: not supported by cvs2svn $
     6// Revision 1.1.1.1  1997/03/19  13:18:44  obachman
     7// Imported Singular sources
     8//
    69*/
    710
     
    473476    if (fp==NULL)
    474477    {
    475       Werror("cannot open %s",buf);
    476       return;
     478      sprintf(buf,"../gftables/%d",nfCharQ);
     479      fp = feFopen(buf,"r",NULL,TRUE);
     480      if (fp == NULL)
     481      {
     482        Werror("cannot find gftables/%d", nfCharQ);
     483        return;
     484      }
    477485    }
    478486    if(!fgets( buf, sizeof(buf), fp)) return;
  • Singular/fglm.cc

    r0e1846 rcc0296  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.1.1.1 1997-03-19 13:18:45 obachman Exp $
     2// $Id: fglm.cc,v 1.2 1997-03-20 16:59:33 obachman Exp $
    33//=============================================
    44//             FGLM - Algorithm
     
    16211621    //. check if rings are compatible:
    16221622    if ( currRing->N == destRing->N ) {
    1623         maFindPerm( currRing->names, pVariables, NULL, destRing->names, pVariables, NULL, perm, NULL );
     1623        maFindPerm( currRing->names, pVariables, NULL, destRing->names, pVariables, NULL, 0, perm, NULL );
    16241624        for ( int k = 1; state == FglmOk && k <= pVariables; k++ )
    16251625            if ( perm[k] <= 0 ) state= FglmIncompatibleRings;
  • Singular/iparith.cc

    r0e1846 rcc0296  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/iparith.cc,v 1.1.1.1 1997-03-19 13:18:46 obachman Exp $";
     4static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/iparith.cc,v 1.2 1997-03-20 16:59:36 obachman Exp $";
    55/* $Log: not supported by cvs2svn $
    66*/
     
    14091409        par_perm=(int *)Alloc0(par_perm_size*sizeof(int));
    14101410      maFindPerm(r->names,       r->N,       r->parameter,
    1411                  currRing->names,currRing->N,currRing->parameter,
     1411                 currRing->names,currRing->N,currRing->parameter, currRing->P,
    14121412                 perm,par_perm);
    14131413    }
  • Singular/maps.cc

    r0e1846 rcc0296  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/maps.cc,v 1.1.1.1 1997-03-19 13:18:49 obachman Exp $";
     4static char rcsid[] = "$Header: /exports/cvsroot-2/cvsroot/Singular/maps.cc,v 1.2 1997-03-20 16:59:39 obachman Exp $";
    55/* $Log: not supported by cvs2svn $
    66*/
     
    271271
    272272void maFindPerm(char **preim_names, int preim_n, char **preim_par,
    273                 char **names, int n, char **par,
     273                char **names, int n, char **par, int nop,
    274274                int * perm, int *par_perm)
    275275{
     
    291291    if ((perm[i+1]==0)&&(par!=NULL))
    292292    {
    293       for(j=0; par[j]!='\0'; j++)
     293      for(j=0; j<nop; j++)
    294294      {
    295295        if (strcmp(preim_names[i],par[j])==0)
     
    320320      if ((par!=NULL) && (par_perm[i]==0))
    321321      {
    322         for(j=0; par[j]!='\0'; j++)
     322        for(j=0; j<nop; j++)
    323323        {
    324324          if (strcmp(preim_par[i],par[j])==0)
     
    346346  //int *par_perm=(int *)Alloc0(rPar(r)*sizeof(int));
    347347  maFindPerm(r->names,r->N, r->parameter,
    348              currRing->names,currRing->N,currRing->parameter,
     348             currRing->names,currRing->N,currRing->parameter, currRing->P,
    349349             perm,NULL/*par_perm*/);
    350350  poly res=pPermPoly(p,perm,r->N/*,par_perm,rPar(r)*/);
  • Singular/maps.h

    r0e1846 rcc0296  
    2121                     int *perm,int N,
    2222                     int *par_perm,int P);
    23 void maFindPerm(char **npi, int lpi, char **spi,
    24                  char **ni, int li, char ** si,
     23void maFindPerm(char **preim_names, int preim_n, char **preim_par,
     24                 char **names, int n, char ** par, int nop,
    2525                 int * perm, int *par_perm);
    2626#endif
  • Singular/mpsr_Get.cc

    r0e1846 rcc0296  
    283283  mpsr_sleftv mlv, mlv1;
    284284  mpsr_Status_t status = mpsr_Success;
     285  mlv.lv = NULL;
     286  mlv.r = NULL;
     287  mlv1.lv = NULL;
     288  mlv1.r = NULL;
    285289
    286290  MP_SkipMsg(link);
     
    819823#ifdef MPSR_DEBUG
    820824      command cmd = (command) mlv.lv->data;
    821       Print("Dump got %s", cmd->arg1.name);
     825      Print("Dump got %s \n", cmd->arg1.name);
    822826#endif     
    823827      mpsr_SetCurrRingHdl(mlv.r);
  • Singular/mpsr_Put.cc

    r0e1846 rcc0296  
    123123        return mpsr_PutMapLeftv(link, v, cring);
    124124
     125      case NONE:
     126        return mpsr_Success;
     127       
    125128      default:
    126129        return mpsr_SetError(mpsr_UnknownLeftvType);
     
    514517  while (h != NULL && h2 == NULL)
    515518  {
     519   
    516520    if (IDTYP(h) == PROC_CMD)
    517521    {
     
    521525#endif
    522526    }
    523     else
     527    else if (IDTYP(h) != LINK_CMD)
    524528    {
    525529      cmd.arg1.name = IDID(h);
  • Singular/mpsr_PutPoly.cc

    r0e1846 rcc0296  
    571571
    572572  // find out the length of the weight-vector
    573   if (r->wvhdl[index] != NULL)
     573  if (r->wvhdl && r->wvhdl[index] != NULL)
    574574    vlength = r->block1[index] - r->block0[index] + 1;
    575575
  • Singular/mptest2.sr

    r0e1846 rcc0296  
    1818list l1 = i,iv,im,i1,iv1,im1;
    1919list l2 = l1, iv2, l, im2;
    20 
    21 
    22 string s;
    23 string s1 = "Hello World";
    2420
    2521
  • Singular/sing_mp.cc

    r0e1846 rcc0296  
    66*/
    77/* $Log: not supported by cvs2svn $
     8// Revision 1.1.1.1  1997/03/19  13:18:41  obachman
     9// Imported Singular sources
     10//
    811*/
    912
    1013#include <stdio.h>
    1114#include <string.h>
     15#include <unistd.h>
    1216#include "mod2.h"
    1317#include "tok.h"
     
    4953{
    5054  int i;
    51   l->argv = (char **) Alloc0(argc * sizeof(char *));
    52   for (i=0; i<argc; i++)
     55  l->argv = (char **) Alloc0((argc +1) * sizeof(char *));
     56  l->argv[0] = mstrdup("MP:connect");
     57  for (i=1; i<=argc; i++)
    5358    l->argv[i] = mstrdup(argv[i]);
    54   l->argc = argc;
     59  l->argc = argc + 1;
    5560  l->name = mstrdup("MP:connect");
    5661  slInit(l,NULL);
     
    191196  char **argv;
    192197  int argc;
    193   MP_Link_pt link;
     198  MP_Link_pt link = NULL;
    194199
    195200  GetCmdArgs(&argc, &argv, argvstr);
     
    204209
    205210  if (host == NULL)
    206      Warn("No host specified for MP:connect; We try localhost");
     211  {
     212    char *hn = (char *) AllocL(64*sizeof(char*));
     213    FreeL(argv[7]);
     214    gethostname(hn, 64);
     215    argv[7] = hn;
     216    Warn("No host specified for MP:connect; We try %s", hn);
     217  }
    207218  else
    208219  {
     
    250261  char **argv;
    251262  int argc;
    252   MP_Link_pt link;
     263  MP_Link_pt link=NULL;
    253264
    254265  GetCmdArgs(&argc, &argv,
    255              "-MPtransp TCP -MPmode launch -MPhost r -MPapplication s");
     266             "-MPtransp TCP -MPmode launch -MPhost localhost -MPapplication s");
    256267
    257268  FreeL(argv[5]);
    258269  if (host == NULL)
    259270  {
    260     Warn("No host specified for MP:launch; We try: localhost");
    261     argv[5] = mstrdup("localhost");
     271    char *hn = (char *) AllocL(64*sizeof(char*));
     272    FreeL(argv[7]);
     273    gethostname(hn, 64);
     274    argv[5] = hn;
     275    Warn("No host specified for MP:connect; We try %s", hn);
    262276  }
    263277  else
     
    287301BOOLEAN slOpenMPTcp(si_link l)
    288302{
    289   MP_Link_pt link;
     303  MP_Link_pt link = NULL;
    290304
    291305  if (l->argc < 1)
     
    410424BOOLEAN mpsr_IsMPLink(si_link l)
    411425{
    412   return strcmp(l->name, "MP:tcp") == 0 ||
    413     strcmp(l->name, "MP:file") == 0;
    414 }
     426  return strcmp(l->name, "MP") > 0;
     427}
     428#endif
     429
     430#define MPSR_BATCH_DEBUG
     431#ifdef MPSR_BATCH_DEBUG
     432BOOLEAN stop = 1;
    415433#endif
    416434
     
    421439  leftv v = NULL;
    422440
     441#ifdef MPSR_BATCH_DEBUG
     442  fprintf(stderr, "Was started with pid %d\n", getpid());
     443  while (stop){};
     444#endif
     445 
    423446  // connect to a listening application
    424447  slInitBatchLink(silink, argc, argv);
     
    444467    }
    445468
    446     if (v == NULL)
    447       v = mpsr_InitLeftv(STRING_CMD, (void *) mstrdup("MPSR_DONE"));
    448 
    449469    slWriteMP(silink, v);
    450     v->CleanUp();
    451     Free(v, sizeof(sleftv));
     470
     471    if (v != NULL)
     472    {
     473      v->CleanUp();
     474      Free(v, sizeof(sleftv));
     475      v = NULL;
     476    }
    452477  }
    453478  // should never get here
Note: See TracChangeset for help on using the changeset viewer.