The I/O-Model Aggarwal and Vitter, The Input/Output Complexity of - - PowerPoint PPT Presentation

the i o model
SMART_READER_LITE
LIVE PREVIEW

The I/O-Model Aggarwal and Vitter, The Input/Output Complexity of - - PowerPoint PPT Presentation

The I/O-Model Aggarwal and Vitter, The Input/Output Complexity of Sorting and Related Problems . Communications of the ACM, 31(9), p. 1116-1127, 1988. Page 1 Analysis of algorithms The standard model: Memory CPU Add : 1 unit of time


slide-1
SLIDE 1

The I/O-Model

  • Aggarwal and Vitter, The Input/Output Complexity of Sorting and

Related Problems. Communications of the ACM, 31(9),

  • p. 1116-1127, 1988.

Page 1

slide-2
SLIDE 2

Analysis of algorithms

The standard model:

Memory CPU

  • Add: 1 unit of time
  • Mult: 1 unit of time
  • Branch: 1 unit of time
  • MemAccess: 1 unit of time

Page 2

slide-3
SLIDE 3

Reality

Memory hierarchy:

CPU

  • Reg. Cache1

RAM Disk Cache2 Tertiary Storage Access time Volume Registers 1 cycle 1 Kb Cache 5 cycles 512 Kb RAM 50 cycles 256 Mb Disk 2,000,000 cycles 80 Gb

CPU speed improves faster than RAM access time and much faster than disk access time

Page 3

slide-4
SLIDE 4

I/O bottleneck

I/O is the bottleneck ⇓ I/O should be optimized (not instruction count)

Page 4

slide-5
SLIDE 5

Analysis of algorithms

New I/O-model:

CPU Memory 2

Block

Memory 1

Parameters:

N =

  • no. of elements in problem.

M =

  • no. of elements that fits in RAM.

B =

  • no. of elements in a block on disk.

D =

  • no. of disks (copies of Memory 2)

Cost: Number of I/O’s (block transfers) between Memory 1 and Memory 2.

Page 5

slide-6
SLIDE 6

Generic Example

Consider two O(n) algorithms:

  • 1. Memory accessed randomly ⇒ page fault at each memory access.
  • 2. Memory accessed sequentially ⇒ page fault every B memory

accesses. O(N) I/Os vs. O(N/B) I/Os Typically, B ∼ 103.

Page 6

slide-7
SLIDE 7

Specific Examples

Two classic sorting algorithms: QuickSort ∼ sequential access vs. HeapSort ∼ random access QuickSort: O(N log2(N/M)/B) I/Os HeapSort: O(N log2(N/M)) I/Os Other examples:

  • Hashing, radixsort (random access)
  • Scanning, queues (sequential access)

Page 7