A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism
Parallel programming is becoming more common in software development with the popularity of multi core processors on the rise. Today there are many people and institutes that develop parallel programming APIs for already existing programming languages. It is difficult for a new programmer to choose...
Main Authors: | , |
---|---|
Format: | Others |
Language: | English |
Published: |
KTH, Skolan för informations- och kommunikationsteknik (ICT)
2013
|
Online Access: | http://urn.kb.se/resolve?urn=urn:nbn:se:kth:diva-128606 |
id |
ndltd-UPSALLA1-oai-DiVA.org-kth-128606 |
---|---|
record_format |
oai_dc |
collection |
NDLTD |
language |
English |
format |
Others
|
sources |
NDLTD |
description |
Parallel programming is becoming more common in software development with the popularity of multi core processors on the rise. Today there are many people and institutes that develop parallel programming APIs for already existing programming languages. It is difficult for a new programmer to choose which programming language to parallel program in when each programming language has supporting APIs for parallel implementation. Comparisons between four popular programming languages with their respective most common parallel programming APIs were done in this study. The four programming languages were C with OpenMP, C++ with TBB, C# with TPL and Java with fork/join. The comparisons include overall speedup, execution time and granularity tests. The comparison is done by translating a chosen benchmark to other programming languages as similar as possible. The benchmark is then run and timed based on how long the execution time of the parallel regions. The number of threads are then increased and the execution time of the benchmark is observed. A second test is running the benchmark on different granularity sizes with the constant number of available threads, testing the behavior on how large or fine grained tasks each language can handle. Results show that the programming language C with OpenMP gave the fastest execution time while C++ gave the best overall speedup in relation to its sequential execution time. Java with fork/join was on par with C and C++ with a slight decay of overall speedup when the number of threads was increased and the granularity became too fine grained. Java could handle the granularity test better than C where it could handle very fine granularity without losing the overall speedup. C# with TPL performed the worst in all scenarios not excelling in any tests. === Med den ökande populariteten av flerkärniga lösningar har parallellprogrammering börjat bli ett mer vanligt tillvägagångssätt att programmera i mjukvaruutveckling. Idag är det många personer och institutioner som utvecklar parallellprogrammerings APIer för redan existerande programmeringsspråk. Det är svårt för en ny programmerare att välja ett programmeringsspråk att parallellprogrammera i när varje programmeringsspråk har stöttande APIer för parallel implementering. I denna studie har fyra populära programmeringsspråk jämförts med deras respektive mest vanliga parallellprogrammerings APIer. De fyra programmeringsspråken var C med OpenMP, C++ med TBB, C# med TPL och Java med fork/join. Jämförelserna innefattar den generella uppsnabbningen, exekveringstiden och kornigheten. Jämförelsen görs genom att översätta ett utvalt prestandatest till andra programmeringsspråk så lika varandra som möjligt. Prestandatestet körs sedan och tidtagning sker baserat på hur lång exekveringstiden av de parallella regionerna är. Sedan ökas antalet trådar och exekveringstiden av prestandatestet observeras. Ett andra test kör prestandatestet med olika storlek på kornigheten med ett konstant antal möjliga trådar och testar beteendet på hur stor eller liten kornighet på uppgifterna varje språk kan hantera. Resultaten visar att programmeringsspråket C med OpenMP hade den snabbaste exekveringstiden, medan C++ hade bäst generell uppsnabbning. Java med fork/join höll jämna steg med C och C++ med en lätt tillbakahållning av den generella uppsnabbningen när antalet trådar ökade och kornigheten minskade. Java hanterade kornigheten bättre än C där den kunde hantera väldigt liten kornighet utan att förlora den generella uppsnabbningen. C# med TPL hade sämst resultat i alla scenarion och framstod inte i något utav testerna. |
author |
Angelo Kaldéren, Göran Anton, From |
spellingShingle |
Angelo Kaldéren, Göran Anton, From A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
author_facet |
Angelo Kaldéren, Göran Anton, From |
author_sort |
Angelo Kaldéren, Göran |
title |
A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
title_short |
A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
title_full |
A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
title_fullStr |
A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
title_full_unstemmed |
A comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallism |
title_sort |
comparative analysis between parallel models in c/c++ and c#/java : a quantitative comparison between different programming models on how they implement parallism |
publisher |
KTH, Skolan för informations- och kommunikationsteknik (ICT) |
publishDate |
2013 |
url |
http://urn.kb.se/resolve?urn=urn:nbn:se:kth:diva-128606 |
work_keys_str_mv |
AT angelokalderengoran acomparativeanalysisbetweenparallelmodelsinccandcjavaaquantitativecomparisonbetweendifferentprogrammingmodelsonhowtheyimplementparallism AT antonfrom acomparativeanalysisbetweenparallelmodelsinccandcjavaaquantitativecomparisonbetweendifferentprogrammingmodelsonhowtheyimplementparallism AT angelokalderengoran enkomparativanalysmellanparallellamodellericcochjavac AT antonfrom enkomparativanalysmellanparallellamodellericcochjavac AT angelokalderengoran comparativeanalysisbetweenparallelmodelsinccandcjavaaquantitativecomparisonbetweendifferentprogrammingmodelsonhowtheyimplementparallism AT antonfrom comparativeanalysisbetweenparallelmodelsinccandcjavaaquantitativecomparisonbetweendifferentprogrammingmodelsonhowtheyimplementparallism |
_version_ |
1716597574791593984 |
spelling |
ndltd-UPSALLA1-oai-DiVA.org-kth-1286062013-09-17T04:30:56ZA comparative analysis between parallel models in C/C++ and C#/Java : A quantitative comparison between different programming models on how they implement parallismengEn komparativ analys mellan parallella modeller i C/C++ och Java/C#Angelo Kaldéren, GöranAnton, FromKTH, Skolan för informations- och kommunikationsteknik (ICT)KTH, Skolan för informations- och kommunikationsteknik (ICT)2013Parallel programming is becoming more common in software development with the popularity of multi core processors on the rise. Today there are many people and institutes that develop parallel programming APIs for already existing programming languages. It is difficult for a new programmer to choose which programming language to parallel program in when each programming language has supporting APIs for parallel implementation. Comparisons between four popular programming languages with their respective most common parallel programming APIs were done in this study. The four programming languages were C with OpenMP, C++ with TBB, C# with TPL and Java with fork/join. The comparisons include overall speedup, execution time and granularity tests. The comparison is done by translating a chosen benchmark to other programming languages as similar as possible. The benchmark is then run and timed based on how long the execution time of the parallel regions. The number of threads are then increased and the execution time of the benchmark is observed. A second test is running the benchmark on different granularity sizes with the constant number of available threads, testing the behavior on how large or fine grained tasks each language can handle. Results show that the programming language C with OpenMP gave the fastest execution time while C++ gave the best overall speedup in relation to its sequential execution time. Java with fork/join was on par with C and C++ with a slight decay of overall speedup when the number of threads was increased and the granularity became too fine grained. Java could handle the granularity test better than C where it could handle very fine granularity without losing the overall speedup. C# with TPL performed the worst in all scenarios not excelling in any tests. Med den ökande populariteten av flerkärniga lösningar har parallellprogrammering börjat bli ett mer vanligt tillvägagångssätt att programmera i mjukvaruutveckling. Idag är det många personer och institutioner som utvecklar parallellprogrammerings APIer för redan existerande programmeringsspråk. Det är svårt för en ny programmerare att välja ett programmeringsspråk att parallellprogrammera i när varje programmeringsspråk har stöttande APIer för parallel implementering. I denna studie har fyra populära programmeringsspråk jämförts med deras respektive mest vanliga parallellprogrammerings APIer. De fyra programmeringsspråken var C med OpenMP, C++ med TBB, C# med TPL och Java med fork/join. Jämförelserna innefattar den generella uppsnabbningen, exekveringstiden och kornigheten. Jämförelsen görs genom att översätta ett utvalt prestandatest till andra programmeringsspråk så lika varandra som möjligt. Prestandatestet körs sedan och tidtagning sker baserat på hur lång exekveringstiden av de parallella regionerna är. Sedan ökas antalet trådar och exekveringstiden av prestandatestet observeras. Ett andra test kör prestandatestet med olika storlek på kornigheten med ett konstant antal möjliga trådar och testar beteendet på hur stor eller liten kornighet på uppgifterna varje språk kan hantera. Resultaten visar att programmeringsspråket C med OpenMP hade den snabbaste exekveringstiden, medan C++ hade bäst generell uppsnabbning. Java med fork/join höll jämna steg med C och C++ med en lätt tillbakahållning av den generella uppsnabbningen när antalet trådar ökade och kornigheten minskade. Java hanterade kornigheten bättre än C där den kunde hantera väldigt liten kornighet utan att förlora den generella uppsnabbningen. C# med TPL hade sämst resultat i alla scenarion och framstod inte i något utav testerna. Student thesisinfo:eu-repo/semantics/bachelorThesistexthttp://urn.kb.se/resolve?urn=urn:nbn:se:kth:diva-128606Trita-ICT-EX ; 2013:157application/pdfinfo:eu-repo/semantics/openAccess |