30.07.2015 Views

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Actas</strong> XXII Jornadas <strong>de</strong> Paralelismo (<strong>JP2011</strong>) , <strong>La</strong> <strong>La</strong>guna, Tenerife, 7-9 septiembre 2011(Fig. 1.4B). Biblio-MetReS implements parsers forHTM, PDF and ASCII documents.Each no<strong>de</strong> or vertex in the graphs is a gene/proteinand each edge refers to an instance of co-occurrencebetween different genes in sentences, paragraphs, ordocuments. The thickness of the edge is proportional tothe mutual information between two genes and the colorof the edge is proportional to a p-value that measureshow much more enriched is the co-occurrence betweentwo genes in sentences or paragraphs with respect todocuments. See [14] for more <strong>de</strong>tails.The whole process <strong>de</strong>scribed above is done on the fly.The serial time in executing all the Biblio-MetReSprocesses can be very high, and it would strongly benefitfrom parallelization.III. P-BIBLIO-METRESIn this section we <strong>de</strong>scribe the main <strong>de</strong>cisions taken inthe <strong>de</strong>sign of the parallel version of Biblio-MetReS, P-Biblio-MetReS.As was pointed out in the Introduction, there areseveral forms of parallel computing: bit-level,instruction level, data, and functional parallelism.Biblio-MetReS is written in a high-level language, Java.Parallelization in the bit or instruction level will bealmost impossible. Instead, parallelism was performedin an upper level, at the Java co<strong>de</strong>.As P-Bilbio-MetReS is <strong>de</strong>signed to be executed on amultithreading machine, the following aspects must betaken into account:• We cannot assume that any running thread has thehighest priority. A higher-priority thread may berunning on a different processor.• We cannot assume that a low-priority thread willnot run. There may be enough processors to give ita chance at execution.• We cannot assume that threads of differentpriorities will not be running at the same time.• We cannot assume that a given race conditions canbe ignored, just because it is unlikely to occur. Raceconditions in a multiprocessor system present a realproblem, whereas race conditions in a singleprocessorsystem are more <strong>de</strong>pen<strong>de</strong>nt on thescheduling engine of the Java virtual machine.Taking these issues into account, the key question ofthe parallelization problem at hand is a) thei<strong>de</strong>ntification of the Java co<strong>de</strong> to be executed in paralleland b) implementing this co<strong>de</strong> in one class (or object)that can be run in multiple threads. Multiple threads arecreated, one for each copy of the object, and then theyare executed in parallel. As all the threads are executedin the same machine, our parallel implementationrequires <strong>de</strong>fining an optimal multithreading policy.Without re<strong>de</strong>signing a program, the parts of the co<strong>de</strong>whose execution is most likely to benefit fromparallelization are those where the application is CPUbound - that is, the sets of instructions where theprogram is mainly using processing cycles, and at thesame time E/S resources (network and secondarystorage) are idle -.We discard the parallelization of E/S parts of co<strong>de</strong>because Biblio-MetReS does not <strong>de</strong>al with an amount ofinformation that makes it necessary to increase the speedof access to the secondary storage. If we would want toincrease the network bandwidth, P-Biblio-MetReS couldalso be simultaneously executed in different machines,each with an individual IP. Distributed environments(for example Grid, Volunteer, Cloud or P2P computing)could be consi<strong>de</strong>red for such an execution.Thus, first and foremost, we are interested in<strong>de</strong>termining the CPU bound objects in Biblio-MetReS.By taking into account the class architecture of Biblio-MetReS (see Fig. 2), we i<strong>de</strong>ntified the objects where a)documents are obtained from different data sources, andb) the parsing of those documents is ma<strong>de</strong> as thosewhere the application is CPU-boun<strong>de</strong>d. These objectsare thus the natural candidates to be executedconcurrently in multiple threads.Fig. 2. Class diagram representing relationships betweenclasses used in the parallelization.Second, we must also consi<strong>de</strong>r that there is no reasonto execute the serial program ‘Biblio-MetReS’ CPUboundobjects in parallel if, during its run, the programdoes not use 100% of the available single physicalthreads. We should control for this possibility whenchoosing a parallelization policy to execute P-Biblio-MetReS.Third, we are interested in getting the appropriatenumber of threads to be created and executed in parallel,so that an optimal run time is obtained. More precisely,we are interested in un<strong>de</strong>rstanding the relationshipbetween the available processing power (the number ofhardware threads) and the number of logical threads wecan create at once in or<strong>de</strong>r to i<strong>de</strong>ntify the ratio R optimalbetween the two quantities that optimizes execution timeof the program. I<strong>de</strong>ntifying this ratio will allow us tocreate an application that scales well.Because there is, to our knowledge, no systematicmethod to i<strong>de</strong>ntify R optimal , we test three heuristicpolicies to <strong>de</strong>termine which of these gives the bestperformance:1. The first method (S1) consists in creating a threadfor every search engine. Each thread handles thelinks returned by the search engine. Then, it parsesthe returned documents. The various threads are<strong>JP2011</strong>-59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!