aboutsummaryrefslogtreecommitdiff
MPI + CUDA, SLURM

MPI + CUDA, SLURM
Financial Transactions Dataset: Analytics

1. Task

Dataset: 💳 Financial Transactions Dataset: Analytics | Kaggle

These are computer translated notes, just read the report.

1.1. The general part

The general part of the wording is as follows. It is necessary to develop (and test) a parallel application using the capabilities of MPI and CUDA, optionally also OpenMP. Programming language: C and/or C++. The application should run as a task in the SLURM manager and use all possible computing resources (processors/cores/threads, CUDA accelerators) of those nodes on which the dispatcher sent the task to. It is necessary to prepare a report on the completion of the work. For the design and structure, it is necessary to use GOST 7.32.

1.2. Personal part

We filter the data, work only with credit_limit >= $12,000, group the data by city (merchant_city) and aggregate the amount spending (amount) of the client (client_id) by month (date), output to a file 100 clients with the highest expenses relative to per capita income per month (per_capita_income/12).

1.3. The algorithm

  1. Filtering load of cards_data.csv, where credit_limit >= $12,000
  2. Filtering load of transactions_data.csv, where card_id was uploaded in step 1
  3. Grouping data from transactions_data.csv by merchant_city
  4. For each client in the group, we sum amount by month in group.client.month.sum
  5. For each client and month in the group group.client.date.sum /= ~client.per_capita_income/12
  6. We sort the group's clients by group.client.sum.sum (it's enough to sort the top 100)
  7. We output the first 100 customers of the group (in the format merchant_city, client_id, group.client.date.sum)
    1. Optional filtering load of users_data.csv, where client_id ended up in the top 100 (to pretty print results and not just IDs).

That is, for each city we want to get the top 100 clients / month (for which and on which cards some nuances are applied).

1.4. On the supercomputer center

4 nodes, each with 2 cores. 2 of the 4 nodes have a GPU.

  1. 8 threads simultaneously load their part of cards_data.csv.
  2. 8 threads exchange loaded hash maps.
  3. 8 threads upload their part transactions_data.csv (SoA key value). Be careful, the loaded data will be split among all GPUs, transactions from the same month should not end up on multiple GPUs!
  4. For each main CPU thread on the GPU node: 3 other threads send loaded transactions to it. It starts on the GPU radix_sort_by_key, reduce (sum of grouped data).
  5. 8 threads simultaneously load their part of users_data.csv. (you can do it while we are working on the GPU)
  6. User data is sent to the GPU nodes. (you can do it while we are working on GPU)
  7. For each GPU node: 2 threads normalize the amounts received (using a hash map with user data).
  8. For each GPU node: 2 threads are searching for the top 100 in their part of the data (minheap AoS key value)
  9. For each GPU node: the top 100 threads are combined (minheap)
  10. The top 100 GPU nodes are combined. (minheap)

2. Documentation

The exported report can be found at this link.

3. Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to https://unlicense.org/

Date: 2025H2

Author: Martin Michalec

Created: 2026-11-10 Tue 11:28