/** * Copies this data and the RingBuffer data from host to device. */ void hostToDevice() { __startTransaction(__getTransactionEvent()); ringBuffer->hostToDevice(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); GridBuffer<VALUE, DIM1, BORDERVALUE>::hostToDevice(); __setTransactionEvent(__endTransaction() + ev1); }
/** * Copies data and additional pointers from host to device. */ void hostToDevice() { __startTransaction(__getTransactionEvent()); ringDataSizes->hostToDevice(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); ringData->hostToDevice(); __setTransactionEvent(__endTransaction() + ev1); }
/** * Copies data and additional pointers from device to host. */ void deviceToHost() { __startTransaction(__getTransactionEvent()); ringDataSizes->deviceToHost(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); ringData->deviceToHost(); __setTransactionEvent(__endTransaction() + ev1); }
/** * Copies this data and the RingBuffer data from device to host. */ void deviceToHost() { __startTransaction(__getTransactionEvent()); ringBuffer->deviceToHost(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); GridBuffer<VALUE, DIM1, BORDERVALUE>::deviceToHost(); EventTask ev2 = __endTransaction(); __setTransactionEvent(ev1 + ev2); }
virtual void init() { m_state = Init; __startTransaction(m_initDependency); m_buffer.bashField(m_exchange); m_initDependency = __endTransaction(); m_state = WaitForBash; }
/** * Resets all internal buffers. */ void reset() { __startTransaction(__getTransactionEvent()); frames->reset(false); frames->initialFillBuffer(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); superCells->getDeviceBuffer().setValue(SuperCell<vint_t > ()); superCells->getHostBuffer().setValue(SuperCell<vint_t > ()); /*nextFrames->getDeviceBuffer().setValue(INV_IDX);//!\todo: is this needed? On device we set any new frame values to INVALID_INDEX prevFrames->getDeviceBuffer().setValue(INV_IDX);//!\todo: is this needed? On device we set any new frame values to INVALID_INDEX nextFrames->getHostBuffer().setValue(INV_IDX);//!\todo: is this needed? On device we set any new frame values to INVALID_INDEX prevFrames->getHostBuffer().setValue(INV_IDX);//!\todo: is this needed? On device we set any new frame values to INVALID_INDEX */ __setTransactionEvent(__endTransaction() + ev1); }
virtual void init() { state = Init; __startTransaction(initDependency); buffer.bashField(exchange); initDependency = __endTransaction(); state = WaitForBash; }
void setCurrentSize(const size_t size) { // do host and device setCurrentSize parallel EventTask split = __getTransactionEvent(); __startTransaction(split); stackIndexer.getHostBuffer().setCurrentSize(size); stack.getHostBuffer().setCurrentSize(size); EventTask e1 = __endTransaction(); __startTransaction(split); stackIndexer.getDeviceBuffer().setCurrentSize(size); EventTask e2 = __endTransaction(); __startTransaction(split); stack.getDeviceBuffer().setCurrentSize(size); EventTask e3 = __endTransaction(); __setTransactionEvent(e1 + e2 + e3); }
virtual void init() { __startTransaction(); this->request = Environment<DIM>::get().EnvironmentController() .getCommunicator().startSend( exchange->getExchangeType(), (char*) exchange->getHostBuffer().getPointer(), exchange->getHostBuffer().getCurrentSize() * sizeof (TYPE), exchange->getCommunicationTag()); __endTransaction(); }
/** * Starts copying data from device to host. */ void deviceToHost() { __startTransaction(__getTransactionEvent()); frames->deviceToHost(); EventTask ev1 = __endTransaction(); __startTransaction(__getTransactionEvent()); superCells->deviceToHost(); EventTask ev2 = __endTransaction(); __startTransaction(__getTransactionEvent()); nextFrames->deviceToHost(); EventTask ev3 = __endTransaction(); __startTransaction(__getTransactionEvent()); prevFrames->deviceToHost(); EventTask ev4 = __endTransaction(); __setTransactionEvent(ev1 + ev2 + ev3 + ev4); }
bool executeIntern() { switch (state) { case Init: break; case WaitForReceive: if (NULL == Environment<>::get().Manager().getITaskIfNotFinished(lastReceiveEvent.getTaskId())) { state = InitInsert; //bash is finished __startTransaction(); lastSize = parBase.getParticlesBuffer().getReceiveExchangeStack(exchange).getHostParticlesCurrentSize(); parBase.insertParticles(exchange); // std::cout<<"brecv = "<<parBase.getParticlesBuffer().getReceiveExchangeStack(exchange).getHostCurrentSize()<<std::endl; tmpEvent = __endTransaction(); state = WaitForInsert; } break; case InitInsert: break; case WaitForInsert: if (NULL == Environment<>::get().Manager().getITaskIfNotFinished(tmpEvent.getTaskId())) { state=Wait; assert(lastSize <= maxSize); //check for next bash round if (lastSize == maxSize) { std::cerr << "recv max size " << maxSize << " particles" << std::endl; init(); //call init and run a full send cycle } else { state = Finished; return true; } } break; case Wait: break; case Finished: return true; default: return false; } return false; }
void shiftParticles() { StrideMapping<AREA, DIM3, MappingDesc> mapper(this->cellDescription); ParticlesBoxType pBox = particlesBuffer->getDeviceParticleBox(); __startTransaction(__getTransactionEvent()); do { __cudaKernel(kernelShiftParticles) (mapper.getGridDim(), TileSize) (pBox, mapper); } while (mapper.next()); __setTransactionEvent(__endTransaction()); }
HINLINE void operator()( T_StorageTuple& tuple, const uint32_t currentStep, const T_Event eventInt, T_Event& updateEvent, T_Event& commEvent ) const { typedef typename HasFlag<FrameType, particlePusher<> >::type hasPusher; if (hasPusher::value) { PMACC_AUTO(speciesPtr, tuple[SpeciesName()]); __startTransaction(eventInt); speciesPtr->update(currentStep); commEvent += speciesPtr->asyncCommunication(__getTransactionEvent()); updateEvent += __endTransaction(); } }
bool executeIntern() { switch (state) { case InitDone: break; case DeviceToHostFinished: state = SendDone; __startTransaction(); Environment<>::get().Factory().createTaskSendMPI(exchange, this); __endTransaction(); //we need no blocking because we get a singnal if transaction is finished break; case SendDone: break; case Finish: return true; default: return false; } return false; }
virtual void init() { __startTransaction(); state = InitDone; if (exchange->hasDeviceDoubleBuffer()) { Environment<>::get().Factory().createTaskCopyDeviceToDevice(exchange->getDeviceBuffer(), exchange->getDeviceDoubleBuffer() ); copyEvent = Environment<>::get().Factory().createTaskCopyDeviceToHost(exchange->getDeviceDoubleBuffer(), exchange->getHostBuffer(), this); } else { copyEvent = Environment<>::get().Factory().createTaskCopyDeviceToHost(exchange->getDeviceBuffer(), exchange->getHostBuffer(), this); } __endTransaction(); //we need no blocking because we get a singnal if transaction is finished }
bool executeIntern() { switch (state) { case WaitForReceived: break; case RunCopy: state = WaitForFinish; __startTransaction(); exchange->getHostBuffer().setCurrentSize(newBufferSize); if (exchange->hasDeviceDoubleBuffer()) { Environment<>::get().Factory().createTaskCopyHostToDevice(exchange->getHostBuffer(), exchange->getDeviceDoubleBuffer()); Environment<>::get().Factory().createTaskCopyDeviceToDevice(exchange->getDeviceDoubleBuffer(), exchange->getDeviceBuffer(), this); } else { Environment<>::get().Factory().createTaskCopyHostToDevice(exchange->getHostBuffer(), exchange->getDeviceBuffer(), this); } __endTransaction(); break; case WaitForFinish: break; case Finish: return true; default: return false; } return false; }
void event(id_t, EventType type, IEventData* data) { switch (type) { case RECVFINISHED: if (data != NULL) { __startTransaction(); //no blocking EventDataReceive *rdata = static_cast<EventDataReceive*> (data); // std::cout<<" data rec "<<rdata->getReceivedCount()/sizeof(TYPE)<<std::endl; newBufferSize = rdata->getReceivedCount() / sizeof (TYPE); __endTransaction(); state = RunCopy; executeIntern(); } break; case COPYHOST2DEVICE: case COPYDEVICE2DEVICE: state = Finish; break; default: return; } }