35 #include <boost/core/ignore_unused.hpp> 47 namespace LibUtilities
65 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
66 m_num_processes[0] =
m_hcomm->GetSize();
80 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
81 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
m_hcomm->GetSize();
88 : (global_rank_id - NumStrips);
93 for (
int i = 0; i < m_num_points_per_proc[0]; i++)
128 m_num_homogeneous_points[0] = HomoBasis0.
GetNumPoints();
129 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
130 m_num_homogeneous_points[1] = HomoBasis1.
GetNumPoints();
131 m_num_homogeneous_coeffs[1] = HomoBasis1.
GetNumModes();
133 m_num_processes[0] =
m_hcomm->GetRowComm()->GetSize();
134 m_num_processes[1] =
m_hcomm->GetColumnComm()->GetSize();
152 boost::ignore_unused(HomoBasis0, HomoBasis1, HomoBasis2);
164 ASSERTL0(
false,
"Transposition is not set up for 3D.");
244 ASSERTL0(
false,
"Transposition not implemented yet.");
249 ASSERTL0(
false,
"Transposition not implemented yet.");
254 ASSERTL0(
false,
"Transposition not implemented yet.");
259 ASSERTL0(
false,
"Transposition type does not exist.");
279 int num_dofs = inarray.num_elements();
281 int num_pencil_per_proc =
288 for (i = 0; i < m_num_processes[0]; i++)
291 m_OffsetMap[i] = i * num_pencil_per_proc * m_num_points_per_proc[0];
303 packed_len = m_num_homogeneous_points[0];
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;
342 int n = inarray.num_elements();
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);
382 int num_dofs = outarray.num_elements();
384 int num_pencil_per_proc =
391 for (i = 0; i < m_num_processes[0]; i++)
394 m_OffsetMap[i] = i * num_pencil_per_proc * m_num_points_per_proc[0];
400 num_pencil_per_proc * m_num_homogeneous_points[0], 0.0);
408 packed_len = m_num_homogeneous_points[0];
412 for (i = 0; i < packed_len; ++i)
414 Vmath::Vcopy(num_pencil_per_proc, &(inarray[i]), packed_len,
415 &(tmp_inarray[i * num_pencil_per_proc]), 1);
421 while (index < num_points_per_plane)
423 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
424 ? num_pencil_per_proc
425 : (num_points_per_plane - index);
430 &(outarray[index + (i * num_points_per_plane)]),
433 cnt += num_pencil_per_proc;
445 int i, pts_per_plane;
446 int n = inarray.num_elements();
462 ASSERTL1(&inarray[0] != &outarray[0],
463 "Inarray and outarray cannot be the same");
465 for (i = 0; i < packed_len; ++i)
468 &(outarray[i * pts_per_plane]), 1);
482 ASSERTL0(
false,
"Parallel transposition not implemented yet for " 483 "3D-Homo-2D approach.");
488 int n = inarray.num_elements();
505 ASSERTL1(&inarray[0] != &outarray[0],
506 "Inarray and outarray cannot be the same");
508 for (i = 0; i < packed_len; ++i)
510 Vmath::Vcopy(pts_per_line, &(inarray[i * pts_per_line]), 1,
511 &(outarray[i]), packed_len);
525 ASSERTL0(
false,
"Parallel transposition not implemented yet for " 526 "3D-Homo-2D approach.");
531 int n = inarray.num_elements();
548 ASSERTL1(&inarray[0] != &outarray[0],
549 "Inarray and outarray cannot be the same");
551 for (i = 0; i < packed_len; ++i)
554 &(outarray[i * pts_per_line]), 1);
566 boost::ignore_unused(UseNumMode);
570 ASSERTL0(
false,
"Parallel transposition not implemented yet for " 571 "3D-Homo-2D approach.");
576 int s = inarray.num_elements();
578 int pts_per_line = s / n;
580 int packed_len = pts_per_line * m_num_homogeneous_points[1];
582 for (
int i = 0; i < m_num_homogeneous_points[0]; ++i)
584 Vmath::Vcopy(packed_len, &(inarray[i]), m_num_homogeneous_points[0],
585 &(outarray[i * packed_len]), 1);
597 boost::ignore_unused(UseNumMode);
601 ASSERTL0(
false,
"Parallel transposition not implemented yet for " 602 "3D-Homo-2D approach.");
607 int s = inarray.num_elements();
609 int pts_per_line = s / n;
611 int packed_len = pts_per_line * m_num_homogeneous_points[1];
613 for (
int i = 0; i < packed_len; ++i)
615 Vmath::Vcopy(m_num_homogeneous_points[0], &(inarray[i]), packed_len,
616 &(outarray[i * m_num_homogeneous_points[0]]), 1);
int GetNumPoints() const
Return points order at which basis is defined.
Array< OneD, int > m_num_homogeneous_points
Total homogeneous points per direction.
void TransposeZYtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
#define ASSERTL0(condition, msg)
Array< OneD, unsigned int > GetPlanesIDs(void)
int m_rank_id
Rank of process.
Array< OneD, int > m_num_points_per_proc
Number of homogeneous points on each processor per direction.
void TransposeXYtoZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeYZtoX(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Transposition(const LibUtilities::BasisKey &HomoBasis0, LibUtilities::CommSharedPtr hcomm0, LibUtilities::CommSharedPtr hcomm1)
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
BasisType GetBasisType() const
Return type of expansion basis.
void TransposeZtoXY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
void TransposeXtoYZ(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Array< OneD, int > m_num_processes
unsigned int GetStripID(void)
Array< OneD, unsigned int > m_planes_IDs
IDs of the planes on the processes.
void TransposeYZtoZY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
int GetNumModes() const
Returns the order of the basis.
Fourier Modified expansions with just the real part of the first mode .
unsigned int GetPlaneID(int i)
Array< OneD, int > m_SizeMap
MPI_Alltoallv map containing size of send/recv buffer.
int m_num_homogeneous_directions
unsigned int m_strip_ID
IDs of the strips on the processes.
Fourier Modified expansions with just the imaginary part of the first mode .
Array< OneD, unsigned int > m_K
Fourier wave numbers associated with the planes.
Fourier ModifiedExpansion with just the first mode .
void Transpose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false, TranspositionDir dir=eNoTrans)
Array< OneD, int > m_OffsetMap
MPI_Alltoallv offset map of send/recv buffer in global vector.
Array< OneD, unsigned int > GetKs(void)
Array< OneD, int > m_num_homogeneous_coeffs
Total number of homogeneous coefficients.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Describes the specification for a Basis.