PYTHON ILE PARALEL PROGRAMLAMA ORUN ULUTA PYTHON Nedir
- Slides: 16
PYTHON ILE PARALEL PROGRAMLAMA ORÇUN ULUTAŞ
PYTHON Nedir ? • Python yorumlanabilir script tabanlı bir dilidir. • Çoklu platform desteği • Geniş kütüphane desteği • Web ve masaüstü uygulamalar geliştirilebilir
YER ALDIĞI PROJELER • Belender, GIMP, Inkscape • Linux dağıtımları • Django Framework • Apache • Bittorrnet • Google, Yahoo, Facebook • GERN, NASA
Python Syntax
Python Syntax
PRALLEL LIBRARIES • MPI 4 PY • py. MPI • Python PROCESS • MULTI PROCESSING • Python Parallel
MPI 4 PY from mpi 4 py import MPI comm = MPI. COMM_WORLD rank = comm. Get_rank() if rank == 0: data = {'a': 7, 'b': 3. 14} comm. send(data, dest=1, tag=11) elif rank == 1: data = comm. recv(source=0, tag=11)
Broadcast from mpi 4 py import MPI comm = MPI. COMM_WORLD rank = comm. Get_rank() if rank == 0: data = {'key 1' : [7, 2. 72, 2+3 j], 'key 2' : ( 'abc', 'xyz')} else: data = None data = comm. bcast(data, root=0)
MPI import mpi if mpi. rank == 0: print "size=", mpi. size print "rank=", mpi. rank, "/size=", mpi. size
root@linuxpc: /home/se 364/python# mpirun –np 2 python mpi. py mypi = 3. 1454 for rank 0 Computed value of pi on 2 processors is 3. 1417 Using 120000 samples.
PPROCESS root@linuxpc: /home/se 364/python# python process. py 1 3
root@linuxpc: /home/se 364/python# python pyocr. py 6. 716026 s for traditional, serial computation. 4. 041723 s for parallel computation.
MULTI PROCESSING p = multiprocessing. Pool() po = p. map_async(fn, args) result = po. get()
root@linuxpc: /home/se 364/python# python mp. py main line ('module name: ', '__main__') ('parent process: ', 4436) ('process id: ', 4815) function f ('module name: ', '__main__') ('parent process: ', 4815) ('process id: ', 4816) ('hello', 'bob')
root@linuxpc: /home/se 364/python# python mp 2. py 3. 1415927 [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
PP root@linuxpc: /home/se 364/python# python mp 2. py Start at: Mon Dec 16 23: 43: 35 2013 Start doing something Do something. . . do something else. . . 1 I'm done 2 I'm done End at: Mon Dec 16 23: 40 2013
- Orun nedir
- Python script nedir
- Programlamayla ilgili temel kavramlar
- Visual studio ile android programlama
- Metin tabanlı programlama nedir
- Programlama temelleri nedir
- Programlama dili nedir
- Matris çarpımı
- Yordamsal programlama nedir
- Script algoritma
- Insan olmak kuruş ile değil duruş ile ölçülür
- Belirtke tablosu örneği
- Fortran programlama dili
- Artan azalan fonksiyon grafikleri
- Arduino programlama dili
- Vardama nedir kpss
- Ntp 10.sınıf