Atom Editor + Monte Carlo Simulations

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 ?

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

You might be running into this bug.

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?

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

Are you on windows? How did you install Julia?

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

So run Julia in a terminal app.

1 Like

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

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.

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

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?