-
Notifications
You must be signed in to change notification settings - Fork 41
/
runDisplacementCalculation.pl
executable file
·49 lines (40 loc) · 1.41 KB
/
runDisplacementCalculation.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
#!/usr/bin/perl
use HTML::Template;
use strict;
require 'library.pl';
#options
my %config = getConfiguration();
my $linuxUser = $config{'fileUserName'};
my $pathToRunTime = $config{'mcrPath'};
my $emailAddress = $config{'email'};
my $baseDir = $config{'simulationPath'};
my $outDir = "$baseDir/documentation/paper/figures/figure5";
my $conditionSetTimeStamp = '2011_10_25_01_45_44';
my $nJobs = 128;
#output directory
`mkdir -p "$outDir"`;
`sudo chmod -R 775 "$outDir"`;
`sudo chown -R $linuxUser:$linuxUser "$outDir"`;
#compile project
#`./build.sh runDisplacementCalculation`;
#analysis job
my $template = HTML::Template->new(filename => 'job.displacementCalculation.sh.tmpl');
$template->param(baseDir => $baseDir);
$template->param(conditionSetTimeStamp => $conditionSetTimeStamp);
$template->param(outDir => $outDir);
$template->param(linuxUser => $linuxUser);
$template->param(emailAddress => $emailAddress);
$template->param(pathToRunTime => $pathToRunTime);
#frame rendering
for (my $i = 1; $i <= $nJobs; $i++) {
my $jobFileName = sprintf("%s/job.displacementCalculation_%s_%d.sh", $outDir, $conditionSetTimeStamp, $i);
$template->param(iJob => $i);
open(FH, '>', $jobFileName) or die $!;
print FH $template->output;
close (FH);
`sudo chmod 775 $jobFileName`;
`sudo chown -R $linuxUser:$linuxUser $jobFileName`;
`sudo qsub $jobFileName`;
}
#print status message with total number of jobs submitted
print "Jobs queued.\n";