MCE::Util - Public and private utility functions for Many-core Engine
This document describes MCE::Util version 1.505
use MCE::Util;
This is a utility module for MCE. Nothing is exported by default. Exportable is get_ncpu.
Returns the number of available (online/active/enabled) CPUs.
my $cpus = MCE::Util::get_ncpu();
Specifying 'auto' for max_workers calls MCE::Util::get_ncpu automatically.
use MCE; my $mce = MCE->new( max_workers => 'auto-1', ## MCE::Util::get_ncpu() - 1 max_workers => 'auto+3', ## MCE::Util::get_ncpu() + 3 max_workers => 'auto', ## MCE::Util::get_ncpu() );
The portable code for detecting the number of processors was adopted from Test::Smoke::SysInfo.
MCE
Mario E. Roy, <marioeroy AT gmail DOT com>
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MCE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MCE
CPAN shell
perl -MCPAN -e shell install MCE
For more information on module installation, please visit the detailed CPAN module installation guide.