-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathprime_fsu.sh
executable file
·58 lines (57 loc) · 1.09 KB
/
prime_fsu.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#
# Name this job.
#
#MOAB -N prime
#
# Run this job in the "backfill" queue.
#
#MOAB -q backfill
#
# Request 8 processors.
#
#MOAB -l nodes=1:ppn=8
#
# Maximum wallclock time :( Hours : Minutes : Seconds )
#
#MOAB -l walltime=00:02:00
#
# Join the two output files (standard output and standard error) into one.
# Based on the job name, this means the single output file will be called
# "prime.oJOBID" where JOBID is a job id number assigned when the job is
# submitted.
#
#MOAB -j oe
#
# This command is required to set up the Gnu version of OpenMPI.
#
module load gnu-openmpi
#
# This command moves from your home directory to the directory
# from which this script was submitted.
#
cd $PBS_O_WORKDIR
#
# Compile and load.
# Wise people do this BEFORE the run!
#
mpiCC prime_mpi.cpp
#
if [ $? -ne 0 ]; then
echo "Errors compiling prime_mpi.cpp"
exit
fi
#
# Rename the executable.
#
mv a.out prime
#
# Ask MPI to use 8 processes to run your program.
#
mpirun -np 8 ./prime > prime_fsu_output.txt
#
# Clean up.
#
rm prime
#
echo "Program output written to prime_fsu_output.txt"