Changeset 5963


Ignore:
Timestamp:
Nov 17, 2008, 1:47:15 PM (15 years ago)
Author:
ole
Message:

Work on platform bug

Location:
anuga_core/source/anuga/shallow_water
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5962 r5963  
    60796079            file = base_name + mux_names[i]
    60806080           
    6081             #print "base_name file", file
     6081            #print 'base_name file', file
    60826082            f = open(file, 'wb')
    60836083            files.append(file)
     
    65646564
    65656565        for i, q in enumerate(quantities):
     6566            #print
     6567            #print i, q
     6568           
    65666569            q_time = zeros((time_step_count, points_num), Float)
    65676570            quantities_init[i] = ensure_numeric(quantities_init[i])
     
    66176620                for point_i in range(points_num):
    66186621                    if time+1>=first_tstep[point_i] and time+1<=last_tstep[point_i]:
    6619                         assert abs(q_time[time, point_i]-unpack('f',f.read(4))[0])<epsilon
     6622                        x = unpack('f',f.read(4))[0]
     6623                        #print time, x, q_time[time, point_i]
     6624                        assert abs(q_time[time, point_i]-x)<epsilon
    66206625
    66216626            f.close()
     
    1104311048if __name__ == "__main__":
    1104411049
    11045     suite = unittest.makeSuite(Test_Data_Manager,'test')
     11050    #suite = unittest.makeSuite(Test_Data_Manager,'test')
    1104611051    #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsI_beyond_model_time')
    1104711052    #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsIV_sinewave_ordering')
     
    1105211057
    1105311058    # FIXME (Ole): This is the test that fails under Windows
    11054     #suite = unittest.makeSuite(Test_Data_Manager,'test_read_mux_platform_problem2')
     11059    suite = unittest.makeSuite(Test_Data_Manager,'test_read_mux_platform_problem2')
    1105511060    #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsIV')
    1105611061
  • anuga_core/source/anuga/shallow_water/urs_ext.c

    r5937 r5963  
    436436        // difference on 11 November 2008. We don't think the problem lies in the
    437437        // C code. Maybe it is a problem with the MUX files written by the unit test
    438         // that fails on Windows but works OK on Linux.
    439          
    440         //printf("\nRead %d elements, ", (int) numData);
    441         //printf("muxdata[%d]=%f\n", 39, muxData[39]);         
    442         //for(i = 0; i < (int) numData; i++)
    443         //{     
    444         //    printf("muxdata[%d]=%f\n", i, muxData[i]);       
    445         //}
     438        // that fails on Windows but works OK on Linux. JJ's test on 17th November shows
     439        // that as far as Python is concerned this file should be OK on both platforms.
    446440       
     441        // These printouts are enough to show the problem when compared on the two platforms
     442        printf("\nRead %d elements, ", (int) numData);
     443        printf("muxdata[%d]=%f\n", 39, muxData[39]);           
     444       
     445        /*
     446        In Windows we get
     447        Read 85 elements, muxdata[39]=0.999574
     448        Read 85 elements, muxdata[39]=-0.087599
     449        Read 85 elements, muxdata[39]=-0.087599
     450       
     451        I Linux we get (the correct)
     452        */
    447453       
    448454        // loop over stations present in the permutation array
Note: See TracChangeset for help on using the changeset viewer.