void FaceBuffer::scatter(cudaColorSpinorField &out, int dagger, int dir) { int dim = dir / 2; if(!commDimPartitioned(dim)) return; if (dir%2 == 0) { out.unpackGhost(fwd_nbr_spinor[dim], dim, QUDA_FORWARDS, dagger, &stream[2*dim + recFwdStrmIdx]); CUERR; } else { out.unpackGhost(back_nbr_spinor[dim], dim, QUDA_BACKWARDS, dagger, &stream[2*dim + recBackStrmIdx]); CUERR; } }
void FaceBuffer::scatter(cudaColorSpinorField &out, int dagger, int dir) { int dim = dir/2; if(!commDimPartitioned(dim)) return; if (dir%2==0) {// receive from forwards out.unpackGhost(from_fwd_face[dim], dim, QUDA_FORWARDS, dagger, &stream[2*dim+recFwdStrmIdx]); // 0, 2, 4, 6 } else { // receive from backwards out.unpackGhost(from_back_face[dim], dim, QUDA_BACKWARDS, dagger, &stream[2*dim+recBackStrmIdx]); // 1, 3, 5, 7 } }
void FaceBuffer::exchangeFacesWait(cudaColorSpinorField &out, int dagger, int dir) { if(!commDimPartitioned(dir)){ return; } comm_wait(recv_request2[dir]); comm_wait(send_request2[dir]); #ifndef GPU_DIRECT memcpy(fwd_nbr_spinor[dir], pageable_fwd_nbr_spinor[dir], nbytes[dir]); #endif out.unpackGhost(fwd_nbr_spinor[dir], dir, QUDA_FORWARDS, dagger, &stream[2*dir + recFwdStrmIdx]); CUERR; comm_wait(recv_request1[dir]); comm_wait(send_request1[dir]); #ifndef GPU_DIRECT memcpy(back_nbr_spinor[dir], pageable_back_nbr_spinor[dir], nbytes[dir]); #endif out.unpackGhost(back_nbr_spinor[dir], dir, QUDA_BACKWARDS, dagger, &stream[2*dir + recBackStrmIdx]); CUERR; }
void FaceBuffer::exchangeFacesWait(cudaColorSpinorField &out, int dagger, int dir, cudaEvent_t &scatterStart, struct timeval &commsEnd) { int dim = dir/2; if(!commDimPartitioned(dim)) return; if (dir%2==0) {// receive from forwards // Scatter faces. QMP_finish_from_fwd(dim); gettimeofday(&commsEnd, NULL); // Record the start of the scattering CUDA_EVENT_RECORD(scatterStart, stream[2*dim+recFwdStrmIdx]); out.unpackGhost(from_fwd_face[dim], dim, QUDA_FORWARDS, dagger, &stream[2*dim+recFwdStrmIdx]); // 0, 2, 4, 6 } else { // receive from backwards QMP_finish_from_back(dim); gettimeofday(&commsEnd, NULL); // Record the start of the scattering CUDA_EVENT_RECORD(scatterStart, stream[2*dim+recBackStrmIdx]); out.unpackGhost(from_back_face[dim], dim, QUDA_BACKWARDS, dagger, &stream[2*dim+recBackStrmIdx]); // 1, 3, 5, 7 } }