PARALLEL PROGRAMMING IN THE SYSTEM OF COMPLEX ECO-ENERGY-ECONOMIC MONITORING

the of that of data and uses to of parallel processes:

Specialists by Igor Sikorsky Kyiv Polytechnic Institute are developing the system of complex eco-energy-economic monitoring (CEEEM) [1] that processes large amounts of data and uses parallel computing to optimize work. This project contains two kinds of parallel processes: threads and asynchronous instructions.
Threads are used for importing data from external files that have more than 1000 rows. In this case, multithreading is a powerful tool, but like all tools, it has its benefits and drawbacks [2].
Asynchronous instructions are used when it's necessary to load large amounts of information from different database tables in different components at the same time [3].
The use of such technologies of parallel programming significantly increases the performance of the system.
The purpose of this work is to study and select the best algorithms for working with parallel processes in the CEEEM system.
Multithreading is resource-intensive. Thread creation requires are take into consideration constraints and creation specifics, which is time and resourceconsuming. For example, when using a database you must provide a new connection for each thread instead of one.
Also, in some cases, multithreading runs much slower than iterative-style programming. The main is the processing data. If we have a small number of data then it's faster to process data by using simple for than creating threads that are resource-intensive.
In СEEEM system concurrency is used in the parser. The parser reads data from the file which is then passed to the other module that writes data line by line to the MySQL Server Database. If not implemented properly the program can run much slower than expected.
The first variant of implementation concurrency in the parser is used to speed up writing data to the database by separating data into a constant-sized thread pool with its connection to the database (figure 1).
The second variant is that for each thread a new connection to the database is created. But that can be a bad thing if using a large number of threads (figure 3).  Also, CEEEM has a large database that contains information about objects on the map and their characteristics because many different experts use it [1]. For example, the table of medical statistics has more than 60 000 records, tables that stored information about POI-objects and emissions in these points only Kyiv city and its region also has more than 60 000 records.
Information from this database must be loaded at the user's request and displayed when working with the map and information windows. For this task, СEEEM uses asynchronous instructions.
This technology is used so that in one window it is possible to execute several queries to the database without blocking the main thread of the user's work with the system.
For example, when a medical expert looks at the incidence statistics in a selected region, the data is loaded into the display window for about 1200 ms (the duration will depend on the set of parameters). During this time, the execution of any actions in the statistics viewing window is blocked. And the more complex queries and the more parameters involved, the longer the window will be frozen. Figure 5 shows the window of medical statistics when selecting diseases for malignant neoplasms (C00-C97) in the Kyiv region for 2019. Figure 6 shows how much time the program spends on fetching and loading data for display in tabular form. If the query to the database and the process of displaying data on the screen are asynchronous processes the query time remains the same, but the main thread is not blocked and there is no feeling of a screen lock. The more data is involved in the queries, the more relevant is the use of asynchronous processes.
Asynchrony is especially effective when you need to render large arrays of graphic objects. So, to display objects on the map, several asynchronous processes are used, which are responsible for fetching data from the database and drawing markers on the region map (figure 7).  Conclusions. The main aspect of CEEEM is working with large arrays of heterogeneous information. That's why they use of optimization technologies is very important. As the above study showed, the use of threads to import data and asynchronous blocks to load data from the database increased the performance of program blocks by 2 or more times.