Mario Roy > MCE-1.415 > MCE::Util

Download:
MCE-1.415.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  1
View/Report Bugs
Module Version: 1.000   Source   Latest Release: MCE-1.513

NAME ^

MCE::Util - Provides utility functions for Many-Core Engine.

VERSION ^

This document describes MCE::Util version 1.000

SYNOPSIS ^

 use MCE::Util;

DESCRIPTION ^

Utility module for MCE. Nothing is exported by default. Exportable is get_ncpu.

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()
 );

ACKNOWLEDGEMENTS ^

The portable code for detecting the number of processors was borrowed from Test::Smoke::SysInfo.

AUTHOR ^

Mario E. Roy, <marioeroy AT gmail DOT com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2013 by Mario E. Roy

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.

syntax highlighting: