@@ -284,11 +284,23 @@ class CGeometry {
284284 in point-to-point comms. */
285285 su2double* bufD_P2PRecv{nullptr }; /* !< \brief Data structure for su2double point-to-point receive. */
286286 su2double* bufD_P2PSend{nullptr }; /* !< \brief Data structure for su2double point-to-point send. */
287+ #ifdef CODI_REVERSE_TYPE
288+ passivedouble* bufPD_P2PRecv{nullptr }; /* !< \brief Data structure for passivedouble point-to-point receive. */
289+ passivedouble* bufPD_P2PSend{nullptr }; /* !< \brief Data structure for passivedouble point-to-point send. */
290+ #endif
291+ #ifdef USE_MIXED_PRECISION
292+ su2mixedfloat* bufF_P2PRecv{nullptr }; /* !< \brief Data structure for su2mixedfloat point-to-point receive. */
293+ su2mixedfloat* bufF_P2PSend{nullptr }; /* !< \brief Data structure for su2mixedfloat point-to-point send. */
294+ #endif
287295 unsigned short * bufS_P2PRecv{nullptr }; /* !< \brief Data structure for unsigned long point-to-point receive. */
288296 unsigned short * bufS_P2PSend{nullptr }; /* !< \brief Data structure for unsigned long point-to-point send. */
289297 SU2_MPI::Request* req_P2PSend{nullptr }; /* !< \brief Data structure for point-to-point send requests. */
290298 SU2_MPI::Request* req_P2PRecv{nullptr }; /* !< \brief Data structure for point-to-point recv requests. */
291299
300+ using PassiveRequest = typename SelectMPIWrapper<passivedouble>::W::Request;
301+ PassiveRequest* reqP_P2PSend{nullptr }; /* !< \brief Data structure for point-to-point send requests. */
302+ PassiveRequest* reqP_P2PRecv{nullptr }; /* !< \brief Data structure for point-to-point recv requests. */
303+
292304 /* --- Data structures for periodic communications. ---*/
293305
294306 int maxCountPerPeriodicPoint{0 }; /* !< \brief Maximum number of pieces of data sent per vertex in periodic comms. */
@@ -370,7 +382,7 @@ class CGeometry {
370382 * \param[in] countPerPoint - Number of variables per point.
371383 * \param[in] val_reverse - Boolean controlling forward or reverse communication between neighbors.
372384 */
373- void PostP2PRecvs (CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPoint,
385+ void PostP2PRecvs (CGeometry* geometry, const CConfig* config, COMM_TYPE commType, unsigned short countPerPoint,
374386 bool val_reverse) const ;
375387
376388 /* !
@@ -383,9 +395,98 @@ class CGeometry {
383395 * \param[in] val_iMessage - Index of the message in the order they are stored.
384396 * \param[in] val_reverse - Boolean controlling forward or reverse communication between neighbors.
385397 */
386- void PostP2PSends (CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPoint,
398+ void PostP2PSends (CGeometry* geometry, const CConfig* config, COMM_TYPE commType, unsigned short countPerPoint,
387399 int val_iMessage, bool val_reverse) const ;
388400
401+ /* !
402+ * \brief Returns the COMM_TYPE enum for a given data type.
403+ */
404+ template <class T >
405+ COMM_TYPE GetCommType () const {
406+ if constexpr (std::is_same_v<T, su2double>) {
407+ return COMM_TYPE::DOUBLE;
408+ } else if constexpr (std::is_same_v<T, passivedouble>) {
409+ return COMM_TYPE::PASSIVE_DOUBLE;
410+ } else if constexpr (std::is_same_v<T, su2mixedfloat>) {
411+ return COMM_TYPE::FLOAT;
412+ } else {
413+ static_assert (std::is_same_v<T, unsigned short >);
414+ return COMM_TYPE::UNSIGNED_SHORT;
415+ }
416+ }
417+
418+ /* !
419+ * \brief Returns the send buffer for a given data type.
420+ */
421+ template <class T >
422+ auto * GetP2PSendBuf () const {
423+ if constexpr (std::is_same_v<T, su2double>) {
424+ return bufD_P2PSend;
425+ #ifdef CODI_REVERSE_TYPE
426+ } else if constexpr (std::is_same_v<T, passivedouble>) {
427+ return bufPD_P2PSend;
428+ #endif
429+ #ifdef USE_MIXED_PRECISION
430+ } else if constexpr (std::is_same_v<T, su2mixedfloat>) {
431+ return bufF_P2PSend;
432+ #endif
433+ } else {
434+ static_assert (std::is_same_v<T, unsigned short >);
435+ return bufS_P2PSend;
436+ }
437+ }
438+
439+ /* !
440+ * \brief Returns the receive buffer for a given data type.
441+ */
442+ template <class T >
443+ auto * GetP2PRecvBuf () const {
444+ if constexpr (std::is_same_v<T, su2double>) {
445+ return bufD_P2PRecv;
446+ #ifdef CODI_REVERSE_TYPE
447+ } else if constexpr (std::is_same_v<T, passivedouble>) {
448+ return bufPD_P2PRecv;
449+ #endif
450+ #ifdef USE_MIXED_PRECISION
451+ } else if constexpr (std::is_same_v<T, su2mixedfloat>) {
452+ return bufF_P2PRecv;
453+ #endif
454+ } else {
455+ static_assert (std::is_same_v<T, unsigned short >);
456+ return bufS_P2PRecv;
457+ }
458+ }
459+
460+ /* !
461+ * \brief Returns the send requests for a given data type.
462+ */
463+ template <class T >
464+ auto * GetP2PSendReq () const {
465+ if constexpr (std::is_same_v<T, su2double>) {
466+ return req_P2PSend;
467+ } else if constexpr (std::is_same_v<T, passivedouble> || std::is_same_v<T, su2mixedfloat>) {
468+ return reqP_P2PSend;
469+ } else {
470+ static_assert (std::is_same_v<T, unsigned short >);
471+ return req_P2PSend;
472+ }
473+ }
474+
475+ /* !
476+ * \brief Returns the receive requests for a given data type.
477+ */
478+ template <class T >
479+ auto * GetP2PRecvReq () const {
480+ if constexpr (std::is_same_v<T, su2double>) {
481+ return req_P2PRecv;
482+ } else if constexpr (std::is_same_v<T, passivedouble> || std::is_same_v<T, su2mixedfloat>) {
483+ return reqP_P2PRecv;
484+ } else {
485+ static_assert (std::is_same_v<T, unsigned short >);
486+ return req_P2PRecv;
487+ }
488+ }
489+
389490 /* !
390491 * \brief Routine to set up persistent data structures for periodic communications.
391492 * \param[in] geometry - Geometrical definition of the problem.
@@ -408,7 +509,7 @@ class CGeometry {
408509 * \param[in] commType - Enumerated type for the quantity to be communicated.
409510 * \param[in] countPerPeriodicPoint - Number of variables per point.
410511 */
411- void PostPeriodicRecvs (CGeometry* geometry, const CConfig* config, unsigned short commType,
512+ void PostPeriodicRecvs (CGeometry* geometry, const CConfig* config, COMM_TYPE commType,
412513 unsigned short countPerPeriodicPoint);
413514
414515 /* !
@@ -420,7 +521,7 @@ class CGeometry {
420521 * \param[in] countPerPeriodicPoint - Number of variables per point.
421522 * \param[in] val_iMessage - Index of the message in the order they are stored.
422523 */
423- void PostPeriodicSends (CGeometry* geometry, const CConfig* config, unsigned short commType,
524+ void PostPeriodicSends (CGeometry* geometry, const CConfig* config, COMM_TYPE commType,
424525 unsigned short countPerPeriodicPoint, int val_iMessage) const ;
425526
426527 /* !
@@ -431,7 +532,7 @@ class CGeometry {
431532 * \param[out] MPI_TYPE - Enumerated type for the datatype of the quantity to be communicated.
432533 */
433534 void GetCommCountAndType (const CConfig* config, MPI_QUANTITIES commType, unsigned short & COUNT_PER_POINT,
434- unsigned short & MPI_TYPE) const ;
535+ COMM_TYPE & MPI_TYPE) const ;
435536
436537 /* !
437538 * \brief Routine to load a geometric quantity into the data structures for MPI point-to-point communication and to
0 commit comments