From 2182bb0ece7af8487abbbe76e6c7ae05e10da997 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Sun, 9 Jan 2022 23:18:47 -0600 Subject: [PATCH] mpi: doxygen fixes --- src/mpi/examples/mpi-test-fixtures.h | 32 ++++++++++++++----- .../examples/simple-distributed-mpi-comm.cc | 10 ++++-- src/mpi/model/mpi-interface.h | 7 +++- src/mpi/test/mpi-test-suite.cc | 7 +++- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/mpi/examples/mpi-test-fixtures.h b/src/mpi/examples/mpi-test-fixtures.h index 14a63368d..345e17ff1 100644 --- a/src/mpi/examples/mpi-test-fixtures.h +++ b/src/mpi/examples/mpi-test-fixtures.h @@ -47,6 +47,8 @@ class Packet; /** + * \ingroup mpi + * * Write to std::cout only from rank 0. * Number line for sorting output of parallel runs. * @@ -64,6 +66,14 @@ class Packet; } \ while (false) +/** + * \ingroup mpi + * + * Append to std::cout only from rank 0. + * Number line for sorting output of parallel runs. + * + * \param x The output operators. + */ #define RANK0COUTAPPEND(x) \ do \ if (SinkTracer::GetWorldRank () == 0) \ @@ -72,13 +82,17 @@ class Packet; } \ while (false) +/** + * \ingroup mpi + * + * Collects data about incoming packets. + */ class SinkTracer { public: /** - * PacketSink receive trace callback. - * \copydetails ns3::Packet::TwoAddressTracedCallback + * PacketSink Init. */ static void Init (void); @@ -93,6 +107,8 @@ public: /** * Verify the sink trace count observed matches the expected count. * Prints message to std::cout indicating success or fail. + * + * \param expectedCount Expected number of packet received. */ static void Verify (unsigned long expectedCount); @@ -125,8 +141,8 @@ public: } /** - * Get current line count and increment. - * + * Get current line count and increment it. + * \return the line count. */ static int GetLineCount (void) { @@ -134,10 +150,10 @@ public: } private: - static unsigned long m_sinkCount; /*< Running sum of number of SinkTrace calls observed */ - static unsigned long m_line; /*< Current output line number for ordering output */ - static int m_worldRank; /*< MPI CommWorld rank */ - static int m_worldSize; /*< MPI CommWorld size */ + static unsigned long m_sinkCount; //!< Running sum of number of SinkTrace calls observed + static unsigned long m_line; //!< Current output line number for ordering output + static int m_worldRank; //!< MPI CommWorld rank + static int m_worldSize; //!< MPI CommWorld size }; } // namespace ns3 diff --git a/src/mpi/examples/simple-distributed-mpi-comm.cc b/src/mpi/examples/simple-distributed-mpi-comm.cc index 98c3afbc0..822fc0c9e 100644 --- a/src/mpi/examples/simple-distributed-mpi-comm.cc +++ b/src/mpi/examples/simple-distributed-mpi-comm.cc @@ -77,16 +77,20 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("SimpleDistributedMpiComm"); -// Tag for whether this rank should go into a new communicator -// ns-3 ranks will have color == 1. +/** + * Tag for whether this rank should go into a new communicator + * ns-3 ranks will have color == 1. + * @{ + */ const int NS_COLOR = 1; const int NOT_NS_COLOR = NS_COLOR + 1; +/** @} */ /** * Report my rank, in both MPI_COMM_WORLD and the split communicator. * * \param [in] color My role, either ns-3 rank or other rank. - * \param [in] spitComm The split communicator. + * \param [in] splitComm The split communicator. */ void ReportRank (int color, MPI_Comm splitComm) diff --git a/src/mpi/model/mpi-interface.h b/src/mpi/model/mpi-interface.h index 302255690..56536b21b 100644 --- a/src/mpi/model/mpi-interface.h +++ b/src/mpi/model/mpi-interface.h @@ -35,7 +35,12 @@ namespace ns3 { /** * \defgroup mpi MPI Distributed Simulation - * + */ + +/** + * \ingroup mpi + * \ingroup tests + * \defgroup mpi-tests MPI Distributed Simulation tests */ class ParallelCommunicationInterface; diff --git a/src/mpi/test/mpi-test-suite.cc b/src/mpi/test/mpi-test-suite.cc index 697efdd76..3db82a472 100644 --- a/src/mpi/test/mpi-test-suite.cc +++ b/src/mpi/test/mpi-test-suite.cc @@ -25,6 +25,8 @@ using namespace ns3; /** + * \ingroup mpi-tests + * * This version of ns3::ExampleTestCase is specialized for MPI * by accepting the number of ranks as a parameter, * then building a `--command-template` string which @@ -94,7 +96,10 @@ MpiTestCase::GetPostProcessingCommand (void) const return command; } -/** MPI specialization of ns3::ExampleTestSuite. */ +/** + * \ingroup mpi-tests + * MPI specialization of ns3::ExampleTestSuite. + */ class MpiTestSuite : public TestSuite { public: