46 namespace LibUtilities
64 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
65 m_num_processes[0] =
m_hcomm->GetSize();
79 int global_rank_id = hcomm0->GetColumnComm()->GetRank();
80 int NumStrips = hcomm0->GetColumnComm()->GetSize() /
m_hcomm->GetSize();
87 : (global_rank_id - NumStrips);
92 for (
int i = 0; i < m_num_points_per_proc[0]; i++)
127 m_num_homogeneous_points[0] = HomoBasis0.
GetNumPoints();
128 m_num_homogeneous_coeffs[0] = HomoBasis0.
GetNumModes();
129 m_num_homogeneous_points[1] = HomoBasis1.
GetNumPoints();
130 m_num_homogeneous_coeffs[1] = HomoBasis1.
GetNumModes();
132 m_num_processes[0] =
m_hcomm->GetRowComm()->GetSize();
133 m_num_processes[1] =
m_hcomm->GetColumnComm()->GetSize();
161 ASSERTL0(
false,
"Transposition is not set up for 3D.");
241 ASSERTL0(
false,
"Transposition not implemented yet.");
246 ASSERTL0(
false,
"Transposition not implemented yet.");
251 ASSERTL0(
false,
"Transposition not implemented yet.");
256 ASSERTL0(
false,
"Transposition type does not exist.");
276 int num_dofs = inarray.num_elements();
278 int num_pencil_per_proc =
285 for (i = 0; i < m_num_processes[0]; i++)
288 m_OffsetMap[i] = i * num_pencil_per_proc * m_num_points_per_proc[0];
300 packed_len = m_num_homogeneous_points[0];
304 while (index < num_points_per_plane)
306 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
307 ? num_pencil_per_proc
308 : (num_points_per_plane - index);
313 &(inarray[index + (i * num_points_per_plane)]), 1,
314 &(outarray[cnt]), 1);
316 cnt += num_pencil_per_proc;
325 for (i = 0; i < packed_len; ++i)
328 &(tmp_outarray[i * num_pencil_per_proc]), 1,
329 &(outarray[i]), packed_len);
338 int i, pts_per_plane;
339 int n = inarray.num_elements();
353 ASSERTL1(&inarray[0] != &outarray[0],
354 "Inarray and outarray cannot be the same");
356 for (i = 0; i < packed_len; ++i)
358 Vmath::Vcopy(pts_per_plane, &(inarray[i * pts_per_plane]), 1,
359 &(outarray[i]), packed_len);
379 int num_dofs = outarray.num_elements();
381 int num_pencil_per_proc =
388 for (i = 0; i < m_num_processes[0]; i++)
391 m_OffsetMap[i] = i * num_pencil_per_proc * m_num_points_per_proc[0];
397 num_pencil_per_proc * m_num_homogeneous_points[0], 0.0);
405 packed_len = m_num_homogeneous_points[0];
409 for (i = 0; i < packed_len; ++i)
411 Vmath::Vcopy(num_pencil_per_proc, &(inarray[i]), packed_len,
412 &(tmp_inarray[i * num_pencil_per_proc]), 1);
418 while (index < num_points_per_plane)
420 copy_len = num_pencil_per_proc < (num_points_per_plane - index)
421 ? num_pencil_per_proc
422 : (num_points_per_plane - index);
427 &(outarray[index + (i * num_points_per_plane)]),
430 cnt += num_pencil_per_proc;
442 int i, pts_per_plane;
443 int n = inarray.num_elements();
459 ASSERTL1(&inarray[0] != &outarray[0],
460 "Inarray and outarray cannot be the same");
462 for (i = 0; i < packed_len; ++i)
465 &(outarray[i * pts_per_plane]), 1);
479 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
480 "3D-Homo-2D approach.");
485 int n = inarray.num_elements();
502 ASSERTL1(&inarray[0] != &outarray[0],
503 "Inarray and outarray cannot be the same");
505 for (i = 0; i < packed_len; ++i)
507 Vmath::Vcopy(pts_per_line, &(inarray[i * pts_per_line]), 1,
508 &(outarray[i]), packed_len);
522 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
523 "3D-Homo-2D approach.");
528 int n = inarray.num_elements();
545 ASSERTL1(&inarray[0] != &outarray[0],
546 "Inarray and outarray cannot be the same");
548 for (i = 0; i < packed_len; ++i)
551 &(outarray[i * pts_per_line]), 1);
565 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
566 "3D-Homo-2D approach.");
571 int s = inarray.num_elements();
573 int pts_per_line = s / n;
575 int packed_len = pts_per_line * m_num_homogeneous_points[1];
577 for (
int i = 0; i < m_num_homogeneous_points[0]; ++i)
579 Vmath::Vcopy(packed_len, &(inarray[i]), m_num_homogeneous_points[0],
580 &(outarray[i * packed_len]), 1);
594 ASSERTL0(
false,
"Parallel transposition not implemented yet for "
595 "3D-Homo-2D approach.");
600 int s = inarray.num_elements();
602 int pts_per_line = s / n;
604 int packed_len = pts_per_line * m_num_homogeneous_points[1];
606 for (
int i = 0; i < packed_len; ++i)
608 Vmath::Vcopy(m_num_homogeneous_points[0], &(inarray[i]), packed_len,
609 &(outarray[i * m_num_homogeneous_points[0]]), 1);
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)
BasisType GetBasisType() const
Return type of expansion basis.
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)
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.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void TransposeYZtoZY(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool UseNumMode=false)
Fourier Modified expansions with just the real part of the first mode .
unsigned int GetPlaneID(int i)
int GetNumPoints() const
Return points order at which basis is defined.
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.
int GetNumModes() const
Returns the order of the basis.
#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.