bool LayerFCD::LoadFromFile() { ::SetProgressCallback(ProgressCallback, 0, 50); try { m_fcd = ::FCDloadData(m_sSubjectDir.toAscii().data(), m_sSubject.toAscii().data()); } catch (int ret) { return false; } if (m_fcd) { if (!m_fcd->mri_norm) { cerr << "Did not find norm volume for FCD data" << endl; return false; } ::SetProgressCallback(ProgressCallback, 50, 70); MakeAllLayers(); ::SetProgressCallback(ProgressCallback, 70, 100); DoCompute(false); } return (m_fcd != NULL); }
double Kernel:: Compute(Propagator & propagator) const { if(0 == propagator.GetNUpwindNeighbors()) return infinity; return DoCompute(propagator); }
unsigned CALLBACK ThreadFunction (LPVOID param) { unsigned threadId = (unsigned)param; bool isRunning = true; while (isRunning) { DWORD count; IocpOp * op; HANDLE completionKey = NULL; unsigned result = GetQueuedCompletionStatus( s_ioPort, &count, (PULONG_PTR)&completionKey, (LPOVERLAPPED *)&op, INFINITE ); printf("thread id : %u\n", threadId); Sleep(100); if (result == FALSE) { printf("GetQueuedCompletionStatus failed!\n"); printf("error code : %d\n", GetLastError()); break; } switch (op->type) { case OP_COMPUTE: DoCompute(op); break; case OP_FILE_READ: DoFileRead(op); break; case OP_FILE_WRITE: case OP_SOCKET_CONNECT: case OP_SOCKET_READ: case OP_SOCKET_WRITE: printf("not implemented operation type\n"); break; case OP_TERMINATE: printf("terminated called!\n"); isRunning = false; break; default: assert(0); } } return 0; }