コード例 #1
0
ファイル: TaskReceiveMPI.hpp プロジェクト: Heikman/picongpu
 virtual void init()
 {
     __startAtomicTransaction();
     this->request = EnvironmentController::getInstance()
             .getCommunicator().startReceive(
                                             exchange->getExchangeType(),
                                             (char*) exchange->getHostBuffer().getBasePointer(),
                                             exchange->getHostBuffer().getDataSpace().getElementCount() * sizeof (TYPE),
                                             exchange->getCommunicationTag());
     __endTransaction();
 }
コード例 #2
0
ファイル: GridBuffer.hpp プロジェクト: BenjaminW3/picongpu
    EventTask asyncReceive(EventTask serialEvent, uint32_t recvEx)
    {
        if (hasReceiveExchange(recvEx))
        {
            __startAtomicTransaction(serialEvent + receiveEvents[recvEx]);
            receiveEvents[recvEx] = receiveExchanges[recvEx]->startReceive();

            __endTransaction();
            return receiveEvents[recvEx];
        }
        return EventTask();
    }
コード例 #3
0
ファイル: GridBuffer.hpp プロジェクト: BenjaminW3/picongpu
 EventTask asyncSend(EventTask serialEvent, uint32_t sendEx, EventTask &gpuFree)
 {
     if (hasSendExchange(sendEx))
     {
         __startAtomicTransaction(serialEvent + sendEvents[sendEx]);
         sendEvents[sendEx] = sendExchanges[sendEx]->startSend(gpuFree);
         __endTransaction();
         /* add only the copy event, because all work on gpu can run after data is copyed
          */
         return gpuFree;
     }
     return EventTask();
 }
コード例 #4
0
        virtual void init()
        {
            state = Init;
            EventTask serialEvent = __getTransactionEvent();

            for (int i = 1; i < Exchanges; ++i)
            {
                if (buffer.getGridBuffer().hasSendExchange(i))
                {
                    __startAtomicTransaction(serialEvent);
                    FieldFactory::getInstance().createTaskFieldSendExchange(buffer, i);
                    tmpEvent += __endTransaction();
                }
            }
            state = WaitForSend;
        }
コード例 #5
0
ファイル: TaskReceive.hpp プロジェクト: CodeLemon/picongpu
        bool executeIntern()
        {
            switch (state)
            {
                case WaitForReceived:
                    break;
                case RunCopy:
                    state = WaitForFinish;
                    __startAtomicTransaction();
                    exchange->getHostBuffer().setCurrentSize(newBufferSize);
                    if (exchange->hasDeviceDoubleBuffer())
                    {

                        Factory::getInstance().createTaskCopyHostToDevice(exchange->getHostBuffer(),
                                                                                     exchange->getDeviceDoubleBuffer());
                        Factory::getInstance().createTaskCopyDeviceToDevice(exchange->getDeviceDoubleBuffer(),
                                                                                       exchange->getDeviceBuffer(),
                                                                                       this);
                    }
                    else
                    {

                        Factory::getInstance().createTaskCopyHostToDevice(exchange->getHostBuffer(),
                                                                                     exchange->getDeviceBuffer(),
                                                                                     this);
                    }
                    __endTransaction();
                    break;
                case WaitForFinish:
                    break;
                case Finish:
                    return true;
                default:
                    return false;
            }

            return false;
        }