#include #include #include #include #include #include "desired_resources.h" #include "controller.h" NTL_CLIENT // The total number of nodes (that is, dpnodes) static unsigned short total_nodes = 1; // The amount of memory we can use per dpnode static unsigned short GB_mem_per_node = 1; // Input: order // Output: desired_dpnodes, max_workers, dpfreq void custom_desired_resources(const ZZ &order, unsigned short &desired_dpnodes, unsigned int &max_workers, unsigned int &dpfreq) { return desired_resources(order, total_nodes, GB_mem_per_node, desired_dpnodes, max_workers, dpfreq); } static void boundcb(const char *boundaddr, unsigned short boundport) { cout << "Listening on " << boundaddr << ":" << boundport << "\n"; const char *fdenv = getenv("CONTROLLER_BOUNDCB_FD"); if (fdenv) { int fd = atoi(fdenv); if (fd > 2) { write(fd, &boundport, 2); write(fd, boundaddr, strlen(boundaddr)); close(fd); } } } int main(int argc, char **argv) { unsigned short bindport = 0; Worklist worklist; if (controller_parse_args(argc, argv, bindport, worklist, total_nodes, GB_mem_per_node)) { std::cerr << "Usage: " << argv[0] << " [-p listenport] [-n num_nodes] [-m GB_mem_per_node] [-r reps] N1 iter1 N2 iter2 ...\n"; return 1; } return controller_main(worklist, bindport, boundcb); }