int main(int argc, char **argv) { timer_init(); ((void) argc); total = 0; rank = atoi(argv[0]); open_noc_connectors(); getwork(); start = timer_get(); friendly_numbers(); end = timer_get(); syncNumbers(); total = timer_diff(start, end); data_send(outfd, &total, sizeof(uint64_t)); /* Close channels. */ mppa_close(infd); mppa_close(outfd); mppa_exit(0); return (0); }
/* * Closes NoC connectors. */ void close_noc_connectors(void) { /* Close channels. */ mppa_close(sync_fd); mppa_close(infd); mppa_close(outfd); }
/* * Close NoC connectors. */ void close_noc_connectors(void) { int i; /* Close channels. */ for (i = 0; i < nclusters; i++) { mppa_close(outfd[i]); mppa_close(infd[i]); } /* Close sync. */ mppa_close(sync_fd); }
void mppa_close_portal (portal_t *portal) { assert(mppa_close(portal->file_descriptor) != -1); free (portal); }
void mppa_close_rqueue(rqueue_t *rqueue) { assert(mppa_close (rqueue->file_descriptor) != -1); free (rqueue); }
void mppa_close_barrier (barrier_t *barrier) { assert(mppa_close(barrier->sync_fd_master) != -1); assert(mppa_close(barrier->sync_fd_slave) != -1); free(barrier); }
void mppa_close_channel (channel_t *channel) { assert(mppa_close(channel->file_descriptor) != -1); free (channel); }