Created
July 10, 2015 16:16
-
-
Save evacchi/e2ebde0823e8917d7f1b to your computer and use it in GitHub Desktop.
Grappa DYLIB Minimal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// grappa_exe.cpp | |
namespace PyGrappa { | |
extern "C" void run(); | |
}; | |
int main(int argc, char **argv){ | |
PyGrappa::run(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --------------------------------------- | |
// libpygrappa.cpp | |
#include <Grappa.hpp> | |
#include <sstream> | |
using namespace Grappa; | |
namespace PyGrappa { | |
extern "C" void run(){ | |
int argc = 1; | |
char * arg = "foo"; | |
char ** argv = &arg; | |
Grappa::init(&argc, &argv); | |
Grappa::run([] | |
{ | |
Grappa::on_all_cores([]{ | |
std::cout << "Hello world from Core " << Grappa::mycore() << " of " << Grappa::cores() | |
<< " (locale " << Grappa::mylocale() << ")"<< "\n"; | |
}); | |
}); | |
Grappa::finalize(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment