Skip to content

Web based job submission

David Anderson edited this page Mar 19, 2026 · 1 revision

A local web-based job submission system is a set of pages on your BOINC project's web site that allow users to submit and monitor jobs (without login access to the BOINC server).

These scripts are application-specific, since the way that users specify parameters and input files depends on the application. These scripts are easiest to implement in PHP.

  • inc/util.inc: utility functions
  • inc/boinc_db.inc: access to BOINC database
  • inc/submit_db.inc: access to job-submissions parts of BOINC database
  • inc/submit_util.inc: job submission utility functions

Input files

Input files can be handled in any of several ways:

  • Use the [User file sandbox]] mechanism.
  • Upload them (from the submitter's computer) as part of the submission form. The submission script must then stage them.
  • Serve them from a remote server.

Authorizing requests

Job-submissions scripts must check that the user is allowed to submit jobs. You can do this as follows:

$user = get_logged_in_user();
$user_submit = BoincUserSubmit::lookup_userid($user->id);
if (!$user_submit) error_page("no submit access");
$app = BoincApp::lookup("name='lammps'");
if (!$app) error_page("no lammps app");
if (!$user_submit->submit_all) {
    $usa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id");
    if (!$usa) {
        error_page("no submit access");
    }
}

Creating batches and jobs

You can create a batch as follows:

$batch_id = BoincBatch::insert(
    "(user_id, create_time, njobs, name, app_id, state)
    values ($user->id, $now, $njobs, '$batch_name', $app->id, ".BATCH_STATE_IN_PROGRESS.")"
);

Create jobs using the create_work script.

Examples

Two examples are included in the BOINC distribution:

  • html/user/tree_threader.php
  • html/user/lammps.php

TODO: the above are full of application-specific complexity; we should provide a minimal, generic example.

Clone this wiki locally