...
Create an unique directory in your scratch space for this calculation (substitute your user name is the commands below):
Code Block language bash mkdir /scratch/user_name/may24_run2/
Report back to a file in your home directory as to which node the calculation is running on and the time it started. This will help you track down the results when it is finished.
Code Block language bash /usr/bin/hostname > /home/user_name/may24_run2.log /usr/bin/date >> /home/user_name/may24_run2.log
Now that we have created the directory, we need to move all the necessary input files over from the home directory.
Code Block language bash cp /home/user_name/input_store/input.dat /scratch/user_name/may24_run2/
Hop into the directory we created
Code Block language bash cd /scratch/user_name/may24_run2
Start the calculation
Code Block language bash /home/user_name/bin/cool_program.x < input.dat > may24.out.run
Report back when the calculation is finished. Leave some info in our home directory log file.
Code Block language bash echo "Job Done" >> /home/user_name/may24_run2.log /bin/date >> /home/user_name/may24_run2.log
Copy results back back to a directory in your home directory (make sure you have previously created the "output_store" folder in your home directory)
Code Block language bash cp /scratch/user_name/may24_run2/may24.out.run /home/user_name/output_store/
Clean up the scratch space on the node so as to not fill up the disk
Code Block language bash rm -rf /scratch/user_name/may24_run2
Ensure that your batch file containing the above commands is executable:
Code Block | ||
---|---|---|
| ||
$ chmod u+x batch_file.run |
And when you start the batch file with srun, use the -b option so srun know that the file contains a series of commands:
Code Block | ||
---|---|---|
| ||
$ srun -b batch_file.run |
You will see a new job listed when you type squeue .
Running Parallel Calculations
...