void data_server(int argc, char *argv[]) { int np; MPI_Comm_size(MPI_COMM_WORLD, &np); MPI_Status status; int num_comp_nodes = np -1; unsigned int num_bytes = sizeof(sAgents); sAgents h_agents_in, h_agents_out[num_comp_nodes]; /* initialize input data */ init_data(h_agents_in); #ifdef DEBUG printf("Init data\n"); display_data(h_agents_in); #endif /* send data to compute nodes */ for(int process = 0; process < num_comp_nodes; process++) MPI_Send(&h_agents_in, num_bytes, MPI_BYTE, process, 0, MPI_COMM_WORLD); runDisplay(argc, argv); /* release resources */ //free(&h_agents_in); //free(&h_agents_out); }
virtual int run(bool fDaemonised /* = false */) { Display *pDisplay = XOpenDisplay(NULL); if (!pDisplay) return VERR_NOT_FOUND; int rc = initDisplay(pDisplay); if (RT_SUCCESS(rc)) rc = runDisplay(pDisplay); XCloseDisplay(pDisplay); return rc; }
void runListDisplay(struct runList * l) { int i; struct run *current; assert(l); current = l->head; for (i = 0; i < l->count; i++) { assert(current); runDisplay(current); current = current->next; } printf("%d run(s) in the list.\n", l->count); }