update_jobs_status: update_jobs_status

View source: R/getResult.R

update_jobs_statusR Documentation

update_jobs_status

Description

Update status for jobs and get result for complete jobs.

Usage

update_jobs_status(connection, jobs_status, callback_function = NULL)

Arguments

connection

a connection created by create_connection

jobs_status

a list returned by create_jobs or update_jobs_status. This is reference like in C++ language.

callback_function

a function with prototype function(result_element) that is called for each result after loading. The value returned by this function is placed in the result list.

Details

This function communicates with the boinc server and gets the state for each job. If the job has already been completed, and its result has been downloaded and processed, then it is skipped. After the last result is downloaded, the jobs data is deleted from the server, and status field in the return value is set to "done".

Errors and warnings

When errors occur, execution can be stopped with the following messages:

  • for unknown connections:

    • "Unknown protocol."

  • for any connection:

    • "All jobs have already been canceled."

    • "All results have already been received."

This function can output the following warnings:

  • for any connection:

    • Failed to download the result: "<error message>"

Value

a list with current states of jobs. This list contains the following fields:

  • batch_id - ID of the batch that includes the jobs;

  • jobs_name - a name of jobs on BOINC server;

  • results - computation results (NULL if computation is still incomplete); The length of this list is equal to the length of the data;

  • jobs_status - human-readable status for each job;

  • status - computation status, may be:

    • "initialization" - jobs have been submitted to the server, but their status was not requested by update_jobs_status;

    • "in_progress" - BOINC serves jobs;

    • "done" - computations are complete, the results were downloaded;

    • "warning" a recoverable error occurred during the job processing;

    • "error" - a serious error occurred during the job processing;

    • "aborted" - processing was canceled using the cancel_jobs function.

Examples

## Not run: 

# Function for data processing:
fun = function(val)
{
   ...
}

# Data for processing:
data = list(...)

# Connection to the BOINC server:
con = create_connection(...)

# Send jobs to BOINC server:
jobs = create_jobs(con, fun, data)

# Get status for jobs:
jobs = update_jobs_status(con, jobs)

# Release resources:
close_connection(con)

## End(Not run)

RBOINC.cl documentation built on Nov. 15, 2022, 3 a.m.