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
Pair Programming
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
Lecture 11: Kepler Orbits
Lecture 3: AVX SOA normalization
Lecture 4: MPI PI
Lecture 5: Asynchronous 1D Jacobi Partitioning
Lecture 6: Thread distributions MVM
Lecture 7: Dynamic Schedule of All-Pairs distance computation
Lecture 8: 1NN classifier on MNIST data
Lecture 9: Backward Substitution
Lecture 10: Interleaved SUMMA
Lecture 11: Kepler Orbits
Lecture 12: Lockfree List using an Array
Lecture 12: Lockfree Hashmap
Lecture 11: Kepler Orbits
Assignment
Scaffold Head
#include <algorithm> #include <iostream> #include <fstream> #include <string> #include <vector> #include <cmath> #include <assert.h> #include <omp.h> #define X (0) #define Y (1) #define G (1E-3) #define NUM_TIME_STEPS (1L<<19) #define NUM_PARTICLES (10) #define NUM_THREADS (6) using namespace std; // this struct has no purpose except to make the code look like on the slides template <class T> struct pair_t { T x; T y; pair_t() : x(0), y(0) {} T& operator[](size_t index){ return index == 0 ? x : y;} const T& operator[](size_t index) const { return index == 0 ? x : y;} }; // this method is used to dump binaries, you do not need it template < typename index_t, typename value_t> void dump_binary( const value_t * data, const index_t length, std::string filename) { std::ofstream ofile(filename.c_str(), std::ios::binary); ofile.write((char*) data, sizeof(value_t)*length); ofile.close(); } // random string generator: // sponsored by stack overflow http://stackoverflow.com/questions/440133 string random_string(size_t length) { auto randchar = []() -> char { const char charset[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; return charset[ rand() % (sizeof(charset) - 1)]; }; srand(time(0)); string str(length, 0); generate_n(str.begin(), length, randchar); return str; } template <class T> void initial_conditions(vector<pair_t<T>>& positions, vector<pair_t<T>>& velocities, vector<T>& masses, T central_factor=1E3) { assert (positions.size() == velocities.size() && positions.size() == masses.size()); // initializes NUM_PARTICLES-1 planets around a massive center for (size_t q = 0; q < positions.size(); q++) { positions [q][X] = q*cos(q); positions [q][Y] = q*sin(q); velocities[q][X] = positions [q][Y]/std::max<T>(1, q*q); velocities[q][Y] = -positions [q][X]/std::max<T>(1, q*q); masses[q] = (q == 0) ? central_factor : static_cast<T>(1); } cout << "remove this if your plot looks reasonable" << endl; }
Scaffold Foot
int main () { vector<double> masses (NUM_PARTICLES); vector<pair_t<double>> positions (NUM_PARTICLES), velocities(NUM_PARTICLES); initial_conditions(positions, velocities, masses); auto prefix = integrate_system(positions, velocities, masses); // visualize the result string call = "python2 /home/sauce/kepler.py " +prefix+" "+to_string(NUM_TIME_STEPS)+" " +to_string(NUM_PARTICLES); if(system(call.c_str())) cout << "ERROR in visualize: Contact hundt@uni-mainz.de" << endl; cout << "ubi materia ibi geometria (Kepler)" << endl; }
Start time:
Mo 22 Okt 2018 10:51:00
End time:
Mo 01 Apr 2019 12:00:00
General test timeout:
10.0 seconds
Tests
Comment prefix
#
Given input
Expected output
ubi materia ibi geometria (Kepler)