locked
different results in different computers?? RRS feed

  • Question

  • Hi everyone

    I'm working on my master project and, after i developed the model for my problem, i run it on a linux server in my Lab. I'm using mono to run it. Because some linux complication i compile everything in windows, and then i transfert the .exe( with all the required files) into the linux machine.

    If for the first version of my model everything run quite perfectly, in the second version of the model, the one more complicated, I have found a kind of problem. While in my laptop with windows I got certain results, these are completely different in the linux machine. This difference however, is not an approximation difference, because the results i got go from 80% in windows to the 56 % on the linux machine. Have you ever noticed this behaviour?? There is a kind of explainantion for this??

    Thank you in Advance

    Marco 

    Tuesday, August 27, 2013 7:33 AM

Answers

  • I finally realise which was the problem. In my Pc, I have installed an Intalian version of windows. This means that floating points are treated with "," instead of with "." in .NET. In the linux machines however linux is in its english version( and then mono as well). There double integer part is separated from the decimal part by the '.'. Because I developed the system on my laptop, i use the function .Replace() to get double values represented with the '.' in a file. However this behaviours make confusion inside the linux machines. And this is the reason for the difference
    Wednesday, August 28, 2013 2:10 PM

All replies

  • Try comparing the generated code for the two versions.  This will tell you if it is a difference in the compiler vs. the runtime.
    Tuesday, August 27, 2013 1:15 PM
    Owner
  • Even if the linux diff command tells me that the files are different in all their lines, i've chacked manually and are equal. Two differents files are generated, one for the "learning" phase and one for "test" phase I guess. This should means that the compiler is the same. But how can i menage runtime diffencies?? I can provide you the model that gives me problems and the one that instead works quite equal in both the machine(diffencies at the 7th 8th decimal digit that i assume is caused by different approximations
    Tuesday, August 27, 2013 3:15 PM
  • If the code is the same in both cases then it sounds like a bug in Mono.  Try using the debugger to step through the generated code and find the first place where the numbers differ between the two versions.
    Wednesday, August 28, 2013 8:22 AM
    Owner
  • I finally realise which was the problem. In my Pc, I have installed an Intalian version of windows. This means that floating points are treated with "," instead of with "." in .NET. In the linux machines however linux is in its english version( and then mono as well). There double integer part is separated from the decimal part by the '.'. Because I developed the system on my laptop, i use the function .Replace() to get double values represented with the '.' in a file. However this behaviours make confusion inside the linux machines. And this is the reason for the difference
    Wednesday, August 28, 2013 2:10 PM