Thursday, July 21, 2016

Today we continue our discussion of the  paper titled "Pelican: a  building block for exascale cold data storage". Pelican treats a group of disks as a single schedulable unit. Resource restrictions such as power consumption, vibrations and failure domains are expressed as constraints over these units.
With the help of resource constraints and scheduling units, Pelican aims to be better than its overprovisioned counterpart racks using computations in software stacks
Pelican uses resources from a set of resource domains which is a subset of disks. Pelican proposes a data layout and IO scheduling algorithms by expressing these resource domains as constraints over the disks. The authors classify the constraints as hard or soft. Hard constraints cause short or long term failures. For example, power and cooling are hard constraints. Violating a  hard constraint takes the disks offline and may have to be remounted. Violating a soft constraint does not lead to failure but instead causes performance degradation or inefficient power resource usage. For example, bandwidth is a soft constraint. The Pelican storage stack uses the following constraints:
1) one disk spinning or spinning up per cooling domain
2) two disks spinning or spinning up per power domain
3) shared links in the PCIe interconnectivity hierarchy and
4) disks located back to back in a tray share a vibration domain.


#codingexercise
Given a sorted matrix (row-wise and column wise) , find kth smallest element.
we walk the board and count until k
int GetKth(int[,] m, int row, int col, int k)
{
int r = 0;
int c = 0;
int count = 0;
var front = new List<int>()
for (int k = row-1; k >= 0; k--)
    front.add(k*col+0);
while ( count < k)
{
// compare right and down and increment r or c
// the idea is that the k smallest elements will be a contiguous block 
// and the next element for inclusion will be either to the right of this block or 
// to the bottom of this block
// we just need to propagate the front on all rows one cell at a time.
int min = INT_MAX;
int selected = -1;
for (int k = row-1; k >= 0; k--)
{
   int i = front[k]/col;
   int j = front[k]%col;
   if ( j  < col && m[i,j] < min){
        selected = k;
        min = m[i,j];
   }
}
if (selected == -1){
   return m[r,c];
}
else{
   int i = front[selected]/col;
   int j = front[selected]%col;
   front[selected] = i * col + j+1;
   r = i;
   c = j;
   prev = count;
   count++;
}
}
}
return m[r,c];
}
2 7 11
3 8 12
9 13 15

No comments:

Post a Comment