# Code Repository for: “Large-scale stochastic propagation method beyond the sequential approach”

This repository provides the **customized C++ implementation of the TBPLaS (Tight-Binding Package for Large-scale Simulation)** used to generate all numerical results reported in the manuscript.

This snapshot contains the **modified source code, auxiliary routines, and example input files** required to reproduce the simulations described in the paper.
 It corresponds to the exact version of the code employed during the preparation of the manuscript.

The new features and methodological improvements introduced in this work are planned to be **integrated into a future official release of the TBPLaS package**, following further testing and validation within the main TBPLaS development branch.

---



## 1. Prerequisites 

* **Compiler:** A C++ compiler supporting C++17. The results in the manuscript were produced using **Intel oneAPI 2023.1.0**. 

*  **Build System:** **CMake >= 3.27.4** is required. 

*  **Operating System:** Tested on Linux. 



## 2. How to Run Examples

The `ref/` directory contains several subfolders. **Each subfolder corresponds to a specific set of results in the manuscript.** Each subfolder is a self-contained case, including the specific C++ source files and build configurations required for that test. We will use `ref/block_size_60` as an example.

### Step 1: Copy Case Folder 

Copy the entire case subfolder from `ref/` to the project's **root directory**.

```bash
# Example, assuming you are in the root directory:
cp -r ref/block_size_60 .
```

### Step 2: Replace Source Code

Copy the C++ source files from the *new* case folder (e.g., `block_size_60/`) and **overwrite** the corresponding base files in the `samples/speedtest/` directory.

```bash
# Example, assuming you are in the root directory:
# This step ensures the compiler finds the correct source
cp block_size_60/*.cpp samples/speedtest/
```

### Step 3: Configure and Compile

Navigate into the case folder you just copied. This will be your working directory for compilation and execution. And run the provided build script from inside the case folder. This will configure CMake and build the executable.

```bash
# Example, assuming you are in the root directory:
cd block_size_60

# You are now inside the 'block_size_60' directory
bash icc_release.sh
make
```


### Step 4: Execute
Run the corresponding script, which is also located in this directory.

```bash
# You are still inside the 'block_size_60' directory
bash run_dp.sh
```

The script will generate raw data files inside this directory. You can compare this output against the reference data provided within the same folder.


> To run other cases: Repeat this process. Copy the desired folder (e.g., ref/ne_120) to the root, replace the source files, cd into the new folder, compile, and run.
