Thank your for the suggestions as they enabled me to solve the issue - though for a different reason than I thought.
I had seen indeed seen the StackArray post you mentioned, but my initial attempt based on that post did not work. Specifically, following that post, I had tried: output = pmap((x,y) -> f(x, y), ["strg1", "strg2", "strg_3"] , [S,S,S]) and received an error message for each of the three components of the output starting with: RemoteException(pid#,CapituredException(MethodError(getindex,(0.000115947... However, modifying it per your suggestion by defining SVector= fill(S, 3) and then running output = pmap((x,y)->f(x,y), ["strg1", "strg2", "strg3"] , SVector) worked. The fact that meaning of "," changes depending on what is in placed in [a,b,c] seems have been the source of the issue. (As an aside, this inconsistency seems to me to be somewhat of a less-than-desireable feature in Julia.) On Wednesday, August 10, 2016 at 9:03:03 PM UTC-4, Greg Plowman wrote: > > I have also found the combination of shared arrays, anonymous functions > and parallel constructs confusing. > > StackOverflow question helped me Shared array usage in Julia > <http://stackoverflow.com/questions/35751420/shared-array-usage-in-julia> > > In essence, "although the underlying data is shared to all workers, the > declaration is not. You will still need to pass in the reference to [the > shared array]" > > S = SharedArray(Int,3,4) > S[:] = 1:length(S) > @everywhere f(S,i) = (println("S[$i] = $(S[i])"); S[i]) > > output1 = pmap(i -> f(S,i), 1:length(S)) # error > output2 = pmap((S,i) -> f(S,i), fill(S,length(S)), 1:length(S)) > output3 = pmap(f, fill(S,length(S)), 1:length(S)) > > > In seems then, in version1, the reference S is local to the worker, but S > is not defined on the worker -> error. > In versions 2&3 the local S is passed as argument to worker and all works > as expected. > >
