Changes between Version 3 and Version 4 of PythonAppDev


Ignore:
Timestamp:
Sep 20, 2007, 8:23:14 AM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PythonAppDev

    v3 v4  
    5959}}}
    6060 * This command may take a long time.  If it's aborted via !^C, it may be repeated later. In that case no new jobs are created, and the master waits for the completion of the remaining slaves.
     61
     62
     63== Implementation ==
     64
     65PyBOINC uses the following files and subdirectories in the job directory:
     66
     67 * pyboinc_checkpoint: If present, this contains a job ID
     68 * new/: result files not yet handled
     69 * old/: result files already handled
     70
     71Pseudocode for the various PyBOINC functions:
     72{{{
     73static jobID
     74
     75pyboinc_call(slave_filename, input)
     76    create a uniquely-named file x in the download hierarchy
     77    Pickler(x).dump(input)
     78    create_work()
     79
     80pyboinc_master(make_calls, handle_result)
     81    read jobID from pyboinc_checkpoint
     82    if none
     83        create a batch record; jobID = its ID
     84        make_calls()
     85        write jobID to checkpoint file
     86    move all files from old/ to new/
     87    while (not all jobs done)
     88        if there is a file x in new/
     89            output = Pickler.load(x)
     90            handle_result(output)
     91        else
     92            sleep(1)
     93
     94pyboinc_get_input()
     95    boinc_resolve_filename("input", infile)
     96    return Pickler.load(infile)
     97
     98pyboinc_return_output(output)
     99    boinc_resolve_filename("output", outfile)
     100    Pickler(outfile).dump(output)