Arvutiteaduse instituut
  1. Kursused
  2. 2025/26 sügis
  3. Paralleelprogrammeerimise keeled (LTAT.06.022)
EN
Logi sisse

Paralleelprogrammeerimise keeled 2025/26 sügis

  • Pealeht
  • Loengud
  • Labs
  • Viited
  • Homework

1. Write a short C/C++ program that prints out the number of cores available.

2. Write a short C/C++ program that executes as many threads as there are cores and prints the thread number of each.

3. Write a short C/C++ program that executes 4 threads and prints the thread number of each.

4. Write a short C/C++ program that executes as many threads as there are cores and sums up the thread numbers plus 1 in a variable and prints that out.

5. Study the program "4-parallel for.txt". What is parallelized here? What would collapse do?

6. Study "5-critical,nowait,barrier.txt" and try out the different options. How are they different?

7. Write a program which initializes an array of size N (defined as variable in the program) to the numbers from 0 to N-1 and then calculate the sum of those numbers. Make the calculation parallel. Make sure there are no problems here with the parallel calculation.

8. Write a program where a number of threads increment a variable and then only the first thread prints out the result.

9. "8-locks.txt" demonstrated locks and compares them to critical.

10. Write an OpenPM program which guarantees that a statement is printed exactly four times.

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused