Shivani Parekh has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33540 )

Change subject: dev: Update master/slave variables dist_iface
......................................................................

dev: Update master/slave variables dist_iface

Change-Id: Ie555328f5a016a482ab973e0db97e19993f55af9
---
M src/dev/net/dist_iface.cc
M src/dev/net/dist_iface.hh
M src/dev/net/tcp_iface.cc
3 files changed, 42 insertions(+), 42 deletions(-)



diff --git a/src/dev/net/dist_iface.cc b/src/dev/net/dist_iface.cc
index cc408e0..7974242 100644
--- a/src/dev/net/dist_iface.cc
+++ b/src/dev/net/dist_iface.cc
@@ -60,7 +60,7 @@
 DistIface::SyncEvent *DistIface::syncEvent = nullptr;
 unsigned DistIface::distIfaceNum = 0;
 unsigned DistIface::recvThreadsNum = 0;
-DistIface *DistIface::master = nullptr;
+DistIface *DistIface::primary = nullptr;
 bool DistIface::isSwitch = false;

 void
@@ -142,7 +142,7 @@
         needExit = ReqType::pending;
     if (needStopSync != ReqType::none)
         needStopSync = ReqType::pending;
-    DistIface::master->sendCmd(header);
+    DistIface::primary->sendCmd(header);
     // now wait until all receiver threads complete the synchronisation
     auto lf = [this]{ return waitNum == 0; };
     cv.wait(sync_lock, lf);
@@ -191,7 +191,7 @@
     } else {
         header.needStopSync = ReqType::none;
     }
-    DistIface::master->sendCmd(header);
+    DistIface::primary->sendCmd(header);
     return true;
 }

@@ -410,7 +410,7 @@
             start();
         } else {
             // Wake up thread contexts on non-switch nodes.
-            for (auto *tc: master->sys->threads) {
+            for (auto *tc: primary->sys->threads) {
                 if (tc->status() == ThreadContext::Suspended)
                     tc->activate();
                 else
@@ -503,10 +503,10 @@
"send_tick:%llu send_delay:%llu link_delay:%llu recv_tick:%llu\n",
             send_tick, send_delay, linkDelay, recv_tick);
     // Every packet must be sent and arrive in the same quantum
-    assert(send_tick > master->syncEvent->when() -
-           master->syncEvent->repeat);
+    assert(send_tick > primary->syncEvent->when() -
+           primary->syncEvent->repeat);
     // No packet may be scheduled for receive in the arrival quantum
-    assert(send_tick + send_delay + linkDelay > master->syncEvent->when());
+ assert(send_tick + send_delay + linkDelay > primary->syncEvent->when());

// Now we are about to schedule a recvDone event for the new data packet. // We use the same recvDone object for all incoming data packets. Packet
@@ -611,8 +611,8 @@
     rank(dist_rank), size(dist_size)
 {
     DPRINTF(DistEthernet, "DistIface() ctor rank:%d\n",dist_rank);
-    isMaster = false;
-    if (master == nullptr) {
+    isPrimary = false;
+    if (primary == nullptr) {
         assert(sync == nullptr);
         assert(syncEvent == nullptr);
         isSwitch = is_switch;
@@ -621,8 +621,8 @@
         else
             sync = new SyncNode();
         syncEvent = new SyncEvent();
-        master = this;
-        isMaster = true;
+        primary = this;
+        isPrimary = true;
     }
     distIfaceId = distIfaceNum;
     distIfaceNum++;
@@ -639,8 +639,8 @@
         assert(sync);
         delete sync;
     }
-    if (this == master)
-        master = nullptr;
+    if (this == primary)
+        primary = nullptr;
 }

 void
@@ -728,7 +728,7 @@
 {
     DPRINTF(DistEthernet,"DistIFace::drain() called\n");
     // This can be called multiple times in the same drain cycle.
-    if (this == master)
+    if (this == primary)
         syncEvent->draining(true);
     return DrainState::Drained;
 }
@@ -736,7 +736,7 @@
 void
 DistIface::drainResume() {
     DPRINTF(DistEthernet,"DistIFace::drainResume() called\n");
-    if (this == master)
+    if (this == primary)
         syncEvent->draining(false);
     recvScheduler.resumeRecvTicks();
 }
@@ -755,7 +755,7 @@
     SERIALIZE_SCALAR(dist_iface_id_orig);

     recvScheduler.serializeSection(cp, "recvScheduler");
-    if (this == master) {
+    if (this == primary) {
         sync->serializeSection(cp, "Sync");
     }
 }
@@ -774,7 +774,7 @@
              dist_iface_id_orig);

     recvScheduler.unserializeSection(cp, "recvScheduler");
-    if (this == master) {
+    if (this == primary) {
         sync->unserializeSection(cp, "Sync");
     }
 }
@@ -801,8 +801,8 @@

     // Initialize the seed for random generator to avoid the same sequence
     // in all gem5 peer processes
-    assert(master != nullptr);
-    if (this == master)
+    assert(primary != nullptr);
+    if (this == primary)
         random_mt.init(5489 * (rank+1) + 257);
 }

@@ -811,7 +811,7 @@
 {
     DPRINTF(DistEthernet, "DistIface::startup() started\n");
// Schedule synchronization unless we are not a switch in pseudo_op mode.
-    if (this == master && (!syncStartOnPseudoOp || isSwitch))
+    if (this == primary && (!syncStartOnPseudoOp || isSwitch))
         syncEvent->start();
     DPRINTF(DistEthernet, "DistIface::startup() done\n");
 }
@@ -822,7 +822,7 @@
     bool ret = true;
     DPRINTF(DistEthernet, "DistIface::readyToCkpt() called, delay:%lu "
             "period:%lu\n", delay, period);
-    if (master) {
+    if (primary) {
         if (delay == 0) {
inform("m5 checkpoint called with zero delay => triggering collaborative "
                    "checkpoint\n");
@@ -851,38 +851,38 @@
 DistIface::toggleSync(ThreadContext *tc)
 {
// Unforunate that we have to populate the system pointer member this way.
-    master->sys = tc->getSystemPtr();
+    primary->sys = tc->getSystemPtr();

// The invariant for both syncing and "unsyncing" is that all threads will // stop executing intructions until the desired sync state has been reached // for all nodes. This is the easiest way to prevent deadlock (in the case
     // of "unsyncing") and causality errors (in the case of syncing).
-    if (master->syncEvent->scheduled()) {
+    if (primary->syncEvent->scheduled()) {
         inform("Request toggling syncronization off\n");
-        master->sync->requestStopSync(ReqType::collective);
+        primary->sync->requestStopSync(ReqType::collective);

         // At this point, we have no clue when everyone will reach the sync
         // stop point.  Suspend execution of all local thread contexts.
         // Dist-gem5 will reactivate all thread contexts when everyone has
         // reached the sync stop point.
 #if THE_ISA != NULL_ISA
-        for (auto *tc: master->sys->threads) {
+        for (auto *tc: primary->sys->threads) {
             if (tc->status() == ThreadContext::Active)
                 tc->quiesce();
         }
 #endif
     } else {
         inform("Request toggling syncronization on\n");
-        master->syncEvent->start();
+        primary->syncEvent->start();

// We need to suspend all CPUs until the sync point is reached by all
         // nodes to prevent causality errors.  We can also schedule CPU
         // activation here, since we know exactly when the next sync will
         // occur.
 #if THE_ISA != NULL_ISA
-        for (auto *tc: master->sys->threads) {
+        for (auto *tc: primary->sys->threads) {
             if (tc->status() == ThreadContext::Active)
-                tc->quiesceTick(master->syncEvent->when() + 1);
+                tc->quiesceTick(primary->syncEvent->when() + 1);
         }
 #endif
     }
@@ -894,10 +894,10 @@
     bool ret = true;
     DPRINTF(DistEthernet, "DistIface::readyToExit() called, delay:%lu\n",
             delay);
-    if (master) {
+    if (primary) {
// To successfully coordinate an exit, all nodes must be synchronising
-        if (!master->syncEvent->scheduled())
-            master->syncEvent->start();
+        if (!primary->syncEvent->scheduled())
+            primary->syncEvent->start();

         if (delay == 0) {
inform("m5 exit called with zero delay => triggering collaborative "
@@ -917,8 +917,8 @@
 DistIface::rankParam()
 {
     uint64_t val;
-    if (master) {
-        val = master->rank;
+    if (primary) {
+        val = primary->rank;
     } else {
         warn("Dist-rank parameter is queried in single gem5 simulation.");
         val = 0;
@@ -930,8 +930,8 @@
 DistIface::sizeParam()
 {
     uint64_t val;
-    if (master) {
-        val = master->size;
+    if (primary) {
+        val = primary->size;
     } else {
         warn("Dist-size parameter is queried in single gem5 simulation.");
         val = 1;
diff --git a/src/dev/net/dist_iface.hh b/src/dev/net/dist_iface.hh
index e568549..f61336b 100644
--- a/src/dev/net/dist_iface.hh
+++ b/src/dev/net/dist_iface.hh
@@ -491,7 +491,7 @@
      */
     unsigned distIfaceId;

-    bool isMaster;
+    bool isPrimary;

   private:
     /**
@@ -507,10 +507,10 @@
      */
     static SyncEvent *syncEvent;
     /**
-     * The very first DistIface object created becomes the master. We need
-     * a master to co-ordinate the global synchronisation.
+     * The very first DistIface object created becomes the primary. We need
+     * a primary to co-ordinate the global synchronisation.
      */
-    static DistIface *master;
+    static DistIface *primary;
     /**
      * System pointer used to wakeup sleeping threads when stopping sync.
      */
@@ -635,7 +635,7 @@
      */
     static uint64_t sizeParam();
     /**
-     * Trigger the master to start/stop synchronization.
+     * Trigger the primary to start/stop synchronization.
      */
     static void toggleSync(ThreadContext *tc);
  };
diff --git a/src/dev/net/tcp_iface.cc b/src/dev/net/tcp_iface.cc
index ba21334..cb6fecb 100644
--- a/src/dev/net/tcp_iface.cc
+++ b/src/dev/net/tcp_iface.cc
@@ -87,7 +87,7 @@
               is_switch, num_nodes), serverName(server_name),
     serverPort(server_port), isSwitch(is_switch), listening(false)
 {
-    if (is_switch && isMaster) {
+    if (is_switch && isPrimary) {
         while (!listen(serverPort)) {
             DPRINTF(DistEthernet, "TCPIface(listen): Can't bind port %d\n",
                     serverPort);
@@ -307,7 +307,7 @@
 {
     DPRINTF(DistEthernetCmd, "TCPIface::sendCmd() type: %d\n",
             static_cast<int>(header.msgType));
-    // Global commands (i.e. sync request) are always sent by the master
+    // Global commands (i.e. sync request) are always sent by the primary
// DistIface. The transfer method is simply implemented as point-to-point
     // messages for now
     for (auto s: sockRegistry)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33540
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie555328f5a016a482ab973e0db97e19993f55af9
Gerrit-Change-Number: 33540
Gerrit-PatchSet: 1
Gerrit-Owner: Shivani Parekh <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to