Subversion Repositories ALCASAR

Rev

Rev 2976 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2976 Rev 3037
Line 41... Line 41...
41
            }
41
            }
42
 
42
 
43
            $this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY);
43
            $this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY);
44
            break;
44
            break;
45
        case 'data':
45
        case 'data':
46
            if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/nvidiasmi.txt', $lines)) {
46
            if (CommonFunctions::rftsdata('nvidiasmi.tmp', $lines)) {
47
                $this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY);
47
                $this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY);
48
            }
48
            }
49
            break;
49
            break;
50
        default:
50
        default:
51
            $this->error->addConfigError('__construct()', '[sensor_nvidiasmi] ACCESS');
51
            $this->error->addConfigError('__construct()', '[sensor_nvidiasmi] ACCESS');
52
            break;
-
 
53
        }
52
        }
54
    }
53
    }
55
 
54
 
56
    /**
55
    /**
57
     * get the information
56
     * get the information
58
     *
57
     *
59
     * @see PSI_Interface_Sensor::build()
58
     * @see PSI_Interface_Sensor::build()
60
     *
59
     *
61
     * @return Void
60
     * @return void
62
     */
61
     */
63
    public function build()
62
    public function build()
64
    {
63
    {
65
        $gpuc=count($this->_gpus);
64
        $gpuc=count($this->_gpus);
66
        switch ($gpuc) {
65
        switch ($gpuc) {
Line 130... Line 129...
130
                        $dev->setValue($out[1]);
129
                    $dev->setValue($out[1]);
131
                        $dev->setUnit("%");
130
                    $dev->setUnit("%");
132
                        $this->mbinfo->setMbOther($dev);
131
                    $this->mbinfo->setMbOther($dev);
133
                    }
132
                }
134
                }
133
            }
135
                break;
-
 
136
        }
134
        }
137
    }
135
    }
138
}
136
}