COSC 6374 Parallel Computation. Dense Matrix Operations
|
|
- Janice McGee
- 5 years ago
- Views:
Transcription
1 COSC 6374 Prllel Computtion Dense Mtrix Opertions Edgr Griel Fll Edgr Griel Prllel Computtion Edgr Griel erminology Dense Mtrix: ll elements of the mtrix ontin relevnt vlues ypilly stored s 2-D rry, (e.g. doule [16][]); Sprse mtrix: most elements of the mtrix re zero Optimized storge tehniques nd mtries: store only the relevnt digonls of the mtrix Highly irregulr sprse mtries: store the oordintes of every non-zero element together with the ontent oeing-hrwell formt: exploit ertin regulrities (e.g. nerly onstnt numer of entries per row or olumn) Jgged Digonl storge formt: see oeing-hrwell formt 1
2 Replition vs. Communition Lrge dt items typilly distriuted ross multiple proesses Wht is lrge? Smll dt items n replited on ll proesses or ommunited whenever required Costs for ommunition: ~ network lteny Costs for replition: ~ memory onsumption + ~ repeted omputtion opertions Prllel Computtion Edgr Griel Mtrix opertions: =. Multiplying Mtrix with onstnt Constnt is definitely smll nd is thus replited on ll proesses E.g. ompiled in the ode Red from onfigurtion file Opertion does not require ny ommunition to e performed rivilly prllel Opertion n e performed independent of the wy the mtrix hs een distriuted ross the proesses Prllel Computtion Edgr Griel 2
3 Prllel Computtion Edgr Griel Mtrix Opertions: =. rnspose Mtrix Often not neessry, sine the opertions (e.g. Mtrixvetor multiply) n e (esily) reformulted for Mtrix- rnspose-vetor multiply opertions nd void the dt trnspose Opertions requiring the trnspose: multi-dimensionl FF ssumption: Mtries, re squre Element [x][y] should e on the sme proess s element [x][y] -> requires ommunition ross the proesses = : One element per proess Initil dt distriution: one element of the Mtrix per proess Proess with oordintes (x,y) needs to send its dt item to the proess with the oordintes (y,x) nd reeive its dt item from (y,x) Prllel Computtion Edgr Griel 3
4 = : One element per proess // ssumptions: // newomm hs een reted using MPI_Crt_rete // doule, re the element of the mtries // owned y eh proess. is lredy set. int oords[2]; // my oordintes in the 2-D topology int rem_oords[2]; // oordintes of my ounterprt MPI_Request req[2]; MPI_Sttus stts[2]; // Determine my own rnk in newomm MPI_Comm_rnk (newomm, &rnk); // Determine my own oordintes in newomm MPI_Crt_oords (newomm, rnk, ndims, oords ); //Determine the oordintes of my ounterprt rem_oords[0] = oords[1]; rem_oords[1] = oords[0]; Prllel Computtion Edgr Griel = // Determine the rnk of my ounterprt using his oordintes MPI_Crt_rnk ( newomm, rem_oords, &rem_rnk); // Initite non-loking ommunition to send MPI_Isend ( &, 1, MPI_DOULE, rem_rnk, 0, newomm,&req[0]); // Initite non-loking ommunition to reeive MPI_Irev ( &, 1, MPI_DOULE, rem_rnk, 0, newomm,&req[1]); // Wit on oth non-loking opertions to finish MPI_Witll ( 2, req, stts); Prllel Computtion Edgr Griel : One element per proess Notes: using non-loking ommunition voids to hve to shedule messges to void dedlok proesses on the min digonl send messge to themselves 4
5 = : Column-wise dt distriution One olumn per proess rnk = rnk = Element [i] needs to e sent to proess i Element [i] will e reeived from proess i Prllel Computtion Edgr Griel = MPI_Request *reqs; MPI_Sttus *stts; int rnk, size; doule [N], [N]; : Column-wise dt distriution // Determine the numer of proesses working on the prolem // nd my rnk in the ommunitor MPI_Comm_size ( omm, &size); MPI_Comm_rnk ( omm, &rnk); // llote the required numer of Requests nd Sttuses. Sine // the ode is supposed to work for ritrry numers of // proessors, you n not use stti rrys for reqs nd stts reqs = (MPI_Request *) mllo ( 2*size*sizeof(MPI_Request) ); stts = (MPI_Sttus *) mllo ( 2*size*sizeof(MPI_Sttus) ); Prllel Computtion Edgr Griel 5
6 = : Column-wise dt distriution // Strt now ll non-loking ommunition opertions for (i=0; i<size; i++ ) { MPI_Isend (&[i], 1, MPI_DOULE, i, 0, omm, &reqs[2*i]); MPI_Irev (&[i], 1, MPI_DOULE, i, 0, omm, &(reqs[2*i+1]); // Wit for ll non-loking opertions to finish MPI_Witll ( 2*size, reqs, stts); Notes: identil pproh nd ode for row-wise dt distriution s long s the lol portions of oth nd re stored s one-dimensionl rrys numer of messges: N 2 = np 2 Prllel Computtion Edgr Griel = : lok olumn-wise dt distriution Eh proess holds N lol olumns of eh mtrix with N = np 1 i= 0 ssuming N n e divided evenly onto np proesses rnk = rnk = N lol Prllel Computtion Edgr Griel 6
7 = Element [i][j] hs to eome element [j][i] ssuming i, j re glol indexes Vrile delrtions on eh proess: doule [N][N lol ]; doule [N][N lol ]; [i][j] is loted on the proess with the rnk r = j/n lol hs the lol indexes [i 1 ][j 1 ] with i 1 =i nd j 1 =j%n lol [j][i] is loted on the proess with the rnk s=i/n lol hs the lol indexes [j 2 ][i 2 ] with j 2 =j nd i 2 =i%n lol Prllel Computtion Edgr Griel : lok olumn-wise dt distriution = : lok olumn-wise dt distriution // ode frgment for the ommunition for ( j1=0; j1<n lol ; j1++) { for (i=0; i<n; i++ ) { dest = i / N lol ; MPI_Isend ( &([i][j1], 1, MPI_DOULE, dest, 0, omm, &reqs[ ]); for ( j=0; j<n; j++ ) { for ( i2=0; i2<n lol ; i2++ ) { sr = j / N lol ; MPI_Irev ( &([j][i2]), 1, MPI_DOULE, sr, 0, omm, &reqs[ ]); Prllel Computtion Edgr Griel 7
8 = : lok olumn-wise dt distriution he lgorithm on the previous slide is good euse it doesn t require ny dditionl temporry storge he lgorithm on the previous slide is d euse it sends N 2 messges, with N>>np osts of eh messge is proportionl to the network lteny for short messges Mtrix hs to e trversed in non-ontiguous mnner C stores multi-dimensionl rrys in row-mjor order essing [0][0] thn [1][0] mens tht we jump in the min memory nd hve lrge numer of he misses Prllel Computtion Edgr Griel Memory lyout of multi-dimensionl rrys E.g. 2-D mtrix Memory lyout in C Memory lyout in Fortrn Prllel Computtion Edgr Griel 8
9 = : lok olumn-wise dt distriution lterntive lgorithm eh proess sends in relity N lol *N lol elements to every other proess send n entire lok of N lol *N lol elements lok hs to e trnsposed either t the sender or t the reeiver rnk = rnk = Prllel Computtion Edgr Griel = : lok olumn-wise dt distriution // Send the mtrix lok-y-lok for ( i=0; i<n; i+=n lol ) { MPI_Isend ( &([i][0], N lol *N lol, MPI_DOULE, i, 0, omm, &reqs[2*i]); MPI_Irev( &([i][0], N lol *N lol, MPI_DOULE, i, 0, omm, &*reqs[2*i+1]); MPI_Witll ( 2*size, reqs, stts); // Now trnspose eh lok for ( i=0; i<n; i+=n lol ) { for ( k=0; k<n lol ; k++ ) { for ( j=k; j<n lol ; j++ ) { temp = [i+k][j]; [i+k][j] = [i+j][k]; [i+j][k] = temp; Prllel Computtion Edgr Griel 9
10 = : other 1-D dt distriutions lok row-wise dt distriution lgorithm very similr to lok olumn-wise dt distriution Cyli olumn-wise dt distriution proess with rnk r gets the olumns r, r+np, r+2*np, et dvntge: none for the Mtrix trnspose opertions for some other opertions, this dt distriution leds often to etter lod lne thn lok olumn-wise distriution Cyli row-wise dt distriution lok-yli olumn-wise dt distriution lok-yli row-wise dt distriution Prllel Computtion Edgr Griel = : 2-D dt distriution Eh proess holds lok of N lol *N lol elements 2-D distriution voids skinny mtries often esier to rete lod lne thn with 1-D lok olumn/row distriution Prllel Computtion Edgr Griel
11 = : 2-D dt distriution ssumption: using 2-D rtesin ommunitor lgorithm: Determine your rnk using MPI_Comm_rnk Determine your oordintes using MPI_Crt_oords Determine the oordintes of your ommunition prtner y reverting the x nd y oordintes of your oordintes determine the rnk of your ommunition prtner using MPI_Crt_rnk Send lok of N lol *N lol elements to omm. prtner Reeive lok of N lol *N lol elements from omm. prtner rnspose the lok tht hs een reeived lgorithm omines tehniques from the one element per proess distriution nd the lok olumn-wise distriution Prllel Computtion Edgr Griel = : lok row-wise distriution repliting the vetor doule [nlol][n], [n]; doule [nlol], glol[n]; int i,j; for (i=0; i<nlol; i++) { for ( j=0;j<n; j++ ) { [i] = [i] + (i,j)*(j); * = MPI_llgther(, nlol, MPI_DOULE, glol, nlol, MPI_DOULE, MPI_COMM_WORLD ); Prllel Computtion Edgr Griel
12 = : lok row-wise distriution Why replite the vetor? memory requirement is O(N) with N eing the size of the vetor in ontrry to Mtrix O(N 2 ) or other higher dimensionl rrys inreses the performne of the Mtrix-vetor multiply opertion Why do we need the llgther t the end? most pplitions require uniform tretment of similr ojets e.g. one vetor is replited, ll should e replited if the result vetor is used in susequent opertion, you would need different implementtions in the ode depending on whether the vetor is distriuted or replited Prllel Computtion Edgr Griel = : lok olumn-wise distriution int min( int rg, hr **rgv) { doule [n][nlol], [nlol]; doule [n], t[n]; int i,j; * = for (i=0; i<n; i++) { for ( j=0;j<nlol;j++ ) { t[i] = t[i] + (i,j)*(j); MPI_llredue ( t,, n, MPI_DOULE, MPI_SUM, MPI_COMM_WORLD ); Prllel Computtion Edgr Griel
13 = : lok olumn-wise distriution Why not replite the vetor in this distriution there is no enefit in doing tht for this opertion there might e other opertions in the ode tht mndte tht ut the result vetor is replited sure, the lgorithm mndtes tht you n still drop the elements tht you don t need fterwrds Prllel Computtion Edgr Griel C = : Mtrix-Mtrix Multiply lok-olumn wise dt distriution Exmple for 2 proesses nd 4x4 mtrix Exmple uses glol indies for the mtrix Mtrix Mtrix Mtrix C rnk=0 rnk=1 rnk=0 rnk=1 rnk=0 rnk=1 = Prllel Computtion Edgr Griel
14 C = : lok-olumn wise distriution 1 st step: eh proess lultes prt of the result elements nd stores it in mtrix C = Prllel Computtion Edgr Griel C = : lok-olumn wise distriution 2 nd step: Proess 0 nd 1 swp there portions of Mtrix Mtrix nd C unhnged, e.g. Mtrix rnk=0 rnk=1 Prllel Computtion Edgr Griel 14
15 C = : lok-olumn wise distriution Finish mtrix multiply opertion = Prllel Computtion Edgr Griel C = : lok-olumn wise distriution Generliztion for np proesses rnk = 0 1 n-1 rnk = 0 1 n-1 rnk = 0 1 n-1 Prllel Computtion Edgr Griel n- 1 x = C n n n n-1 2 n n-2 it = 0 x n-1 = n-1 it = x n-1 = n-1. it = np n n- 1 C C n n
16 C = : lok-olumn wise distriution np-1 steps required to give every proess ess to the entire mtrix lgorithm does not require proess to hold the entire mtrix t ny point in time finl shift opertion required in order for eh proess to hve its originl portion of the mtrix k Communition etween proesses often using ring, e.g. proess x sends to x-1 nd reeives from x+1 speil se for proess 0 nd np-1 need to use temporry uffer if simultneously sending nd reeiving the mtrix Prllel Computtion Edgr Griel C = : lok-olumn wise distriution // nlolols: no. of olumns held y proess // nrows: no. of rows of the mtrix // np: numer of proesses // rnk: rnk of this proess sendto = rnk-1; revfrom = rnk+1; if ( rnk == 0 ) sendto = np-1; if ( rnk == np-1 ) revfrom = 0; MPI_Isend(, nrows*nlolols, MPI_DOULE, sendto, 0, omm, &req[0]); MPI_Irev ( temp, nrows, nlolols, MPI_DOULE, revfrom, 0, omm, &req[1]); MPI_Witll ( req, sttuses ); // Copy dt from temporry uffer into mempy (, temp, nrows*nlolols*sizeof(doule)); Prllel Computtion Edgr Griel 16
17 C = : lok-olumn wise distriution Mpping of glol to lol indies required sine C dt struture n not strt t n ritrry vlue, ut hs to strt t index 0 need to know from whih proess we hold the tul dt item in order to know whih elements of the Mtrix to use mpping will depend of the diretion of the ring ommunition Prllel Computtion Edgr Griel C = : lok-olumn wise distriution // nlolols: no. of olumns held y proess // nrows: no. of rows of the mtrix // np: numer of proesses // rnk: rnk of this proess for ( it=0; it < np; it++ ) { offset = (rnk+it)%np * nlolols; for (i=0; i<nrows; i++) { for ( j=0;j<nlolols;j++ ) { for (k=0; k<nlolols; k++) { C[i][j] += [i][k] + [offset+k][j]; // Communition s shown on previous slides Prllel Computtion Edgr Griel 17
18 C = : lok-olumn wise distriution lterntive ommunition pttern for lok-olumn wise distriution: in itertion it, proess with rnk=it rodsts its portion of the Mtrix to ll proesses. Mpping of glol to lol indies it simpler Communition osts higher thn for the ring ommunition Prllel Computtion Edgr Griel C = : lok-row wise distriution Similr lgorithm s for lok-olumn wise, e.g. 1 st step rnk=0 rnk=1 = nd step omitted here, only differene to lok-olumn wise distriution is tht the mtrix is rotted mong the proesses mpping of lol to glol indies relevnt for Mtrix Prllel Computtion Edgr Griel 18
19 C = : 2-D dt distriution oth mtries need to e rotted mong the proesses only proesses holding portion of the sme rows of Mtrix need to rotte mongst eh other only proesses holding portion of the sme olumns of Mtrix need to rotte mongst eh other Prllel Computtion Edgr Griel C = : 2-D dt distriution e.g. for 2 nd step: ssuming 2-D proess topology Mtrix is ommunited in ring to the left neighor Mtrix is ommunited in ring to the upper neighor Prllel Computtion Edgr Griel 19
20 C = : 2-D dt distriution Cnnon s lgorithm for squre mtries Set up 2-D proess topology determine nlolols nd nlolrows for eh proess initil shift opertion suh tht eh proess multiplies its lol sumtries y i steps (see next slide) for i=0; i< numer of proesses in row (or olumn) lulte lol prt of mtrix-mtrix multiply opertion send lol portion of to the left neighor reeive next portion of from the right neighor send lol portion of to the upper neighor reeive next portion of from the lower neighor Prllel Computtion Edgr Griel Initil ssignment of Mtries nd 0,0 0,1 0,2 0,3 1,0 1,1 1,2 1,3 2,0 2,1 2,2 2,3 3,0 3,1 3,2 3,3 0,0 0,1 0,2 0,3 1,0 1,1 1,2 1,3 2,0 2,1 2,2 2,3 3,0 3,1 3,2 3,3 Initil shift of Mtries nd suh tht: Mtrix is shifted y i proesses left for proesses in the i-th olumn of the proess topology Mtrix is shifted y j proesses up for proesses in the j-th olumn of the proess topology 0,0 0,1 0,2 0,3 1,1 1,2 1,3 1,0 2,2 2,3 2,0 2,1 3,3 3,0 3,1 3,2 0,0 1,1 2,2 3,3 1,0 2,1 3,2 0,3 2,0 3,1 0,2 1,3 3,0 0,1 1,2 2,3 Prllel Computtion Edgr Griel
COSC 6374 Parallel Computation. Non-blocking Collective Operations. Edgar Gabriel Fall Overview
COSC 6374 Prllel Computtion Non-loking Colletive Opertions Edgr Griel Fll 2014 Overview Impt of olletive ommunition opertions Impt of ommunition osts on Speedup Crtesin stenil ommunition All-to-ll ommunition
More informationCOSC 6374 Parallel Computation. Communication Performance Modeling (II) Edgar Gabriel Fall Overview. Impact of communication costs on Speedup
COSC 6374 Prllel Computtion Communition Performne Modeling (II) Edgr Griel Fll 2015 Overview Impt of ommunition osts on Speedup Crtesin stenil ommunition All-to-ll ommunition Impt of olletive ommunition
More informationCS 241 Week 4 Tutorial Solutions
CS 4 Week 4 Tutoril Solutions Writing n Assemler, Prt & Regulr Lnguges Prt Winter 8 Assemling instrutions utomtilly. slt $d, $s, $t. Solution: $d, $s, nd $t ll fit in -it signed integers sine they re 5-it
More informationShared Memory Architectures. Programming and Synchronization. Today s Outline. Page 1. Message passing review Cosmic Cube discussion
Tody s Outline Arhitetures Progrmming nd Synhroniztion Disuss pper on Cosmi Cube (messge pssing) Messge pssing review Cosmi Cube disussion > Messge pssing mhine Shred memory model > Communition > Synhroniztion
More informationV = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)
Definitions G = (V, E) V = set of verties (vertex / noe) E = set of eges (v, w) (v, w in V) (v, w) orere => irete grph (igrph) (v, w) non-orere => unirete grph igrph: w is jent to v if there is n ege from
More informationInternet Routing. IP Packet Format. IP Fragmentation & Reassembly. Principles of Internet Routing. Computer Networks 9/29/2014.
omputer Networks 9/29/2014 IP Pket Formt Internet Routing Ki Shen IP protool version numer heder length (words) for qulity of servie mx numer remining hops (deremented t eh router) upper lyer protool to
More informationDistributed Systems Principles and Paradigms
Distriuted Systems Priniples nd Prdigms Christoph Dorn Distriuted Systems Group, Vienn University of Tehnology.dorn@infosys.tuwien..t http://www.infosys.tuwien..t/stff/dorn Slides dpted from Mrten vn Steen,
More informationDistance vector protocol
istne vetor protool Irene Finohi finohi@i.unirom.it Routing Routing protool Gol: etermine goo pth (sequene of routers) thru network from soure to Grph strtion for routing lgorithms: grph noes re routers
More informationDistributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems
Distriuted Systems Priniples nd Prdigms Mrten vn Steen VU Amsterdm, Dept. Computer Siene steen@s.vu.nl Chpter 11: Distriuted File Systems Version: Deemer 10, 2012 2 / 14 Distriuted File Systems Distriuted
More informationFundamentals of Engineering Analysis ENGR Matrix Multiplication, Types
Fundmentls of Engineering Anlysis ENGR - Mtri Multiplition, Types Spring Slide Mtri Multiplition Define Conformle To multiply A * B, the mtries must e onformle. Given mtries: A m n nd B n p The numer of
More informationError Numbers of the Standard Function Block
A.2.2 Numers of the Stndrd Funtion Blok evlution The result of the logi opertion RLO is set if n error ours while the stndrd funtion lok is eing proessed. This llows you to rnh to your own error evlution
More informationChapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.
Chpter 9 Greey Tehnique Copyright 2007 Person Aison-Wesley. All rights reserve. Greey Tehnique Construts solution to n optimiztion prolem piee y piee through sequene of hoies tht re: fesile lolly optiml
More informationCS553 Lecture Introduction to Data-flow Analysis 1
! Ide Introdution to Dt-flow nlysis!lst Time! Implementing Mrk nd Sweep GC!Tody! Control flow grphs! Liveness nlysis! Register llotion CS553 Leture Introdution to Dt-flow Anlysis 1 Dt-flow Anlysis! Dt-flow
More informationMinimal Memory Abstractions
Miniml Memory Astrtions (As implemented for BioWre Corp ) Nthn Sturtevnt University of Alert GAMES Group Ferury, 7 Tlk Overview Prt I: Building Astrtions Minimizing memory requirements Performnes mesures
More informationCMPUT101 Introduction to Computing - Summer 2002
CMPUT Introdution to Computing - Summer 22 %XLOGLQJ&RPSXWHU&LUFXLWV Chpter 4.4 3XUSRVH We hve looked t so fr how to uild logi gtes from trnsistors. Next we will look t how to uild iruits from logi gtes,
More informationCS453 INTRODUCTION TO DATAFLOW ANALYSIS
CS453 INTRODUCTION TO DATAFLOW ANALYSIS CS453 Leture Register llotion using liveness nlysis 1 Introdution to Dt-flow nlysis Lst Time Register llotion for expression trees nd lol nd prm vrs Tody Register
More informationCS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal
CS 55 Computer Grphis Hidden Surfe Removl Hidden Surfe Elimintion Ojet preision lgorithms: determine whih ojets re in front of others Uses the Pinter s lgorithm drw visile surfes from k (frthest) to front
More informationCOMP 423 lecture 11 Jan. 28, 2008
COMP 423 lecture 11 Jn. 28, 2008 Up to now, we hve looked t how some symols in n lphet occur more frequently thn others nd how we cn sve its y using code such tht the codewords for more frequently occuring
More informationProblem Final Exam Set 2 Solutions
CSE 5 5 Algoritms nd nd Progrms Prolem Finl Exm Set Solutions Jontn Turner Exm - //05 0/8/0. (5 points) Suppose you re implementing grp lgoritm tt uses ep s one of its primry dt strutures. Te lgoritm does
More informationPARALLEL AND DISTRIBUTED COMPUTING
PARALLEL AND DISTRIBUTED COMPUTING 2009/2010 1 st Semester Teste Jnury 9, 2010 Durtion: 2h00 - No extr mteril llowed. This includes notes, scrtch pper, clcultor, etc. - Give your nswers in the ville spce
More informationFig.25: the Role of LEX
The Lnguge for Specifying Lexicl Anlyzer We shll now study how to uild lexicl nlyzer from specifiction of tokens in the form of list of regulr expressions The discussion centers round the design of n existing
More informationLesson 4.4. Euler Circuits and Paths. Explore This
Lesson 4.4 Euler Ciruits nd Pths Now tht you re fmilir with some of the onepts of grphs nd the wy grphs onvey onnetions nd reltionships, it s time to egin exploring how they n e used to model mny different
More information2 Computing all Intersections of a Set of Segments Line Segment Intersection
15-451/651: Design & Anlysis of Algorithms Novemer 14, 2016 Lecture #21 Sweep-Line nd Segment Intersection lst chnged: Novemer 8, 2017 1 Preliminries The sweep-line prdigm is very powerful lgorithmic design
More informationDuality in linear interval equations
Aville online t http://ijim.sriu..ir Int. J. Industril Mthemtis Vol. 1, No. 1 (2009) 41-45 Dulity in liner intervl equtions M. Movhedin, S. Slhshour, S. Hji Ghsemi, S. Khezerloo, M. Khezerloo, S. M. Khorsny
More informationDoubts about how to use azimuth values from a Coordinate Object. Juan Antonio Breña Moral
Douts out how to use zimuth vlues from Coordinte Ojet Jun Antonio Breñ Morl # Definition An Azimuth is the ngle from referene vetor in referene plne to seond vetor in the sme plne, pointing towrd, (ut
More informationUTMC APPLICATION NOTE UT1553B BCRT TO INTERFACE PSEUDO-DUAL-PORT RAM ARCHITECTURE INTRODUCTION ARBITRATION DETAILS DESIGN SELECTIONS
UTMC APPLICATION NOTE UT1553B BCRT TO 80186 INTERFACE INTRODUCTION The UTMC UT1553B BCRT is monolithi CMOS integrte iruit tht provies omprehensive Bus Controller n Remote Terminl funtions for MIL-STD-
More informationGreedy Algorithm. Algorithm Fall Semester
Greey Algorithm Algorithm 0 Fll Semester Optimiztion prolems An optimiztion prolem is one in whih you wnt to fin, not just solution, ut the est solution A greey lgorithm sometimes works well for optimiztion
More informationCS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string.
CS 340, Fll 2016 Sep 29th Exm 1 Nme: Note: in ll questions, the speil symol ɛ (epsilon) is used to indite the empty string. Question 1. [10 points] Speify regulr expression tht genertes the lnguge over
More informationSMALL SIZE EDGE-FED SIERPINSKI CARPET MICROSTRIP PATCH ANTENNAS
Progress In Eletromgnetis Reserh C, Vol. 3, 195 22, 28 SMALL SIZE EDGE-FED SIERPINSKI CARPET MICROSTRIP PATCH ANTENNAS W.-L. Chen nd G.-M. Wng Rdr Engineering Deprtment Missile Institute of Air Fore Engineering
More informationMidterm Exam CSC October 2001
Midterm Exm CSC 173 23 Otoer 2001 Diretions This exm hs 8 questions, severl of whih hve suprts. Eh question indites its point vlue. The totl is 100 points. Questions 5() nd 6() re optionl; they re not
More informationCOMP108 Algorithmic Foundations
Grph Theory Prudene Wong http://www.s.liv..uk/~pwong/tehing/omp108/201617 How to Mesure 4L? 3L 5L 3L ontiner & 5L ontiner (without mrk) infinite supply of wter You n pour wter from one ontiner to nother
More informationEECS150 - Digital Design Lecture 23 - High-level Design and Optimization 3, Parallelism and Pipelining
EECS150 - Digitl Design Lecture 23 - High-level Design nd Optimiztion 3, Prllelism nd Pipelining Nov 12, 2002 John Wwrzynek Fll 2002 EECS150 - Lec23-HL3 Pge 1 Prllelism Prllelism is the ct of doing more
More informationThe Network Layer: Routing in the Internet. The Network Layer: Routing & Addressing Outline
CPSC 852 Internetworking The Network Lyer: Routing in the Internet Mihele Weigle Deprtment of Computer Siene Clemson University mweigle@s.lemson.edu http://www.s.lemson.edu/~mweigle/ourses/ps852 1 The
More informationLecture 13: Graphs I: Breadth First Search
Leture 13 Grphs I: BFS 6.006 Fll 2011 Leture 13: Grphs I: Bredth First Serh Leture Overview Applitions of Grph Serh Grph Representtions Bredth-First Serh Rell: Grph G = (V, E) V = set of verties (ritrry
More informationParadigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms
Prdigm. Dt Struture Known exmples: link tble, hep, Our leture: suffix tree Will involve mortize method tht will be stressed shortly in this ourse Suffix trees Wht is suffix tree? Simple pplitions History
More informationLINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION
Overview LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION 4.4.1.0 Due to the omplex nture of this updte, plese fmilirize yourself with these instrutions nd then ontt RGB Spetrum Tehnil
More informationInter-domain Routing
COMP 631: NETWORKED & DISTRIBUTED SYSTEMS Inter-domin Routing Jsleen Kur Fll 2016 1 Internet-sle Routing: Approhes DV nd link-stte protools do not sle to glol Internet How to mke routing slle? Exploit
More informationTO REGULAR EXPRESSIONS
Suject :- Computer Science Course Nme :- Theory Of Computtion DA TO REGULAR EXPRESSIONS Report Sumitted y:- Ajy Singh Meen 07000505 jysmeen@cse.iit.c.in BASIC DEINITIONS DA:- A finite stte mchine where
More informationProduct of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials
Product of polynomils Introduction to Progrmming (in C++) Numericl lgorithms Jordi Cortdell, Ricrd Gvldà, Fernndo Orejs Dept. of Computer Science, UPC Given two polynomils on one vrile nd rel coefficients,
More informationMTH 146 Conics Supplement
105- Review of Conics MTH 146 Conics Supplement In this section we review conics If ou ne more detils thn re present in the notes, r through section 105 of the ook Definition: A prol is the set of points
More informationbox Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example:
Boxes nd Arrows There re two kinds of vriles in Jv: those tht store primitive vlues nd those tht store references. Primitive vlues re vlues of type long, int, short, chr, yte, oolen, doule, nd flot. References
More informationcisc1110 fall 2010 lecture VI.2 call by value function parameters another call by value example:
cisc1110 fll 2010 lecture VI.2 cll y vlue function prmeters more on functions more on cll y vlue nd cll y reference pssing strings to functions returning strings from functions vrile scope glol vriles
More informationGENG2140 Modelling and Computer Analysis for Engineers
GENG4 Moelling n Computer Anlysis or Engineers Letures 9 & : Gussin qurture Crete y Grn Romn Joles, PhD Shool o Mehnil Engineering, UWA GENG4 Content Deinition o Gussin qurture Computtion o weights n points
More informationDynamic Programming. Andreas Klappenecker. [partially based on slides by Prof. Welch] Monday, September 24, 2012
Dynmic Progrmming Andres Klppenecker [prtilly bsed on slides by Prof. Welch] 1 Dynmic Progrmming Optiml substructure An optiml solution to the problem contins within it optiml solutions to subproblems.
More informationSolution of Linear Algebraic Equations using the Gauss-Jordan Method
Solution of Liner Algebric Equtions using the Guss-Jordn Method Populr pproch for solving liner equtions The Guss Jordn method depends on two properties of liner equtions: Scling one or more of ny of the
More informationIn the last lecture, we discussed how valid tokens may be specified by regular expressions.
LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.
More informationCompression Outline :Algorithms in the Real World. Lempel-Ziv Algorithms. LZ77: Sliding Window Lempel-Ziv
Compression Outline 15-853:Algorithms in the Rel World Dt Compression III Introduction: Lossy vs. Lossless, Benchmrks, Informtion Theory: Entropy, etc. Proility Coding: Huffmn + Arithmetic Coding Applictions
More informationA distributed edit-compile workflow
Time Synhroniztion nd Logil Cloks Tody 1. The need for time synhroniztion 2. Wll lok time synhroniztion 3. Logil Time: Lmport Cloks COS 418: Distriuted Systems Leture 4 Kyle Jmieson 2 A distriuted edit-ompile
More informationIntroduction to Algebra
INTRODUCTORY ALGEBRA Mini-Leture 1.1 Introdution to Alger Evlute lgeri expressions y sustitution. Trnslte phrses to lgeri expressions. 1. Evlute the expressions when =, =, nd = 6. ) d) 5 10. Trnslte eh
More informationNetwork Interconnection: Bridging CS 571 Fall Kenneth L. Calvert All rights reserved
Network Interconnection: Bridging CS 57 Fll 6 6 Kenneth L. Clvert All rights reserved The Prolem We know how to uild (rodcst) LANs Wnt to connect severl LANs together to overcome scling limits Recll: speed
More informationLecture 8: Graph-theoretic problems (again)
COMP36111: Advned Algorithms I Leture 8: Grph-theoreti prolems (gin) In Prtt-Hrtmnn Room KB2.38: emil: iprtt@s.mn..uk 2017 18 Reding for this leture: Sipser: Chpter 7. A grph is pir G = (V, E), where V
More informationA Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards
A Tutology Checker loosely relted to Stålmrck s Algorithm y Mrtin Richrds mr@cl.cm.c.uk http://www.cl.cm.c.uk/users/mr/ University Computer Lortory New Museum Site Pemroke Street Cmridge, CB2 3QG Mrtin
More informationLexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay
Lexicl Anlysis Amith Snyl (www.cse.iit.c.in/ s) Deprtment of Computer Science nd Engineering, Indin Institute of Technology, Bomy Septemer 27 College of Engineering, Pune Lexicl Anlysis: 2/6 Recp The input
More informationPointers and Arrays. More Pointer Examples. Pointers CS 217
Pointers nd Arrs CS 21 1 2 Pointers More Pointer Emples Wht is pointer A vrile whose vlue is the ddress of nother vrile p is pointer to vrile v Opertions &: ddress of (reference) *: indirection (dereference)
More informationString comparison by transposition networks
String omprison y trnsposition networks Alexnder Tiskin (Joint work with Peter Krushe) Deprtment of Computer Siene University of Wrwik http://www.ds.wrwik..uk/~tiskin (inludes n extended version of this
More informationGeometric transformations
Geometric trnsformtions Computer Grphics Some slides re bsed on Shy Shlom slides from TAU mn n n m m T A,,,,,, 2 1 2 22 12 1 21 11 Rows become columns nd columns become rows nm n n m m A,,,,,, 1 1 2 22
More informationc s ha2 c s Half Adder Figure 2: Full Adder Block Diagram
Adder Tk: Implement 2-it dder uing 1-it full dder nd 1-it hlf dder omponent (Figure 1) tht re onneted together in top-level module. Derie oth omponent in VHDL. Prepre two implementtion where VHDL omponent
More informationContainers: Queue and List
Continers: Queue n List Queue A ontiner in whih insertion is one t one en (the til) n eletion is one t the other en (the he). Also lle FIFO (First-In, First-Out) Jori Cortell n Jori Petit Deprtment of
More informationBalanced Trees. 2-3 trees red-black trees B-trees. 2-3 trees red-black trees B-trees smaller than. 2-node. 3-node E J S X A C.
ymol tle review Blned Trees implementtion gurntee verge se serh insert delete serh hit insert delete ordered itertion? opertions on keys sequentil serh (linked list) N N N N/2 N N/2 no equls() 2-3 trees
More informationCS201 Discussion 10 DRAWTREE + TRIES
CS201 Discussion 10 DRAWTREE + TRIES DrwTree First instinct: recursion As very generic structure, we could tckle this problem s follows: drw(): Find the root drw(root) drw(root): Write the line for the
More informationAdvanced Programming Handout 5. Enter Okasaki. Persistent vs. Ephemeral. Functional Queues. Simple Example. Persistent vs.
Avne Progrmming Hnout 5 Purel Funtionl Dt Strutures: A Cse Stu in Funtionl Progrmming Persistent vs. Ephemerl An ephemerl t struture is one for whih onl one version is ville t time: fter n upte opertion,
More information6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.
6.3 Volumes Just s re is lwys positive, so is volume nd our ttitudes towrds finding it. Let s review how to find the volume of regulr geometric prism, tht is, 3-dimensionl oject with two regulr fces seprted
More informationCS321 Languages and Compiler Design I. Winter 2012 Lecture 5
CS321 Lnguges nd Compiler Design I Winter 2012 Lecture 5 1 FINITE AUTOMATA A non-deterministic finite utomton (NFA) consists of: An input lphet Σ, e.g. Σ =,. A set of sttes S, e.g. S = {1, 3, 5, 7, 11,
More informationInternet Routing. Reminder: Routing. CPSC Network Programming
PS 360 - Network Progrmming Internet Routing Mihele Weigle eprtment of omputer Siene lemson University mweigle@s.lemson.eu pril, 00 http://www.s.lemson.eu/~mweigle/ourses/ps360 Reminer: Routing Internet
More informationSimplifying Algebra. Simplifying Algebra. Curriculum Ready.
Simplifying Alger Curriculum Redy www.mthletics.com This ooklet is ll out turning complex prolems into something simple. You will e le to do something like this! ( 9- # + 4 ' ) ' ( 9- + 7-) ' ' Give this
More informationQuiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex
Long Quiz2 45mins Nme: Personl Numer: Prolem. (20pts) Here is n Tle of Perl Regulr Ex Chrcter Description. single chrcter \s whitespce chrcter (spce, t, newline) \S non-whitespce chrcter \d digit (0-9)
More informationCalculus Differentiation
//007 Clulus Differentition Jeffrey Seguritn person in rowot miles from the nerest point on strit shoreline wishes to reh house 6 miles frther down the shore. The person n row t rte of mi/hr nd wlk t rte
More informationThe Fundamental Theorem of Calculus
MATH 6 The Fundmentl Theorem of Clculus The Fundmentl Theorem of Clculus (FTC) gives method of finding the signed re etween the grph of f nd the x-xis on the intervl [, ]. The theorem is: FTC: If f is
More informationMPI Groups and Communicators
MPI Groups nd Communictors We now lern techniques to modulrize communictions t more locl level so tht messges do not interfere with ech other We do this by setting up Groups of processes We then crete
More information5 Regular 4-Sided Composition
Xilinx-Lv User Guide 5 Regulr 4-Sided Composition This tutoril shows how regulr circuits with 4-sided elements cn be described in Lv. The type of regulr circuits tht re discussed in this tutoril re those
More informationMcAfee Web Gateway
Relese Notes Revision C MAfee We Gtewy 7.6.2.11 Contents Aout this relese Enhnement Resolved issues Instlltion instrutions Known issues Additionl informtion Find produt doumenttion Aout this relese This
More information[SYLWAN., 158(6)]. ISI
The proposl of Improved Inext Isomorphi Grph Algorithm to Detet Design Ptterns Afnn Slem B-Brhem, M. Rizwn Jmeel Qureshi Fulty of Computing nd Informtion Tehnology, King Adulziz University, Jeddh, SAUDI
More informationDefinition of Regular Expression
Definition of Regulr Expression After the definition of the string nd lnguges, we re redy to descrie regulr expressions, the nottion we shll use to define the clss of lnguges known s regulr sets. Recll
More informationSolving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016
Solving Prolems y Serching CS 486/686: Introduction to Artificil Intelligence Winter 2016 1 Introduction Serch ws one of the first topics studied in AI - Newell nd Simon (1961) Generl Prolem Solver Centrl
More informationHIGH-LEVEL TRANSFORMATIONS DATA-FLOW MODEL OF COMPUTATION TOKEN FLOW IN A DFG DATA FLOW
1 2 Topis: * Dt-flow grphs * (Non)overlpped sheduling * Miniml itertion period Further reding: * Trnsformtions for speed-up * Trnsformtions for low power Prhi, K.K., High-Level Algorithm nd Arhiteture
More informationCompilers. Topic 4. The Symbol Table and Block Structure PART II. Mick O Donnell: Alfonso Ortega:
Compilers Topi 4 The ol Tle nd Blok Struture PART II Mik O Donnell: mihel.odonnell@um.es Alfonso Orteg: lfonso.orteg@um.es Topi 2: Blok Struture 2 1 ol tles with lok strutures Blok Struture Progrmming
More informationCompilers Spring 2013 PRACTICE Midterm Exam
Compilers Spring 2013 PRACTICE Midterm Exm This is full length prctice midterm exm. If you wnt to tke it t exm pce, give yourself 7 minutes to tke the entire test. Just like the rel exm, ech question hs
More informationIf you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.
Lecture 5 Wlks, Trils, Pths nd Connectedness Reding: Some of the mteril in this lecture comes from Section 1.2 of Dieter Jungnickel (2008), Grphs, Networks nd Algorithms, 3rd edition, which is ville online
More informationMITSUBISHI ELECTRIC RESEARCH LABORATORIES Cambridge, Massachusetts. Introduction to Matroids and Applications. Srikumar Ramalingam
Cmrige, Msshusetts Introution to Mtrois n Applitions Srikumr Rmlingm MERL mm//yy Liner Alger (,0,0) (0,,0) Liner inepenene in vetors: v, v2,..., For ll non-trivil we hve s v s v n s, s2,..., s n 2v2...
More informationPresentation Martin Randers
Presenttion Mrtin Rnders Outline Introduction Algorithms Implementtion nd experiments Memory consumption Summry Introduction Introduction Evolution of species cn e modelled in trees Trees consist of nodes
More informationGraphing Conic Sections
Grphing Conic Sections Definition of Circle Set of ll points in plne tht re n equl distnce, clled the rdius, from fixed point in tht plne, clled the center. Grphing Circle (x h) 2 + (y k) 2 = r 2 where
More informationSection 2.3 Functions. Definition: Let A and B be sets. A function (mapping, map) f from A to B, denoted f :A B, is a subset of A B such that
Setion 2.3 Funtions Definition: Let n e sets. funtion (mpping, mp) f from to, enote f :, is suset of suh tht x[x y[y < x, y > f ]] n [< x, y 1 > f < x, y 2 > f ] y 1 = y 2 Note: f ssoites with eh x in
More informationPattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions
Pttern Mthing Pttern Mthing Some of these leture slides hve een dpted from: lgorithms in C, Roert Sedgewik. Gol. Generlize string serhing to inompletely speified ptterns. pplitions. Test if string or its
More informationFinal Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book
inl xm Review 06 M 236 e sure to loo over ll of your tests, s well s over the tivities you did in the tivity oo 1 1. ind the mesures of the numered ngles nd justify your wor. Line j is prllel to line.
More informationAn Efficient Code Update Scheme for DSP Applications in Mobile Embedded Systems
An Effiient Code Updte Sheme for DSP Applitions in Moile Emedded Systems Weiji Li, Youto Zhng Computer Siene Deprtment,University of Pittsurgh,Pittsurgh, PA 526 {weijili,zhngyt}@s.pitt.edu Astrt DSP proessors
More informationThe dictionary model allows several consecutive symbols, called phrases
A dptive Huffmn nd rithmetic methods re universl in the sense tht the encoder cn dpt to the sttistics of the source. But, dpttion is computtionlly expensive, prticulrly when k-th order Mrkov pproximtion
More informationMath 227 Problem Set V Solutions. f ds =
Mth 7 Problem Set V Solutions If is urve with prmetriztion r(t), t b, then we define the line integrl f ds b f ( r(t) ) dr dt (t) dt. Evlute the line integrl f(x,y,z)ds for () f(x,y,z) xosz, the urve with
More informationDesign Space Exploration for Massively Parallel Processor Arrays
In Proeedings of the Sixth Interntionl Conferene on Prllel Computing Tehnologies (PCT-2001), Novosiirsk, Russi, Septemer 3-7, 2001. Volume 2127 of Leture Notes in Computer Siene (LNCS), pp. 51-65, Springer-Verlg,
More informationSection 10.4 Hyperbolas
66 Section 10.4 Hyperbols Objective : Definition of hyperbol & hyperbols centered t (0, 0). The third type of conic we will study is the hyperbol. It is defined in the sme mnner tht we defined the prbol
More informationCS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08
CS412/413 Introduction to Compilers Tim Teitelum Lecture 4: Lexicl Anlyzers 28 Jn 08 Outline DFA stte minimiztion Lexicl nlyzers Automting lexicl nlysis Jlex lexicl nlyzer genertor CS 412/413 Spring 2008
More informationFrom Dependencies to Evaluation Strategies
From Dependencies to Evlution Strtegies Possile strtegies: 1 let the user define the evlution order 2 utomtic strtegy sed on the dependencies: use locl dependencies to determine which ttriutes to compute
More informationCOMMON FRACTIONS. or a / b = a b. , a is called the numerator, and b is called the denominator.
COMMON FRACTIONS BASIC DEFINITIONS * A frtion is n inite ivision. or / * In the frtion is lle the numertor n is lle the enomintor. * The whole is seprte into "" equl prts n we re onsiering "" of those
More informationCICS Application Design
CICS Applition Design In orer to lern whih questions hve een nswere orretly: 1. Print these pges. 2. Answer the questions. 3. Sen this ssessment with the nswers vi:. FAX to (212) 967-3498. Or. Mil the
More informationB. Definition: The volume of a solid of known integrable cross-section area A(x) from x = a
Mth 176 Clculus Sec. 6.: Volume I. Volume By Slicing A. Introduction We will e trying to find the volume of solid shped using the sum of cross section res times width. We will e driving towrd developing
More informationCOMPUTER EDUCATION TECHNIQUES, INC. (WEBLOGIC_SVR_ADM ) SA:
In orer to lern whih questions hve een nswere orretly: 1. Print these pges. 2. Answer the questions. 3. Sen this ssessment with the nswers vi:. FAX to (212) 967-3498. Or. Mil the nswers to the following
More informationTransparent neutral-element elimination in MPI reduction operations
Trnsprent neutrl-element elimintion in MPI reduction opertions Jesper Lrsson Träff Deprtment of Scientific Computing University of Vienn Disclimer Exploiting repetition nd sprsity in input for reducing
More informationUnion-Find Problem. Using Arrays And Chains. A Set As A Tree. Result Of A Find Operation
Union-Find Problem Given set {,,, n} of n elements. Initilly ech element is in different set. ƒ {}, {},, {n} An intermixed sequence of union nd find opertions is performed. A union opertion combines two
More informationBefore We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):
Overview (): Before We Begin Administrtive detils Review some questions to consider Winter 2006 Imge Enhncement in the Sptil Domin: Bsics of Sptil Filtering, Smoothing Sptil Filters, Order Sttistics Filters
More informationNetwork Layer: Routing Classifications; Shortest Path Routing
igitl ommuniction in the Modern World : Routing lssifictions; Shortest Pth Routing s min prolem: To get efficiently from one point to the other in dynmic environment http://.cs.huji.c.il/~com com@cs.huji.c.il
More informationSystems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits
Systems I Logic Design I Topics Digitl logic Logic gtes Simple comintionl logic circuits Simple C sttement.. C = + ; Wht pieces of hrdwre do you think you might need? Storge - for vlues,, C Computtion
More information