Find Jobs
Hire Freelancers

I would like to hire a Greek Translator

€30-250 EUR

Cancelled
Posted over 7 years ago

€30-250 EUR

Paid on delivery
The problem concerns sorting a large array in-memory using concurrent threads. One approach is the following: (a) partition the array into N chunks of near-equal size, where N is a power of two. (b) in parallel, sort each chunk, using a standard sorting technique, e.g. insertion sort. (c) while there is more than one chunk, merge pairs of chunks in parallel. For example, suppose the original array contains 16 entries, and we want to use up to N=4 threads. Initial array: [8, 9, 2, 5, 11, 4, 19, 7, 13, 6, 16, 3, 19, 1, 10, 14] We subdivide the array into four (= 16/4) chunks; in practice this does not involve copying the array, but rather allocating a range of indices to each of four threads: Array chunks: [[8, 9, 2, 5], [11, 4, 19, 7], [13, 6, 16, 3], [19, 1, 10, 14]] Next, each thread sorts its chunk in-place. Sorted chunks: [[2, 5, 8, 9], [4, 7, 11, 19], [3, 6, 13, 16], [1, 10, 14, 19]] There are 4 > 1 chunks, so we perform a merge pass, using two threads to merge two pairs of adjacent chunks into larger ordered chunks: First merge pass: [[2, 4, 5, 7, 8, 9, 11, 19], [1, 3, 6, 10, 13, 14, 16, 19]] There are still 2 > 1 chunks, so we perform a further merge pass, now using a single thread to merge the remaining chunks: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 19] The original array is now sorted. To simplify the programming task, you can assume that the size of your input array and the number of threads are both powers of 2. You program should create an array dynamically (219 should be a decent size), populate the array with random values, and then sort it. For the “merge” phase, you will find it useful to create a second array, of the same size as the first, and store the merged chunks in the merge array. Then swap the merge array with the original array. Once sorting is complete, your program should check that the array is sorted within the main body (using a simple sequential scan), before reporting the result of the check on the terminal. The number of threads to use can be fixed as a constant in your program. I recommend running 8 threads as a starting point
Project ID: 11769609

About the project

3 proposals
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
3 freelancers are bidding on average €35 EUR for this job
User Avatar
Hello, I am a 5th semester IT student. I can translate that for you. I assume there is more than the description to translate. If not then it will cost only 10 EUR.
€44 EUR in 2 days
5.0 (3 reviews)
2.3
2.3
User Avatar
I am fully able to do the outlined task given in the project description.
€30 EUR in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
Leeds, United Kingdom
5.0
7
Payment method verified
Member since Oct 12, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.