Slides from FYS4411 Lectures
Morten Hjorth-Jensen & Gustav R. Jansen
1Department of Physics and Center of Mathematics for Applications
University of Oslo, N-0316 Oslo, Norway
Spring 2012
1 / 87
Slides from FYS4411 Lectures Morten Hjorth-Jensen & Gustav R. - - PowerPoint PPT Presentation
Slides from FYS4411 Lectures Morten Hjorth-Jensen & Gustav R. Jansen 1 Department of Physics and Center of Mathematics for Applications University of Oslo, N-0316 Oslo, Norway Spring 2012 1 / 87 Topics for Week 8, February 20. - 24.
1Department of Physics and Center of Mathematics for Applications
1 / 87
2 / 87
3 / 87
i
4 / 87
∂x . Then,
P , which yields
5 / 87
6 / 87
7 / 87
8 / 87
9 / 87
10/ 87
11/ 87
12/ 87
13/ 87
14/ 87
15/ 87
16/ 87
17/ 87
18/ 87
19/ 87
20/ 87
21/ 87
22/ 87
23/ 87
24/ 87
25/ 87
26/ 87
27/ 87
28/ 87
29/ 87
30/ 87
31/ 87
32/ 87
33/ 87
34/ 87
35/ 87
36/ 87
37/ 87
38/ 87
39/ 87
a
a
N
i=1
40/ 87
41/ 87
42/ 87
43/ 87
44/ 87
45/ 87
46/ 87
47/ 87
48/ 87
49/ 87
50/ 87
51/ 87
52/ 87
53/ 87
54/ 87
55/ 87
56/ 87
◮ List available modules: module avail ◮ Load module: module load <environment> ◮ Unload module: module unload <environment> ◮ Currently loaded: module list
57/ 87
# login to t i t a n $ ssh t i t a n . uio . no # ask for 4 cpus $ qlogin − −account=fys3150 − −ntasks=4 # s t a r t a job setup , note the punktum ! $ source / s i t e / bin / jobsetup # we want to use the i n t e l module $ module load i n t e l $ module load openmpi / 1 . 2 . 8 . i n t e l $ mkdir −p fys3150 / mpiexample / $ cd fys3150 / mpiexample / # Use program6 . cpp from the course pages , see chapter 4 # compile the program $ mpic++ − O3 −o program6 . x program6 . cpp # and execute i t $ mpirun . / program6 . x $ Trapezoidal rule = 3.14159 $ Time = 0.000378132 on number of processors : 4 58/ 87
# ! / bin / sh # Call this f i l e job . slurm # 4 cpus with mpi ( or
#SBATCH −ntasks=4 # 10 mins of walltime #SBATCH − −time =0:10:00 # project fys3150 #SBATCH − −account=fys3150 # we need 2000 MB of memory per process #SBATCH − − mem −per−cpu=2000M # name of job #SBATCH − −job− name=program5 source / s i t e / bin / jobsetup # load the module used when we compiled the program module load scampi # s t a r t program mpirun . / program5 . x #END OF SCRIPT 59/ 87
60/ 87
# check i f job i s running : $ showq −u mhjensen ACTIVE JOBS − − − − − − − − − − − − − − − − − − − − JOBNAME USERNAME STATE PROC REMAINING STARTTIME 883129 mhjensen Running 4 10:31:17 F r i Oct 2 13:59:25 1 Active Job 2692 of 4252 Processors Active (63.31%) 482 of 602 Nodes Active (80.07%) IDLE JOBS − − − − − − − − − − − − − − − − − − − − − − JOBNAME USERNAME STATE PROC WCLIMIT QUEUETIME 0 I d l e Jobs BLOCKED JOBS − − − − − − − − − − − − − − − − JOBNAME USERNAME STATE PROC WCLIMIT QUEUETIME Total Jobs : 1 Active Jobs : 1 I d l e Jobs : 0 Blocked Jobs : 0 61/ 87
62/ 87
1 + r 2 2 )/2
1 + r 2 2 )/2
2
63/ 87
1 + r 2 2 )/2
2
64/ 87
65/ 87
66/ 87
◮ Statistical errors ◮ Systematical errors
67/ 87
68/ 87
69/ 87
70/ 87
71/ 87
72/ 87
73/ 87
74/ 87
75/ 87
76/ 87
77/ 87
78/ 87
79/ 87
80/ 87
81/ 87
82/ 87
83/ 87
84/ 87
struct stat result ; i f ( stat ("blocks_rank0.dat" , &result ) == 0){ l o c a l n = result . s t s i z e / sizeof ( double ) ; n = l o c a l n∗n procs ; } double∗ mc results = new double [ n ] ; for ( int i =0; i<n procs ; i ++){
< "blocks_rank" < < i < < ".dat" ; ifstream i n f i l e ; i n f i l e . open ( ost . s t r ( ) . c s t r ( ) , ios : : in | ios : : binary ) ; i n f i l e . read ( ( char∗)&( mc results [ i ∗l o c a l n ] ) , result . s t s i z e ) ; i n f i l e . close ( ) ; } 85/ 87
86/ 87
87/ 87