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 evaluation of Pelican.
Pelican was measured under different load regimes. The disk throughput was measured using a quiescent system. Seeks are simulated by including a constant latency of 4.2 ms for all disk accesses and it was found that seek latency has negligible impact on performance. It was also found that the latency of spinning the disk up and mounting the volume heavily dominate over seek time. The distribution for mount delays was widely affected by the load on the system.
We were analyzing the charts from the evaluation run.we said the spin up and unmount delay are not affected by load and have more or less a uniform distribution because they affect all the disks and are one time only. This is different for mount delays where the higher the workload the higher the chance of a disk being a straggler.
#codingexercise
There are n pairs of 2n people. All these 2n persons are arranged in random fashion.Find the minimum number of swaps required to arrange these pairs such that all pairs become adjacent to each other.
Notice this has a greedy choice property in terms of costs as the number of pairs
The cost to pair the first two elements if they are already a pair is zero.
The cost to pair the first two element if they are not is the minimum of the costs to find the partner for the first element and to find the partner for the second element
Once we found the minimum cost for the first we do the same for the next pair.
Each time we revert the changes made so we can find the cost for the next pair as it appears in the given order.
int GetMinSwaps(List<int> pairs, List<int>num, List<int>index, int start)
{
var n = num.Count;
if (start> n) return 0;
if (pairs[num[start]] == num[start+1])
return GetMinSwaps(pairs, num, index, start+2);
int select = num[start+1]
int pairindex = index[pairs[num[start]]];
int partner = num[pairindex];
Swap(num[start+1], partner)
UpdateIndex(index, select, start+1, partner, pairindex);
int firstcost = GetMinSwaps(pairs, num, index, start+2);
swap(num[start+1], partner);
UpdateIndex(index, select, pairindex, partner, start+1);
int secondindex = index[pairs[num[start+1]]];
int second = nums[secondindex];
swap(nums[start], second);
UpdateIndex(index, second, secondindex, nums[start], start);
int secondcost = GetMinSwaps(pairs, num, index, start+2);
swap(nums[start], second);
UpdateIndex(index, second,start, nums[start], secondindex);
return 1 + min(firstcost, secondcost);
}
Void updateindex(list<int> index, int first, int firstindex, int second, int secondindex)
{
Index[firstindex] = first;
Index[secondindex]=second;
}
{
var n = num.Count;
if (start> n) return 0;
if (pairs[num[start]] == num[start+1])
return GetMinSwaps(pairs, num, index, start+2);
int select = num[start+1]
int pairindex = index[pairs[num[start]]];
int partner = num[pairindex];
Swap(num[start+1], partner)
UpdateIndex(index, select, start+1, partner, pairindex);
int firstcost = GetMinSwaps(pairs, num, index, start+2);
swap(num[start+1], partner);
UpdateIndex(index, select, pairindex, partner, start+1);
int secondindex = index[pairs[num[start+1]]];
int second = nums[secondindex];
swap(nums[start], second);
UpdateIndex(index, second, secondindex, nums[start], start);
int secondcost = GetMinSwaps(pairs, num, index, start+2);
swap(nums[start], second);
UpdateIndex(index, second,start, nums[start], secondindex);
return 1 + min(firstcost, secondcost);
}
Void updateindex(list<int> index, int first, int firstindex, int second, int secondindex)
{
Index[firstindex] = first;
Index[secondindex]=second;
}
No comments:
Post a Comment