Dear Rafael,
I think from SLURM’s perspective both commands will give your job num_cpu cores. The -n {{ num_cpu }} is a bit risky since tasks can run on multiple nodes and your solution limit them to one node.
I am glad you are able to run a SLURM job. Could you please let me know how you were able to make SLURM work (I asked for help here but no reply yet)? I installed cryoSPARC 4 or 5 times and I followed the instructions word-by-word but when I queue a job, it runs on the master node only.