{"id":52760,"date":"2021-09-22T22:15:31","date_gmt":"2021-09-22T22:15:31","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/09\/22\/sorting-and-threading-data-sets\/"},"modified":"2021-09-22T22:15:31","modified_gmt":"2021-09-22T22:15:31","slug":"sorting-and-threading-data-sets","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/09\/22\/sorting-and-threading-data-sets\/","title":{"rendered":"sorting and threading data sets"},"content":{"rendered":"<p>The data to be processed are \u201ctuples\u201d which are numbers and associated text strings, that is lines of CSV separated values, we wish to sort these. <br \/> 1. Get the data set on Canvas <br \/> 1a. Sort the data, that is each \u201crecord\u201d (line, tuple) in ascending order by numeric value <br \/> 2. Either: sort the data by hand (not a good idea), or write a two loop (bubble or insertion) sort program to sort the data. <br \/> (Do not use a \u201cbetter\u201d (faster) sorting method, the purpose is to use a \u201cslow\u201d sort method, but if you really want to, use much, much bigger data.) <br \/> 3. \u201cInstrument\u201d your program (time it). Do not include time to load data or output results. <br \/> 4. Create a program that will, in turn, run multiple processes \u201cconcurrently\u201d <br \/> (at the same time, employing all of your CPUs and CPU Cores, using \u201cfork( )\u201d and \u201cexec( )\u201d (there are several variants of exec (execl, execv, etc.) <br \/> Please do not use \u201cthreads\u201d (yet). <br \/> 5. Do the sort, again, in parallel for 2 concurrent processes, then 4, and finally 10 processes. <br \/> 6. Instrument those sorts (like above). <br \/> 7. How will you pass data (parts of the array) to each process (IPC)? (Files, pipes, shared memory, message queues?) <br \/> 8. You may (not required) to use a menu to select number of processes, size of data, etc. <br \/> Part 2: <br \/> Description: <br \/> You will create a process and threads, run in parallel, and pass information between threads. <br \/> You will use synchronization operations to avoid overwriting shared resources. <br \/> As in Assignment above: <br \/> 1. Use the same data set, as previous part of assignment 2. <br \/> 2. Sort, using the same methods from part 1, (write a two loop (bubble or insertion) sort program to sort the numbers in ascending order. <br \/> 3. \u201cInstrument\u201d your program (time it). <br \/> 4. Create a program that will, in turn, run multiple threads \u201cconcurrently\u201d using a kernel level threading system. <br \/> (there are several options: Pthreads, Java, C\/C ) <br \/> 5. Do the sort, again, in parallel for 2 concurrent threads, then 4, and 10 threads. <br \/> 6. Instrument those sorts (above). <br \/> 7. How will you pass data (parts of the array) to each thread? <br \/> (How will you synchronize sharing resources such as memory?) <br \/> 8. You may (not required) to use a menu to select number of threads, size of data, etc. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The data to be processed are \u201ctuples\u201d which are numbers and associated text strings, that is lines of CSV separated values, we wish to sort these. 1. Get the data set on Canvas 1a. Sort the data, that is each \u201crecord\u201d (line, tuple) in ascending order by numeric value 2. Either: sort the data by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-52760","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-programming"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/52760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=52760"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/52760\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=52760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=52760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=52760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}