-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob_temp.sh
More file actions
29 lines (22 loc) · 731 Bytes
/
job_temp.sh
File metadata and controls
29 lines (22 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#SBATCH --partition=edr1-al9_short # Specify the partition
#SBATCH --output=tmp/#job_name#.out # Standard output file
#SBATCH --job-name=#job_name# # Set job name
#SBATCH --cpus-per-task=2 # Number of CPU cores per task
# Set environment variables
export PATH="~/anaconda3/envs/cytnx_v1.0.1/bin:${PATH}"
mkdir -p tmp
# Log the start time
echo "Job started on $(date)"
# Run the Python script
python code_tmp_#job_name#.py
# Check if the script ran successfully
if [ $? -eq 0 ]; then
echo "Job completed successfully on $(date)"
rm code_tmp_#job_name#.py
rm tmp/job_tmp_#job_name#.sh
else
echo "Job failed on $(date)"
exit 1
fi
echo -e "\nJob done.\n"