# A Parallel Monte Carlo Algorithm for the Life Cycle Asset Allocation Problem
## 3 Results
### Parallel Monte Carlo  
In this study, we implemented a parallel Monte Carlo simulation to solve a Bellman equation, which is essential for decision-making under uncertainty in finance. We utilized the mpi4 py library to leverage the distributed computing capabilities of the high-performance computing (HPC) environment. Specifically, our experiments were conducted on a cluster with 256 AMD EPYC 7773X 64-Core Processors, Table 2 shows the server parameters used. To enhance the efficiency of our parallel algorithm, we adopted a hybrid memory approach that exploits both distributed and shared memory systems. The hybrid approach \begin{table}
\begin{tabular}{c c} \hline \hline
**Server** & **Parameters** \\ \hline Nodes & AMD EPYC 7773X 64-Core Processor \\ Operating & Centos7.6 \\ MPI & hpcx-2.4.1 \\ Network & HDR Infiniband (200 Gb) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Server Parameters. Figure 4: Pension wealth. Figure 3: Optimal consumption. allowed us to minimize the communication overhead between processes by effectively managing the data locality, thus reducing the time spent in data exchange and synchronization across the processors. Additionally, we optimized memory access patterns by aligning the data structures with the cache line, leading to a reduction in cache misses and improved data throughput. By carefully orchestrating the computational load and communication among the processors, we achieved a significant reduction in the overall runtime, demonstrating the scalability of our simulation across multiple nodes. The optimization measures were specifically tailored to the computational characteristics of Monte Carlo methods, where the primary focus was on load balancing and reducing the random memory access patterns that could lead to bottlenecks in a high-performance computing setup. The randomness inherent in the Monte Carlo simulation often results in non-uniform memory access patterns. To address this, we implemented an intelligent scheduling system that dynamically adjusts the allocation of tasks based on the current load of each processor, thus ensuring that no single processor becomes a point of contention, leading to a more efficient parallel execution. Our implementation demonstrates the utility of parallel optimization techniques such as reducing communication costs through intelligent data distribution, optimizing memory access, and implementing dynamic load balancing. These optimizations are crucial for simulations that require a substantial number of iterations to obtain high-precision results, as is the case with the evaluation of the expected utility in asset allocation strategies. Table 3 shows a time comparison between the value iteration method and our proposed method after parallelization versus serialization. The value iteration method shares the same parameters as the model. The value iteration method was conducted on a discretized grid of state variable, pension wealth, and it employed a backward induction approach to solve for value functions and policies. The Gauss-Hermite quadrature method with nine nodes was used to capture the stochastic shock dynamics influencing equity returns and income growth. To further refine the accuracy, the variable space was represented by 30 grid points for pension wealth, 10 grid points for labor income, and 20 points each for consumption and asset allocation. Initialization Stage: At age 120, we define the terminal value function \(V[T]\). At this terminal age, the initial terminal utility \(U_{T}\) is calculated based on the given pension wealth and possible consumption levels. The maximum possible consumption \(C\) is equal to the total pension wealth \(W\), and this value is chosen to initialize the terminal utility. Dynamic Programming and Backward Induction: We iterate backward from age 119 to age 20 to compute the optimal value function and corresponding decisions at each age.