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); }
void GUIVTermDevice::loop() { ulong buf[IPC_DEF_SIZE / sizeof(ulong)]; while(!isStopped()) { msgid_t mid; int fd = getwork(id(),&mid,buf,sizeof(buf),_rbufPos > 0 ? GW_NOBLOCK : 0); if(EXPECT_FALSE(fd < 0)) { /* just log that it failed. maybe a client has sent a message that was too big */ if(fd != -EINTR && fd != -ENOCLIENT) printe("getwork failed"); /* append the buffer now to reduce delays */ if(_rbufPos > 0) { { std::lock_guard<std::mutex> guard(*_vt.mutex); _rbuffer[_rbufPos] = '\0'; vtout_puts(&_vt,_rbuffer,_rbufPos,true); _sh->update(); _rbufPos = 0; } checkPending(); } continue; } esc::IPCStream is(fd,buf,sizeof(buf),mid); handleMsg(mid,is); _sh->update(); } }
/* * Clusters data. */ int main(int argc, char **argv) { ((void)argc); rank = atoi(argv[0]); /* Setup interprocess communication. */ open_noc_connectors(); sync_master(); getwork(); kmeans(); data_send(outfd, &total, sizeof(uint64_t)); close_noc_connectors(); mppa_exit(0); return (0); }
main(int argc, char *argv[]) { char **dict; int i = 0, count; if(argc != 3) { printf("Usage: %s [parent ip] [count]\n", argv[0]); return -1; } count = atoi(argv[2]); dict = malloc(count * sizeof(char *)); getwork(argv[1], count, dict); while(i < count) printf("%d:\t%s\n", i, dict[i++]); free(dict[0]); free(dict); }