Questions tagged [pmap]

161 questions
3
votes
1 answer

Julia Distributed.jl questions

I would like to use pmap to parallelize a function over iterators running on multiple processors in the same machine with shared memory within a Julia cluster, and wanted to get a few details. Is it more efficient to use SharedArray or DArray for…
james
  • 31
  • 1
3
votes
1 answer

Passing NULL in purrr pmap

I have a function that sometimes returns NULL and I try to pass it later on using pmap. When I call the same function directly it works fine, but not with pmap. Is this expected, if so, why? Any workaround? library(tidyverse) plot_fun <-…
MLEN
  • 2,162
  • 2
  • 20
  • 36
3
votes
2 answers

pmap purrr error: Argument 1 must have names

I plan to sum a data.table row-wise and add a constant to it. What is wrong with this code. I am specifically looking for pmap_dfr solution: library(data.table) library(tidyverse) temp.dt <- data.table(a = 1:3, b = 1:3, c = 1:3) d <- 10 temp.dt %>%…
aajkaltak
  • 1,437
  • 4
  • 20
  • 28
3
votes
1 answer

Applying pmap list arguments to a function nested within another function

I need to perform some rowwise operations with the help of pmap variants but I can't do so when it comes to passing the list of arguments (that is the ".l" argument) to a function that's nested within another function. I've tried various things…
Diego
  • 392
  • 3
  • 16
3
votes
2 answers

purrr to find smallest value and then label with case_when

I have two datasets. The first one contains a list of cities and their distance in miles from destinations. The second list contains the destinations. I want to use purrr to put the name of the closest destination into a new column in the first…
J.Sabree
  • 2,280
  • 19
  • 48
3
votes
1 answer

Calling var() from purrr's pmap() returns NA

I am trying to use pmap() from the purrr package to simplify my code. I have a list of vectors x; all the vectors are the same length. I want to find the mean and variance of all nth elements across all vectors in the list. That is, I want the mean…
Richard Herron
  • 9,760
  • 12
  • 69
  • 116
3
votes
1 answer

use pmap() to calculate row means of several columns

I'm trying to better understand how pmap() works within dataframes, and I get a surprising result when applying pmap() to compute means from several columns. mtcars %>% mutate(comp_var = pmap_dbl(list(vs, am, cyl), mean)) %>% select(comp_var,…
Joe
  • 3,217
  • 3
  • 21
  • 37
3
votes
1 answer

What is a deleted segment in linux pmap output?

Here are the first few lines of output from pmap on a process, running on CentOS 5.2: Address Kbytes RSS Anon Locked Mode Mapping 00101000 1268 - - - r-x-- libc-2.5.so 0023e000 8 - - - r---- …
Jay V
  • 33
  • 3
3
votes
1 answer

linux process memory growth when creating a thread

when creating a thread, using pthread_create, the memory address space reported (via top and ps) grows significantly per the info below: The stack size for the thread is explicity set, so that is fine and I can see it pop up in pmap. But what I…
moore
  • 33
  • 4
3
votes
2 answers

Pmap inside a transducer in Clojure

I would like to use pmap within a transducer, if I write my code using regular map, it works fine. However if I use pmap I get an arity exception. Is it possible to achieve this in clojure or am I doing something wrong? If it were to be impossible,…
Joaquin
  • 121
  • 9
3
votes
1 answer

split apply combine w/ function or purrr package pmap?

This is a big problem for me to solve. If I had enough reputation to award a bounty I would! Looking to balance territories of accounts of sales reps. I have the process broken up, and I don't really know how to do it across each region. In this…
Matt W.
  • 3,692
  • 2
  • 23
  • 46
3
votes
1 answer

Fixing arguments when using pmap in Julia

I have defined a function f(x, y, z) in Julia and I want to parallely compute f for many values of x, holding y and z fixed. What is the "best practices" way to do this using pmap? It would be nice if it was something like pmap(f, x, y = 5, z = 8),…
jcz
  • 267
  • 1
  • 9
3
votes
2 answers

How to get concurrent function (pmap) to use all cores in Elixir?

I'm new to Elixir, and I'm starting to read through Dave Thomas's excellent Programming Elixir. I was curious how far I could take the concurrency of the "pmap" function, so I iteratively boosted the number of items to square from 1,000 to…
user456584
  • 86,427
  • 15
  • 75
  • 107
3
votes
3 answers

Why the memory not freed in top and pmap?

I have check the code with valgrind, no memory leak. but I use 'top' to see the memory, it cost 295MB memory after the 'delete' called. I use 'pmap -x' to see the memory, most memory cost by a [anon]: Address Kbytes RSS Dirty Mode …
Joey
  • 175
  • 7
3
votes
0 answers

pmap bounds error: parallel julia

I get a bounds error when running a function in parallel that runs fine normally (sequentially) e.g. when I run: parallelsol = @time pmap(i -> findividual(x,y,z), 1:50) It gives me an error: exception on 2: exception on exception on 16:…
1 2
3
10 11