I want to be able to run a command inside the bash file and save it in somefile.txt
I am running my script the following way:
- sbatch file.sh and inside this file I have a terminal command
目标:在使用 sbatch 启动作业时捕获特定终端命令的输出
当前工作解决方案:
例子:
#!/bin/bash
#SBATCH --job-name application1
#SBATCH --partition=TSA
#SBATCH --nodelist=node52
module load openmpi/1.10.2/gcc/4.9.3
mpirun -np 1 NASA.IS
# I have placed the python call at the end because I want to capture
# the time it took for the application to run and save it to a file
# I was able to code everything inside the python file and generate the
# corresponding data
python outputCollector.py