OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright 2013. Lawrence Livermore National Security, LLC. |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Steven Smith <smith84@llnl.gov> |
| 19 * |
| 20 */ |
| 21 |
| 22 #ifndef NS3_PARALLEL_COMMUNICATION_INTERFACE_H |
| 23 #define NS3_PARALLEL_COMMUNICATION_INTERFACE_H |
| 24 |
| 25 #include <stdint.h> |
| 26 #include <list> |
| 27 |
| 28 #include <ns3/object.h> |
| 29 #include <ns3/nstime.h> |
| 30 #include <ns3/buffer.h> |
| 31 #include <ns3/packet.h> |
| 32 |
| 33 #if defined(NS3_MPI) |
| 34 #include "mpi.h" |
| 35 #endif |
| 36 |
| 37 namespace ns3 { |
| 38 |
| 39 /** |
| 40 * \ingroup mpi |
| 41 * |
| 42 * \brief Pure virtual base class for the interface between ns-3 and |
| 43 * the parallel communication layer being used. |
| 44 * |
| 45 * Each type of parallel communication layer is required to implement |
| 46 * this interface. This interface is called through the |
| 47 * MpiInterface. |
| 48 */ |
| 49 class ParallelCommunicationInterface |
| 50 { |
| 51 public: |
| 52 /** |
| 53 * Deletes storage used by the parallel environment. |
| 54 */ |
| 55 virtual void Destroy () = 0; |
| 56 /** |
| 57 * \return system identification |
| 58 */ |
| 59 virtual uint32_t GetSystemId () = 0; |
| 60 /** |
| 61 * \return number of parallel tasks |
| 62 */ |
| 63 virtual uint32_t GetSize () = 0; |
| 64 /** |
| 65 * \return true if parallel communication is enabled |
| 66 */ |
| 67 virtual bool IsEnabled () = 0; |
| 68 /** |
| 69 * \param pargc number of command line arguments |
| 70 * \param pargv command line arguments |
| 71 * |
| 72 * Sets up parallel communication interface |
| 73 */ |
| 74 virtual void Enable (int* pargc, char*** pargv) = 0; |
| 75 /** |
| 76 * Terminates the parallel environment. |
| 77 * This function must be called after Destroy () |
| 78 */ |
| 79 virtual void Disable () = 0; |
| 80 /** |
| 81 * \param p packet to send |
| 82 * \param rxTime received time at destination node |
| 83 * \param node destination node |
| 84 * \param dev destination device |
| 85 * |
| 86 * Serialize and send a packet to the specified node and net device |
| 87 */ |
| 88 virtual void SendPacket (Ptr<Packet> p, const Time &rxTime, uint32_t node, uin
t32_t dev) = 0; |
| 89 |
| 90 private: |
| 91 }; |
| 92 |
| 93 } // namespace ns3 |
| 94 |
| 95 #endif /* NS3_PARALLEL_COMMUNICATION_INTERFACE_H */ |
OLD | NEW |