Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions source/source_base/parallel_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ void Parallel_Grid::init_parallel(const int nprocgroup)
this->whichpro_loc[ip].assign(this->ncz, 0);
}

this->z_distribution();
this->z_distribution(GlobalV::KPAR);

}
#endif
void Parallel_Grid::init(const int& ncx_in,
Expand All @@ -107,18 +108,18 @@ void Parallel_Grid::init(const int& ncx_in,
const int nprocgroup)
{
this->init_serial(ncx_in, ncy_in, ncz_in, nczp_in, nrxx_in, nbz_in, bz_in);

#ifdef __MPI
this->init_parallel(nprocgroup);
#endif
}
void Parallel_Grid::z_distribution()
void Parallel_Grid::z_distribution(const int kpar)
{
assert(!this->numz.empty());

std::vector<int> startp(GlobalV::KPAR);
assert(kpar > 0);

std::vector<int> startp(kpar);
startp[0] = 0;
for (int ip = 0; ip < GlobalV::KPAR; ip++)
for (int ip = 0; ip < kpar; ip++)
{
const int nproc = nproc_in_pool[ip];

Expand Down
2 changes: 1 addition & 1 deletion source/source_base/parallel_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Parallel_Grid

private:

void z_distribution(void);
void z_distribution(const int kpar);

void init_serial(const int& ncx_in,
const int& ncy_in,
Expand Down
Loading