Hacker News new | ask | show | jobs
by kmaitreys 33 days ago
How do you develop a program which will run for longer duration on HPCs. How do you quickly modify struct definitations, how do you define imports (using vs include syntax is so confusing!)

REPL-based workflow doesn't make sense to me other than scripting work.

2 comments

Re: REPL use, you just use it to run code and look at results. e.g. for TDD – you can modify your code files normally in the IDE, changes get picked up by revise, and then you re-run the tests in the REPL.

For long-running jobs, I basically follow the same process as in any other language: make the functions I want to run, test them locally on a small dataset that runs relatively quickly, then launch them on the remote machines with the full data.

Revise.jl has struct redefinition now, but before that I would just use NamedTuples while iterating, then make a struct when I was ready to move something to production.

`using` is for importing modules, `include` is for specific files. At work, we currently have a monorepo, with one top-level OurProject.jl file that uses `using` to import external packages, and `include` for all the internal files.

> How do you develop a program which will run for longer duration on HPCs.

The main strategy is to have a way of parameterize the program to bring the runtime down to seconds-minutes on a laptop. E.G. for PDEs, you may be running the HPC version on a giant mesh, but you can run the same algorithm on your local computer on a much coarser mesh.

> How do you quickly modify struct definitations

Thankfully on 1.12 this has been solved. You can redefine structs while keeping the REPL up.

> how do you define imports (using vs include syntax is so confusing!)

Yeah julia messed this up. The basic rule is that include and using are basically the same.