Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
config_procs.pl

Determine computer processor information.

#!/usr/local/bin/perl
##############################################################################
# file: config_procs.pl #
# 'msparser' toolkit example code #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998-2010 Matrix Science Limited All Rights Reserved. #
# #
##############################################################################
# $Source: parser/examples/test_perl/config_procs.pl $ #
# $Author: villek@matrixscience.com $ #
# $Date: 2018-07-30 16:23:53 +0100 $ #
# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
# $NoKeywords:: $ #
##############################################################################
use strict;
##############################################################################
use msparser;
# When running under Linux 2.4, don't set to 1 unless you are prepared to wait.
my $checkLinuxHT = 0;
my $numLicensed = 1;
my $cpus = new msparser::ms_processors($checkLinuxHT, $numLicensed);
if (!$cpus->isValid) {
print "There are errors. Cannot continue. The last error description:\n";
print $cpus->getLastErrorString(), "\n";
exit 1;
}
print "Number of CPUS available on the system: ", $cpus->getNumOnSystem(), "\n";
=pod
Running the program, for example with
perl -I../bin config_procs.pl
will give the following output (depending on the number of processors on your
system):
Number of CPUS available on the system: 4
=cut