Changeset 331 for devel/5.X


Ignore:
Timestamp:
03/09/15 23:06:35 (8 years ago)
Author:
bas
Message:

use the standard error file from pbs

Location:
devel/5.X
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • devel/5.X/cpit

    r330 r331  
    11#!/bin/sh
    22
    3 cp /usr/include/torque/pbs_ifl.h .
    43#cp /usr/include/torque/log.h .
    54cp /usr/include/torque/rm.h .
     5
     6## No changes
    67cp /usr/include/torque/pbs_error.h .
    7 
    8 
     8cp /usr/include/torque/pbs_error_db.h .
     9cp /usr/include/torque/pbs_ifl.h .
  • devel/5.X/errors.py

    r324 r331  
    9292  """
    9393  e = get_error()
    94   if errors_txt.has_key(e):
    95      return (e, errors_txt[e])
    96   else:
    97      return (e, "Could not find a text for this error, uhhh")
     94  return (e, pbs_strerror(e))
     95#     return (e, errors_txt[e])
     96#  else:
     97#     return (e, "Could not find a text for this error, uhhh")
  • devel/5.X/pbs.i

    r327 r331  
    2323#include "log.h"
    2424
    25 #define SARA_DEBUG 0
     25#define SARA_DEBUG 1
    2626
    2727//extern int pbs_errno;
     
    494494int get_error()
    495495{
    496    char *errmsg;
    497 
    498    errmsg = pbse_to_txt(pbs_errno);
    499496   if (SARA_DEBUG)
    500497   {
    501       printf("Bas = %d\n", pbs_errno);
    502       printf("Bas = %d, text = %s\n", pbs_errno, errmsg);
     498      printf("Bas pbs_errno = %d, pbs_strerror %s\n", pbs_errno, pbs_strerror(pbs_errno));
    503499   }
    504500   return (pbs_errno);
     
    521517%include "rm.h"
    522518%include "log.h"
     519%include "pbs_error.h"
    523520
    524521
  • devel/5.X/pbs.py

    r327 r331  
    841841TRUE = _pbs.TRUE
    842842FALSE = _pbs.FALSE
     843PBSE_TOTAL_CEILING = _pbs.PBSE_TOTAL_CEILING
     844PBSE_ = _pbs.PBSE_
     845PBSE_NONE = _pbs.PBSE_NONE
     846
     847def pbse_to_txt(*args):
     848  return _pbs.pbse_to_txt(*args)
     849pbse_to_txt = _pbs.pbse_to_txt
     850
     851def pbs_strerror(*args):
     852  return _pbs.pbs_strerror(*args)
     853pbs_strerror = _pbs.pbs_strerror
    843854#  PBS python interface
    844855#  Author: Bas van der Vlies <bas.vandervlies@surfsara.nl>
     
    10801091  """
    10811092  e = get_error()
    1082   if errors_txt.has_key(e):
    1083      return (e, errors_txt[e])
    1084   else:
    1085      return (e, "Could not find a text for this error, uhhh")
     1093  return (e, pbs_strerror(e))
     1094#     return (e, errors_txt[e])
     1095#  else:
     1096#     return (e, "Could not find a text for this error, uhhh")
    10861097
    10871098# This file is compatible with both classic and new-style classes.
  • devel/5.X/pbs_node_info

    r328 r331  
    1111
    1212  nodes = pbs.pbs_statnode(c, '', 'NULL', 'NULL')
    13   e, txt=  pbs.error()
     13  e, txt =  pbs.error()
    1414  if e:
    15     print txt
     15    print  "statnode erro: %s" %pbs.pbs_strerror(e)
     16    print "txt %s\n" %txt
    1617
    1718  for node in nodes:
     
    3031    #mom_id = pbs.openrm(node.name, pbs.PBS_MANAGER_SERVICE_PORT)
    3132    mom_id = pbs.openrm("localhost", 15003)
     33    print mom_id
    3234    e, e_txt = pbs.error()
    3335    print "openrm", e, e_txt
    3436    print node.name, mom_id, pbs.PBS_MANAGER_SERVICE_PORT
    35     pbs.flushreq()
     37    #pbs.flushreq()
    3638    #pbs.fullresp(1)
    37     e, e_txt = pbs.error()
    38     print "flush", e, e_txt
     39    #e, e_txt = pbs.error()
     40    #print "flush", e, e_txt
    3941
    4042    #pbs.addreq_err(mom_id, err, "arch")
    41     pbs.addreq(mom_id, "arch")
     43    pbs.addreq(mom_id, "larch")
    4244    e, e_txt = pbs.error()
    4345    print "addreq:", e, e_txt
  • devel/5.X/pbs_wrap.c

    r327 r331  
    29792979#include "log.h"
    29802980
    2981 #define SARA_DEBUG 0
     2981#define SARA_DEBUG 1
    29822982
    29832983//extern int pbs_errno;
     
    30913091int get_error()
    30923092{
    3093    char *errmsg;
    3094 
    3095    errmsg = pbse_to_txt(pbs_errno);
    30963093   if (SARA_DEBUG)
    30973094   {
    3098       printf("Bas = %d\n", pbs_errno);
    3099       printf("Bas = %d, text = %s\n", pbs_errno, errmsg);
     3095      printf("Bas pbs_errno = %d, pbs_strerror %s\n", pbs_errno, pbs_strerror(pbs_errno));
    31003096   }
    31013097   return (pbs_errno);
     
    83758371  if (alloc6 == SWIG_NEWOBJ) free((char*)buf6);
    83768372  return NULL;
     8373}
     8374
     8375
     8376SWIGINTERN PyObject *_wrap_pbse_to_txt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     8377  PyObject *resultobj = 0;
     8378  int arg1 ;
     8379  int val1 ;
     8380  int ecode1 = 0 ;
     8381  PyObject * obj0 = 0 ;
     8382  char *result = 0 ;
     8383 
     8384  if (!PyArg_ParseTuple(args,(char *)"O:pbse_to_txt",&obj0)) SWIG_fail;
     8385  ecode1 = SWIG_AsVal_int(obj0, &val1);
     8386  if (!SWIG_IsOK(ecode1)) {
     8387    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pbse_to_txt" "', argument " "1"" of type '" "int""'");
     8388  }
     8389  arg1 = (int)(val1);
     8390  result = (char *)pbse_to_txt(arg1);
     8391  resultobj = SWIG_FromCharPtr((const char *)result);
     8392  return resultobj;
     8393fail:
     8394  return NULL;
     8395}
     8396
     8397
     8398SWIGINTERN PyObject *_wrap_pbs_strerror(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     8399  PyObject *resultobj = 0;
     8400  int arg1 ;
     8401  int val1 ;
     8402  int ecode1 = 0 ;
     8403  PyObject * obj0 = 0 ;
     8404  char *result = 0 ;
     8405 
     8406  if (!PyArg_ParseTuple(args,(char *)"O:pbs_strerror",&obj0)) SWIG_fail;
     8407  ecode1 = SWIG_AsVal_int(obj0, &val1);
     8408  if (!SWIG_IsOK(ecode1)) {
     8409    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pbs_strerror" "', argument " "1"" of type '" "int""'");
     8410  }
     8411  arg1 = (int)(val1);
     8412  result = (char *)pbs_strerror(arg1);
     8413  resultobj = SWIG_FromCharPtr((const char *)result);
     8414  return resultobj;
     8415fail:
     8416  return NULL;
     8417}
     8418
     8419
     8420SWIGINTERN int Swig_var_pbs_errno_set(PyObject *_val) {
     8421  {
     8422    int val;
     8423    int res = SWIG_AsVal_int(_val, &val);
     8424    if (!SWIG_IsOK(res)) {
     8425      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""pbs_errno""' of type '""int""'");
     8426    }
     8427    pbs_errno = (int)(val);
     8428  }
     8429  return 0;
     8430fail:
     8431  return 1;
     8432}
     8433
     8434
     8435SWIGINTERN PyObject *Swig_var_pbs_errno_get(void) {
     8436  PyObject *pyobj = 0;
     8437 
     8438  pyobj = SWIG_From_int((int)(pbs_errno));
     8439  return pyobj;
    83778440}
    83788441
     
    84908553         { (char *)"log_init", _wrap_log_init, METH_VARARGS, NULL},
    84918554         { (char *)"chk_file_sec", _wrap_chk_file_sec, METH_VARARGS, NULL},
     8555         { (char *)"pbse_to_txt", _wrap_pbse_to_txt, METH_VARARGS, NULL},
     8556         { (char *)"pbs_strerror", _wrap_pbs_strerror, METH_VARARGS, NULL},
    84928557         { NULL, NULL, 0, NULL }
    84938558};
     
    96409705  SWIG_Python_SetConstant(d, "TRUE",SWIG_From_int((int)(1)));
    96419706  SWIG_Python_SetConstant(d, "FALSE",SWIG_From_int((int)(0)));
     9707  SWIG_Python_SetConstant(d, "PBSE_TOTAL_CEILING",SWIG_From_int((int)(PBSE_TOTAL_CEILING)));
     9708  SWIG_Python_SetConstant(d, "PBSE_",SWIG_From_int((int)(15000)));
     9709  SWIG_Python_SetConstant(d, "PBSE_NONE",SWIG_From_int((int)(0)));
     9710  SWIG_addvarlink(SWIG_globals(),(char*)"pbs_errno",Swig_var_pbs_errno_get, Swig_var_pbs_errno_set);
    96429711#if PY_VERSION_HEX >= 0x03000000
    96439712  return m;
  • devel/5.X/rm.h

    r327 r331  
    9595int addreq(int, char *);
    9696int allreq(char *);
    97 char *getreq_err(int *INOUT, int);
    98 char *getreq(int);
     97char* getreq_err(int *INOUT, int);
     98char* getreq(int);
    9999int flushreq(void);
    100100int activereq(void);
Note: See TracChangeset for help on using the changeset viewer.