-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit_lammps_parallel.pl
55 lines (41 loc) · 1.47 KB
/
submit_lammps_parallel.pl
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
#!/usr/bin/perl -w
#
# Script to generate submit script for running parallel LAMMPS simulations
# modified to include different random seeds in each simulation
#
# Usage: submit_lammps_parallel.pl in.file-name number-of-processors job-name | qsub
#
# Last modified: submit_lammps_parallel.pl
#
unless (@ARGV >= 3){die "Error: Need 3 arguments -- sugested usage\nsubmit_lammps_parallel.pl in.file-name number-of-processors job-name | qsub\n";}
$in = shift(@ARGV);
$nproc = shift(@ARGV);
$name = shift(@ARGV);
# Random seed
use Time::HiRes qw/ time sleep /;
my $datestring = int(time*1000000);
my $datestring2 = "$datestring";
@datestring3 = split(//, $datestring2);
my $tme = int(join("", @datestring3[-6..-1]));
print "\#!/bin/csh
\#\$ -N $name
\#\$ -cwd
\# send output to job.log (STDOUT + STDERR)
\#\$ -o $in\.out
\#\$ -j y
\# specify the mpich parallel environment and request 4
\# processors from the available hosts
\#\$ -pe mpich2 $nproc
\# specify the hardware platform to run the job on.
\#\$ -q mime
echo \"------------------------------------------------------------------------\"
date
echo \"Got \$NSLOTS slots.\"
\# command to run. ONLY CHANGE THE NAME OF YOUR MPI APPLICATION
date >! TIMING
/scratch/a1/sge/mpich2/bin/mpiexec -np \$NSLOTS -machinefile \$TMPDIR/machines /nfs/matsci-fserv/share/\$USER/bin/lmp_parallel -var seed $tme < $in
date >> TIMING
echo \" ALL DONE \"
date
echo \"------------------------------------------------------------------------\"
exit 0";