This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time as t | |
import numpy as np | |
import matplotlib.pyplot as plt | |
N_POPULATION = 100 | |
N_INITIAL_BALANCE = 100 | |
MAX_TRADE = 10 | |
N_TICKS = 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subroutine smp_bcast() | |
double precision :: xx_bcast = 0d0 | |
integer :: data_num = 1 ! 送信するデータの個数 | |
integer :: origin_rank = 0 ! 送信元プロセスのランク | |
!ランク0のxx_bcastだけ1d0にする | |
if(me == 0) then | |
xx_bcast=1d0 | |
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpif90 -o smp01 smp01.f90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type,extends(parent_class) :: child_class | |
integer param1 | |
!... | |
contains | |
procedure :: method1 => child_method1 | |
!... | |
end type child_class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using std::cout; | |
using std::endl; | |
//抽象クラスvehicleの定義 | |
class vehicle{ | |
public: | |
virtual void start(void)=0; | |
virtual void stop(void)=0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
nx = 100 | |
ny = 200 | |
mydata = np.loadtxt('mydata.txt') | |
xx = np.linspace(0,nx,nx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do i=1,Nx | |
write(UNITNUM,*) i,a(i) | |
end do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time as t | |
import numpy as np | |
import sys | |
smp_num = 10000 | |
mydata = [float(i) for i in range(smp_num)] | |
res = [0.0 for i in range(smp_num)] | |
def integ_for(): |