35 #include <boost/core/ignore_unused.hpp>
47 namespace LibUtilities
80 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
81 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
m_hcomm->GetSize();
88 : (global_rank_id - NumStrips);
152 boost::ignore_unused(HomoBasis0, HomoBasis1, HomoBasis2);
164 ASSERTL0(
false,
"Transposition is not set up for 3D.");
245 ASSERTL0(
false,
"Transposition not implemented yet.");
250 ASSERTL0(
false,
"Transposition not implemented yet.");
255 ASSERTL0(
false,
"Transposition not implemented yet.");
260 ASSERTL0(
false,
"Transposition type does not exist.");
283 int num_pencil_per_proc =
309 while (index < num_points_per_plane)
311 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
312 ? num_pencil_per_proc
313 : (num_points_per_plane - index);
318 &(inarray[index + (i * num_points_per_plane)]), 1,
319 &(outarray[cnt]), 1);
321 cnt += num_pencil_per_proc;
330 for (i = 0; i < packed_len; ++i)
333 &(tmp_outarray[i * num_pencil_per_proc]), 1,
334 &(outarray[i]), packed_len);
343 int i, pts_per_plane;
358 ASSERTL1(&inarray[0] != &outarray[0],
359 "Inarray and outarray cannot be the same");
361 for (i = 0; i < packed_len; ++i)
363 Vmath::Vcopy(pts_per_plane, &(inarray[i * pts_per_plane]), 1,
364 &(outarray[i]), packed_len);
387 int num_pencil_per_proc =
415 for (i = 0; i < packed_len; ++i)
417 Vmath::Vcopy(num_pencil_per_proc, &(inarray[i]), packed_len,
418 &(tmp_inarray[i * num_pencil_per_proc]), 1);
424 while (index < num_points_per_plane)
426 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
427 ? num_pencil_per_proc
428 : (num_points_per_plane - index);
433 &(outarray[index + (i * num_points_per_plane)]),
436 cnt += num_pencil_per_proc;
448 int i, pts_per_plane;
465 ASSERTL1(&inarray[0] != &outarray[0],
466 "Inarray and outarray cannot be the same");
468 for (i = 0; i < packed_len; ++i)
471 &(outarray[i * pts_per_plane]), 1);
486 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
487 "3D-Homo-2D approach.");
509 ASSERTL1(&inarray[0] != &outarray[0],
510 "Inarray and outarray cannot be the same");
512 for (i = 0; i < packed_len; ++i)
514 Vmath::Vcopy(pts_per_line, &(inarray[i * pts_per_line]), 1,
515 &(outarray[i]), packed_len);
530 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
531 "3D-Homo-2D approach.");
553 ASSERTL1(&inarray[0] != &outarray[0],
554 "Inarray and outarray cannot be the same");
556 for (i = 0; i < packed_len; ++i)
559 &(outarray[i * pts_per_line]), 1);
572 boost::ignore_unused(UseNumMode);
576 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
577 "3D-Homo-2D approach.");
584 int pts_per_line = s / n;
591 &(outarray[i * packed_len]), 1);
604 boost::ignore_unused(UseNumMode);
608 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
609 "3D-Homo-2D approach.");
616 int pts_per_line = s / n;
620 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)