Strumenti Utente

Strumenti Sito


Sort (with Cilk and C++ (11) Threads)


Write a program that

  • generates a vector with N items filled with random values
  • sorts the vector (in parallel)

Provide two versions of the program, one implemented using Cilk and one implemented using standard C++11 threads. You may consider using either merge or quick sort. Mergesort has a trivial divide phase and non trivial conquer phase. Quick sort is the other way round: non trivial divide and trivial conquer phases.


On local machines you'll mostly likely have available a GNU compiler. Cilk extensions are present since g++ version 4.9 (try g++ –version to check your version number).

If you can't manage to have a recent g++ version of the compiler on your machine, please use On the remote machine you may use icc with no specific flags to compile the Cilk code.

If you prefer using the local tools to edit:

  • use local tools to edit
  • from a shell rsync -avzur DirectoryWithCodeNoSlashAtEndOfTheName
  • then ssh
  • cd DirectoryWithCodeNoSlashAtEndOfTheName
  • icc -std=c++11 cilksourcefilename.cpp -o xxx
magistraleinformaticanetworking/spm/spm1617sort.txt · Ultima modifica: 09/11/2016 alle 15:22 (7 anni fa) da Marco Danelutto