35#include <boost/core/ignore_unused.hpp>
78 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
79 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
m_hcomm->GetSize();
86 : (global_rank_id - NumStrips);
150 boost::ignore_unused(HomoBasis0, HomoBasis1, HomoBasis2);
162 ASSERTL0(
false,
"Transposition is not set up for 3D.");
243 ASSERTL0(
false,
"Transposition not implemented yet.");
248 ASSERTL0(
false,
"Transposition not implemented yet.");
253 ASSERTL0(
false,
"Transposition not implemented yet.");
258 ASSERTL0(
false,
"Transposition type does not exist.");
281 int num_pencil_per_proc =
307 while (index < num_points_per_plane)
309 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
310 ? num_pencil_per_proc
311 : (num_points_per_plane - index);
316 &(inarray[index + (i * num_points_per_plane)]), 1,
317 &(outarray[cnt]), 1);
319 cnt += num_pencil_per_proc;
328 for (i = 0; i < packed_len; ++i)
331 &(tmp_outarray[i * num_pencil_per_proc]), 1,
332 &(outarray[i]), packed_len);
341 int i, pts_per_plane;
356 ASSERTL1(&inarray[0] != &outarray[0],
357 "Inarray and outarray cannot be the same");
359 for (i = 0; i < packed_len; ++i)
361 Vmath::Vcopy(pts_per_plane, &(inarray[i * pts_per_plane]), 1,
362 &(outarray[i]), packed_len);
385 int num_pencil_per_proc =
413 for (i = 0; i < packed_len; ++i)
415 Vmath::Vcopy(num_pencil_per_proc, &(inarray[i]), packed_len,
416 &(tmp_inarray[i * num_pencil_per_proc]), 1);
422 while (index < num_points_per_plane)
424 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
425 ? num_pencil_per_proc
426 : (num_points_per_plane - index);
431 &(outarray[index + (i * num_points_per_plane)]),
434 cnt += num_pencil_per_proc;
446 int i, pts_per_plane;
463 ASSERTL1(&inarray[0] != &outarray[0],
464 "Inarray and outarray cannot be the same");
466 for (i = 0; i < packed_len; ++i)
469 &(outarray[i * pts_per_plane]), 1);
484 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
485 "3D-Homo-2D approach.");
507 ASSERTL1(&inarray[0] != &outarray[0],
508 "Inarray and outarray cannot be the same");
510 for (i = 0; i < packed_len; ++i)
512 Vmath::Vcopy(pts_per_line, &(inarray[i * pts_per_line]), 1,
513 &(outarray[i]), packed_len);
528 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
529 "3D-Homo-2D approach.");
551 ASSERTL1(&inarray[0] != &outarray[0],
552 "Inarray and outarray cannot be the same");
554 for (i = 0; i < packed_len; ++i)
557 &(outarray[i * pts_per_line]), 1);
570 boost::ignore_unused(UseNumMode);
574 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
575 "3D-Homo-2D approach.");
582 int pts_per_line = s / n;
589 &(outarray[i * packed_len]), 1);
602 boost::ignore_unused(UseNumMode);
606 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
607 "3D-Homo-2D approach.");
614 int pts_per_line = s / n;
618 for (
int i = 0; i < packed_len; ++i)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
int GetNumPoints() const
Return points order at which basis is defined.
BasisType GetBasisType() const
Return type of expansion basis.
int GetNumModes() const
Returns the order of the basis.
void TransposeYZtoZY(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
unsigned int GetStripID(void)
int m_rank_id
Rank of process.
Array< OneD, unsigned int > GetKs(void)
unsigned int m_strip_ID
IDs of the strips on the processes.
Array< OneD, int > m_num_homogeneous_coeffs
Total number of homogeneous coefficients.
Array< OneD, unsigned int > GetPlanesIDs(void)
void TransposeYZtoX(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_OffsetMap
MPI_Alltoallv offset map of send/recv buffer in global vector.
void Transpose(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false, TranspositionDir dir=eNoTrans)
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm0, LibUtilities::CommSharedPtr hcomm1)
unsigned int GetPlaneID(int i)
void TransposeXtoYZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_num_processes
Array< OneD, int > m_num_points_per_proc
Number of homogeneous points on each processor per direction.
Array< OneD, int > m_SizeMap
MPI_Alltoallv map containing size of send/recv buffer.
Array< OneD, int > m_num_homogeneous_points
Total homogeneous points per direction.
int m_num_homogeneous_directions
Array< OneD, unsigned int > m_K
Fourier wave numbers associated with the planes.
Array< OneD, unsigned int > m_planes_IDs
IDs of the planes on the processes.
void TransposeZtoXY(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeXYtoZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeZYtoYZ(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eFourierSingleMode
Fourier ModifiedExpansion with just the first mode .
@ eFourierHalfModeIm
Fourier Modified expansions with just the imaginary part of the first mode .
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode .
@ eFourier
Fourier Expansion .
The above copyright notice and this permission notice shall be included.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)