wiki:AppCoprocessor

Version 14 (modified by davea, 10 years ago) (diff)

--

Applications that use coprocessors

T(DesignDocument)?

This document describes BOINC's support for applications that use coprocessors such as

  • GPUs
  • Cell SPEs

We'll assume that these resources are allocated rather than scheduled: i.e., an application using a coprocessor has it locked while the app is in memory, even if the app is suspended by BOINC or descheduled by the OS.

The BOINC client probes for coprocessors and reports them in scheduler requests.

Deploying a coprocessor app

BOINC uses the application planning mechanism to coordinate the scheduling of multi-threaded applications.

Suppose you've developed a coprocessor program, that it uses a CUDA GPU and 1 GFLOPS of the CPU, and produces a total of 100 GFLOPS. To deploy it:

  • Choose a "planning class" name for the program, say "cuda_1.1" (see below).
  • Create an app version. Include a file app_plan containing "cuda_1.1".
  • Link the following function into your scheduler:
    bool app_plan(SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu) {
        if (strcmp(plan_class, "cuda_1.1") != 0) {
            return false;
        }
        for (i=0; i<sreq.coprocs.size(); i++) {
            COPROC cp = sreq.coprocs[i];
            if (cp.type == COPROC_CUDA) {
                COPROC_USAGE cu;
                strcpy(cu.name, cp.name);
                cu.count = 1;
                hu.coprocs.push_back(cu);
                double x = 1e9/host.p_fpops;
                if (x > 1) x = 1;
                hu.avg_ncpus = x;
                hu.max_ncpus = x;
                hu.fpops = 5e11;
                return true;
            }
        }
        return false;
    }
    

Questions

  • How does BOINC know if non-BOINC applications are using resources?

Possible future additions

  • Allow app_versions to specify min and max requirements (and have a corresponding allocation scheme in the client).
  • Let projects define their own resources, unknown to BOINC, and have "probe" programs (using the assigned-job mechanism) that surveys the resources on each host.
  • Store the resource descriptions in the DB (or maybe flat files), so that you can study your host population.