Questions tagged [pmap]

161 questions
2
votes
1 answer

julia: pmap passing in vectors with indexes

I would like to use julia's pmap to do something like this: pmap( f, v, inits[i]) where f is the function I want to call in parallel on v which is some array. I also want to pass some parameters to f (inits), but inits itself is an array, and I…
bdeonovic
  • 4,130
  • 7
  • 40
  • 70
2
votes
3 answers

pmap and fork: where is my copy on write flag?

this, I hope, is a simple question. I am familiar with the idea that fork in unix/linux/etc does not actually copy an entire image, but maps shared memory as private with a copy-on-write flag. To illustrate this, I tried the following example below…
2
votes
1 answer

How to use rpc:pmap correctly?

I've found in module rpc function pmap. And I've stuck when tried to use it. The first question - does it requires connection with other nodes, or it would performs as lists:map if there is no connection to other nodes? I've tried to execute pmap…
stemm
  • 5,960
  • 2
  • 34
  • 64
1
vote
4 answers

When To Use reduce Or Instead Use pmap

Edit: The data really looks like this. 1,000-00-000,GRABBUS,OCTOPUS,,M,26-Nev-12,,05 FRENCH TOAST ROAD,,VACANT,ZA,1867,(001) 111-1011,(002) 111-1000,, I've got to make it look silly, because it contains proprietary information. This is what it…
octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131
1
vote
2 answers

Applying @everywhere to an already defined function in Julia

I would like to take an arbitrary function at runtime that may or may not be defined with the @everywhere macro, and run it in a distributed way. My first, naive attempt was to simply try and use the function inside of pmap @assert nprocs() >…
tillfalko
  • 13
  • 3
1
vote
1 answer

Using pmap to parallelize fitting linear mixed models in Julia

I am trying to use Julia to fit a set of different linear mixed models to the same dataset using pmap (Mac OSX 12.6.3, Julia 1.9). I can successfully fit a linear mixed model and run pmap using a native function, like pmap(sqrt, 1:100). I wrote a…
1
vote
0 answers

Train multiple NN in parallel with Jax

I would like to train the same neural network model in parallel instead of using a loop in Jax. We construct the model as: class Model(flax.linen.Module): ........ return out # create a list that contains n times the NN model models =…
relaxon
  • 141
  • 6
1
vote
0 answers

Using pmap at specific changing levels with map_depth

I'm wondering if it's possible to apply purrr::pmap (purrr::map2?) combined with purrr::map_depth. Let's say I have two lists with exact same structure with multiple nested lists, defined as: l1 <- list( list(0.0132), list( …
filemonPi
  • 65
  • 5
1
vote
2 answers

Identifying combinations of binary variables in tidyverse

I have a dataframe with several variables (23 in my example) with binary yes/no conditions, and I am trying to identify combinations of pairs of variables df <- tibble(V1 = sample(c(0,1), 25, replace=TRUE, prob=c(0.6, 0.4)), V2 =…
JFerret
  • 11
  • 1
1
vote
1 answer

Using SharedArray and pmap in Julia

I am thinking about using distributed computation in a problem I face. Suppose I have an index k which increases from 1 to 800 (for instance). And for each k, I have a pool p which has large size and many numbers stored in it. I want to get kth-pool…
1
vote
1 answer

how to filter on column==var when var has same name as column? (inside pmap)

I have a tibble that I want to filter by comparing its columns against some variables. However, it's convenient for that variable to have the same name as the column. How can I force dplyr to evaluate the variable so it doesn't confuse the variable…
flies
  • 2,017
  • 2
  • 24
  • 37
1
vote
1 answer

R: Setting purrr:pmap's .l attribute in advance using the $ operator

I am quite a newbie in R and therefore cannot explain the following behavior. So, let's assume I have the this data structure. > use_data ID value1 value2 value3 Time
mAI
  • 111
  • 1
  • 10
1
vote
1 answer

append a globally defined list from inside of a function in R

I am using the walk function to iterate over my list of lists and append a list element to every sub-list. .insideFunction <- function(sublistName, arg2){ newListElement <- "Hello" newListElement <- as.list(newListElement) names(newListElement) <-…
Nneka
  • 1,764
  • 2
  • 15
  • 39
1
vote
1 answer

Purrr::pmap using a named list of columns with '~' function doesn't respect names from .l?

This is my first time posting, so bear with me. I'm using purrr::pmap() to map a function over 3 columns of a tibble(), to create a 4th column library(tidyverse) set.seed(123) df <- tibble(a = as.character(1:3), b = sample(LETTERS, 3), c =…
JudgedGem
  • 121
  • 4
1
vote
1 answer

How can I pass multiple arguments from one dataframe to modify values in another dataframe in R?

I want to use manual inputs to a QAQC 'log file' to update an existing dataframe. The following log file would indicate date ranges (bounded by datetime_min and datetime_max) for particular variable (or 'all' of them) observations to be omitted from…