From 6c5f0f77c7000cba9a017ac9bd1573c6b35f1d34 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 8 Nov 2019 17:16:51 +0100 Subject: [PATCH] Fixed last commit --- docs/vortraege/christian/colab19/tex/vortrag.tex | 4 ++-- src/mc_electron/simulation.cpp | 15 ++++++++++----- src/mc_electron/simulation.hpp | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/vortraege/christian/colab19/tex/vortrag.tex b/docs/vortraege/christian/colab19/tex/vortrag.tex index d1d38e0..576673e 100644 --- a/docs/vortraege/christian/colab19/tex/vortrag.tex +++ b/docs/vortraege/christian/colab19/tex/vortrag.tex @@ -55,8 +55,8 @@ % the presentation starts here -\title[KERL]{The KERL Code} -\subtitle{\textbf{KERL} - \textbf{K}atrin wgts \textbf{E}lectron and ion spect\textbf{R}um monte car\textbf{L}o simulation} +\title[KARL]{The KARL Code} +\subtitle{\textbf{KARL} - \textbf{KA}trin wgts elect\textbf{R}on and ion spectrum monte car\textbf{L}o simulation} \author{Christian Reiling} \institute{ETP} diff --git a/src/mc_electron/simulation.cpp b/src/mc_electron/simulation.cpp index 913211b..8e94463 100644 --- a/src/mc_electron/simulation.cpp +++ b/src/mc_electron/simulation.cpp @@ -39,6 +39,7 @@ void Simulation::init_pop_arrays() { // Init C-arrays used for MPI-Allgather com pop_species = new species[number_pop_species]; pop_array_lengths = new int[number_pop_species]; global_cum_time_s = new double *[number_pop_species]; + global_offset = new int *[number_pop_species]; Population_Base *population; @@ -50,8 +51,10 @@ void Simulation::init_pop_arrays() { // Init C-arrays used for MPI-Allgather com pop_array_lengths[i] = population->access_container()->data_size; global_cum_time_s[i] = new double[pop_array_lengths[i]]; + global_offset[i] = new int [pop_array_lengths[i]]; for (int j = 0; jfind(pop_species[i])->access_container(); @@ -206,9 +211,9 @@ void Simulation::sync_populations() { // Sync new densities for each species and continue; } global_delta_cumulated_time_s = new double[array_length]; - global_delta_offset = new double[array_length]; + global_delta_offset = new int[array_length]; local_delta_cumulated_time_s = new double[array_length]; - local_delta_offset = new double[array_length]; + local_delta_offset = new int[array_length]; for (int j = 0; jcum_times_s[j] - global_cum_time_s[i][j]; @@ -216,7 +221,7 @@ void Simulation::sync_populations() { // Sync new densities for each species and } MPI_Allreduce(local_delta_cumulated_time_s, global_delta_cumulated_time_s, array_length, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(local_delta_offset, global_delta_offset, array_length, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(local_delta_offset, global_delta_offset, array_length, MPI_INT, MPI_SUM, MPI_COMM_WORLD); for (int j = 0; j