PPL Logo

PythonObject Class Reference

#include <PythonCCS.h>

Collaboration diagram for PythonObject:

Collaboration graph
[legend]

Public Member Functions

void pyRequest (CkCcsRequestMsg *msg)
void execute (CkCcsRequestMsg *msg, CcsDelayedReply *reply)
void print (PythonPrint *pyMsg, CcsDelayedReply *reply)
void finished (PythonFinished *pyMsg, CcsDelayedReply *reply)
void cleanup (PythonExecute *pyMsg, PyThreadState *pts, CmiUInt4 pyVal)
void getPrint (CkCcsRequestMsg *msg)
void executeThread (PythonExecute *pyMsg)
virtual PyMethodDef * getMethods ()
virtual const char * getMethodsDoc ()
 PythonObject ()
void pythonSetString (PyObject *, char *, char *)
void pythonSetString (PyObject *, char *, char *, int)
void pythonSetInt (PyObject *, char *, long)
void pythonSetLong (PyObject *, char *, long)
void pythonSetLong (PyObject *, char *, unsigned long)
void pythonSetLong (PyObject *, char *, double)
void pythonSetFloat (PyObject *, char *, double)
void pythonSetComplex (PyObject *, char *, double, double)
void pythonSetPointer (PyObject *, char *, void *)
void pythonGetString (PyObject *, char *, char **)
void pythonGetInt (PyObject *, char *, long *)
void pythonGetLong (PyObject *, char *, long *)
void pythonGetLong (PyObject *, char *, unsigned long *)
void pythonGetLong (PyObject *, char *, double *)
void pythonGetFloat (PyObject *, char *, double *)
void pythonGetComplex (PyObject *, char *, double *, double *)
void pythonGetPointer (PyObject *, char *, void **)
PyObject * pythonGetArg (int)
void pythonReturn (int)
void pythonReturn (int, PyObject *)
void pythonAwake (int)
void pythonSleep (int)
virtual PyObject * read (PyObject *where)
virtual void write (PyObject *where, PyObject *what)
virtual int buildIterator (PyObject *&, void *)
virtual int nextIteratorUpdate (PyObject *&, PyObject *, void *)

Static Public Member Functions

static void replyIntValue (PythonObject *obj, CcsDelayedReply *reply, CmiUInt4 *value)
static void _callthr_executeThread (CkThrCallArg *impl_arg)

Data Fields

CmiUInt4 pyNumber
PythonTable pyWorkers
void(* replyIntFn )(PythonObject *, CcsDelayedReply *, CmiUInt4 *)

Protected Member Functions

int prepareInterpreter (PythonExecute *pyMsg)
 This method prepares a python interpreter for execution of code inside it.

Static Private Attributes

static PyMethodDef CkPy_MethodsCustom []
static const char * CkPy_MethodsCustomDoc = ""

Detailed Description

Definition at line 55 of file PythonCCS.h.


Constructor & Destructor Documentation

PythonObject::PythonObject (  )  [inline]

Definition at line 79 of file PythonCCS.h.

References replyIntFn, and replyIntValue().

Here is the call graph for this function:


Member Function Documentation

void PythonObject::pyRequest ( CkCcsRequestMsg msg  ) 

void PythonObject::execute ( CkCcsRequestMsg msg,
CcsDelayedReply reply 
)

Definition at line 300 of file PythonCCS.C.

References _callthr_executeThread(), ckout, CmiWallTimer(), CthCreate(), CthResume(), CkCcsRequestMsg::data, endl(), executeThread(), PythonExecute::isHighLevel(), PythonExecute::isWait(), prepareInterpreter(), pyWorkers, replyIntFn, and PythonExecute::unpack().

Referenced by pyRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

void PythonObject::print ( PythonPrint pyMsg,
CcsDelayedReply reply 
)

void PythonObject::finished ( PythonFinished pyMsg,
CcsDelayedReply reply 
)

Definition at line 265 of file PythonCCS.C.

References PythonFinished::interpreter, PythonFinished::isWait(), pyWorkers, replyIntFn, and PythonFinished::unpack().

Referenced by pyRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

int PythonObject::prepareInterpreter ( PythonExecute pyMsg  )  [protected]

This method prepares a python interpreter for execution of code inside it.

It either allocates a new interpreter or uses an existing one, depending on the input parameters. The python lock is acquired if the interpreter is successfully prepared.

Returns:
the ID of the interpreter allocated. zero means failure

Definition at line 358 of file PythonCCS.C.

References CkPy_MethodsDefault, CkPythonDebugf(), getMethods(), getMethodsDoc(), PythonExecute::interpreter, PythonExecute::isHighLevel(), PythonExecute::isKeepPrint(), pyNumber, and pyWorkers.

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

void PythonObject::replyIntValue ( PythonObject obj,
CcsDelayedReply reply,
CmiUInt4 value 
) [static]

Definition at line 162 of file PythonCCS.C.

References array, CkReduction::bitvec_and, cb, CcsSendDelayedReply(), Converse::CkMyPe(), CkPythonDebugf(), CkReductionMgr::contribute(), group, pythonCcsProxy, PythonReplyInt::reply, and PythonReplyInt::value.

Referenced by PythonObject().

Here is the call graph for this function:

Here is the caller graph for this function:

void PythonObject::cleanup ( PythonExecute pyMsg,
PyThreadState *  pts,
CmiUInt4  pyVal 
)

Definition at line 684 of file PythonCCS.C.

References PythonExecute::isPersistent(), pyWorkers, and replyIntFn.

Referenced by executeThread().

Here is the call graph for this function:

Here is the caller graph for this function:

void PythonObject::getPrint ( CkCcsRequestMsg msg  ) 

Definition at line 716 of file PythonCCS.C.

void PythonObject::_callthr_executeThread ( CkThrCallArg impl_arg  )  [static]

Definition at line 482 of file PythonCCS.C.

References CkCcsRequestMsg::data, CkThrCallArg::msg, and CkThrCallArg::obj.

Referenced by execute().

Here is the caller graph for this function:

void PythonObject::executeThread ( PythonExecute pyMsg  ) 

Definition at line 491 of file PythonCCS.C.

References buildIterator(), Ck_printclient(), ckout, CkPythonDebugf(), cleanup(), CmiWallTimer(), PythonExecute::code, CthSelf(), endl(), PythonExecute::info, PythonExecute::isHighLevel(), PythonExecute::isIterate(), PythonExecute::methodName, nextIteratorUpdate(), part, and pyWorkers.

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual PyMethodDef* PythonObject::getMethods (  )  [inline, virtual]

Definition at line 76 of file PythonCCS.h.

References CkPy_MethodsCustom.

Referenced by prepareInterpreter().

Here is the caller graph for this function:

virtual const char* PythonObject::getMethodsDoc (  )  [inline, virtual]

Definition at line 77 of file PythonCCS.h.

References CkPy_MethodsCustomDoc.

Referenced by prepareInterpreter().

Here is the caller graph for this function:

void PythonObject::pythonSetString ( PyObject *  arg,
char *  descr,
char *  value 
)

Definition at line 721 of file PythonCCS.C.

void PythonObject::pythonSetString ( PyObject *  arg,
char *  descr,
char *  value,
int  len 
)

Definition at line 727 of file PythonCCS.C.

void PythonObject::pythonSetInt ( PyObject *  arg,
char *  descr,
long  value 
)

Definition at line 739 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
long  value 
)

Definition at line 751 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
unsigned long  value 
)

Definition at line 757 of file PythonCCS.C.

void PythonObject::pythonSetLong ( PyObject *  arg,
char *  descr,
double  value 
)

Definition at line 763 of file PythonCCS.C.

void PythonObject::pythonSetFloat ( PyObject *  arg,
char *  descr,
double  value 
)

Definition at line 787 of file PythonCCS.C.

void PythonObject::pythonSetComplex ( PyObject *  arg,
char *  descr,
double  real,
double  imag 
)

Definition at line 799 of file PythonCCS.C.

void PythonObject::pythonSetPointer ( PyObject *  arg,
char *  descr,
void *  ptr 
)

Definition at line 812 of file PythonCCS.C.

void PythonObject::pythonGetString ( PyObject *  arg,
char *  descr,
char **  result 
)

Definition at line 733 of file PythonCCS.C.

void PythonObject::pythonGetInt ( PyObject *  arg,
char *  descr,
long *  result 
)

Definition at line 745 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
long *  result 
)

Definition at line 769 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
unsigned long *  result 
)

Definition at line 775 of file PythonCCS.C.

void PythonObject::pythonGetLong ( PyObject *  arg,
char *  descr,
double *  result 
)

Definition at line 781 of file PythonCCS.C.

void PythonObject::pythonGetFloat ( PyObject *  arg,
char *  descr,
double *  result 
)

Definition at line 793 of file PythonCCS.C.

void PythonObject::pythonGetComplex ( PyObject *  arg,
char *  descr,
double *  real,
double *  imag 
)

Definition at line 805 of file PythonCCS.C.

void PythonObject::pythonGetPointer ( PyObject *  arg,
char *  descr,
void **  ptr 
)

Definition at line 818 of file PythonCCS.C.

PyObject * PythonObject::pythonGetArg ( int  handle  ) 

Definition at line 824 of file PythonCCS.C.

References pyWorkers.

void PythonObject::pythonReturn ( int  handle  ) 

Definition at line 831 of file PythonCCS.C.

void PythonObject::pythonReturn ( int  handle,
PyObject *  data 
)

Definition at line 841 of file PythonCCS.C.

References pyWorkers.

void PythonObject::pythonAwake ( int  handle  ) 

Definition at line 849 of file PythonCCS.C.

void PythonObject::pythonSleep ( int  handle  ) 

Definition at line 857 of file PythonCCS.C.

virtual PyObject* PythonObject::read ( PyObject *  where  )  [inline, virtual]

Definition at line 115 of file PythonCCS.h.

virtual void PythonObject::write ( PyObject *  where,
PyObject *  what 
) [inline, virtual]

Definition at line 116 of file PythonCCS.h.

virtual int PythonObject::buildIterator ( PyObject *&  ,
void *   
) [inline, virtual]

Definition at line 121 of file PythonCCS.h.

Referenced by executeThread().

Here is the caller graph for this function:

virtual int PythonObject::nextIteratorUpdate ( PyObject *&  ,
PyObject *  ,
void *   
) [inline, virtual]

Definition at line 122 of file PythonCCS.h.

Referenced by executeThread().

Here is the caller graph for this function:


Field Documentation

PyMethodDef PythonObject::CkPy_MethodsCustom [static, private]

Initial value:

 {
  {NULL,      NULL}        
}

Definition at line 56 of file PythonCCS.h.

Referenced by getMethods().

const char * PythonObject::CkPy_MethodsCustomDoc = "" [static, private]

Definition at line 57 of file PythonCCS.h.

Referenced by getMethodsDoc().

Definition at line 59 of file PythonCCS.h.

Referenced by prepareInterpreter().


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:29:07 2020 for Charm++ by  doxygen 1.5.5