How to avoid running code on head node of the cluster

1.1k views Asked by At

I am using a cluster to run my code. I use a runm file to run my code on the cluster. runm script is as below:

#!/bin/sh 
#SBATCH --job-name="....."
#SBATCH -n 4
#SBATCH --output=bachoutput
#SBATCH --nodes=1-1
#SBATCH -p all
#SBATCH --time=1-01:00:00
matlab <znoDisplay.m>o1

today, when my code was running I received an email from cluster boss which says please don't run your code on the head node and use other nodes. I did a lot of searches but I couldn't find that how can I have changed the node from the main node to other nodes. Could anyone help me? Is there any script which could be used in runm to change it?

Could anyone help me to avoid running my code on head node?

1

There are 1 answers

1
damienfrancois On

If the Matlab process was running on the head node, it means you did not submit your script but you most probably simply ran it.

Make sure to submit it with

sbatch runm

Then you can see it waiting in the queue (or running) with

squeue -u $USER

and check that it is not running on the frontend with

top

Also note @atru's comment about the Matlab options -nodisplay and -nosplash for Matlab to work properly in batch mode.