Changes between Version 1 and Version 2 of LocalityNew


Ignore:
Timestamp:
Aug 14, 2012, 2:06:53 PM (12 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LocalityNew

    v1 v2  
     1[[PageOutline]]
    12= Locality scheduling redesign =
    23
     
    45
    56 * A '''batch''' consists of a sequence of files F1 ... Fn
    6         and a set of jobs J1 ... Jm operating on these files.
     7  and a set of jobs J1 ... Jm operating on these files.
    78 * Each job uses a contiguous set of files.
    89 * A given file may be used by many jobs.
     
    7475workunit (new fields)
    7576        cursor_id integer
     77        job_num integer
    7678
    7779result (new fields)
     
    8688 * create batch record
    8789 * based on # of hosts, # of jobs, and job density,
    88    create locality_job_range and locality_cursor records
     90   create locality_cursor records
    8991
    9092=== Feeder/scheduler ===
     
    107109==== Assigning jobs ====
    108110
     111For each batch:
     112
     113Enumerate unsent results for this host's cursor
     114in order of increasing job num
     115(i.e. finish old jobs before starting new ones).
     116Send as many as the host can handle.
     117
     118Some type of synchronization is needed; maybe
     119
     120 * use a DB transaction (how much would this lock?)
     121 * explicitly lock the locality_cursor record (is this possible?)
     122 * use a semaphore per cursor
     123
    109124==== Deleting files ====
     125
     126If the host has a file that's used only by finished jobs,
     127tell client to delete it.
    110128
    111129=== Work generator ===
    112130
    113 === Validator ===
     131Try to maintain a cushion of N unsent jobs per cursor.
     132Start generating jobs at cursor.first_ungenerated_job_num.
    114133
    115134=== Transitioner ===
    116135
     136When a workunit is completed (successfully or not):
     137
     138{{{
     139if workunit.job_num == cursor.first_unfinished_job_num
     140        cursor.first_unfinished_job_num++
     141}}}
     142
    117143=== locality_daemon ===
     144
     145This runs periodically (every hour or day) and recomputes
     146locality_cursor.expavg_credit.
     147It doesn't have to be a separate program;
     148it could be added to an existing daemon, like the feeder