mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=12273
This commit is contained in:
parent
8c0bdc5bda
commit
b5dbce7b3f
|
@ -2847,3 +2847,12 @@ Rom 27 Mar 2007
|
|||
boinc_dll_2003.vcproj
|
||||
boincmgr_curl.vcproj
|
||||
boincmgr_curl_2003.vcproj
|
||||
|
||||
David 27 Mar 2007
|
||||
- client: on startup, show how much RAM and disk are usable
|
||||
(taking prefs into account)
|
||||
|
||||
client/
|
||||
cs_prefs.C
|
||||
lib/
|
||||
str_util.h
|
||||
|
|
|
@ -356,7 +356,7 @@ public:
|
|||
int project_disk_usage(PROJECT*, double&);
|
||||
int total_disk_usage(double&);
|
||||
// returns the total disk usage of BOINC on this host
|
||||
int allowed_disk_usage(double&);
|
||||
double allowed_disk_usage();
|
||||
int allowed_project_disk_usage(double&);
|
||||
int suspend_tasks(int reason);
|
||||
int resume_tasks(int reason=0);
|
||||
|
|
|
@ -49,23 +49,21 @@ using std::string;
|
|||
#define MAX_PROJ_PREFS_LEN 65536
|
||||
// max length of project-specific prefs
|
||||
|
||||
#if 0
|
||||
// Return the maximum allowed disk usage as determined by user preferences.
|
||||
// There are three different settings in the prefs;
|
||||
// return the least of the three.
|
||||
//
|
||||
int CLIENT_STATE::allowed_disk_usage(double& size) {
|
||||
double CLIENT_STATE::allowed_disk_usage() {
|
||||
double percent_space, min_val;
|
||||
|
||||
percent_space = host_info.d_total*global_prefs.disk_max_used_pct/100.0;
|
||||
|
||||
min_val = host_info.d_free - global_prefs.disk_min_free_gb*1e9;
|
||||
|
||||
size = min(min(global_prefs.disk_max_used_gb*(1e9), percent_space), min_val);
|
||||
double size = min(min(global_prefs.disk_max_used_gb*(1e9), percent_space), min_val);
|
||||
if (size < 0) size = 0;
|
||||
return 0;
|
||||
return size;
|
||||
}
|
||||
#endif
|
||||
|
||||
int CLIENT_STATE::project_disk_usage(PROJECT* p, double& size) {
|
||||
char buf[256];
|
||||
|
@ -400,6 +398,10 @@ void CLIENT_STATE::read_global_prefs() {
|
|||
fclose(f);
|
||||
}
|
||||
|
||||
msg_printf(NULL, MSG_INFO,
|
||||
"Preferences limit memory usage to %.2fMB, disk usage to %.2fGB",
|
||||
max_available_ram()/MEGA, allowed_disk_usage()/GIGA
|
||||
);
|
||||
// max_cpus, bandwidth limits may have changed
|
||||
//
|
||||
set_ncpus();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <vector>
|
||||
|
||||
#define MEGA (1048576.0)
|
||||
#define GIGA (1024.*1048576.0)
|
||||
|
||||
#if !defined(HAVE_STRLCPY)
|
||||
extern size_t strlcpy(char*, const char*, size_t);
|
||||
|
|
Loading…
Reference in New Issue