Bugzilla – Bug 1053
Need better error diagnostics in ns2-mobility-trace example
Last modified: 2012-05-08 13:49:54 EDT
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
(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.
(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.
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.
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.
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.
(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?
(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 .
(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.
+1
Bug closed. Changeset: 140eea99f4f2