Matrix Science header

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: /vol/cvsroot/parser/examples/test_perl/config_procs.pl,v $ #
#     $Author: villek $                                                      #
#       $Date: 2010/08/31 08:48:07 $                                         #
#   $Revision: 1.3 $                                                         #
# $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


Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:50