Changes between Version 10 and Version 11 of AssimilateIntro


Ignore:
Timestamp:
Oct 22, 2014, 10:56:20 AM (10 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AssimilateIntro

    v10 v11  
     1[[PageOutline]]
    12= Handling completed jobs =
    23
     
    1617
    1718This function is called when either
    18  * The workunit has a nonzero [JobIn#Redundancyandschedulingattributes error mask] (indicating, for example, too many error results). In this case the handler might write a message to a log or send an email to the project administrator.
    19  * The workunit has a canonical result. In this case wu.canonical_resultid will be nonzero, and canonical_result will contain the canonical result.
     19 * The workunit has a nonzero [JobIn#Redundancyandschedulingattributes error mask]
     20  (indicating, for example, too many error results).
     21  In this case the handler might write a message to a log or send an email to the project administrator.
     22 * The workunit has a canonical result.
     23  In this case wu.canonical_resultid will be nonzero, and canonical_result will contain the canonical result.
    2024
    2125In both cases the 'results' vector will be populated with all the workunit's results (including unsuccessful and unsent ones).
     
    2630The return values of `assimilate_handler()` are:
    2731 * 0: success: the workunit will be marked as assimilated.
    28  * DEFER_ASSIMILATION: the workunit will be processed again when another instance finishes.  This is useful for appliations where you want to see all the completed results.
    29  * Other nonzero values: the assimilator will log an error message and exit. Typically '''assimilate_handler()''' should return nonzero for any error condition. This way the system administrator can fix the problem before any completed or erroneous workunits are mis-handled by BOINC.
     32 * DEFER_ASSIMILATION: the workunit will be processed again when another instance finishes.
     33  This is useful for appliations where you want to see all the completed results.
     34 * Other nonzero values: the assimilator will log an error message and exit.
     35  Typically '''assimilate_handler()''' should return nonzero for any error condition.
     36  This way the system administrator can fix the problem before any completed or erroneous workunits are mis-handled by BOINC.
    3037
    3138You can use BOINC's [BackendUtilities back-end utility functions] to get file pathnames and open files.
     
    3643{{{
    3744<daemon>
    38    <cmd> my_assimilator -app APPNAME </cmd>
     45   <cmd> my_assimilator --app APPNAME </cmd>
    3946</daemon>
    4047}}}
     
    5057
    5158 [ --dont_update_db ] :: don't mark jobs as assimilated (for testing)
    52  
     59
     60== Using scripting languages ==
     61
     62The assimilator '''script_assimilator''' lets you write assimilator logic
     63in your language of choice (Python, Perl, bash, etc.).
     64'''script_assimilator''' takes a command-line argument
     65
     66 --script filename:: name of script to handle a completed job
     67
     68The script is called as
     69{{{
     70script --wu_name X f1 ... fn
     71}}}
     72to handle a successful job, where X is the workunit name
     73and f1 ... fn are the output files of the canonical result,
     74or as
     75{{{
     76script --wu_name X --error N
     77}}}
     78to handle an error job, were N is an integer encoding the error conditions
     79(see WU_ERROR_* in html/inc/common_defs.inc).
     80
     81The script must be put in your project's bin/ directory.
     82
    5383== The sample assimilator ==
    5484
     
    6090  If there are more than one they are named WU_NAME_0, WU_NAME_1, etc.
    6191  If there are no output files, an empty file WU_NAME_no_output_files is created.
    62  * If the workunit failed (e.g., too many errors) it appends a line to '''sample_results/errors''' containing the workunit name and the error code.
     92 * If the workunit failed (e.g., too many errors) it appends a line to '''sample_results/errors'''
     93  containing the workunit name and the error code.
    6394
    64 The sample assimilator can be used as a placeholder while you
    65 are developing your application.
     95The sample assimilator can be used as a placeholder while you are developing your application.
    6696In some cases you may be able to use it in production.