Bug 1053 - Need better error diagnostics in ns2-mobility-trace example
Need better error diagnostics in ns2-mobility-trace example
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mobility models
pre-release
All All
: P5 trivial
Assigned To: Mitch Watrous
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-13 03:07 EST by Pavel Boyko
Modified: 2012-05-08 13:49 EDT (History)
4 users (show)

See Also:


Attachments
ns-2 mobility helper file handling diagnostics (473 bytes, patch)
2012-01-08 21:33 EST, Anirudh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Boyko 2011-02-13 03:07:47 EST
From ns-3-users:

I was wondering if somebody else ran into the same problem as me:

When I run the conversion program to incorporate ns-2 trace files in
ns-3 it works fine if I use absolute paths for the traceFile and
logFile as given below:

 sudo ./waf --run "ns2-mobility-trace --traceFile=/home/anirudh/
Desktop/ns-3-dev/examples/mobility/default.ns_movements --nodeNum=2 --
duration=100.0 --logFile=/home/anirudh/Desktop/ns-3-dev/examples/
mobility/main-ns2-mob.log"

But when I replace the absolute paths with relative paths and run the
same program it terminates without any error messages or any output.

I know it's not a big deal, but took me a long time to figure this
out. Was wondering if someone else ran into the same issue before.

Anirudh
Comment 1 Anirudh 2012-01-02 06:13:17 EST
(In reply to comment #0)
> From ns-3-users:
> 
> I was wondering if somebody else ran into the same problem as me:
> 
> When I run the conversion program to incorporate ns-2 trace files in
> ns-3 it works fine if I use absolute paths for the traceFile and
> logFile as given below:
> 
>  sudo ./waf --run "ns2-mobility-trace --traceFile=/home/anirudh/
> Desktop/ns-3-dev/examples/mobility/default.ns_movements --nodeNum=2 --
> duration=100.0 --logFile=/home/anirudh/Desktop/ns-3-dev/examples/
> mobility/main-ns2-mob.log"
> 
> But when I replace the absolute paths with relative paths and run the
> same program it terminates without any error messages or any output.
> 
> I know it's not a big deal, but took me a long time to figure this
> out. Was wondering if someone else ran into the same issue before.
> 
> Anirudh

Has anyone worked on this bug since ? It seems that it is not fixed in version 3.13 of ns . I can work on this, if no one is working on it right now.
Comment 2 Tom Henderson 2012-01-04 00:42:29 EST
(In reply to comment #1)
> 
> Has anyone worked on this bug since ? It seems that it is not fixed in version
> 3.13 of ns . I can work on this, if no one is working on it right now.

Since no one has chimed in on this, I think it is safe to assume that no one is working on it.  A patch would be welcome.
Comment 3 Pavel Boyko 2012-01-04 21:22:58 EST
Hi Anirudh,

We will appreciate any help with the ns-2 mobility helper. 

Best regards,
Pavel

(In reply to comment #1)
> (In reply to comment #0)
> > From ns-3-users:
> > 
> > I was wondering if somebody else ran into the same problem as me:
> > 
> > When I run the conversion program to incorporate ns-2 trace files in
> > ns-3 it works fine if I use absolute paths for the traceFile and
> > logFile as given below:
> > 
> >  sudo ./waf --run "ns2-mobility-trace --traceFile=/home/anirudh/
> > Desktop/ns-3-dev/examples/mobility/default.ns_movements --nodeNum=2 --
> > duration=100.0 --logFile=/home/anirudh/Desktop/ns-3-dev/examples/
> > mobility/main-ns2-mob.log"
> > 
> > But when I replace the absolute paths with relative paths and run the
> > same program it terminates without any error messages or any output.
> > 
> > I know it's not a big deal, but took me a long time to figure this
> > out. Was wondering if someone else ran into the same issue before.
> > 
> > Anirudh
> 
> Has anyone worked on this bug since ? It seems that it is not fixed in version
> 3.13 of ns . I can work on this, if no one is working on it right now.
Comment 4 Anirudh 2012-01-08 21:33:37 EST
Created attachment 1301 [details]
ns-2 mobility helper file handling diagnostics

Checks to see if the given trace file can be opened by the program or not.
Comment 5 Anirudh 2012-01-08 21:34:52 EST
Hi

I have enclosed a patch for this. Do let me know if anything else needs to be done at my end. The patch is wrt ns-3-dev. In essence, I just added an is_open() check to the constructor Ns2MobilityHelper() and I print an NS_FATAL_ERROR if the file does not open. Hope that's fine.

Anirudh

(In reply to comment #3)
> Hi Anirudh,
> 
> We will appreciate any help with the ns-2 mobility helper. 
> 
> Best regards,
> Pavel
> 
> (In reply to comment #1)
> > (In reply to comment #0)
> > > From ns-3-users:
> > > 
> > > I was wondering if somebody else ran into the same problem as me:
> > > 
> > > When I run the conversion program to incorporate ns-2 trace files in
> > > ns-3 it works fine if I use absolute paths for the traceFile and
> > > logFile as given below:
> > > 
> > >  sudo ./waf --run "ns2-mobility-trace --traceFile=/home/anirudh/
> > > Desktop/ns-3-dev/examples/mobility/default.ns_movements --nodeNum=2 --
> > > duration=100.0 --logFile=/home/anirudh/Desktop/ns-3-dev/examples/
> > > mobility/main-ns2-mob.log"
> > > 
> > > But when I replace the absolute paths with relative paths and run the
> > > same program it terminates without any error messages or any output.
> > > 
> > > I know it's not a big deal, but took me a long time to figure this
> > > out. Was wondering if someone else ran into the same issue before.
> > > 
> > > Anirudh
> > 
> > Has anyone worked on this bug since ? It seems that it is not fixed in version
> > 3.13 of ns . I can work on this, if no one is working on it right now.
Comment 6 Tom Henderson 2012-01-09 00:04:12 EST
(In reply to comment #5)
> Hi
> 
> I have enclosed a patch for this. Do let me know if anything else needs to be
> done at my end. The patch is wrt ns-3-dev. In essence, I just added an
> is_open() check to the constructor Ns2MobilityHelper() and I print an
> NS_FATAL_ERROR if the file does not open. Hope that's fine.
> 
> Anirudh

I'm fine with adding such a check, but I got the impression from the original bug report that also making the system support relative file paths was going to be part of the solution.

Was that considered and dropped due to difficulty, or was the original intent just to check whether the file opened successfully?
Comment 7 Anirudh 2012-01-09 07:47:52 EST
(In reply to comment #6)
> (In reply to comment #5)
> > Hi
> > 
> > I have enclosed a patch for this. Do let me know if anything else needs to be
> > done at my end. The patch is wrt ns-3-dev. In essence, I just added an
> > is_open() check to the constructor Ns2MobilityHelper() and I print an
> > NS_FATAL_ERROR if the file does not open. Hope that's fine.
> > 
> > Anirudh
> 
> I'm fine with adding such a check, but I got the impression from the original
> bug report that also making the system support relative file paths was going to
> be part of the solution.
> 
> Was that considered and dropped due to difficulty, or was the original intent
> just to check whether the file opened successfully?

I am not sure about that. The paths have to be relative to some directory and the ns2-mobility-trace application can be run using waf from multiple directories. How is the current working directory set, when using waf to run ns applications ? And no matter how it is set, the above code should be able to handle it I guess, because the arguments to open() can be absolute or relative paths .
Comment 8 Tom Henderson 2012-01-10 00:11:22 EST
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > Hi
> > > 
> > > I have enclosed a patch for this. Do let me know if anything else needs to be
> > > done at my end. The patch is wrt ns-3-dev. In essence, I just added an
> > > is_open() check to the constructor Ns2MobilityHelper() and I print an
> > > NS_FATAL_ERROR if the file does not open. Hope that's fine.
> > > 
> > > Anirudh
> > 
> > I'm fine with adding such a check, but I got the impression from the original
> > bug report that also making the system support relative file paths was going to
> > be part of the solution.
> > 
> > Was that considered and dropped due to difficulty, or was the original intent
> > just to check whether the file opened successfully?
> 
> I am not sure about that. The paths have to be relative to some directory and
> the ns2-mobility-trace application can be run using waf from multiple
> directories. How is the current working directory set, when using waf to run ns
> applications ? And no matter how it is set, the above code should be able to
> handle it I guess, because the arguments to open() can be absolute or relative
> paths .

I agree with your explanation; I wasn't sure from the initial report whether you were asking for the relative file paths (relative to ns-3 top level directory) supported also somehow from running it when using ./waf.  I think your solution is fine.
Comment 9 Mathieu Lacage 2012-03-24 09:02:15 EDT
+1
Comment 10 Mitch Watrous 2012-05-08 13:49:54 EDT
Bug closed.

Changeset:  140eea99f4f2