21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

378 C.–C. L<strong>in</strong> and C.–L. Chen<br />

� Si – the code size of bytecode handler Vi.<br />

� N – the size of one NAND flash page.<br />

� M(Pk ) – the size of partition Pk. It is ΣSm for all Vm∈ Pk .<br />

� H(Pk ) – the value of partition Pk. It is ΣFi,j for all Vi , Vj ∈ Pk .<br />

Our goal was to construct partitions that satisfy the follow<strong>in</strong>g constra<strong>in</strong>s.<br />

Def<strong>in</strong>ition 2. The problem is to divide G <strong>in</strong>to K disjo<strong>in</strong>ed partitions {P1, P2,…,Pk}.<br />

For each Pk that M(Pk) ≤ N. Such that Wi,j is m<strong>in</strong>imized. And maximize ΣH(Pi ) for all<br />

Pi ∈ {P1, P2,…,Pk}.<br />

This rectified model is exactly an application of the graph partition problem, i.e., the<br />

size of each partition must satisfy the constra<strong>in</strong>t (NAND flash page size), and the sum<br />

of <strong>in</strong>tra-partition path weights is m<strong>in</strong>imal. The graph partition problem is NPcomplete<br />

[13]. However, the purpose of this paper was neither to create a new graph<br />

partition algorithm nor to discuss difference between exist<strong>in</strong>g algorithms. The<br />

experimental implementation just adopted the follow<strong>in</strong>g algorithm to demonstrate our<br />

approach works. Other implementations based on this approach may choose another<br />

graph partition algorithm that satisfies specific requirements.<br />

Partition (G)<br />

1. F<strong>in</strong>d the edge with maximal weight Fi,j among graph G, while the Si + Sj ≤ N.<br />

If there is no such an edge, go to step 4.<br />

2. Call Merge (Vi, Vj ) to comb<strong>in</strong>e vertexes Vi and Vj.<br />

3. Remove both Vi and Vj from G. go to step 1.<br />

4. F<strong>in</strong>d a pair of vertexes Vi and Vj <strong>in</strong> G such that Si + Sj ≤ N. If there isn’t a pair<br />

satisfied the criteria, go to step 7.<br />

5. Call Merge (Vi , Vj ) to comb<strong>in</strong>e vertexes Vi and Vj.<br />

6. Remove both Vi and Vj out of G. go to step 4.<br />

7. End.<br />

The procedure of merg<strong>in</strong>g both vertexes Vi and Vj is:<br />

Merge (Vi , Vj )<br />

1. Add a new vertex Vk. to G.<br />

2. Pickup an edge E connects Vt with either Vi or Vj. If there is no such an edge,<br />

then go to step 6.<br />

3. If there is already an edge F connects Vt to Vk,<br />

4. Then, add the weight of E to F, and discard E.<br />

5. Else, replace one end of E which is either Vi or Vj with Vk.<br />

6. End.<br />

F<strong>in</strong>ally, each vertex <strong>in</strong> G is an aggregation of several bytecode handlers. The<br />

ref<strong>in</strong>ement process is to collect bytecode handlers belong to the same vertex and place<br />

them <strong>in</strong>to one NAND flash page.<br />

5 Ref<strong>in</strong>ement Process<br />

The implementation of the ref<strong>in</strong>ement process consisted of two steps. The ref<strong>in</strong>ement<br />

process acted as a post processor of the compiler. It parsed <strong>in</strong>termediate files

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!