Debian Codegraph @

bench/fem/speedup/cpp/submit-bench

raw
1 #!/usr/bin/env python
2 #
3 # This script submits jobs for measuring parallel speedup.
4 #
5 # Copyright (C) 2009 Johan Hake
6 #
7 # This file is part of DOLFIN.
8 #
9 # DOLFIN is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Lesser General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # DOLFIN is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Lesser General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public License
20 # along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
21 #
22 # Modified by Anders Logg, 2009.
23 #
24 # First added: 2009-09-15
25 # Last changed: 2011-01-04
26
27 from dolfin_utils.pjobs import submit
28 from numpy import arange
29 import sys
30
31 # Parameters for benchmark
32 SIZE = 128
33
34 # Number of processes to use
35 # NOTE: Largest number of processors to run is 2^EXP
36 EXP = 6
37 num_processes = list(2**arange(EXP+1))
38
39 # Check command-line arguments
40 dryrun = True if 'dryrun' in sys.argv else False
41
42 # Iterate over process range
43 for np in num_processes:
44
45 if np == 1:
46 run_cmd = ""
47 else:
48 run_cmd = "mpirun.openmpi -n %d " % np
49
50 # Submit assemble benchmark
51 submit("%s./assemble-poisson %d" % (run_cmd, SIZE),
52 nodes=max(1, np/8),
53 ppn=8, # Grab all cores on a node
54 name="assemble-poisson_np_%d_size_%d.log" % (np, SIZE),
55 dryrun=dryrun)
56
57 # Submit solve benchmark
58 submit("%s./solve-poisson %d" % (run_cmd, SIZE),
59 nodes=max(1, np/8),
60 ppn=8, # Grab all cores on a node
61 name="solve-poisson_np_%d_size_%d.log" % (np, SIZE),
62 dryrun=dryrun)