Skip to content

Commit

Permalink
Temporary change -- Randomize prefetch file list.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent c2628fe commit af25b43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/XrdFileCache/XrdFileCache.cc
Expand Up @@ -193,7 +193,7 @@ Cache::RAMBlockReleased()
//==============================================================================
//======================= PREFETCH ===================================
//==============================================================================

/*
namespace {
struct prefetch_less_than
{
Expand All @@ -202,7 +202,7 @@ struct prefetch_less_than
return (struct1->GetPrefetchScore() < struct2->GetPrefetchScore());
}
}myobject;
}
}*/
//______________________________________________________________________________

void
Expand Down Expand Up @@ -243,7 +243,8 @@ Cache::GetNextFileToPrefetch()
return 0;
}

std::sort(m_files.begin(), m_files.end(), myobject);
// std::sort(m_files.begin(), m_files.end(), myobject);
std::random_shuffle(m_files.begin(), m_files.end());
File* f = m_files.back();
f->MarkPrefetch();
return f;
Expand All @@ -270,7 +271,7 @@ Cache::Prefetch()
File* f = GetNextFileToPrefetch();
if (f) {
f->Prefetch();
XrdSysTimer::Wait(1);
// XrdSysTimer::Wait(1);
continue;
}
}
Expand Down

0 comments on commit af25b43

Please sign in to comment.