Meta tags:
Headings (most frequently used words):
parallelize, vector, map, function, using, forking, unix, pvec, description, usage, arguments, details, value, note, author, see, also, examples, parallel, package, documentation, browse, packages, we, want, your, feedback,
Text of the page (most frequently used words):
the (44), vector (16), pvec (15), fun (14), and (13), for (11), function (10), unix (10), cores (10), mclapply (9), using (9), #parallel (9), that (8), not (8), this (7), map (7), #forking (7), dates (7), will (7), packages (6), set (6), posixct (6), package (5), run (5), parallelize (5), processes (5), all (5), time (5), system (5), each (5), your (4), can (4), documentation (4), process (4), format (4), see (4), from (4), length (4), code (3), mcparallel (3), current (3), stopifnot (3), one (3), use (3), integer (3), but (3), does (3), since (3), result (3), warning (3), case (3), same (3), are (3), must (3), true (3), more (2), embedding (2), copy (2), website (2), github (2), note (2), support (2), should (2), cran (2), language (2), rdrr (2), home (2), improve (2), page (2), find (2), what (2), versions (2), windows (2), separate (2), lapply (2), mcfork (2), get (2), cpu (2), functions (2), forked (2), cluster (2), computation (2), number (2), 1000 (2), sqrt (2), strings (2), operation (2), test (2), with (2), 02d (2), runif (2), faster (2), would (2), value (2), call (2), also (2), core (2), error (2), handling (2), child (2), such (2), given (2), split (2), into (2), many (2), elements (2), side (2), effects (2), which (2), splitting (2), description (2), cleanup (2), least (2), output (2), silent (2), seed (2), arguments (2), part (2), input (2), close, information, customizing, embed, read, snippets, clipboard, remove, add, following, snippet, personal, blog, ian, mutexlabs, com, issue, tracker, tweet, rdrrhq, provide, technical, individual, you, contact, authors, want, feedback, forge, bioconductor, browse, online, submit, extra, info, optional, other, have, suggestion, looking, its, content, looks, wrong, serial, mcmapply, mcdummies, evaluate, expression, asynchronously, mapply, fork, affinity, mask, mcaffinity, low, level, management, children, divide, tasks, distribution, splitindices, implementation, pierre, ecuyer, rngstreams, rngstream, create, socket, makecluster, detect, detectcores, apply, operations, clusters, clusterapply, convert, date, large, datasets, relatively, slow, let, some, random, first, small, only, options, increase, larger, scale, 1e5, sprintf, 04d, 2000, rnorm, specifying, ought, overhead, high, much, slower, because, require, unlist, examples, clustermap, parlapply, derived, formerly, multicore, simon, urbanek, author, inadvisability, gui, front, ends, multi, threaded, libraries, due, nature, parallelization, follow, usual, rules, errors, returned, results, killed, show, simply, non, existent, data, therefore, responsibility, user, check, make, sure, correct, size, raises, know, whether, outcome, intentional, successful, occurred, was, may, shorter, longer, evaluates, major, difference, between, element, separately, whereas, assumes, equivalent, thus, calls, there, fewer, subset, makes, efficient, than, requires, above, assumption, parallelizes, where, returns, pure, without, collected, nearly, identically, sized, subvectors, although, principle, possible, necessarily, maps, interpretation, specific, theory, arbitrary, cases, details, argument, most, how, simultaneously, two, option, initialized, environment, variable, mc_cores, then, suppressed, affected, stderr, stdout, any, further, passed, after, operate, false, getoption, usage, relies, hence, available, unless, parellelizes, execution, submitting, vectorized, takes, creates, exactly, doesn, depend, partition, browser, docs,
Text of the page (random words):
unix pvec parallelize a vector map function using forking rdrr io find an r package r language docs run r in your browser home r documentation parallel unix pvec parallelize a vector map function using forking unix pvec parallelize a vector map function using forking pvec r documentation parallelize a vector map function using forking description pvec parellelizes the execution of a function on vector elements by splitting the vector and submitting each part to one core the function must be a vectorized map i e it takes a vector input and creates a vector output of exactly the same length as the input which doesn t depend on the partition of the vector it relies on forking and hence is not available on windows unless mc cores 1 usage pvec v fun mc set seed true mc silent false mc cores getoption mc cores 2l mc cleanup true arguments v vector to operate on fun function to call on each part of the vector any further arguments passed to fun after the vector mc set seed see mcparallel mc silent if set to true then all output on stdout will be suppressed for all parallel processes forked stderr is not affected mc cores the number of cores to use i e at most how many child processes will be run simultaneously must be at least one and at least two for parallel operation the option is initialized from environment variable mc_cores if set mc cleanup see the description of this argument in mclapply details pvec parallelizes fun x where fun is a function that returns a vector of the same length as x fun must also be pure i e without side effects since side effects are not collected from the parallel processes the vector is split into nearly identically sized subvectors on which fun is run although it is in principle possible to use functions that are not necessarily maps the interpretation would be case specific as the splitting is in theory arbitrary a warning is given in such cases the major difference between pvec and mclapply is that mclapply will run fun on each element separately whereas pvec assumes that c fun x 1 fun x 2 is equivalent to fun x 1 2 and thus will split into as many calls to fun as there are cores or elements if fewer each handling a subset vector this makes it more efficient than mclapply but requires the above assumption on fun if mc cores 1 this evaluates fun v in the current process value the result of the computation in a successful case it should be of the same length as v if an error occurred or the function was not a map the result may be shorter or longer and a warning is given note due to the nature of the parallelization error handling does not follow the usual rules since errors will be returned as strings and results from killed child processes will show up simply as non existent data therefore it is the responsibility of the user to check the length of the result to make sure it is of the correct size pvec raises a warning if that is the case since it does not know whether such an outcome is intentional or not see mcfork for the inadvisability of using this with gui front ends and multi threaded libraries author s simon urbanek and r core derived from the multicore package formerly on cran see also mcparallel mclapply parlapply clustermap examples x pvec 1 1000 sqrt stopifnot all x sqrt 1 1000 one use is to convert date strings to unix time in large datasets as that is a relatively slow operation so let s get some random dates first a small test only with 2 cores set options mc cores and increase n for a larger scale test n 1e5 dates sprintf 04d 02d 02d as integer 2000 rnorm n as integer runif n 1 12 as integer runif n 1 28 system time a as posixct dates but specifying the format is faster system time a as posixct dates format y m d pvec ought to be faster but system overhead can be high system time b pvec dates as posixct format y m d stopifnot all a b using mclapply for this would much slower because each value will require a separate call to as posixct as lapply dates as posixct does system time c unlist mclapply dates as posixct format y m d stopifnot all a c parallel clusterapply apply operations using clusters detectcores detect the number of cpu cores makecluster create a parallel socket cluster parallel package support for parallel computation rngstream implementation of pierre l ecuyer s rngstreams splitindices divide tasks for distribution in a cluster unix children low level functions for management of forked processes unix mcaffinity get or set cpu affinity mask of the current process unix mcfork fork a copy of the current r process unix mclapply parallel versions of lapply and mapply using forking unix mcparallel evaluate an r expression asynchronously in a separate process unix pvec parallelize a vector map function using forking windows mcdummies serial versions of mclapply mcmapply and pvec what can we improve the page or its content looks wrong i can t find what i m looking for i have a suggestion other extra info optional submit improve this page r package documentation rdrr io home r language documentation run r code online browse r packages cran packages bioconductor packages r forge packages github packages we want your feedback note that we can t provide technical support on individual packages you should contact the package authors for that tweet to rdrrhq github issue tracker ian mutexlabs com personal blog embedding an r snippet on your website add the following code to your website remove this copy to clipboard for more information on customizing the embed code read embedding snippets close
|