#include <PythonCCS.h>
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 = "" |
Definition at line 55 of file PythonCCS.h.
PythonObject::PythonObject | ( | ) | [inline] |
Definition at line 79 of file PythonCCS.h.
References replyIntFn, and replyIntValue().
void PythonObject::pyRequest | ( | CkCcsRequestMsg * | msg | ) |
Definition at line 175 of file PythonCCS.C.
References CkCcsRequestMsg::data, execute(), finished(), PythonAbstract::isExecute(), PythonAbstract::isFinished(), PythonAbstract::isPrint(), print(), CkCcsRequestMsg::reply, and PythonAbstract::unpack().
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().
void PythonObject::print | ( | PythonPrint * | pyMsg, | |
CcsDelayedReply * | reply | |||
) |
Definition at line 197 of file PythonCCS.C.
References array, cb, CcsNoDelayedReply(), CcsSendDelayedReply(), CkReductionMgr::contribute(), PythonReplyString::data, group, PythonPrint::interpreter, PythonPrint::isKill(), PythonPrint::isWait(), length, pythonCcsProxy, pyWorkers, PythonCCS::reduceString, PythonReplyString::reply, replyIntFn, and PythonPrint::unpack().
Referenced by pyRequest().
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().
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.
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().
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().
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().
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().
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().
virtual PyMethodDef* PythonObject::getMethods | ( | ) | [inline, virtual] |
Definition at line 76 of file PythonCCS.h.
References CkPy_MethodsCustom.
Referenced by prepareInterpreter().
virtual const char* PythonObject::getMethodsDoc | ( | ) | [inline, virtual] |
Definition at line 77 of file PythonCCS.h.
References CkPy_MethodsCustomDoc.
Referenced by prepareInterpreter().
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 | ) |
void PythonObject::pythonReturn | ( | int | handle | ) |
Definition at line 831 of file PythonCCS.C.
void PythonObject::pythonReturn | ( | int | handle, | |
PyObject * | data | |||
) |
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().
virtual int PythonObject::nextIteratorUpdate | ( | PyObject *& | , | |
PyObject * | , | |||
void * | ||||
) | [inline, virtual] |
Definition at line 122 of file PythonCCS.h.
Referenced by executeThread().
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 60 of file PythonCCS.h.
Referenced by cleanup(), execute(), executeThread(), finished(), prepareInterpreter(), print(), pythonGetArg(), and pythonReturn().
void(* PythonObject::replyIntFn)(PythonObject *, CcsDelayedReply *, CmiUInt4 *) |
Referenced by cleanup(), execute(), finished(), print(), and PythonObject().