how to run sim with MPI from console?

76 views
Skip to first unread message

alanxptm

unread,
Jul 17, 2022, 10:39:19 AM7/17/22
to OMNeT++ Users
So I've finally got Omnet compiled and running with OpenMPI on Linux, issue is when I try to run my simulation I get this error with each -p that I've set:

<!> Error: cFileCommunications: Invalid -p<procId> switch on the command line: "-p3,5"

In the project folder I'm trying to run it like this from console (as directly from the IDE throws another -p error):

./mca20 -p1,5 & ./mca20 -p2,5 &./mca20 -p3,5 & ./mca20 -p4,5 & ./mca20 -p5,5

My omnet.ini has this:

parallel-simulation = true
parsim-num-partitions = 5
*.extG**.partition-id=0
*.intG[0]**.partition-id=1
*.intG[1]**.partition-id=2
*.intG[2]**.partition-id=3
*.intG[3]**.partition-id=4

Can somebody help me?
Message has been deleted

alanxptm

unread,
Jul 18, 2022, 10:24:42 AM7/18/22
to OMNeT++ Users
I'm trying to run the simulation with this:

opp_runall -j5 ./mca20 -u Cmdenv --cmdenv-express-mode=true --scalar-recording=true

But I get this error:

./mca20 -u Cmdenv --cmdenv-express-mode=true --scalar-recording=true -s --cmdenv-redirect-output=true -r 0
cMPICommunications: started as process 0 out of 1.
MPI thinks this process is the only one in the session (did you use mpirun to start this program?)

<!> Error: cMPICommunications: The number of partitions configured (5) differs from the number of instances started by MPI (1)

alanxptm

unread,
Jul 18, 2022, 11:03:17 AM7/18/22
to OMNeT++ Users
So it seems like I got it working with this:

mpirun ./mca20_proyecto_new -u Cmdenv --cmdenv-express-mode=true --sim-time-limit=900s --scalar-recording=true

But it ends instantly and even if some display to have created messages, all scalar results are 0 for each process. This is what I get in the terminal:

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

Setting up Cmdenv...

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Setting up Cmdenv...

Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

OMNeT++ Discrete Event Simulation  (C) 1992-2022 Andras Varga, OpenSim Ltd.
Version: 6.0, build: 220413-71d8fab425, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Cmdenv...

cMPICommunications: started as process 6 out of 8.
cMPICommunications: started as process 1 out of 8.
cMPICommunications: started as process 0 out of 8.
cMPICommunications: started as process 5 out of 8.
cMPICommunications: started as process 2 out of 8.
cMPICommunications: started as process 7 out of 8.
cMPICommunications: started as process 4 out of 8.
cMPICommunications: started as process 3 out of 8.
Loading NED files from .:  1
Loading NED files from .:  1
Loading NED files from .:  1
Loading NED files from .:  1
Loading NED files from .:  1

Preparing for running configuration General, run #0...
Loading NED files from .:  1

Preparing for running configuration General, run #0...
Loading NED files from .:  1

Preparing for running configuration General, run #0...
Loading NED files from .:  1

Preparing for running configuration General, run #0...

Preparing for running configuration General, run #0...

Preparing for running configuration General, run #0...

Preparing for running configuration General, run #0...

Preparing for running configuration General, run #0...
Assigned runID=General-0-20220718-09:56:23-2163
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2158
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2157
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2162
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2159
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2164
Assigned runID=General-0-20220718-09:56:23-2161
Setting up network "Net"...
Assigned runID=General-0-20220718-09:56:23-2160
Setting up network "Net"...
Setting up network "Net"...
Initializing...
Initializing...
Initializing...
Initializing...
Initializing...
Initializing...
Initializing...
Initializing...

Running simulation...

Running simulation...
** Event #0   t=0   Elapsed: 6e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 14   present: 14   in FES: 15

Running simulation...
** Event #0   t=0   Elapsed: 6e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 14   present: 14   in FES: 15

Running simulation...
** Event #0   t=0   Elapsed: 6e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 19   present: 19   in FES: 15
** Event #0   t=0   Elapsed: 9e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 14   present: 14   in FES: 15

Running simulation...
** Event #0   t=0   Elapsed: 6e-06s (0m 00s)  0% completed  (0% total)

Running simulation...
** Event #0   t=0   Elapsed: 6e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

Running simulation...
** Event #0   t=0   Elapsed: 8e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

Running simulation...
** Event #0   t=0   Elapsed: 7e-06s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140
** Event #1   t=900   Elapsed: 0.000479s (0m 00s)  100% completed  (100% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 14   present: 14   in FES: 14
** Event #1   t=900   Elapsed: 0.00051s (0m 00s)  100% completed  (100% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
** Event #1   t=900   Elapsed: 0.00051s (0m 00s)  100% completed  (100% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 14   present: 14   in FES: 14
** Event #0   t=0   Elapsed: 0.000258s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

<!> Terminating simulation on request from procId=5: Simulation time limit reached -- at t=0s, event #0

Calling finish() at end of Run #0...
** Event #0   t=0   Elapsed: 0.00037s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

<!> Terminating simulation on request from procId=5: Simulation time limit reached -- at t=0s, event #0

Calling finish() at end of Run #0...

<!> Simulation time limit reached -- at t=900s, event #1

Calling finish() at end of Run #0...
** Event #0   t=0   Elapsed: 0.000408s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

<!> Terminating simulation on request from procId=5: Simulation time limit reached -- at t=0s, event #0

Calling finish() at end of Run #0...
** Event #0   t=0   Elapsed: 0.000589s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 19   present: 19   in FES: 15

<!> Terminating simulation on request from procId=5: Simulation time limit reached -- at t=0s, event #0

Calling finish() at end of Run #0...
     Messages:  created: 14   present: 14   in FES: 14

<!> Simulation time limit reached -- at t=900s, event #1

Calling finish() at end of Run #0...
** Event #0   t=0   Elapsed: 0.000334s (0m 00s)  0% completed  (0% total)
     Speed:     ev/sec=0   simsec/sec=0   ev/simsec=0
     Messages:  created: 265   present: 265   in FES: 140

<!> Terminating simulation on request from procId=5: Simulation time limit reached -- at t=0s, event #0

Calling finish() at end of Run #0...

<!> Simulation time limit reached -- at t=900s, event #1

Calling finish() at end of Run #0...

End.

End.

End.

End.

End.


End.

End.
End.

I've attached my model.ned and omnet.ini if you could give it a look. When I run the simulation from the IDE all works normally but its really slow.

omnetpp.ini
model.ned
Reply all
Reply to author
Forward
0 new messages