mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
minor MPI fixes
This commit is contained in:
parent
9c0eac9e68
commit
6aa60ca218
3 changed files with 15 additions and 5 deletions
|
@ -475,6 +475,8 @@ private:
|
|||
{
|
||||
size_t iglobal = i + offsets_[CONFIG::MPI_task_rank];
|
||||
|
||||
status.MPI_ERROR = MPI_SUCCESS;
|
||||
|
||||
int recvfrom = 0;
|
||||
if (iglobal < fny[0])
|
||||
{
|
||||
|
|
|
@ -31,8 +31,11 @@ void Grid_FFT<data_t>::FillRandomReal( unsigned long int seed )
|
|||
template <typename data_t>
|
||||
void Grid_FFT<data_t>::Setup(void)
|
||||
{
|
||||
|
||||
#if defined(USE_FFTW_THREADS)
|
||||
if (CONFIG::FFTW_threads_ok)
|
||||
fftw_plan_with_nthreads(std::thread::hardware_concurrency());
|
||||
#endif
|
||||
|
||||
#if !defined(USE_MPI) ////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -204,6 +207,9 @@ void Grid_FFT<data_t>::ApplyNorm(void)
|
|||
template <typename data_t>
|
||||
void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
||||
{
|
||||
#if defined(USE_MPI)
|
||||
MPI_Barrier( MPI_COMM_WORLD );
|
||||
#endif
|
||||
|
||||
if (space_ != kspace_id)
|
||||
{
|
||||
|
@ -212,8 +218,7 @@ void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
|||
{
|
||||
double wtime = get_wtime();
|
||||
|
||||
FFTW_API(execute)
|
||||
(plan_);
|
||||
FFTW_API(execute)(plan_);
|
||||
this->ApplyNorm();
|
||||
|
||||
wtime = get_wtime() - wtime;
|
||||
|
@ -233,6 +238,10 @@ void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
|||
template <typename data_t>
|
||||
void Grid_FFT<data_t>::FourierTransformBackward(bool do_transform)
|
||||
{
|
||||
#if defined(USE_MPI)
|
||||
MPI_Barrier( MPI_COMM_WORLD );
|
||||
#endif
|
||||
|
||||
if (space_ != rspace_id)
|
||||
{
|
||||
//.............................
|
||||
|
@ -240,8 +249,7 @@ void Grid_FFT<data_t>::FourierTransformBackward(bool do_transform)
|
|||
{
|
||||
double wtime = get_wtime();
|
||||
|
||||
FFTW_API(execute)
|
||||
(iplan_);
|
||||
FFTW_API(execute)(iplan_);
|
||||
this->ApplyNorm();
|
||||
|
||||
wtime = get_wtime() - wtime;
|
||||
|
|
|
@ -53,7 +53,7 @@ int main( int argc, char** argv )
|
|||
|
||||
#if defined(USE_MPI)
|
||||
fftw_mpi_init();
|
||||
csoca::ilog << "MPI is enabled : " << "yes" << std::endl;
|
||||
csoca::ilog << "MPI is enabled : " << "yes (" << CONFIG::MPI_task_size << " tasks)" << std::endl;
|
||||
#else
|
||||
csoca::ilog << "MPI is enabled : " << "no" << std::endl;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue