> Is there an easy or automated way perhaps a tool or a package to write
> Slurm sbatch scripts to schedule and run Erlang module file or application
> on a server?
> https://slurm.schedmd.com/sbatch.html >
> Can somebody please help me and provide an sbatch script (.sh) shows a way
> to schedule and run an Erlang module (.erl file) espically a way to
> execute the file ?
Are you trying to execute a single file or a project residing in a directory
laid out the traditional way?
The simplest way of all would be to use an escript instead of an .erl file.
Escripts can start with a shebang (just like a shell script), have a main/1
function, and just execute right there.
io:format("I am module ~tp~n", [?MODULE]),
ceverett@changa:~$ erlc foo.erl
ceverett@changa:~$ erl -pa ./ -noshell -s foo bar
I am module foo
Note the explicit system halt called at the end of bar/0.
The invocation of the specific module and function name
are the arguments following `-s`.
Escripts are really the way to go for this, though.
If you DO have an .erl file that can't have a shebang at the
top, but you CAN force that it has a function called main/1,
then you can still run it as an escript: