Skip to content

BOINC client tech notes

matszpk edited this page Apr 4, 2012 · 4 revisions

BOINC client technotes:

I introduced two important modules into boinc client. In this page I describe shortly these modules and their purposes (sorry for my pure English):

ClientMonitor - monitors event inside BOINC client.

This module just sends event to manager through new communication channel (in the port 31417). Currently I defined only 6 events, which can be sent to manager:

  • ATTACH_PROJECT (code 1) - when client attaches to new project.
  • DETACH_PROJECT (code 2) - when client detaches from project.
  • SUSPEND_ALL_TASK (code 3) - when client suspends all tasks
  • RUN_TASKS (code 4) - when client resumes one of the tasks.
  • RUN_BENCHMARK (code 5) - when run benchmarks
  • FINISH_BENCHMARK (code 6) - when client finishes benchmarks

Format of the message:

<reply>
  <type>{code}</type>
  <project>{project_url}</project>
</reply>

First event is used during installation. After receiving ATTACH_PROJECT NativeBOINC manager installs binaries of the new project (if exists in the my repository). Rest of events excluding DETACH_PROJECT are used to power management by NativeBOINC manager (triggers holding or releasing wake locks).

I introduced 'auth_monitor' GUI RPC request for performing monitor authorization (see code).

GUI RPC extensions:

  • auth_monitor - authorizes access to monitor

returns:

<value>{auth_code}</value> - authorization code client monitor
<failed/> - when failed

Client monitor can sent events only to a localhost clients.

modified or introduced sources codes (client directory):

  • monitor.cpp, monitor.h - main module
  • client_state.cpp, client_state.h - support for main an awaiting routine (do_io_or_sleep).
  • gui_rpc_server_ops.cpp - GUI RPC request

Update_apps - updates binaries of application for specified project

This is my GUI RPC extension. Allows to installation of the project binaries during client work. Copies files from 'updates/project_dir' directory to 'projects/project_dir' directory with applying permissions for executables. Also suspends tasks when tasks of specified project were ran. After updates resumes suspended tasks.

I added two new GUI RPC extensions:

  • update_project_apps - main request which triggers updating.

    input:

    <project_url>{project_url}</project_url> - project url which binaries should be installed

    returns:

    - when success {message} - when failed - when failed

  • update_project_apps_poll - it polls updating for specified project

    input:

    <project_url>{project_url}</project_url> - project url which binaries should be installed

    returns:

    <update_project_apps_reply> OK </update_project_apps_reply> - when successfully updated

    <update_project_apps_reply> <error_num>{erro_code}</error_num> </update_project_apps_reply> - when not finished (ERR_IN_PROGRESS) or failed (other code)

modified or introduced sources codes (client directory):

  • gui_rpc_server_ops.cpp - rpc requests
  • cpu_sched.cpp - changes for cpu scheduler
  • client_state.cpp, client_state.h - fixes for main routine
  • app.cpp, app.h - applications killing
  • app_control.cpp - applications killing

Minor changes

I also performed minor changes in host_info_unix.cpp (detection of extensions and multicore), prefs.* (new Global preferences for battery management), boinc_api (fix bug with suspending of the tasks).