Skip to content

Commit

Permalink
Merge pull request #5123 from BOINC/dpa_p_features2
Browse files Browse the repository at this point in the history
  • Loading branch information
AenBleidd authored Mar 4, 2023
2 parents c6c73a2 + 826f641 commit 8494e83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions client/hostinfo_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static void parse_meminfo_linux(HOST_INFO& host) {
// See http://people.nl.linux.org/~hch/cpuinfo/ for some examples.
//
static void parse_cpuinfo_linux(HOST_INFO& host) {
char buf[1024], features[P_FEATURES_SIZE], model_buf[1024];
char buf[P_FEATURES_SIZE], features[P_FEATURES_SIZE], model_buf[1024];
bool vendor_found=false, model_found=false;
bool cache_found=false, features_found=false;
bool model_hack=false, vendor_hack=false;
Expand Down Expand Up @@ -527,7 +527,7 @@ static void parse_cpuinfo_linux(HOST_INFO& host) {

host.m_cache=-1;
safe_strcpy(features, "");
while (fgets(buf, 1024, f)) {
while (fgets(buf, sizeof(buf), f)) {
strip_whitespace(buf);
if (
/* there might be conflicts if we dont #ifdef */
Expand Down Expand Up @@ -762,7 +762,7 @@ void use_cpuid(HOST_INFO& host) {
u_int cpu_id;
char vendor[13];
int hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow, has3DNowExt, hasAVX;
char capabilities[256];
char capabilities[P_FEATURES_SIZE];

hasMMX = hasSSE = hasSSE2 = hasSSE3 = has3DNow = has3DNowExt = hasAVX = 0;
do_cpuid(0x0, p);
Expand Down Expand Up @@ -1075,7 +1075,7 @@ static void get_cpu_info_haiku(HOST_INFO& host) {

int32 found = 0;
int32 i;
char buf[12];
char buf[256];

for (i = 0; i < 32; i++) {
if ((cpuInfo.eax_1.features & (1UL << i)) && kFeatures[i] != NULL) {
Expand Down
1 change: 1 addition & 0 deletions db/boinc_db_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "opencl_boinc.h"
#include "parse.h"
#include "wslinfo.h"
#include "hostinfo.h"

// Sizes of text buffers in memory, corresponding to database BLOBs.
// The following is for regular blobs, 64KB
Expand Down
2 changes: 1 addition & 1 deletion lib/hostinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const char file_redhatrelease[] = "/etc/redhat-release";

// if you add fields, update clear_host_info()

#define P_FEATURES_SIZE 1024
#define P_FEATURES_SIZE 8192

class HOST_INFO {
public:
Expand Down
10 changes: 6 additions & 4 deletions sched/plan_class_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,12 +1286,14 @@ int main() {
}

for (unsigned int i=0; i<pcs.classes.size(); i++) {
bool b = pcs.check(sreq, pcs.classes[i].name, hu);
WORKUNIT wu;
wu.id = 100;
wu.batch = 100;
bool b = pcs.check(sreq, pcs.classes[i].name, hu, &wu);
if (b) {
printf("%s: check succeeded\n", pcs.classes[i].name);
printf("\tncudas: %f\n\tnatis: %f\n\tgpu_ram: %fMB\n\tavg_ncpus: %f\n\tprojected_flops: %fG\n\tpeak_flops: %fG\n",
hu.ncudas,
hu.natis,
printf("\tgpu_usage: %f\n\tgpu_ram: %fMB\n\tavg_ncpus: %f\n\tprojected_flops: %fG\n\tpeak_flops: %fG\n",
hu.gpu_usage,
hu.gpu_ram/1e6,
hu.avg_ncpus,
hu.projected_flops/1e9,
Expand Down

0 comments on commit 8494e83

Please sign in to comment.