Leveraging multiple cores - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

What do you all use to utilize more than 1 cpu core in your Haskell program?

(Asking in the context of making neuron do so ...)

Neuron is a future-proof open-source app for managing your plain-text notes in Zettelkasten style, as well as for publishing them on the web. Read its Philosophy.For a web interface to your neuron notes, see Cerveau
Georgi Lyubenov // googleson78

have you taken a look at parallel and concurrent programming by Marlow? or are you looking for something more high-level/a "production" example?

Georgi Lyubenov // googleson78

the goto is the async library for concurrency and the parallel strategies sparks stuff for parallelism, I'd wager

Georgi Lyubenov // googleson78

not sure what the nomenclature is elsewhere

Georgi Lyubenov // googleson78

basically a "task" for the rts to schedule on some thread eventually

Georgi Lyubenov // googleson78

of the form "evaluate this expression"

bradrn

A related question: once you’ve parallelised your program, is it possible to get the executable to automatically use all available cores? It seems that you have to pass +RTS -N<cores> to use more than one core, but this is rather inconvenient if you’re making a program for end users who may not even know what a command line is…

Georgi Lyubenov // googleson78

I think you can set these to be the "default" rts options

Georgi Lyubenov // googleson78

and I think the default stack new template does this already

IC Rainbow

Fighting multicore GC with -qn1 mostly.

bradrn

Thanks @Georgi Lyubenov // googleson78 , I didn’t know about either of those! So I can just do -with-rtsopts -N then.