1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Interleave code path; not enabled

This commit is contained in:
Peter Boyle 2017-06-30 10:23:51 +01:00
parent b73bd151bb
commit 38325ebbc6
2 changed files with 26 additions and 1 deletions

View File

@ -51,8 +51,31 @@ LebesgueOrder::LebesgueOrder(GridBase *_grid)
if ( Block[0]==0) ZGraph(); if ( Block[0]==0) ZGraph();
else if ( Block[1]==0) NoBlocking(); else if ( Block[1]==0) NoBlocking();
else CartesianBlocking(); else CartesianBlocking();
}
if (0) {
std::cout << "Thread Interleaving"<<std::endl;
ThreadInterleave();
}
}
void LebesgueOrder::ThreadInterleave(void)
{
std::vector<IndexInteger> reorder = _LebesgueReorder;
std::vector<IndexInteger> throrder;
int vol = _LebesgueReorder.size();
int threads = GridThread::GetThreads();
int blockbits=3;
int blocklen = 8;
int msk = 0x7;
for(int t=0;t<threads;t++){
for(int ss=0;ss<vol;ss++){
if ( ( ss >> blockbits) % threads == t ) {
throrder.push_back(reorder[ss]);
}
}
}
_LebesgueReorder = throrder;
}
void LebesgueOrder::NoBlocking(void) void LebesgueOrder::NoBlocking(void)
{ {
std::cout<<GridLogDebug<<"Lexicographic : no cache blocking"<<std::endl; std::cout<<GridLogDebug<<"Lexicographic : no cache blocking"<<std::endl;

View File

@ -70,6 +70,8 @@ namespace Grid {
std::vector<IndexInteger> & xi, std::vector<IndexInteger> & xi,
std::vector<IndexInteger> &dims); std::vector<IndexInteger> &dims);
void ThreadInterleave(void);
private: private:
std::vector<IndexInteger> _LebesgueReorder; std::vector<IndexInteger> _LebesgueReorder;