Skip to content

Commit ede0f2d

Browse files
authored
Merge branch 'main' into develop
2 parents 3642a4d + d1c9179 commit ede0f2d

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

README.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
###########
1+
#############
22
Tsunami Lab
3-
###########
3+
#############
44

5-
This project was created as part of the Tsunami course in the winter semester 2023/24 at FSU Jena.
6-
The lectures content was implemented by `Luca-Philipp Grumbach <https://github.com/xLPMG>`_ and `Richard Hofmann <https://github.com/ZeyxRew>`_ as weekly homework / exam assignments.
5+
The `tsunami lab <https://scalable.uni-jena.de/opt/tsunami/>`_ is a course taught at the `University of Jena <https://www.uni-jena.de/en/universityofjena>`_ as
6+
the practical lab for the lecture on parallel computing.
7+
The goal is to write a C++ tsunami `wave equation <https://en.wikipedia.org/wiki/Wave_equation>`_ `solver <https://www.clawpack.org/riemann_book/html/Index.html>`_, optimize and parallelize it and run tsunami simulations on an `HPC cluster <https://wiki.uni-jena.de/pages/viewpage.action?pageId=22453005>`_.
78

8-
Further information is available from: https://scalable.uni-jena.de/opt/tsunami/
9+
During the class, we received weekly assignments which make up the final grade. Our (`Luca-Philipp Grumbach <https://github.com/xLPMG>`_ and `Richard Hofmann <https://github.com/ZeyxRew>`_)
10+
implementations of the given weekly tasks are what make up this repository - a fully functional 2D wave equation solver for Linux and MacOS.
911

1012
The documentation can be found here: https://xlpmg.github.io/tsunami_lab/index.html
1113

12-
.. image:: docs/source/_static/assets/tohoku_example.png
13-
:alt: Bathymetry of chile
14+
.. figure:: docs/source/_static/assets/tohoku_example.png
15+
16+
Visualization of an OpenMP-parallelized tsunami simulation of the March 11, 2011 M 9.1 Tohoku event.
1417

1518

docs/source/files/assignments/project.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
In the project phase we decided to implement a user-friendly graphical user interface. The aim was to make the usage of our Tsunami solver
66
as easy and interactive as possible.
77

8+
All authors contributed in equal parts.
9+
810
*********************
911
Preface
1012
*********************
@@ -76,7 +78,7 @@ In the last window, data files can be selected and then sent to the server. Rece
7678
Server-side
7779
*********************
7880

79-
The first thing we did was to modularize our main ``tsunami_lab`` program.
81+
The first task we had to tackle was to modularize our main ``tsunami_lab`` program.
8082

8183
The original ``main.cpp`` had one main function that executed the whole program loop.
8284
The code was moved to ``Simulator.cpp`` and we now have separate functions for the different parts of the program, such as ``prepareForCalculation()`` and ``runCalculation()``.
@@ -102,7 +104,7 @@ Linux
102104

103105
``getCPUUsage()`` reads from ``/proc/stat`` and calculates the CPU usage based on the values in that file.
104106
It provides us with info for each core on how much time it spent in different states (user, system, idle, etc.).
105-
The time is measures in jiffies, which are typically 1/100th of a second.
107+
The time is measured in jiffies, which are typically 1/100th of a second.
106108
The server reads this file every 10 milliseconds and calculates the CPU usage based on the difference between the current and the last read.
107109

108110
``getRAMUsage()`` makes use of the ``sysinfo.h`` linux header file. It would've been possible to read from ``/proc/meminfo`` however we would have needed to parse the file and collect the correct value ourselves.
@@ -217,5 +219,4 @@ Communicator API
217219
Since all communication happens using text over TCP, we had to implement a structure that both server and client can adhere to
218220
in order to guarantee correct communication. For this, we decided to send all data in JSON format and a ``Message`` struct.
219221

220-
221-
.. note:: For further information, see :ref:`ns-lib`
222+
.. note:: For further information, see :ref:`ns-lib`

src/Server.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@
88
#include <atomic>
99
using json = nlohmann::json;
1010

11-
//! port for the server
11+
//! Port for the server
1212
int m_PORT = 8080;
13-
//! exit flag
13+
//! Exit flag
1414
bool m_EXIT = false;
15-
//! simulator object pointer
15+
//! Simulator object pointer
1616
tsunami_lab::Simulator *simulator = nullptr;
17-
//! thread object while will be used to run simulation tasks
17+
//! Thread object which will be used to run simulation tasks
1818
std::thread m_simulationThread;
19-
//! thread object which will be used to update system info
19+
//! Thread object which will be used to update system info
2020
std::thread m_updateThread;
21-
//! flag to stop updating
21+
//! Flag to stop updating
2222
std::atomic<bool> m_stopUpdating = false;
23-
//! flag to check if simulation is running
23+
//! Flag to check if simulation is running
2424
bool m_isSimulationRunning = false;
2525

26-
//! last update time point
26+
//! Last update time point
2727
std::chrono::time_point m_lastDataUpdate = std::chrono::high_resolution_clock::now();
28-
//! data update frequency in ms
28+
//! Lata update frequency in ms
2929
int m_dataUpdateFrequency = 10;
3030

31-
//! system info object
31+
//! System info object
3232
tsunami_lab::systeminfo::SystemInfo l_systemInfo;
33-
//! amount of used RAM
33+
//! Amount of used RAM
3434
double l_usedRAM = 0;
35-
//! total amount of RAM
35+
//! Total amount of RAM
3636
double l_totalRAM = 0;
3737
//! CPU usage vector
3838
std::vector<float> l_cpuUsage;
@@ -578,4 +578,4 @@ int main(int i_argc, char *i_argv[])
578578

579579
delete simulator;
580580
return exitCode;
581-
}
581+
}

0 commit comments

Comments
 (0)