All Phase 5 files are in place and properly structured:
- ✅ src/gpu/modules/BackgroundFlow.ned - Module definition (38 lines)
- ✅ src/gpu/modules/BackgroundFlow.cc - Implementation (212 lines)
- ✅ Class definition:
class BackgroundFlow : public cSimpleModule - ✅ Module registration:
Define_Module(BackgroundFlow); - ✅ Includes:
#include "gpu/messages/Lan_m.h"
- ✅ Class definition:
- ✅ simulations/gpu_share_background/package.ned - Package declaration
- ✅ simulations/gpu_share_background/GPUShareBackground.ned - Network topology (125 lines)
- ✅ Import:
import gpu_share.gpu.modules.BackgroundFlow; - ✅ Submodules:
bgFlow10[numBackgroundFlowsPerVlan],bgFlow20[numBackgroundFlowsPerVlan] - ✅ Connections: Properly connected to VLAN buses
- ✅ Import:
- ✅ simulations/gpu_share_background/omnetpp.ini - Configuration (257 lines)
- ✅ 4 configurations: NoBackground, LightBackground, MediumBackground, HeavyBackground
- ✅ Statistics recording for all BackgroundFlow signals
- ✅ PHASE5_README.md - Comprehensive testing guide (516 lines)
- ✅ PHASE5_SUMMARY.md - Implementation summary (247 lines)
- ✅ simulations/gpu_share_background/README.md - Quick reference
- ✅ run.md - Updated with Phase 5 commands
simple BackgroundFlow {
parameters:
int vlanId, flowId, srcAddr, destAddr;
double burstInterval, packetInterval, startTime;
int burstSize, packetSize, maxBursts;
bool debug;
@signal[packetsSent](type=long);
@signal[bytesSent](type=long);
@signal[burstsCompleted](type=long);
gates:
inout port;
}✅ All parameters properly typed ✅ All signals declared ✅ Statistics decorations present ✅ Gate defined
class BackgroundFlow : public cSimpleModule {
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
virtual void finish() override;
private:
// 13 parameters, 5 state variables, 3 signals
void startNewBurst();
void sendPacket();
void scheduleNextPacketInBurst();
};
Define_Module(BackgroundFlow);✅ Proper inheritance from cSimpleModule
✅ Override methods: initialize(), handleMessage(), finish()
✅ Module registration macro present
✅ Helper methods for burst/packet management
✅ Proper memory management (timer cleanup in finish())
network GPUShareBackground {
submodules:
bgFlow10[numBackgroundFlowsPerVlan]: BackgroundFlow {
vlanId = parent.vlan10Id;
flowId = index + 50;
srcAddr = index + 50;
destAddr = -1; // Broadcast
}
connections:
for i=0..numBackgroundFlowsPerVlan-1 {
bgFlow10[i].port <--> Lan <--> bus10.port++;
}
}✅ Proper module instantiation with vector submodules
✅ Parameters use parent and index correctly
✅ For-loop connections properly structured
✅ Channel type Lan properly referenced
[Config NoBackground]
*.numBackgroundFlowsPerVlan = 0
[Config LightBackground]
*.numBackgroundFlowsPerVlan = 2
*.bgFlow10[*].burstInterval = 2s
*.bgFlow10[*].burstSize = 5
*.bgFlow10[*].packetSize = 512B
...
**.bgFlow10[*].packetsSent.record = count
**.bgFlow10[*].bytesSent.record = sum,vector✅ Proper configuration inheritance (extends)
✅ Wildcard patterns for vector submodules ([*])
✅ Unit annotations (@unit) for timed parameters
✅ Statistics recording properly configured
BackgroundFlow uses existing DataPkt message from Lan.msg:
message DataPkt extends LanFrame {
frameType = 6;
int bytes; // ← Used by BackgroundFlow for variable packet sizes
int seqNumber; // ← Used by BackgroundFlow for packet ordering
string payload;
}✅ No changes needed to Lan.msg
✅ BackgroundFlow properly sets bytes field
✅ VlanBus properly handles DataPkt serialization delays
VlanBus.cc already handles DataPkt correctly:
if (DataPkt *dataPkt = dynamic_cast<DataPkt*>(frame)) {
frameBytes = dataPkt->getBytes(); // ← Uses BackgroundFlow-set bytes field
}
serializationDelay = (frameBytes * 8.0) / datarate;✅ No changes needed to VlanBus ✅ Serialization delay automatically applied to background traffic
GPUShareBackground extends Phase 4 topology:
- ✅ Reuses existing modules: VlanBus, Router, GPUHost, Scheduler, JobClient
- ✅ Adds new BackgroundFlow modules without modifying existing structure
- ✅ All connections properly terminated (no dangling gates)
The current src/Makefile does NOT include BackgroundFlow.o yet:
OBJS = \
$O/gpu/modules/DummyNode.o \
$O/gpu/modules/GPUHost.o \
$O/gpu/modules/JobClient.o \
$O/gpu/modules/Router.o \
$O/gpu/modules/Scheduler.o \
$O/gpu/modules/TestModule.o \
$O/gpu/modules/VlanBus.o
# ← BackgroundFlow.o missing!YOU MUST RUN THIS COMMAND BEFORE BUILDING:
cd d:\omnetpp-6.2.0\samples\gpu_share\src
opp_makemake -f --deep -I.After running opp_makemake, the Makefile will include:
OBJS = \
$O/gpu/modules/BackgroundFlow.o \ # ← NEW
$O/gpu/modules/DummyNode.o \
$O/gpu/modules/GPUHost.o \
...cd d:\omnetpp-6.2.0\samples\gpu_share\src
opp_makemake -f --deep -I. # ← Regenerate Makefile
make clean # ← Clean old objects
make -j16 # ← Build with 16 parallel jobsExpected compilation order:
Lan_m.cc(from Lan.msg) →Lan_m.oBackgroundFlow.cc→BackgroundFlow.o← NEW- All
.ofiles linked →gpu_share.exe
Compiling gpu/messages/Lan_m.cc...
Compiling gpu/modules/BackgroundFlow.cc... ← NEW
Compiling gpu/modules/VlanBus.cc...
Compiling gpu/modules/GPUHost.cc...
...
Linking gpu_share.exe...
Build complete: gpu_share.exe
/usr/bin/ld: cannot find gpu/modules/BackgroundFlow.o: No such file or directory
collect2: error: ld returned 1 exit status
Solution: Run opp_makemake -f --deep -I.
GPUShareBackground
├── bus10 (VlanBus)
├── bus20 (VlanBus)
├── router (Router)
├── host10[0], host10[1] (GPUHost)
├── host20[0], host20[1] (GPUHost)
├── scheduler (Scheduler)
├── client10[0], client10[1] (JobClient)
└── client20[0], client20[1] (JobClient)
Total: 10 modules
GPUShareBackground
├── ... (same as above)
├── bgFlow10[0], bgFlow10[1] (BackgroundFlow) ← NEW
└── bgFlow20[0], bgFlow20[1] (BackgroundFlow) ← NEW
Total: 14 modules
t=0.000s: BackgroundFlow50 initialized: vlanId=10, srcAddr=50, destAddr=-1,
burstInterval=2s, burstSize=5, packetSize=512 bytes, packetInterval=0.02s
t=0.421s: BackgroundFlow50 starting burst #1 at t=0.421
t=0.421s: BackgroundFlow50 sent packet 1 (burst 1, pkt 1/5), 512 bytes
t=0.441s: BackgroundFlow50 sent packet 2 (burst 1, pkt 2/5), 512 bytes
...
scalar GPUShareBackground.bgFlow10[0] packetsSent:count 200
scalar GPUShareBackground.bgFlow10[0] bytesSent:sum 102400
scalar GPUShareBackground.bgFlow10[0] burstsCompleted:count 40
scalar GPUShareBackground.client10[0] jobCompletionTime:mean 4.83
scalar GPUShareBackground.bus10 throughput:sum 315672
vector 23 GPUShareBackground.bgFlow10[0] bytesSent:vector ETV
23 1.523 512
23 1.543 1024
23 1.563 1536
...
vector 14 GPUShareBackground.client10[0] jobCompletionTime:vector ETV
14 4.234 3.451
14 9.876 5.123
...
Before you build and test Phase 5, verify:
- All source files exist in
src/gpu/modules/ - All simulation files exist in
simulations/gpu_share_background/ - BackgroundFlow.cc has proper
#include "gpu/messages/Lan_m.h" - BackgroundFlow.cc has
Define_Module(BackgroundFlow); - GPUShareBackground.ned imports BackgroundFlow
- omnetpp.ini has all 4 configurations
- Documentation files created (README, SUMMARY)
- Ready to run
opp_makemake -f --deep -I.
Next steps:
- Run the build commands from run.md
- Run all 4 configurations
- Analyze results as described in PHASE5_README.md
Expected outcome:
- ✅ Clean build with no errors
- ✅ All 4 configs run to completion
- ✅ JCT increases with background traffic load
- ✅ 12 result files generated
If you encounter any issues, refer to the Troubleshooting sections in:
- PHASE5_README.md - Detailed troubleshooting
- PHASE5_SUMMARY.md - Quick troubleshooting table
Good luck with your Phase 5 testing! 🎉