Rosetta
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
protocols::boinc::Boinc Class Reference

#include <boinc.hh>

Public Member Functions

void initialize_worker (void)
 Initialize BOINC. Sets up diagnostics, calls boinc_init(), etc. Should be used at the start of main in worker app. More...
 

Static Public Member Functions

static Boincinstance (void)
 Access to singleton Boinc class. More...
 
static core::Real get_project_pref_max_gfx_fps (void)
 Get maximum graphics frames per second user preference. More...
 
static core::Real get_project_pref_max_gfx_cpu (void)
 Get maximum percent cpu for graphics user preference. More...
 
static int get_project_pref_max_cpu_run_time (void)
 Get maximum target cpu run time user preference. More...
 
static background_type get_project_pref_bg (void)
 Get graphics background type user preference. More...
 
static void set_project_pref_max_gfx_fps (core::Real project_pref_max_gfx_fps)
 Set maximum graphics frames per second. Standalone mode only. More...
 
static void set_project_pref_max_gfx_cpu (core::Real project_pref_max_gfx_cpu)
 Set maximum percent cpu for graphics. Standalone mode only. More...
 
static void set_project_pref_max_cpu_run_time (int project_pref_max_cpu_run_time)
 Set maximum target cpu run time. Standalone mode only. More...
 
static void set_working_set_size (core::Real working_set_size)
 Set working set size to keep track of memory usage. More...
 
static void read_and_set_project_prefs (void)
 Rereads project prefs and stores info. More...
 
static core::Real get_remaining_cpu_time (void)
 Gets the remaining cpu time which depends on the user run time preference. More...
 
static void update_pct_complete (void)
 Determines the fraction complete based on the max_cpu_run_time preference and the total wu_cpu_run_time. Calls BOINC API boinc_fraction_done(). More...
 
static core::Real get_boinc_wu_cpu_time ()
 gets the current runtime for the boinc wu More...
 
static bool worker_is_finished (const int &total_nstruct)
 Is the task finished? More...
 
static void worker_startup (void)
 Start BOINC. More...
 
static void worker_shutdown (void)
 Stop BOINC. Does not return. Uses BOINC API boinc_finish(0). More...
 
static void worker_finish_summary (const int &num_decoys, const int &attempted_decoys, const int &starting_structs)
 Brief summary. Formatted for the R@h validator so don't change. More...
 
static int iterate_checkpoint_count (void)
 Keeps track of number of checkpoints made. Necessary for determining whether application is making progress on the client. More...
 
static void checkpoint_completed (void)
 Must be called after a checkpoint is made. More...
 
static bool is_worker_running (void)
 
static void stop_running_worker (void)
 
static void get_sema_name (char *name, platform::Size n)
 
static int create_semaphore (void)
 
static int get_semaphore (void)
 
static int wait_semaphore (void)
 
static int trywait_semaphore (void)
 
static int unlock_semaphore (void)
 
static int decoy_count ()
 

Private Member Functions

 Boinc ()=default
 

Static Private Attributes

static bool worker_initialized_
 
static core::Real fraction_done_
 
static core::Real cpu_time_
 
static core::Real working_set_size_
 
static core::Real working_set_size_max_val_
 
static int checkpoint_count_
 
static int decoy_count_
 
static int no_progress_init_cnt_
 
static bool worker_running_
 
static core::Real project_pref_max_gfx_fps_
 
static core::Real project_pref_max_gfx_cpu_
 
static int project_pref_max_cpu_run_time_
 
static background_type project_pref_bg_
 

Constructor & Destructor Documentation

◆ Boinc()

protocols::boinc::Boinc::Boinc ( )
privatedefault

Member Function Documentation

◆ checkpoint_completed()

static void protocols::boinc::Boinc::checkpoint_completed ( void  )
static

Must be called after a checkpoint is made.

Referenced by protocols::checkpoint::Timer::reset().

◆ create_semaphore()

static int protocols::boinc::Boinc::create_semaphore ( void  )
static

◆ decoy_count()

static int protocols::boinc::Boinc::decoy_count ( )
inlinestatic

References decoy_count_.

◆ get_boinc_wu_cpu_time()

static core::Real protocols::boinc::Boinc::get_boinc_wu_cpu_time ( )
static

gets the current runtime for the boinc wu

◆ get_project_pref_bg()

static background_type protocols::boinc::Boinc::get_project_pref_bg ( void  )
static

Get graphics background type user preference.

◆ get_project_pref_max_cpu_run_time()

static int protocols::boinc::Boinc::get_project_pref_max_cpu_run_time ( void  )
static

Get maximum target cpu run time user preference.

◆ get_project_pref_max_gfx_cpu()

static core::Real protocols::boinc::Boinc::get_project_pref_max_gfx_cpu ( void  )
static

Get maximum percent cpu for graphics user preference.

◆ get_project_pref_max_gfx_fps()

static core::Real protocols::boinc::Boinc::get_project_pref_max_gfx_fps ( void  )
static

Get maximum graphics frames per second user preference.

◆ get_remaining_cpu_time()

static core::Real protocols::boinc::Boinc::get_remaining_cpu_time ( void  )
static

Gets the remaining cpu time which depends on the user run time preference.

◆ get_sema_name()

static void protocols::boinc::Boinc::get_sema_name ( char *  name,
platform::Size  n 
)
static

◆ get_semaphore()

static int protocols::boinc::Boinc::get_semaphore ( void  )
static

◆ initialize_worker()

void protocols::boinc::Boinc::initialize_worker ( void  )

Initialize BOINC. Sets up diagnostics, calls boinc_init(), etc. Should be used at the start of main in worker app.

◆ instance()

static Boinc& protocols::boinc::Boinc::instance ( void  )
static

Access to singleton Boinc class.

◆ is_worker_running()

static bool protocols::boinc::Boinc::is_worker_running ( void  )
static

◆ iterate_checkpoint_count()

static int protocols::boinc::Boinc::iterate_checkpoint_count ( void  )
static

Keeps track of number of checkpoints made. Necessary for determining whether application is making progress on the client.

◆ read_and_set_project_prefs()

static void protocols::boinc::Boinc::read_and_set_project_prefs ( void  )
static

Rereads project prefs and stores info.

◆ set_project_pref_max_cpu_run_time()

static void protocols::boinc::Boinc::set_project_pref_max_cpu_run_time ( int  project_pref_max_cpu_run_time)
static

Set maximum target cpu run time. Standalone mode only.

◆ set_project_pref_max_gfx_cpu()

static void protocols::boinc::Boinc::set_project_pref_max_gfx_cpu ( core::Real  project_pref_max_gfx_cpu)
static

Set maximum percent cpu for graphics. Standalone mode only.

◆ set_project_pref_max_gfx_fps()

static void protocols::boinc::Boinc::set_project_pref_max_gfx_fps ( core::Real  project_pref_max_gfx_fps)
static

Set maximum graphics frames per second. Standalone mode only.

◆ set_working_set_size()

static void protocols::boinc::Boinc::set_working_set_size ( core::Real  working_set_size)
static

Set working set size to keep track of memory usage.

◆ stop_running_worker()

static void protocols::boinc::Boinc::stop_running_worker ( void  )
static

◆ trywait_semaphore()

static int protocols::boinc::Boinc::trywait_semaphore ( void  )
static

◆ unlock_semaphore()

static int protocols::boinc::Boinc::unlock_semaphore ( void  )
static

◆ update_pct_complete()

static void protocols::boinc::Boinc::update_pct_complete ( void  )
static

Determines the fraction complete based on the max_cpu_run_time preference and the total wu_cpu_run_time. Calls BOINC API boinc_fraction_done().

Referenced by protocols::cyclic_peptide_predict::SimpleCycpepPredictApplication::checkpoint(), and protocols::checkpoint::Timer::reset().

◆ wait_semaphore()

static int protocols::boinc::Boinc::wait_semaphore ( void  )
static

◆ worker_finish_summary()

static void protocols::boinc::Boinc::worker_finish_summary ( const int &  num_decoys,
const int &  attempted_decoys,
const int &  starting_structs 
)
static

Brief summary. Formatted for the R@h validator so don't change.

Referenced by protocols::jd2::BOINCJobDistributor::go(), and protocols::jobdist::BaseJobDistributor::shutdown().

◆ worker_is_finished()

static bool protocols::boinc::Boinc::worker_is_finished ( const int &  total_nstruct)
static

◆ worker_shutdown()

static void protocols::boinc::Boinc::worker_shutdown ( void  )
static

Stop BOINC. Does not return. Uses BOINC API boinc_finish(0).

Referenced by protocols::jd2::BOINCJobDistributor::go(), and protocols::jobdist::BaseJobDistributor::shutdown().

◆ worker_startup()

static void protocols::boinc::Boinc::worker_startup ( void  )
static

Member Data Documentation

◆ checkpoint_count_

int protocols::boinc::Boinc::checkpoint_count_
staticprivate

◆ cpu_time_

core::Real protocols::boinc::Boinc::cpu_time_
staticprivate

◆ decoy_count_

int protocols::boinc::Boinc::decoy_count_
staticprivate

Referenced by decoy_count().

◆ fraction_done_

core::Real protocols::boinc::Boinc::fraction_done_
staticprivate

◆ no_progress_init_cnt_

int protocols::boinc::Boinc::no_progress_init_cnt_
staticprivate

◆ project_pref_bg_

background_type protocols::boinc::Boinc::project_pref_bg_
staticprivate

◆ project_pref_max_cpu_run_time_

int protocols::boinc::Boinc::project_pref_max_cpu_run_time_
staticprivate

◆ project_pref_max_gfx_cpu_

core::Real protocols::boinc::Boinc::project_pref_max_gfx_cpu_
staticprivate

◆ project_pref_max_gfx_fps_

core::Real protocols::boinc::Boinc::project_pref_max_gfx_fps_
staticprivate

◆ worker_initialized_

bool protocols::boinc::Boinc::worker_initialized_
staticprivate

◆ worker_running_

bool protocols::boinc::Boinc::worker_running_
staticprivate

◆ working_set_size_

core::Real protocols::boinc::Boinc::working_set_size_
staticprivate

◆ working_set_size_max_val_

core::Real protocols::boinc::Boinc::working_set_size_max_val_
staticprivate

The documentation for this class was generated from the following file: