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 over provisioned 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.
We were discussing implementation considerations. Pelican has to ensure that the disks do not spin when first powered. It also needs to mount and check every drive which it does in parallel.It does this with the help of groups where the request is initialized and scheduled as the first operation in each group. The disks in the group are domain disjoint so these can be performed concurrently. Each disk is initialized with a GPT partition table and formatted with an NTFS system. Furthermore, Pelican had to silence unexpected spin ups of disks from services like disk failure predictors polling the disk. It added a special No Access flag to the Windows Server driver stack that causes all IOs issued to a disk marked to return with a "media not ready" error code. Pelican also had to tackle legacy issues such as ports exposed by the HBA that run out of space and cause the BIOS code to hang. Therefore, the BIOS code was modified to handle all 72 HBAs.
#codingexercise
Yesterday we were discussing counting the number of squares in a rectangle.
We counted the squares formed within the largest square in the rectangle and those from the overlap of the largest square and the extra columns that make up the rectangle. However, we suggested that squares can also be formed exclusively in the region made up of the extra columns beyond the largest square and making up the rectangle. Consequently, we split the problem of counting squares as a recursive call to count the squares in the largest square of the rectangle plus the squares from the overlap of the largest square of the rectangle and the extra columns and those exclusively formed within the extra columns. This is shown as follows:
Int getSquaresCount(int
n, int m)
{
If (n <
m)
Swap(n,m);
If (n == 0
|| m == 0) return 0;
If (n == m
&& n == 1) return 1;
int count = m(m+1)(2m+1)/6;
count += (n-m)*m(m-1)/2
+ GetSquaresCount(n –m, n-m) + GetSquaresCount(n-m, 2m-n);
return count;
}
Next let us look to generalize the problem as
Given a N*M matrix, print all squares/rectangles of all possible sizes
void PrintSquaresRectanglesFromPosition(int n, int m, int startrow, int startcol)
{
for (int i =startrow; i <= M; i++){
for (int j = startcol; j <=N; j++){
if (i == startrow && j == startcol) continue;
if (i == startrow && j == startcol) continue;
Console.Write("top left {0}{1} - bottom right{2}{3}", startrow-1, startcol-1, i-1, j-1);
}
}
}
}
}
void PrintSquaresRectangles(int n, int m)
{
for (int i = 1; i <= m; i++)
for(int j = 1; j <=n; j++)
PrintSquaresRectanglesFromPosition(n,m,i,j);
}
No comments:
Post a Comment