Subject: [manet] Opnet!!

From: Shobit Mazumdar <[email-masked]>
Date: Mon, 3 May 2004 12:40:35 -0700 (PDT)

Hi,
      
if anyone  could kindly let me know if there is a way in OPNET to
run from the command prompt ....the way we do in ns-2 and glomosim...

specifically i would like to plug in some printf statement in the source code and see the 
out put in the screen....how do we do it in OPNET....

I Went through the documentation but all they talk there is regarding building a particular 
scenario and running the aprticular protocol from the Gui options that we have ....i want to
do it from the command prompt ...like including some configuration files...mobiliy models ...
choose the protocol...and then run the simulation from the command prompt.....

If there is a way do this OPNET please help me ....
 
the op_runsim probably is the way to do it but what other files do i need to include...also where can i insert the printfs....for example if i need to print out some info from he DSR source code ....

Regards
Shobit 

---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs

---

From: manet user <[email-masked]>
Date: Mon, 3 May 2004 15:33:37 -0700 (PDT)

Hi Shobit,
 
If you have support for your OPNET product, you can find many answers from FAQ at www.opnet.com/support
I found one for your current question. Just pasting it here. Hope it helps. Also, you can enable ODB debugger option while running from GUI which can provide many debugging capabilities and you can see your printfs as well.
 
FAQ ID: 375
When a simulation is launched from the OPNET GUI (project editor or simulation set editor), the OPNET GUI passes many arguments to the simulation program op_runsim. If you instead run a simulation from the command line (using op_runsim or a static simulation executable built using op_mksim), and you want to get the same results as the simulation launched from the OPNET GUI, you must pass almost all of the same arguments to the simulation program on the command line. 

To see the exact arguments passed by the OPNET GUI:
1) Start a simulation from the GUI
2) Open the file <user_home_dir>/op_admin/session_log. 
3) Scroll to the end of the file.
4) Observe the arguments passed to op_runsim.
5) The values of the arguments (such as "duration") will be different depending how you have configured your simulation attributes in the OPNET GUI.
6) You can copy these arguments from the session_log, then reuse them by pasting them when you run your simulation from the command line (using op_runsim or a static simulation executable).

Note that one argument passed to op_runsim from the GUI is particularly important: the "-ef" argument, which by default has a value <project-scenario> in 8.0 and later. This .ef file contains the values of simulation attributes specified in the OPNET GUI. 

The rest of the FAQ applies to versions 7.0 and earlier 
-------------------------------------------------------
In 7.0 and earlier, the default value of the "-ef" argument is "sim_attrs". The "sim_attrs.ef" is a temporary file that contains the values of simulation attributes specified in the OPNET GUI. To get the same results by running the simulation on the command line, you will have to copy and rename that "sim_attrs.ef" file:
1) First, run your simulation from the GUI and pause it before it completes.
2) You should see a file called "sim_attrs.ef" in your primary models directory (the directory listed first in your mod_dirs). The file will be deleted when the simulation completes.
3) Copy "sim_attrs.ef" it to a unique name (such as "my_sim_attrs_1").
4) Click on the "Stop Run" button in the GUI.
5) When you run the simulation from the command line, use the same arguments as you found in the session_log file above, but instead of using the argument "-ef sim_attrs", use the argument "-ef my_sim_attrs_1".
6) For additional details on the sim_attrs.ef file, you can read the FAQ "How can I generate an example environment file for running simulations?"). 

EXAMPLES

Example A: 
Sample op_runsim command recorded by the OPNET 7.0 GUI in the <user_home_dir>/session_log:
----------------------
21:22:05 Sun Jan 12 1999: modeler issued the following command:
op_runsim -opnet_user_home c:/users/opnet -net_name ACE-local_net -child_id 1 -opnet_port 3456 -verbose_sim true -verbose_load true -duration 3600 -probe ACE-local_net -noprompt TRUE -ov_file ACE-local_net -log_file ACE-local_net -parallel_sim.num_processors 1 -ef sim_attrs
----------------------

Example B: 
In order to get the exact same results running the simulation at the command line, you would have to copy the sim_attrs file, then the following command:

prompt% op_runsim -opnet_user_home c:/users/opnet -net_name ACE-local_net -duration 3600 -probe ACE-local_net -noprompt TRUE -ov_file ACE-local_net -log_file ACE-local_net -ef my_sim_attrs_1

In the above example, note that the last argument is the renamed my_sim_attrs_1. Also, note that we omitted the following arguments (but we would also get the same results if we chose not to omit them): child_id, opnet_port, verbose_sim, verbose_load, and parallel_sim.num_processors.

Shobit Mazumdar <[email-masked]> wrote:
Hi,

 

Regards
Shobit

---

From: Jay Lee <[email-masked]>
Date: Mon, 03 May 2004 19:10:55 -0400

You can start OPNET from a console and should be able to see the
print-out from your printf() calls within the console.  Edit the
"Edit->preferences->console" option to true and restart
OPNET.

Best of luck, - Jay

At 12:40 PM 5/3/2004 -0700, Shobit Mazumdar wrote:

Hi,

if anyone  could kindly let me know if there is a way in OPNET
to

run from the command prompt ....the way we do in ns-2 and
glomosim...

specifically i would like to plug in some printf statement in the source
code and see the

I Went through the documentation but all they talk there is regarding
building a particular

scenario and running the aprticular protocol from the Gui options that we
have ....i want to

do it from the command prompt ...like including some configuration
files...mobiliy models ...

choose the protocol...and then run the simulation from the command
prompt.....

the op_runsim probably is the way to do it but what other files do i need
to include...also where can i insert the printfs....for example if i need
to print out some info from he DSR source code ....

Regards

Shobit

Do you Yahoo!?

Win
a $20,000 Career Makeover at Yahoo! HotJobs

**************************

Junghan (Jay) Lee

Senior Consulting Engineer, Consulting Services

OPNET Technologies, Inc. (NASDAQ:OPNT)

www.opnet.com

[email-masked]

201.928.1648 (home office)

=============================================================

Register for OPNET's Online Technology Workshops

http://www.opnet.com/TechWorkshops/

=============================================================

Register for OPNETWORK 2004 (Aug 30 - Sept 3, Washington DC)

http://www.opnet.com/opnetwork2004/

=============================================================

_______________________________________________
manet mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/manet