f4exb / wsgc

Automatically exported from code.google.com/p/wsgc
2 stars 2 forks source link

CUDA message averaging error in simulate synchronization mode #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
it is difficult to reproduce at will but it will occur in many cases in limit 
conditions for example using this entry:
`wsgc_test -s 512 -c 63 -C 10 -t 2.12 -r 0.0 -N 4 -I 0 -R 16 -P 1 -B 4 -F 31 -n 
-11 -L rcos:13,1.0,128.0 -m 6 -M 43 -f "W:0.0,1.0,0.2,0.0" --cuda 
--simulate-sync`

What is the expected output? What do you see instead?

Here the first symbol shows inconsistent averaging because the maxima should 
always increase as correlation values are accumulated during the symbol period:

--- correlation records:
PNi Si Ni iPN iMagMax PN# Mag.Max Max/Avg Ti.. PlTi Nse.Max Nse.Avg Ph@Mx 
Frx... Fl S/N.. S
  0  0  0 000 00000.0 000 00000.0 - N/A - 0477 0477 00000.0 00002.7  0.00  -5.50  N  0.00 N
  1  0  1 000 00000.0 008 00009.8 003.960 0017 0017 00000.0 00002.7 -2.28   2.38  N  3.61 Y
  2  0  2 000 00000.0 034 00051.7 009.763 0017 0017 00000.0 00002.7  0.29   2.25  N 18.97 Y
  3  0  3 000 00000.0 034 00047.1 006.417 0017 0017 00000.0 00002.7  0.57   2.12  N 17.29 Y

I would expect record #3 Mag.Max value to be greater than record #2 Mag.Max 
value.

Here it applies to the same PRN bin (#34) but sometimes a lower maximum 
magnitude value is selected for a different PRN.

The problem is not always with the first symbol as in the example.

The host implementation does not show the same problem

This bug makes the CUDA message correlator unusable for benchmark tests 
resorting to the host implementation will make execution longer which can be a 
problem for large sequences or FFT sizes.

Original issue reported on code.google.com by f4ex...@gmail.com on 20 Jan 2013 at 7:20

GoogleCodeExporter commented 9 years ago
Example with change in PRN value:

--- correlation records:
PNi Si Ni iPN iMagMax PN# Mag.Max Max/Avg Ti.. PlTi Nse.Max Nse.Avg Ph@Mx 
Frx... Fl S/N.. S
...
 28  7  0 000 00000.0 041 00011.1 003.706 0010 0010 00000.0 00011.3  0.48  10.25  N  0.99 N
 29  7  1 000 00000.0 008 00018.7 004.234 0017 0017 00000.0 00011.3  1.90   2.25  N  1.66 Y
 30  7  2 000 00000.0 043 00033.1 004.220 0017 0017 00000.0 00011.3 -1.67   2.25  N  2.94 Y
 31  7  3 000 00000.0 008 00029.9 002.830 0017 0017 00000.0 00011.3  1.27   2.12  N  2.66 Y

Original comment by f4ex...@gmail.com on 20 Jan 2013 at 7:25

GoogleCodeExporter commented 9 years ago
Ii seems that in the CUDA case unselected records that is records with 
unidentifiable pilot correlation contribute to the average while in the host 
version they do not. In all problem cases at least one record is marked with 
"N" in the selected ("S") column.

Original comment by f4ex...@gmail.com on 20 Jan 2013 at 10:47

GoogleCodeExporter commented 9 years ago
While the remark above is actually a problem and that it was fixed in a test 
version this does not solve the original problem. Here is a new example:

--- correlation records:
PNi Si Ni iPN iMagMax PN# Mag.Max Max/Avg Ti.. PlTi Nse.Max Nse.Avg Ph@Mx 
Frx... Fl S/N.. S
...
 28  7  0 000 00000.0 016 00035.5 012.162 0019 0019 00000.0 00007.5 -1.47   2.12  N  4.74 Y
 29  7  1 000 00000.0 016 00115.5 016.962 0019 0019 00000.0 00007.5 -1.22   2.12  N 15.42 Y
 30  7  2 000 00000.0 016 00123.2 014.057 0018 0018 00000.0 00007.5 -1.08   2.00  N 16.46 Y
 31  7  3 000 00000.0 016 00100.3 010.956 0018 0018 00000.0 00007.5 -1.02   2.00  N 13.40 Y

Original comment by f4ex...@gmail.com on 20 Jan 2013 at 10:56

GoogleCodeExporter commented 9 years ago
The host implementation does the averaging sum on the magnitude of complex 
correlations while the CUDA implementation does the averaging sum on the 
complex correlations then takes the magnitude. It could explain the difference. 
The host implementation used to do the complex sum but that was commented out. 
This tends to prove it was not successful so the sum of magnitudes should be 
preferred. In that case we will observe an increase in value during the symbol 
integration.

Original comment by f4ex...@gmail.com on 20 Jan 2013 at 11:15

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 18a65cec70aa.

Original comment by f4ex...@gmail.com on 21 Jan 2013 at 10:57