.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MCE::Subs 3pm" .TH MCE::Subs 3pm "2014-10-24" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" MCE::Subs \- Exports functions mapped directly to MCE methods .SH "VERSION" .IX Header "VERSION" This document describes MCE::Subs version 1.517 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use MCE::Subs; ## Exports manager and worker functions only \& ## Getter functions are not exported by default \& \& use MCE::Subs qw( :getter ); ## All, including getter functions \& use MCE::Subs qw( :manager ); ## Exports manager functions only \& use MCE::Subs qw( :worker ); ## Exports worker functions only \& \& use MCE::Subs qw( :getter :worker ); ## Excludes manager functions .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module exports functions mapped to \s-1MCE\s0 methods. All exported functions are prototyped, therefore allowing one to call them without using parentheses. .PP .Vb 1 \& use MCE::Subs qw( :worker ); \& \& ## barrier synchronization among workers \& \& sub user_func { \& my $wid = MCE\->wid; \& \& mce_say "A: $wid"; \& mce_sync; \& \& mce_say "B: $wid"; \& mce_sync; \& \& mce_say "C: $wid"; \& mce_sync; \& \& return; \& } \& \& MCE\->new( \& max_workers => 24, user_func => \e&user_func \& ); \& \& mce_run 0 for (1..100); ## 0 means do not shutdown after running .Ve .PP For the next example, we only want the worker functions to be exported due to using MCE::Map, which takes care of creating a \s-1MCE\s0 instance and running. .PP .Vb 2 \& use MCE::Map; \& use MCE::Subs qw( :worker ); \& \& ## The following will serialize output to STDOUT as well as gather \& ## to @a. mce_say displays $_ when called without arguments. \& \& my @a = mce_map { mce_say; $_ } 1 .. 100; \& \& print scalar @a, "\en"; .Ve .PP Unlike the native Perl functions, print, printf, and say methods require the comma after the file handle. .PP .Vb 3 \& MCE\->print("STDERR", $error_msg, "\en"); ## Requires quotes around \& MCE\->say("STDERR", $error_msg); ## the bare\-word FH. \& MCE\->say($fh, $error_msg); \& \& mce_print STDERR, $error_msg, "\en"; ## Quotes are optional \& mce_say STDERR, $error_msg; ## around the bare\-word FH. \& mce_say $fh, $error_msg; .Ve .SH "FUNCTIONS for the MANAGER PROCESS via ( :manager )" .IX Header "FUNCTIONS for the MANAGER PROCESS via ( :manager )" \&\s-1MCE\s0 methods are described in MCE::Core. .IP "mce_abort" 3 .IX Item "mce_abort" .PD 0 .IP "mce_forchunk" 3 .IX Item "mce_forchunk" .IP "mce_foreach" 3 .IX Item "mce_foreach" .IP "mce_forseq" 3 .IX Item "mce_forseq" .IP "mce_freeze" 3 .IX Item "mce_freeze" .IP "mce_process" 3 .IX Item "mce_process" .IP "mce_restart_worker" 3 .IX Item "mce_restart_worker" .IP "mce_run" 3 .IX Item "mce_run" .IP "mce_print" 3 .IX Item "mce_print" .IP "mce_printf" 3 .IX Item "mce_printf" .IP "mce_say" 3 .IX Item "mce_say" .IP "mce_send" 3 .IX Item "mce_send" .IP "mce_shutdown" 3 .IX Item "mce_shutdown" .IP "mce_spawn" 3 .IX Item "mce_spawn" .IP "mce_status" 3 .IX Item "mce_status" .IP "mce_thaw" 3 .IX Item "mce_thaw" .PD .SH "FUNCTIONS for MCE WORKERS via ( :worker )" .IX Header "FUNCTIONS for MCE WORKERS via ( :worker )" \&\s-1MCE\s0 methods are described in MCE::Core. .IP "mce_abort" 3 .IX Item "mce_abort" .PD 0 .IP "mce_do" 3 .IX Item "mce_do" .IP "mce_exit" 3 .IX Item "mce_exit" .IP "mce_freeze" 3 .IX Item "mce_freeze" .IP "mce_gather" 3 .IX Item "mce_gather" .IP "mce_last" 3 .IX Item "mce_last" .IP "mce_next" 3 .IX Item "mce_next" .IP "mce_print" 3 .IX Item "mce_print" .IP "mce_printf" 3 .IX Item "mce_printf" .IP "mce_say" 3 .IX Item "mce_say" .IP "mce_sendto" 3 .IX Item "mce_sendto" .IP "mce_sync" 3 .IX Item "mce_sync" .IP "mce_thaw" 3 .IX Item "mce_thaw" .IP "mce_yield" 3 .IX Item "mce_yield" .PD .SH "GETTERS for MCE ATTRIBUTES via ( :getter )" .IX Header "GETTERS for MCE ATTRIBUTES via ( :getter )" \&\s-1MCE\s0 methods are described in MCE::Core. .IP "mce_chunk_id" 3 .IX Item "mce_chunk_id" .PD 0 .IP "mce_chunk_size" 3 .IX Item "mce_chunk_size" .IP "mce_max_workers" 3 .IX Item "mce_max_workers" .IP "mce_sess_dir" 3 .IX Item "mce_sess_dir" .IP "mce_task_id" 3 .IX Item "mce_task_id" .IP "mce_task_name" 3 .IX Item "mce_task_name" .IP "mce_task_wid" 3 .IX Item "mce_task_wid" .IP "mce_tmp_dir" 3 .IX Item "mce_tmp_dir" .IP "mce_user_args" 3 .IX Item "mce_user_args" .IP "mce_wid" 3 .IX Item "mce_wid" .PD .SH "INDEX" .IX Header "INDEX" \&\s-1MCE\s0 .SH "AUTHOR" .IX Header "AUTHOR" Mario E. Roy, .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See for more information.