SAUCE
Home
Events
Listing
Future
Previous
Accelerated Computing with GPUs 2020
Data Mining - Winter 20/21
High Performance Computing 2019
Einführung in die Bioinformatik WS19/20
Computational Logic
Parallel Algorithms and Architectures 2019
DSEA Praktikum 2018/19
Deep Learning 2018
High Performance Computing 2018
Parallel Algorithms and Architectures 2018
Datenstrukturen und effiziente Algorithmen Ws 18/19
EiP SoSe 18
bio-st-18
EiP WS 2017/18
High Performance Computing 2017
Datenstrukturen und effiziente Algorithmen WiSe 17/18
PS SS 2017
Einfuehrung in die Programmierung SS17
Parallel Algorithms and Architectures 2017
High Performance Computing 2016
DSEA 2016/17
EiP WS2016/17
Parallel Algorithms and Architectures 2016
PS SS 2016
Krypto SS 2016
EiP SS 2016
DSEA Praktikum WS 2015/16
DSEA WS 2015/16
News
Documentation
About
Changelog
Roadmap
Deutsche Dokumentation
Tips and Tricks
Test configuration
Language information
Contact
Login
High Performance Computing 2018
Sheet 3 (Stochastic PI, Shallow Deep Learning)
Pair Programming
Sheet 2 (AVX Shuffles, Instruction Parallelism)
Sheet 3 (Stochastic PI, Shallow Deep Learning)
Sheet 4 (Max-Pooling, Asynchronous 2D Jacobi Partitioning)
Sheet 5 (std::async, block-cyclic distribution)
Sheet 6 (Atomics, Knapsack)
Sheet 7 (Sorting, Riemann Zeta)
Sheet 8 (Data Dependencies, Task Parallelism)
Sheet 9 (Reverse-Engineering MPI, SUMMA)
Sheet 11 (Position Based Dynamics)
Sheet 12: Lockfree Hashmaps
Task 1 (Stochastic PI)
Task 1 (Stochastic PI)
Task 2 (Softmax Regression)
Task 1 (Stochastic PI)
Assignment
Scaffold Head
#include <iostream> #include <iomanip> #include <cstdint> #include <random> #include <mpi.h> constexpr double pi = 3.1415926535897932384626433832795028841971693993751058; double residue (const double& result) { return (result > pi ? result-pi : pi-result); } template <typename engine_t> double uniform_random(engine_t& engine) { std::uniform_real_distribution<double> dist(0.0, 1.0); return dist(engine); } int main (int argc, char * argv[]) { MPI::Init(argc , argv ); uint64_t num_samples=0; const uint64_t num_ranks = MPI::COMM_WORLD.Get_size(); const uint64_t rank = MPI::COMM_WORLD.Get_rank(); // actual value of num_samples only known to the root if (rank == 0) num_samples= 1UL<<24;
Scaffold Foot
if (rank == 0) { const double error = residue(result); std::cout << std::setprecision(16) << "# pi: " << result << " residue: " << error << "\nParallel programming is " << (error < 1E-3 ? "fun!" : "error-prone!") << std::endl; } MPI::Finalize(); }
Start time:
Mo 22 Okt 2018 10:51:00
End time:
Fr 01 Mär 2019 12:00:00
General test timeout:
10.0 seconds
Tests
Command line arguments
4
Comment prefix
#
Given input
Expected output
Parallel programming is fun!