#include #include #include #include using namespace std; using namespace ff; // should be global to be accessible from workers #define MAX 1024 double x[MAX]; double y[MAX]; #define ITERNO 100000 int iterno = ITERNO; class Worker: public ff_node { int svc_init() { cout << "Worker initialized" << endl; return 0; } void * svc(void * in) { int i = * ((int *) in); // cout << "Computing " << i << endl; for(int j=0; j farm(true,nw); // true for offloading, NW for the number of workers ... std::vector w; // prepare workers for(int i=0;i