コード例 #1
0
ファイル: boincmodule.C プロジェクト: ph4r05/boinc
static PyObject *boinc_boinc_get_fraction_done(PyObject *self, PyObject *args)
{

	double fractDone;

	fractDone = boinc_get_fraction_done();

	return Py_BuildValue("d", fractDone);
}
コード例 #2
0
ファイル: openclapp.hpp プロジェクト: Ashod/Boinc
void update_shmem() {
    if (!shmem) return;

    // always do this; otherwise a graphics app will immediately
    // assume we're not alive
    shmem->update_time = dtime();

    // Check whether a graphics app is running,
    // and don't bother updating shmem if so.
    // This doesn't matter here,
    // but may be worth doing if updating shmem is expensive.
    //
    if (shmem->countdown > 0) {
        // the graphics app sets this to 5 every time it renders a frame
        shmem->countdown--;
    } else {
        return;
    }
    shmem->fraction_done = boinc_get_fraction_done();
    shmem->cpu_time = boinc_worker_thread_cpu_time();;
    boinc_get_status(&shmem->status);
}