2 I 2017.07.13 I 2 2017.07.13 1 / 61
I 2 2017.07.13 2 / 61
I 2 2017.07.13 3 / 61
7/13 2 7/20 I 7/27 II I 2 2017.07.13 4 / 61
π-computer gnuplot MobaXterm Wiki PC X11 DISPLAY I 2 2017.07.13 5 / 61
Mac 1. X11 XQuartz.app 2. ssh -Y my id@pi.ircpi.kobe-u.ac.jp 3. π-computer gnuplot I 2 2017.07.13 6 / 61
gnuplot> gnuplot> plot sin(x) I 2 2017.07.13 7 / 61
cp -r /tmp/170713/ your_directory ls -l 4 data, sierpinski, src01d, src02d cd your_directory/src01d I 2 2017.07.13 8 / 61
1D data1d generator.f95 module I 2 2017.07.13 9 / 61
const m module const m i m p l i c i t none! < f o r t r a n c o n s t a n t s > i n t e g e r, parameter : : SP = s e l e c t e d r e a l k i n d ( 6 ) i n t e g e r, parameter : : DP = s e l e c t e d r e a l k i n d ( 1 5 )! <s i m u l a t i o n c o n s t a n t s > i n t e g e r, parameter : : NN = 101 end module const m I 2 2017.07.13 10 / 61
f95 data1d_generator.f95 &&./a.out > data.1d make data.1d make I 2 2017.07.13 11 / 61
data.1d I 2 2017.07.13 12 / 61
gnuplot # 1 x, y 1 plot x 2 y I 2 2017.07.13 13 / 61
gnuplot gnuplot> plot data.1d w lp PDF w lp with linespoints linepoint w linespoints I 2 2017.07.13 14 / 61
I 2 2017.07.13 15 / 61
gnuplot gnuplot gnuplot script src01d graph1d.gp # # A simple sample gnuplot script: graph1d.gp # # # set size square # same side lengths for x and y # set size 0.65, 1 # other way to set regular rectan set xlabel x # x-axis set ylabel func # y-axis set xrange[-10:10] # x coords range set yrange[-1:1] # y coords range set title graph 1d plot data.1d w lp pause -1 I 2 2017.07.13 16 / 61
gnuplot quit shell gnuplot graph1d.gp make graph I 2 2017.07.13 17 / 61
Makefile make target source target: source [ ] command_to_make_target_from_source target source source target I 2 2017.07.13 18 / 61
Makefile make target: source01 [ ] command_to_make_target_from_source01 source01: source02 [ ] command_to_make_source01_from_source02 source02: source03 [ ]... I 2 2017.07.13 19 / 61
I 2 2017.07.13 20 / 61
recsin(x, n) = sin(sin(sin( (sin(x))) ) anim data generator.f95 I 2 2017.07.13 21 / 61
anim data generator.f95 make anim.data 50 I 2 2017.07.13 22 / 61
gnuplot gnuplot pause t t pause t t I 2 2017.07.13 23 / 61
set xlabel x set ylabel func set xrange[-10:10] set yrange[-1:1] set title anim 1d plot data.1d.000 w lp pause 5 plot data.1d.001 w lp pause 0.5 plot data.1d.002 w lp pause 0.5 plot data.1d.003 w lp.. pause -1 # x-axis # y-axis # x coords range # y coords range # Enter I 2 2017.07.13 24 / 61
100 plot 100 : anim plotscript generator.f95 make anim.gp anim.gp I 2 2017.07.13 25 / 61
make anim I 2 2017.07.13 26 / 61
I 2 2017.07.13 27 / 61
2 1 gnuplot 2 plot splot gnuplot > splot [ f(x,y)] gnuplot > splot x**2 + y**2 I 2 2017.07.13 28 / 61
splot f(x,y) I 2 2017.07.13 29 / 61
splot gnuplot splot exp(-x**2-y**2) set isosamples 50 # replot set xrange[-2:2] # x replot set yrange[-2:2] # y replot I 2 2017.07.13 30 / 61
show view # set view 60,0 # x 60 replot set view 60,30 # x 60 z 30 I 2 2017.07.13 31 / 61
I 2 2017.07.13 32 / 61
set hidden3d replot # I 2 2017.07.13 33 / 61
set contour base # replot set cntrparam levels 30 # replot I 2 2017.07.13 34 / 61
unset surface replot # I 2 2017.07.13 35 / 61
set pm3d at b replot # draw with colored contour I 2 2017.07.13 36 / 61
2D I 2 2017.07.13 37 / 61
2D x00 y00 x01 y00 x02 y00 x09 y00 x00 y01 x01 y01 x09 y01 x09 y09 I 2 2017.07.13 38 / 61
cd [your directory]/src02d I 2 2017.07.13 39 / 61
heat4.f95 I 2 2017.07.13 40 / 61
2D x,y s u b r o u t i n e p r i n t p r o f i l e 2 d ( p, j j, f ) t y p e ( r a n k s t ), i n t e n t ( i n ) : : p t y p e ( s p a n t ), i n t e n t ( i n ) : : j j r e a l (DP), d i m e n s i o n ( 0 : NGRID+1, & r e a l (DP), j j%s t t 1: j j%end+1), i n t e n t ( i n ) : : f d i m e n s i o n ( 0 : NGRID+1,0:NGRID+1) & : : f g l o b a l! 2d p r o f to be saved i n t e g e r : : c o u n t e r = 0! has s a v e a t t r i b. t y p e ( s p a n t ) : : j j 2! used f o r f g l o b a l c h a r a c t e r ( l e n =4) : : s e r i a l n u m! put on f i l e name c h a r a c t e r ( l e n = ), parameter : : base =.. / data /temp. 2 d. i n t e g e r : : i, j I 2 2017.07.13 41 / 61
2D j j 2 = a d j u s t j s t a r t a n d j e n d ( p, j j ) w r i t e ( s e r i a l n u m, ( i 4. 4 ) ) c o u n t e r f g l o b a l ( :, : ) = s e t p r o f 2 d ( j j, j j 2, f ) i f ( p%myrank==0 ) then open ( 1 0, f i l e =base // s e r i a l n u m ) do j = 0, NGRID+1 do i = 0, NGRID+1 w r i t e ( 1 0, ) i, j, f g l o b a l ( i, j ) end do w r i t e ( 1 0, )! g n u p l o t r e q u i r e s a b l a n k l i n e h e r e. end do c l o s e ( 1 0 ) end i f c o u n t e r = c o u n t e r + 1 end s u b r o u t i n e p r i n t p r o f i l e 2 d I 2 2017.07.13 42 / 61
1. mpifrtpx heat4.f95 2. pjsub heat4.sh../data temp.2d.0000 make data OK I 2 2017.07.13 43 / 61
0 36 0.000000000000000 1 36 2.1867122785152873E-002 2 36 4.2655284590767971E-002 3 36 6.2396502500601705E-002 4 36 8.1122529495226178E-002 I 2 2017.07.13 44 / 61../data temp.2d.0000 55 35 0.1165598588705999 56 35 9.9624877672293416E-002 57 35 8.1734108631726782E-002 58 35 6.2857224006520482E-002 59 35 4.2963409431420671E-002 60 35 2.2021479795155254E-002 61 35 0.000000000000000
heat4 lines.gp 2 gnuplot # # A sample gnuplot script: heat4_lines.gp # # [ line contours ] # # set size square # same side lengths for x and y set size 0.65, 1 # same side lengths for x and y set xlabel "i" # x-axis set ylabel "j" # y-axis set xrange[0:50] # i-grid min & max set yrange[0:50] # j-grid min & max set nosurface # do not show surface plot unset ztics # do not show z-tics set contour base # enables contour lines set cntrparam levels 10 # draw 10 contours set view 0,0 # view from the due north set title "Temperature" I 2 2017.07.13 45 / 61
gnuplot UNIX gnuplot heat4 lines.gp I 2 2017.07.13 46 / 61
I 2 2017.07.13 47 / 61
gnuplot heat4 colors.gp I 2 2017.07.13 48 / 61
heat4 colors.gp # # A sample gnuplot script: heat4_plot_contour_colors.gp # # [ color contours ] # # set size square # same side lengths for x and y set size 0.65, 1 # same side lengths for x and y set xlabel "i" # x-axis set ylabel "j" # y-axis set xrange[0:50] # i-grid min & max set yrange[0:50] # j-grid min & max set palette defined (0 "blue", 0.15 "red", 0.3 "yellow") set nosurface # do not show surface plot unset ztics # do not show z-tics set pm3d at b # draw with colored contour set view 0,0 # view from the due north set title "Temperature " splot "../data/temp.2d.0000" using 1:2:3 pause -1 I 2 2017.07.13 49 / 61
I 2 2017.07.13 50 / 61
bird s eye view I 2 2017.07.13 51 / 61
gnuplot plot4_plot_birdseyeview.gp # # a sample gnuplot script: plot4_plot_birdseyeview.gp # # [ Bird"s Eye View ] # # set size square # same side lengths for x and y set size 0.65, 1 set xlabel "i" # x-axis set ylabel "j" # y-axis set xrange[0:50] # i-grid min & max set yrange[0:50] # j-grid min & max set contour base # enables contour lines set cntrparam levels 10 # draw 10 contours # set palette defined (0 "blue", 0.15 "red", 0.3 "yellow") # set pm3d # draw with colored contour set title "Temperature " splot "../data/temp.2d.0000" using 1:2:3 w l pause -1 I 2 2017.07.13 52 / 61
I 2 2017.07.13 53 / 61
splot view heat4 plot rotating birdseyeview generator.f95 gfortran heat4 plot rotating birdseyeview generator.f95./a.out > anim.gp anim.gp gnuplot anim.gp 5 make anim OK make clean make data../data make anim I 2 2017.07.13 54 / 61
I 2 2017.07.13 55 / 61
cd [your directory]/sierpinski OpenMP 2 sierp.f95 I 2 2017.07.13 56 / 61
sierp.f95 sierp2.f95 omp section 3 module private public I 2 2017.07.13 57 / 61
sierp2.f95 enshu.sh frtpx -Kopenmp sierp2.f95 pjsub enshu.sh make data Makefile : data.000... data.099 data.??? make graph I 2 2017.07.13 58 / 61
I 2 2017.07.13 59 / 61
sierp2.f95 1/3 (x n+1, y n+1 ) = (x n /2 + 1, y n /2) 1/3 (x n+1, y n+1 ) = (x n /2 1, y n /2) 1/3 (x n+1, y n+1 ) = (x n /2, y n + 1) 1/10 (x n+1, y n+1 ) = (x n /2 + 1, y n /2) 1/10 (x n+1, y n+1 ) = (x n /2 1, y n /2) 8/10 (x n+1, y n+1 ) = (x n /2, y n + 1) sierp3.f95 gnuplot I 2 2017.07.13 60 / 61
π-computer diff sierp2.f95 sierp3.f95 mail kage 7/19 23:59 I 2 2017.07.13 61 / 61