.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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 >0, 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 .\" ======================================================================== .\" .IX Title "MCE::Subs 3pm" .TH MCE::Subs 3pm "2019-01-30" "perl v5.28.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.838 .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 ); \& \& 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 serializes output to STDOUT and gathers $_ 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, printf, print, and say methods require the comma after the glob reference or file handle. .PP .Vb 4 \& MCE\->printf(\e*STDERR, "%s\en", $error_msg); \& MCE\->print(\e*STDERR, $error_msg, "\en"); \& MCE\->say(\e*STDERR, $error_msg); \& MCE\->say($fh, $error_msg); \& \& mce_printf \e*STDERR, "%s\en", $error_msg; \& mce_print \e*STDERR, $error_msg, "\en"; \& mce_say \e*STDERR, $error_msg; \& 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 "\(bu" 3 mce_abort .IP "\(bu" 3 mce_forchunk .IP "\(bu" 3 mce_foreach .IP "\(bu" 3 mce_forseq .IP "\(bu" 3 mce_freeze .IP "\(bu" 3 mce_process .IP "\(bu" 3 mce_relay_final .IP "\(bu" 3 mce_restart_worker .IP "\(bu" 3 mce_run .IP "\(bu" 3 mce_print .IP "\(bu" 3 mce_printf .IP "\(bu" 3 mce_say .IP "\(bu" 3 mce_send .IP "\(bu" 3 mce_shutdown .IP "\(bu" 3 mce_spawn .IP "\(bu" 3 mce_status .IP "\(bu" 3 mce_thaw .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 "\(bu" 3 mce_abort .IP "\(bu" 3 mce_do .IP "\(bu" 3 mce_exit .IP "\(bu" 3 mce_freeze .IP "\(bu" 3 mce_gather .IP "\(bu" 3 mce_last .IP "\(bu" 3 mce_next .IP "\(bu" 3 mce_print .IP "\(bu" 3 mce_printf .IP "\(bu" 3 mce_relay .IP "\(bu" 3 mce_relay_recv .IP "\(bu" 3 mce_say .IP "\(bu" 3 mce_sendto .IP "\(bu" 3 mce_sync .IP "\(bu" 3 mce_thaw .IP "\(bu" 3 mce_yield .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 "\(bu" 3 mce_chunk_id .IP "\(bu" 3 mce_chunk_size .IP "\(bu" 3 mce_max_retries .IP "\(bu" 3 mce_max_workers .IP "\(bu" 3 mce_pid .IP "\(bu" 3 mce_sess_dir .IP "\(bu" 3 mce_task_id .IP "\(bu" 3 mce_task_name .IP "\(bu" 3 mce_task_wid .IP "\(bu" 3 mce_tmp_dir .IP "\(bu" 3 mce_user_args .IP "\(bu" 3 mce_wid .SH "INDEX" .IX Header "INDEX" \&\s-1MCE\s0, MCE::Core .SH "AUTHOR" .IX Header "AUTHOR" Mario E. Roy,