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];
|
size_t iglobal = i + offsets_[CONFIG::MPI_task_rank];
|
||||||
|
|
||||||
|
status.MPI_ERROR = MPI_SUCCESS;
|
||||||
|
|
||||||
int recvfrom = 0;
|
int recvfrom = 0;
|
||||||
if (iglobal < fny[0])
|
if (iglobal < fny[0])
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,8 +31,11 @@ void Grid_FFT<data_t>::FillRandomReal( unsigned long int seed )
|
||||||
template <typename data_t>
|
template <typename data_t>
|
||||||
void Grid_FFT<data_t>::Setup(void)
|
void Grid_FFT<data_t>::Setup(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined(USE_FFTW_THREADS)
|
||||||
if (CONFIG::FFTW_threads_ok)
|
if (CONFIG::FFTW_threads_ok)
|
||||||
fftw_plan_with_nthreads(std::thread::hardware_concurrency());
|
fftw_plan_with_nthreads(std::thread::hardware_concurrency());
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(USE_MPI) ////////////////////////////////////////////////////////////////////////////////////////////
|
#if !defined(USE_MPI) ////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -204,6 +207,9 @@ void Grid_FFT<data_t>::ApplyNorm(void)
|
||||||
template <typename data_t>
|
template <typename data_t>
|
||||||
void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
||||||
{
|
{
|
||||||
|
#if defined(USE_MPI)
|
||||||
|
MPI_Barrier( MPI_COMM_WORLD );
|
||||||
|
#endif
|
||||||
|
|
||||||
if (space_ != kspace_id)
|
if (space_ != kspace_id)
|
||||||
{
|
{
|
||||||
|
@ -212,8 +218,7 @@ void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
||||||
{
|
{
|
||||||
double wtime = get_wtime();
|
double wtime = get_wtime();
|
||||||
|
|
||||||
FFTW_API(execute)
|
FFTW_API(execute)(plan_);
|
||||||
(plan_);
|
|
||||||
this->ApplyNorm();
|
this->ApplyNorm();
|
||||||
|
|
||||||
wtime = get_wtime() - wtime;
|
wtime = get_wtime() - wtime;
|
||||||
|
@ -233,6 +238,10 @@ void Grid_FFT<data_t>::FourierTransformForward(bool do_transform)
|
||||||
template <typename data_t>
|
template <typename data_t>
|
||||||
void Grid_FFT<data_t>::FourierTransformBackward(bool do_transform)
|
void Grid_FFT<data_t>::FourierTransformBackward(bool do_transform)
|
||||||
{
|
{
|
||||||
|
#if defined(USE_MPI)
|
||||||
|
MPI_Barrier( MPI_COMM_WORLD );
|
||||||
|
#endif
|
||||||
|
|
||||||
if (space_ != rspace_id)
|
if (space_ != rspace_id)
|
||||||
{
|
{
|
||||||
//.............................
|
//.............................
|
||||||
|
@ -240,8 +249,7 @@ void Grid_FFT<data_t>::FourierTransformBackward(bool do_transform)
|
||||||
{
|
{
|
||||||
double wtime = get_wtime();
|
double wtime = get_wtime();
|
||||||
|
|
||||||
FFTW_API(execute)
|
FFTW_API(execute)(iplan_);
|
||||||
(iplan_);
|
|
||||||
this->ApplyNorm();
|
this->ApplyNorm();
|
||||||
|
|
||||||
wtime = get_wtime() - wtime;
|
wtime = get_wtime() - wtime;
|
||||||
|
|
|
@ -53,7 +53,7 @@ int main( int argc, char** argv )
|
||||||
|
|
||||||
#if defined(USE_MPI)
|
#if defined(USE_MPI)
|
||||||
fftw_mpi_init();
|
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
|
#else
|
||||||
csoca::ilog << "MPI is enabled : " << "no" << std::endl;
|
csoca::ilog << "MPI is enabled : " << "no" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue