SIGSEGV: Segmentation fault - invalid memory reference

I’m trying to run a MONC simulation in ARCHER2 that’s bigger than previous simulations. When I do I get the error in the title. I have this in my submission script:

#SBATCH --open-mode=append
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=128
#SBATCH --ntasks=128
#SBATCH --cpus-per-task=1

I’m assuming I need to increase some of these numbers but I’m not sure which or by how much. I tried nodes=8 but that still didn’t work. I’m sure what sort of number I should go up to or if there is a limit to how high I can go. Also, do I need to change ntasks if I change nodes? Should it be the product of nodes and ntasks-per-node?

If you are running out of memory then having more nodes may help, but if you are getting a segmentation fault, then you should look to debug the code.
The Archer documentation has information about allocating resources in slurm, and debugging (for e.g. look here: Debugging - ARCHER2 User Documentation )
If you can get a stacktrace you can see where the issue is.
Also you can turn debugging output on in most codes under logging options, and perhaps that will give you a clue if your input data isn’t correct?