15 #ifndef INCLUDED_protocols_boinc_boinc_hh
16 #define INCLUDED_protocols_boinc_boinc_hh
21 #include <boinc_win.h>
24 #include <boinc_api.h>
25 #include <diagnostics.h>
26 #include <error_numbers.h>
28 #include <graphics2.h>
33 #define SKIP_FOR_EFFICIENCY 50 //100
37 #include <semaphore.h>
39 #define USE_SYSV_SEMAPHORE
40 #define SEMA_KEY_PREFIX 54321
41 #include <sys/types.h>
51 #endif // BOINC_GRAPHICS
60 #define BOINC_MAX_NO_PROGRESS_INIT_CNT 25 // maximum allowed restarts w/ no progress
61 #define BOINC_MAX_NSTRUCT 99 // maximum nstruct that the assimilator should have to handle. More than that is likely too much to sensibly upload anyway!
62 #define BOINC_DEFAULT_MAX_CPU_RUN_TIME 10800
63 #define BOINC_MAX_GFX_FPS 10.0
64 #define BOINC_MAX_GFX_CPU 10.0
65 #define BOINC_CHECKPOINT_COUNT_FILE "boinc_checkpoint_count.txt"
66 #define BOINC_INIT_COUNT_FILE "boinc_init_count.txt"
69 #define BOINC_SHMEM_NAME "minirosetta"
130 static void worker_finish_summary(
const int & num_decoys,
const int & attempted_decoys,
const int & starting_structs );
148 #ifdef BOINC_GRAPHICS
153 static void set_wu_desc(
void );
156 static const int attach_graphics_current_pose_observer(
core::pose::Pose & pose );
162 static void update_mc_trial_info(
const int & trial_cnt,
const std::string & mover_type );
170 enum update_mode_enum { DEFAULT, PERSIST, RESET };
171 static void update_graphics_low_energy(
core::pose::Pose & pose,
core::Real low_energy, update_mode_enum update_mode = DEFAULT );
180 static void create_shared_memory(
void );
181 static void attach_shared_memory(
void );
182 static void update_status_shmem(
void );
184 #endif // BOINC_GRAPHICS
187 #ifdef USE_SYSV_SEMAPHORE
189 static const key_t get_sema_key(
void );
191 static const int destroy_semaphore(
void );
222 #ifdef BOINC_GRAPHICS
225 static HANDLE sem_des_;
227 #ifndef USE_SYSV_SEMAPHORE
228 static sem_t* sem_des_;
236 #endif // BOINC_GRAPHICS
245 #endif // INCLUDED_protocols_boinc_boinc_HH