Skip to content

File mpitags.h

File List > code_source > templat > include > TempLat > parallel > mpi > mpitags.h

Go to the documentation of this file

#ifndef TEMPLAT_PARALLEL_MPI_MPITAGS_H
#define TEMPLAT_PARALLEL_MPI_MPITAGS_H

/* This file is part of TempLat, available at https://cosmolattice.github.io/templat .
   Copyright 2021-2026 The TempLat authors, see AUTHORS.md.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Wessel Valkenburg, Year: 2019

namespace TempLat
{
  /* we are going to abuse __LINE__ as an looper like value, simply so we get unique values for all tags. */
  namespace MPITags
  {
    static constexpr int waitInLine = __LINE__;
    static constexpr int remapPrepareTransose = __LINE__;
    static constexpr int remapAllToAll = __LINE__;
    static constexpr int gatherAsVector = __LINE__;
    static constexpr int rangeExchangeSend = __LINE__;
    static constexpr int dataShiftGhostCells = __LINE__;
    // Zero-byte synchronization tokens for the GPU P2P ghost exchange (replace shared-memory barriers
    // with pairwise neighbor handshakes). Distinct from dataShiftGhostCells so they never match data.
    static constexpr int ghostP2PPackToken = __LINE__;  // "my send buffer is packed, safe to read"
    static constexpr int ghostP2PReadToken = __LINE__;  // "I finished reading you, buffer safe to reuse"
    static constexpr int ghostP2PPhaseToken = __LINE__; // PCIe two-phase: "my phase-0 read on our link is done"
  }; // namespace MPITags

  class MPITagsJustCompile
  {
  public:
    // Put public methods here. These should change very little over time.
    MPITagsJustCompile() = default;

  private:
    /* Put all member variables and private methods here. These may change arbitrarily. */
  };
} // namespace TempLat

#endif