File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed
include/El/blas_like/level1/Copy Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -3891,14 +3891,43 @@ void TranslateBetweenGrids(
38913891 Int ALDim = A.LDim ();
38923892
38933893 mpi::Comm const & viewingCommB = B.Grid ().ViewingComm ();
3894+ bool const inAGrid = A.Participating ();
3895+ bool const inBGrid = B.Participating ();
3896+
3897+ Int recvMetaData[4 ];
3898+ Int metaData[4 ];
3899+ if (inAGrid)
3900+ {
3901+ metaData[0 ] = m;
3902+ metaData[1 ] = n;
3903+ metaData[2 ] = strideA;
3904+ metaData[3 ] = ALDim;
3905+ }
3906+ else
3907+ {
3908+ metaData[0 ] = 0 ;
3909+ metaData[1 ] = 0 ;
3910+ metaData[2 ] = 0 ;
3911+ metaData[3 ] = 0 ;
3912+ }
3913+ const std::vector<Int> sendMetaData (metaData, metaData + 4 );
3914+ mpi::AllReduce (sendMetaData.data (),
3915+ recvMetaData,
3916+ 4 ,
3917+ mpi::MAX,
3918+ viewingCommB,
3919+ SyncInfo<El::Device::CPU>{});
3920+
3921+ m = recvMetaData[0 ];
3922+ n = recvMetaData[1 ];
3923+ strideA = recvMetaData[2 ];
3924+ ALDim =recvMetaData[3 ];
38943925
38953926 B.Resize (m, n);
38963927 const Int nLocA = A.LocalWidth ();
38973928 const Int nLocB = B.LocalWidth ();
38983929
38993930 // Return immediately if there is no local data
3900- const bool inAGrid = A.Participating ();
3901- const bool inBGrid = B.Participating ();
39023931 if (!inAGrid && !inBGrid) {
39033932 return ;
39043933 }
You can’t perform that action at this time.
0 commit comments