Atom Editor + Monte Carlo Simulations

#1

I am using the Atom editor to run MC simulations using Julia. I have implemented a parallel program for the same and am currently using addprocs(5). But, at the end or in the course of the simulations, the editor either hangs or crashes. Is there a way out of this ?

#2

Run the REPL in a shell. In particular for long running calcs that is better anyway as otherwise your IDE-repl is blocked.

1 Like
#3

You might be running into this bug.

#4

I am a relatively new user of Julia. If it is not too naive to ask, may I know what it means to run the REPL in a shell? I understand that the shell is for running system commands?

#5

It means running julia outside from Atom in a shell. This may vary slightly depending on your operating system, but the basic idea is to start the julia binary. See, for instance, here.

1 Like
#6

Are you on windows? How did you install Julia?

#7

I am using a Mac. I installed Julia from the downloaded installation file on their webpage.

#8

So run Julia in a terminal app.

1 Like
#9

Oh, that was the shell reference in the earlier reply. Thank you !

#10

I tried to run them in shell. However, the result is not any different. It hangs and takes unusually long to complete the simulation. If it is of any help, I run the following:

const mc = 1 ;
const mcd = 500 ; # Number of Monte Carlo iterations
theta = pmap(mc -> MonteCarlo(mc,mcf),1:1:mcf) ;

MonteCarlo is a function which on every run returns a tuple - 2 1500-by-100 arrays, 2 1500-by-100-by-100 matrices, 3 1-by-100 arrays. Currently I am trying with two workers,

addprocs(2)

Am I doing it right or is there a better way to implement it ? Thank you.

#11

I’m sorry but I can’t make sense of the numbers you gave. These are huge, if true!

#12

If you’re using Float64 arrays, each iteration’s matrices will consume 2*1500*100*100*8=240 MB. With 500 runs, that comes out to 120 GB, so you may be exhausting your system’s memory. Is there any sparsity or simplification you could exploit?