2#include <structmember.h>
4#include <boost/algorithm/string.hpp>
18std::string(
"Initialise from opal file\n")+
19std::string(
"If you are getting an error message from openMPI, try\n")+
20std::string(
"rebuilding the MPI library with --disable-dlopen switch\n");
24 static char *kwlist[] = {
const_cast<char*
>(
"file_name"),
27 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|s", kwlist,
31 const char* exe =
"parser";
34 argvr[0] =
static_cast<char*
>(malloc(
sizeof(
'c')*7));
37 strcpy(argvr[0], exe);
42 std::string err =
"Failed to initialise OPAL from file";
43 PyErr_SetString(PyExc_ValueError, err.c_str());
51PyObject*
list_objects(PyObject *self, PyObject *args, PyObject *kwds) {
53 for (
size_t i = 0; i < names.size(); ++i) {
54 std::cout <<
" " << names[i] <<
std::endl;
61static PyMethodDef _module_methods[] = {
69static struct PyModuleDef parserdef = {
70 PyModuleDef_HEAD_INIT,
83 PyObject* module = PyModule_Create(&parserdef);
int opalMain(int argc, char *argv[])
Inform & endl(Inform &inf)
std::vector< std::string > getAllNames() const
Get a list of all objects.
static OpalData * getInstance()
PyObject * initialise_from_opal_file(PyObject *self, PyObject *args, PyObject *kwds)
const char * module_docstring
std::string list_objects_docstring
PyObject * list_objects(PyObject *self, PyObject *args, PyObject *kwds)
std::string initialise_from_opal_file_docstring
PyMODINIT_FUNC PyInit_parser(void)