WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-May-25 12:37:09

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Hello there!

So I was wondering about this tremendously long period of time that it takes for the pc to get data from our boards if I don't change the default MEX settings.

To sum up once again:
- WARP v3 boards
- WARPLab 7.5.1
- MEX 1.0.2a
- 1GB switch
- up to 7126 bytes supported by my NIC (pinging the nodes at 7127 gets 100% loss where at 7126 0% loss)
- ...and I am on a 32bit pc for the time being.

I haven't found out how to read the default MEX maximum request size, but I suppose it isn't per frame. MEX has also reported some times after I started using WARPLab 7.5.1, that due to MATLAB limitations it can support up to 33554432 samples (512MB). I have 3.25GB RAM on here though. So, if I want to get 4*(2^23) samples without MEX IQ warnings, I should set it at least at 512MB?

I did it, set it at 512*(2^20) after the boards setup, ran my code, and after 45 mex read iq warnings, I got a different warning saying

Code:

WARNING:  Sample packet indexes not correct.  Expected the sum of sample indexes to be 
          (571734688) but received a sum of (-1575748960).  Retrying ...
Packet Tracking Information: 
    Requested Samples:  Number:  8388608    Start Sample:        0  
    Received  Samples:  Number:  8388608  
Error:  Encountered error in sample packets but could not determine the error.  See above for debug information. 
   Socket Error Code: 0
Error using wl_mex_udp_transport
Error:  See description above.

Error in wl_transport_eth_udp_mex/read_buffers (line 545)
                    [num_rcvd_samples, cmds_used, rx_samples]  =
                    wl_mex_udp_transport('read_iq', obj.sock, data8,
                    length(data8), obj.address, obj.port, num_samples,
                    buffer_ids, start_sample, obj.maxS
Error in wl_baseband_buffers>readIQ (line 1393)
        rxSamples_IQ = node.transport.read_buffers('IQ', numSamps, buffSel,
        offset, myCmd, 0);

Error in wl_baseband_buffers/procCmd (line 576)
                    out = readIQ(obj, node, buffSel, cmdStr, varargin{:});

So i guess those MEX setting didn't work.

Well, 2^23 samples per RF are already too much to begin with. I just wanted to test if I could limit the time needed to read many samples by setting different maximum request size. And since not messing with the mex settings retrieved 512MB in 36minutes, I suppose the default is not 512MB. So to avoid restarting my pc, I set it at the maximum buffer capacity multiplied by 4 which got me to 8GB for maximum request size. I still get warnings but I retrieve 2MB in around 2 minutes.

Is this how it's gonna be until I change to a 64bit pc with more memory? :( Or are those durations expected? Is there anything I can do under those circumstances to limit the time needed to read the samples?

Thank you in advance.

Offline

 

#2 2015-May-25 13:08:49

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Something is definitely not working as expected if you're seeing read_iq/write_iq times of many minutes.

I'm sure Erik will have more debugging suggestions Tuesday AM, but one thing-

I haven't found out how to read the default MEX maximum request size, but I suppose it isn't per frame. MEX has also reported some times after I started using WARPLab 7.5.1, that due to MATLAB limitations it can support up to 33554432 samples (512MB). I have 3.25GB RAM on here though. So, if I want to get 4*(2^23) samples without MEX IQ warnings, I should set it at least at 512MB?

Are you running Windows? If so, try running the 'memory' command after a reboot and fresh launch of MATLAB. This will print details on how much RAM MATLAB can access and the largest array it can currently allocate. If you're running a 32-bit MATLAB binary the maximum array size will be smaller than with a 64-bit environment.

Offline

 

#3 2015-May-27 09:57:58

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

First, I apologize for the delayed response.  There was some crazy weather here yesterday.

In terms of debug steps, I first need to understand a couple more things about your setup:

  1)  What have you set your maximum transport payload size:

Code:

------------------------------------------------------------
Select from the following maximum transport payload size:
[1]           1470 bytes (non-jumbo)
[2]           5000 bytes (jumbo)
[3] (default) 8966 bytes (jumbo)

Depending on your host NIC and network setup you may be able to
use larger packets to increase your transport performance.

2)  If you perform a default initialization of the node, what values do you get for maxPayload and rxBufferSize.  On the Matlab command prompt:

Code:

 node = wl_initNodes(1)
 node.transport.maxPayload
 node.transport.rxBufferSize

Next, are you able to reliably create this error or is it intermittent?  One way to isolate the transport from the rest of your experiment is to use the wl_benchmark command:

Code:

 results = wl_benchmark(node, 'read_iq', 10, 2^23)

The command above will transfer 2^23 samples ten times from the node that you initialized above (this command only tests the transport performance).  When you run this command, it would be good to have the Task Manager open so you can see the memory performance of the system.  One of the "features" of Matlab is that it will use swap space when it needs more memory than physically available on the system.  The downside is that it takes a lot longer to process data once Matlab starts using swap space.  I would like to understand if you are hitting your physical memory limit during the Read IQ command. 

One thing to note is that if you have a 4RF node and want to do a transfer from all four buffers in one Read IQ command, you can use the wl_benchmark command:

Code:

 results = wl_benchmark(node, 'read_iq', 10, 2^23, 4)

If you are able to reliably create this error and everything else looks reasonable, then could you modify the MEX transport to uncomment the for loop on line 2857 so that you can send us the additional debug information.  Once you modify the C code, you will need to delete the .mex* files (i.e. the executable files) in WARPLab_Reference_Design_7.5.1\M_Code_Reference\mex\ (after you unload the transport in Matlab via "clear all"; you might have to run the clear all twice to fully unload the MEX), and recompile the transport. 

It is strange that 571734688 (0x2213FAA0) and -1575748960 (0xA213FAA0) only differ by 0x80000000 which is the sign bit for 32-bit integers.  Looking at the code, we declare everything to be a uint32 (i.e. an unsigned 32 bit integer), but there might be some issue on 32-bit systems that we don't see on 64-bit systems.  Thanks for your help in debugging this issue.

Offline

 

#4 2015-May-28 10:36:18

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Thank you both very much for your responses! And don't worry about the delay because I had been busy with other things anyway.

I've been over this thing over 7 hours now today. So, after many trials, I increased the Virtual Memory paging file size from 2046-404something, to 16384 MB, also I increased the MATLAB heap space at the maximum choise of 831MB, and realized that my PC suffers from JVM memory leak. I haven't figured out how to fix this yet though.

So, to answer your questions murphoo:

- Yes I am running Windows XP Professional.
- After restarting the pc, and ending all tabs and processes on Chrome apart from this page where I write my reply, the "memory" command in my R2011b 32bit MATLAB prints out

Code:

Maximum possible array:             470 MB (4.933e+008 bytes) *
Memory available for all arrays:    781 MB (8.192e+008 bytes) **
Memory used by MATLAB:              313 MB (3.281e+008 bytes)
Physical Memory (RAM):             3326 MB (3.487e+009 bytes)

*  Limited by contiguous virtual address space available.
** Limited by virtual address space available.

And I don't get it at all since the virtual adress space is much more now! My hard drive free space was decreased the amount of MB I allocated to the virtual space. And it doesn't let me put over 831MB in the java.opts file.

And welsh:

1) It defaults to the 3rd choice, 8966 bytes.

2)

Code:

node = wl_initNodes(1)
 node.transport.maxPayload
 node.transport.rxBufferSize
node = 
Displaying properties of 1 wl_node objects:
|  ID |  WLVER |  HWVER |    Serial # |  Ethernet MAC Addr |          Address | 
-------------------------------------------------------------------------------
|   0 |  7.5.1 |      3 |  W3-a-00474 |  40-D8-55-04-23-A0 |         10.0.0.1 |
-------------------------------------------------------------------------------
ans =
        7118
ans =
     4194304

Well, 7118 is a bit less than 7126 that I can ping using cmd and this buffer size is 2^22.

3) So, I uncommented this "for loop" you said, "cleared all" multiple times so that MEX stopped running, deleted the .mex* files from the mex directory, ran wl_setup to be sure that no mex option appeared, and succesfully recompiled mex. But running for one buffer 10 times never printed anything more than:

Code:

results = wl_benchmark(node, 'read_iq', 10, 2^23)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =    8388608  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |     8388608 |          209.72 |         10 |              566263.78 |                      0.47 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results =
     []

The loop I uncommented didn't add anything to the results message. And I always got 0.47-0.48 Mbps Avg Tranfer Speed.

Running for 4 buffers always resulted in an "out of memory" error.

Code:

Error using wl_mex_udp_transport
Out of memory. Type HELP MEMORY for your options.

Error in wl_transport_eth_udp_mex/read_buffers (line 545)
                    [num_rcvd_samples, cmds_used, rx_samples]  =
                    wl_mex_udp_transport('read_iq', obj.sock, data8,
                    length(data8), obj.address, obj.port, num_samples,
                    buffer_ids, start_sample, obj.maxS
Error in wl_baseband_buffers>readIQ (line 1393)
        rxSamples_IQ = node.transport.read_buffers('IQ', numSamps, buffSel,
        offset, myCmd, 0);

Error in wl_baseband_buffers/procCmd (line 576)
                    out = readIQ(obj, node, buffSel, cmdStr, varargin{:});

Error in wl_baseband_buffers/subsref (line 112)
            varargout{:} = builtin('subsref', obj, S);

Error in wl_node/wl_basebandCmd (line 296)
                    out(n) = currNode.baseband.procCmd(n, currNode,
                    varargin{:});

Error in wl_benchmark (line 304)
                    rx_IQ        = wl_basebandCmd(currNode, RF_INF, 'read_IQ',
                    0, RxLength);

So I changed the MEX maximum request size to 2^28 (still I can't know if this was an increase or a decrease), ran "results = wl_benchmark(node, 'read_iq', 1, 2^22, 4)" and, after a lot of read_iq warnings again, I got:

Code:

------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =    4194304  Num buffers =     4
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |     4194304 |          104.86 |          1 |              287691.42 |                      0.47 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results =
     []

The command "results = wl_benchmark(node, 'read_iq', 1, 2^19, 4)" (the number of samples I usually used in our experiments) resulted in:

Code:

------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     524288  Num buffers =     4
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      524288 |           13.11 |          1 |               27390.72 |                      0.61 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results =
     []

Again I had read_iq warnings.

I should point out that the MATLAB process used 250-300MB in the task manager at all times and PF Usage didn't go over 1.2GB. So no I never hit the physical memory limit while running the benchmark code. Maybe the problem is this JVM leak. I am super buffled. :/ And tired.

I hope that my error messages give you a hint about what is really going on. In the meantime, I will try to setup another pc. Luckily there are a few unused in the lab. Thank you again very much!

Offline

 

#5 2015-May-28 15:20:13

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Thank you for such a detailed reply.

Something is definitely not right with some aspect of the transport.  When I run the same command on my machine:

Code:

>> results = wl_benchmark(node, 'read_iq', 10, 2^23)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00006  Num samples =    8388608  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00006 |  WL Mex UDP |         7118 |     8388608 |          209.72 |         10 |                 276.21 |                    971.86 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------


results =

     []

First, let me start off by answering the question about max request size.  When Matlab initializes the socket during initNodes, the code requests an Ethernet receive buffer from the OS for 2^22 bytes (REQUESTED_BUF_SIZE).  This value was chosen b/c it gives good performance and most OSes are able to allocate an Ethernet receive buffer that large.  Therefore, by default, we only allow requests to the node that are 80% of that receive buffer (~3.35 MB) so that the node cannot overwhelm the host with data.  Now, if your host still has issues keeping up (i.e. you are getting "Read IQ / Read RSSI request timed out." warnings), then you can set the maximum request size of the transport to be smaller.  You can see how this value is used here.  By setting the value to 2^28, you are increasing the request size and pretty much guaranteeing that the host cannot keep up and issuing additional warning.  This is why you should not have seen warnings before you set the max request size and why you did see warnings after you set it to 2^28.  If you are going to use this, then you should set it to a value less than (0.8 * 2^22).

Next lets look at the out of memory error:  Each IQ sample is stored in Matlab as a complex double.  This means that each sample requires 16 bytes of memory to be stored in Matlab.  Now, if you are transferring 2^23 samples, this implies that one array of those samples requires 2^27 bytes (i.e. 128 MB).  Therefore, when you try to run the benchmark with 4 buffers, the code tries to allocate 2^29 bytes (i.e. 512 MB) for the samples but as you can see from your "memory" command, the largest array you can allocate is 470 MB.  This is why you get an out of memory error when you request 2^23 samples with 4 buffers but have a successful transfer when you request 2^22 samples with 4 buffers.  In the case of 2^22 samples, the code only requests 2^28 bytes (i.e. 256 MB) which doesn't exceed your memory.

Now, all that being said, I'm still puzzled as to why you are getting such poor performance on your system.  Since I'm not sure where the performance issue is, I would like to try to get a profile of the read IQ performance on your computer (similar to what I did to generate the transport performance benchmarks for my PC).  If you could run the following benchmark commands, it will give us a better idea of the performance of the transport as more memory is required:

Code:

results = wl_benchmark(node, 'read_iq', 1000, 2^10)
results = wl_benchmark(node, 'read_iq', 1000, 2^11)
results = wl_benchmark(node, 'read_iq', 640, 2^12)
results = wl_benchmark(node, 'read_iq', 320, 2^13)
results = wl_benchmark(node, 'read_iq', 160, 2^14)
results = wl_benchmark(node, 'read_iq', 80, 2^15)
results = wl_benchmark(node, 'read_iq', 40, 2^16)
results = wl_benchmark(node, 'read_iq', 20, 2^17)
results = wl_benchmark(node, 'read_iq', 10, 2^18)
results = wl_benchmark(node, 'read_iq', 10, 2^19)
results = wl_benchmark(node, 'read_iq', 10, 2^20)
results = wl_benchmark(node, 'read_iq', 10, 2^21)
results = wl_benchmark(node, 'read_iq', 10, 2^22)

Please feel free to adjust the number of trials down if your average Read IQ time starts getting too long (i.e. greater that 10000 ms).  I don't want this this to take a lot of time, but I want to try to run enough trials to average out any jitter.

Some other questions:
  1) What version of Matlab are you running?
  2) How fast is the Ethernet card in the PC running?  (i.e. 1 Gbps, 100 Mbps, 10 Mbps)
  3) What are the processor specs on the PC? (i.e. Intel Core i7-2600 CPU @ 3.40 GHz)

If we can find a better performance point for your PC, it is pretty straight forward to break up large sample requests using the offset functionality of the Read IQ command.

Also, if none of those benchmark commands results in decent performance, one other thing you might try is to change the REQUESTED_BUF_SIZE to 2^20 bytes or smaller (you will have to modify the this line in the Matlab reference code).  There could be an issue that even though the OS gives you a 2^22 byte Ethernet receive buffer, there are performance issues with a receive buffer that large. 

Thanks for all your help tracking down this issue.

Offline

 

#6 2015-May-29 06:59:31

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Hello again welsh!

Thank you for replying so fast.

First off:
1) I am running MATLAB R2001b (7.13.0.564) 32-bit (win32).
2) My card is the TRENDnet TEG-PCITXR 32-bit 10/100/1000Mbps PCI ADAPTER

This is my second card. I have two so that I can be online the same time I run my experiments.
I modified its properties a bit in the "Advanced" tab and I maxed the Wake-on-LAN speed at 100Mbps (it was 10) and instead of automatic negotiation at Speed & Duplex property, I put 1.0 Gbps/Full Duplex. So any following results will be after those changes.

3) Intel Xeon CPU E5320 @ 1.86GHz
1.86 GHz, 3,25 GB of RAM (yikes..??)

So, before I change the REQUESTED_BUF_SIZE in the code, and without changing the MEX max request size, I got these results (this will be a looooong post):

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^10)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =       1024  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |        1024 |            0.03 |      10000 |                   1.39 |                     23.51 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^11)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =       2048  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |        2048 |            0.05 |      10000 |                   1.61 |                     40.77 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^12)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =       4096  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |        4096 |            0.10 |      10000 |                   1.60 |                     81.68 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^13)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =       8192  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |        8192 |            0.20 |      10000 |                   1.75 |                    150.05 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^14)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =      16384  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |       16384 |            0.41 |      10000 |                   2.06 |                    254.29 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^15)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =      32768  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |       32768 |            0.82 |      10000 |                   2.70 |                    388.67 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

results = wl_benchmark(node, 'read_iq', 10000, 2^16)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =      65536  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |       65536 |            1.64 |      10000 |                   4.36 |                    480.77 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

The command "results = wl_benchmark(node, 'read_iq', 10000, 2^17) was expected to take 1 minute because for one repeat I got 6.67 Avg Read  IQ Time (ms). But I kept getting read iq warnings. I don't think it is a matter of memory leak though because I can see in the Task Manager that the Commit Charge is 871MB out of 19530MB. So I aborted the benchmark experiment. I decided to limit the java heap space to 128MB so that I can have more memory for arrays. Now, memory command gives me:

Code:

Maximum possible array:             670 MB (7.028e+008 bytes) *
Memory available for all arrays:   1487 MB (1.559e+009 bytes) **
Memory used by MATLAB:              319 MB (3.348e+008 bytes)
Physical Memory (RAM):             3326 MB (3.487e+009 bytes)

*  Limited by contiguous virtual address space available.
** Limited by virtual address space available.

So I continued.

Code:

results = wl_benchmark(node, 'read_iq', 9, 2^17)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     131072  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      131072 |            3.28 |          9 |                   6.72 |                    624.47 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results = wl_benchmark(node, 'read_iq', 10, 2^17)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     131072  Num buffers =     1
WARNING:  Read IQ / Read RSSI request timed out.  Retrying remaining samples. 
          If this message occurs frequently, please adjust the Read IQ 
          maximum request size (in bytes) for the transport using the 
          M code function:  
              wl_mex_udp_transport('read_iq_set_max_request_size', size)  
          Defaults to 80 percent of the receive buffer allocated by the OS. 

          To suppress all IQ warnings for the transport use the M code function: 
              wl_mex_udp_transport('suppress_iq_warnings')
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      131072 |            3.28 |         10 |                2733.66 |                      1.53 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

So yeah, for 2^17 samples I found that over 9 repeats give warnings and of course the read iq time averages at high values.

Then, even one repeat of 2^18 gives a warning and 10 repeats gave 10 warnings (so I'll ommit the warnings from now on):

Code:

results = wl_benchmark(node, 'read_iq', 1, 2^18)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     262144  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      262144 |            6.55 |          1 |               13678.81 |                      0.61 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results = wl_benchmark(node, 'read_iq', 10, 2^18)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     262144  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      262144 |            6.55 |         10 |               13725.29 |                      0.61 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

1 repeat of 2^19 gave 2 warnings and 10 repeats gave 20 warnings.

Code:

results = wl_benchmark(node, 'read_iq', 1, 2^19)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     524288  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      524288 |           13.11 |          1 |               27274.17 |                      0.62 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results = wl_benchmark(node, 'read_iq', 10, 2^19)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     524288  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      524288 |           13.11 |         10 |               27388.10 |                      0.61 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

1 repeat of 2^20 gave 6 warnings! 10 repeats gave 50 warnings and finished after approximately 11 minutes as you can see.

Code:

results = wl_benchmark(node, 'read_iq', 1, 2^20)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =    1048576  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |     1048576 |           26.21 |          1 |               82790.95 |                      0.41 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

tic
results = wl_benchmark(node, 'read_iq', 10, 2^20)
toc
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =    1048576  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |     1048576 |           26.21 |         10 |               68327.00 |                      0.49 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
results =
     []
Elapsed time is 683.654514 seconds.

So I suppose there isn't any reason to continue on with 2^21 and 2^22 buffer size, right?

First I will reduce the MEX max request size to 2^16 because I could succesfully do the benchmark test with 10000 repeats using this buffer size, and then do the benchmark again for 2^17 and up.

Code:

  results = wl_benchmark(node, 'read_iq', 10000, 2^17)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     131072  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      131072 |            3.28 |      10000 |                   9.56 |                    438.95 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

SUCCESS!! And continuing...

Code:

results = wl_benchmark(node, 'read_iq', 1000, 2^18)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     262144  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      262144 |            6.55 |       1000 |                  17.32 |                    484.28 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Code:

 results = wl_benchmark(node, 'read_iq', 1000, 2^19)
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     524288  Num buffers =     1
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      524288 |           13.11 |       1000 |                  32.33 |                    518.95 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

On "results = wl_benchmark(node, 'read_iq', 1000, 2^20)" matlab crashed. I tried again. wl_setup, note init, set 2^16 max request size, but it crashed again and again and again. I maximized the heap space again in case this is the problem, but no, it kept crashing. The report log is the following:

Code:

MATLAB crash file:C:\DOCUME~1\Foteini\LOCALS~1\Temp\matlab_crash_dump.3688-1:


------------------------------------------------------------------------
       Segmentation violation detected at Fri May 29 14:33:46 2015
------------------------------------------------------------------------

Configuration:
  Crash Decoding  : Disabled
  Default Encoding: windows-1253
  MATLAB Root     : C:\Program Files\MATLAB\R2011b
  MATLAB Version  : 7.13.0.564 (R2011b)
  Operating System: Microsoft Windows XP
  Processor ID    : x86 Family 6 Model 15 Stepping 11, GenuineIntel
  Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
  Window System   : Version 5.1 (Build 2600: Service Pack 3)

Fault Count: 1



Abnormal termination:
Segmentation violation

Register State (from fault):
  EAX = 000fff68  EBX = 0000005f
  ECX = 49b294cf  EDX = 001003fa
  ESP = 00c261f8  EBP = 00c2624c
  ESI = 000006e8  EDI = 4b100030
 
  EIP = 03a92c97  EFL = 00010206
 
   CS = 0000001b   DS = 00000023   SS = 00000023
   ES = 00000023   FS = 0000003b   GS = 00000000


Stack Trace (from fault):
[  0] 0x03a92c97 C:\WARPlab751\M_Code_Reference\mex\wl_mex_udp_transport.mexw32+00011415 wl_read_baseband_buffer+001831
[  1] 0x03a94dbe C:\WARPlab751\M_Code_Reference\mex\wl_mex_udp_transport.mexw32+00019902 mexFunction+003726
[  2] 0x02066cf4 C:\Program Files\MATLAB\R2011b\bin\win32\libmex.dll+00027892 ( mexRunMexFile+000132 )
[  3] 0x020659e9 C:\Program Files\MATLAB\R2011b\bin\win32\libmex.dll+00023017 ( inSwapMexfileReader+000201 )
[  4] 0x02065c14 C:\Program Files\MATLAB\R2011b\bin\win32\libmex.dll+00023572 ( inSwapMexfileReader+000756 )
[  5] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[  6] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[  7] 0x7b9b49e5 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00608741 ( inDestroyWS+352917 )
[  8] 0x7b9a4080 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00540800 ( inDestroyWS+284976 )
[  9] 0x7b9886d1 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00427729 ( inDestroyWS+171905 )
[ 10] 0x7bc4a07d C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+03317885 ( inMexEvalStringWithTrap+003814 )
[ 11] 0x7b993412 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00472082 ( inDestroyWS+216258 )
[ 12] 0x7b9951cd C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00479693 ( inDestroyWS+223869 )
[ 13] 0x7b997a71 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490097 ( inDestroyWS+234273 )
[ 14] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[ 15] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[ 16] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[ 17] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[ 18] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[ 19] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[ 20] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 21] 0x723b1b53  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00138067 ( mcos::COSValue::COSValue+006227 )
[ 22] 0x723b5386  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00152454 ( mcos::COSString::operator char const *+003766 )
[ 23] 0x723b3f6c  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00147308 ( mcos::COSDictionary::getNameID+003612 )
[ 24] 0x723b1623  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00136739 ( mcos::COSValue::COSValue+004899 )
[ 25] 0x723b0fe4  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00135140 ( mcos::COSValue::COSValue+003300 )
[ 26] 0x723b8ceb  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00167147 ( omIsClassFunction+002747 )
[ 27] 0x7f63e9bc C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059836 ( Mfh_MATLAB_fn::dispatch_fh+000668 )
[ 28] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 29] 0x7b9b0c4f C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00592975 ( inDestroyWS+337151 )
[ 30] 0x7b9a2891 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00534673 ( inDestroyWS+278849 )
[ 31] 0x7b9a21c9 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00532937 ( inDestroyWS+277113 )
[ 32] 0x7b99bbc2 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00506818 ( inDestroyWS+250994 )
[ 33] 0x7b9a2665 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00534117 ( inDestroyWS+278293 )
[ 34] 0x7b9a21c9 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00532937 ( inDestroyWS+277113 )
[ 35] 0x7b99bbc2 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00506818 ( inDestroyWS+250994 )
[ 36] 0x7b99a309 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00500489 ( inDestroyWS+244665 )
[ 37] 0x7b997b6b C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490347 ( inDestroyWS+234523 )
[ 38] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[ 39] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[ 40] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[ 41] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[ 42] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[ 43] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[ 44] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 45] 0x7b99ac96 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00502934 ( inDestroyWS+247110 )
[ 46] 0x7b997c71 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490609 ( inDestroyWS+234785 )
[ 47] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[ 48] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[ 49] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[ 50] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[ 51] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[ 52] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[ 53] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 54] 0x72465400  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00873472 ( COSGetPublicClient+000384 )
[ 55] 0x723b8c86  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00167046 ( omIsClassFunction+002646 )
[ 56] 0x7f63e9bc C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059836 ( Mfh_MATLAB_fn::dispatch_fh+000668 )
[ 57] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 58] 0x7b9b0c4f C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00592975 ( inDestroyWS+337151 )
[ 59] 0x7b9a2891 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00534673 ( inDestroyWS+278849 )
[ 60] 0x7b9a21c9 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00532937 ( inDestroyWS+277113 )
[ 61] 0x7b99bbc2 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00506818 ( inDestroyWS+250994 )
[ 62] 0x7bc45140 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+03297600 ( inFunctionHandleInterface::AnonymousFunctionBinding+003012 )
[ 63] 0x7bb8c69d C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+02541213 ( TabContext::FormCompletion+000535 )
[ 64] 0x7f63ea8c C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060044 ( mdLogging::log_function_exit+000108 )
[ 65] 0x7f63e561 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00058721 ( Mfunction_handle::dispatch+000401 )
[ 66] 0x7f645e30 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00089648 ( Mdispatcher::lookup_builtin+000464 )
[ 67] 0x7f63ea8c C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060044 ( mdLogging::log_function_exit+000108 )
[ 68] 0x7f63e561 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00058721 ( Mfunction_handle::dispatch+000401 )
[ 69] 0x7b99ac96 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00502934 ( inDestroyWS+247110 )
[ 70] 0x7b997c71 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490609 ( inDestroyWS+234785 )
[ 71] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[ 72] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[ 73] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[ 74] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[ 75] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[ 76] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[ 77] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 78] 0x72465400  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00873472 ( COSGetPublicClient+000384 )
[ 79] 0x723b8c86  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00167046 ( omIsClassFunction+002646 )
[ 80] 0x7f63e9bc C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059836 ( Mfh_MATLAB_fn::dispatch_fh+000668 )
[ 81] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 82] 0x7b93b664 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00112228 ( inPathNotification::refresh_notification+002676 )
[ 83] 0x7b9ec7c4 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00837572 ( inSetPredictor+001204 )
[ 84] 0x7b923ab4 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00015028 ( inGetFunctionHandleInterface+007492 )
[ 85] 0x7ba7d9f4 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+01432052 ( inFunctionHandleInterface::getWorkspaceObj+520740 )
[ 86] 0x7b99bbc2 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00506818 ( inDestroyWS+250994 )
[ 87] 0x7b9a2665 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00534117 ( inDestroyWS+278293 )
[ 88] 0x7b9a21c9 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00532937 ( inDestroyWS+277113 )
[ 89] 0x7b99bbc2 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00506818 ( inDestroyWS+250994 )
[ 90] 0x7b99a309 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00500489 ( inDestroyWS+244665 )
[ 91] 0x7b997b6b C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490347 ( inDestroyWS+234523 )
[ 92] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[ 93] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[ 94] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[ 95] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[ 96] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[ 97] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[ 98] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[ 99] 0x72465400  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00873472 ( COSGetPublicClient+000384 )
[100] 0x723b8c86  C:\Program Files\MATLAB\R2011b\bin\win32\mcos.dll+00167046 ( omIsClassFunction+002646 )
[101] 0x7f63e9bc C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059836 ( Mfh_MATLAB_fn::dispatch_fh+000668 )
[102] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[103] 0x7b99ac96 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00502934 ( inDestroyWS+247110 )
[104] 0x7b997c71 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00490609 ( inDestroyWS+234785 )
[105] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[106] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[107] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[108] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[109] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[110] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[111] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[112] 0x7b99ac96 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00502934 ( inDestroyWS+247110 )
[113] 0x7b927165 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00029029 ( inGetFunctionHandleInterface+021493 )
[114] 0x7b99909f C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00495775 ( inDestroyWS+239951 )
[115] 0x7b9a6807 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00550919 ( inDestroyWS+295095 )
[116] 0x7b9a6922 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00551202 ( inDestroyWS+295378 )
[117] 0x7b9862c7 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00418503 ( inDestroyWS+162679 )
[118] 0x7b9882cc C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00426700 ( inDestroyWS+170876 )
[119] 0x7b978989 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00362889 ( inDestroyWS+107065 )
[120] 0x7f63ec53 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00060499 ( Mfh_file::dispatch_fh+000403 )
[121] 0x7f63e686 C:\Program Files\MATLAB\R2011b\bin\win32\m_dispatcher.dll+00059014 ( Mfunction_handle::dispatch+000694 )
[122] 0x7b9eba06 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00834054 ( inAnonymousFunction+001046 )
[123] 0x7b9f6bcf C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00879567 ( init_cleaner+001119 )
[124] 0x7b9f76e9 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00882409 ( init_cleaner+003961 )
[125] 0x7b9f76c5 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00882373 ( init_cleaner+003925 )
[126] 0x7b9f7680 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00882304 ( init_cleaner+003856 )
[127] 0x7b9dabe4 C:\Program Files\MATLAB\R2011b\bin\win32\m_interpreter.dll+00764900 ( inCallFcn+002052 )



This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help.

I tried changing the requested buffer size in the classes/wl_transport_eth_udp_mex.m file, as you told me, to 2^19, but wouldn't this mean that I couldn't set the receiver's buffer size over 2^19?

So these are my results. And on 4 buffers:

Code:

 tic
results = wl_benchmark(node, 'read_iq', 1000, 2^19, 4)
toc
------------------------------------------------------------
Read IQ running on node 1 of 1:  ID =    0  Serial Number =   W3-a-00474  Num samples =     524288  Num buffers =     4
------------------------------------------------------------
Displaying results of 1 nodes:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
|  ID |  WLVER |    Serial # |   Transport | Pkt Size (B) | Num Samples | TX/RX Time (ms) | Num Trials | Avg Read  IQ Time (ms) | Avg Transfer Speed (Mbps) |
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 |  7.5.1 |  W3-a-00474 |  WL Mex UDP |         7118 |      524288 |           13.11 |       1000 |                  31.64 |                    530.23 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------

results =
     []
Elapsed time is 129.103519 seconds.

Compared to my problem in the thred title, this is awesome.
I am sorry I didn't edit this post so that I can briefly tell you what I discovered. Now that I got the idea about the max request size, I will test some different sizes so that I can achieve better performance and I will continue working with 2^19 buffer sizes. If I find this restricting the amount of work I can get from experiments in a given amount of time, then I will change to a 64bit pc and newer version of MATLAB.

Thank you again very very much!

Edit: Setting max request size at 2^19 I got a bit over 700 Mbps average transfer speed for 4x2^19 samples. (Yeay!) Also, when I tried running again my latest energy-detection experiments that took over 4 hours to finish, I just needed to increase the pause before the read_iq a bit because I got some "Node was not ready to process Write IQ request." warnings. So instead of "pause(1.2 * BUFFER_LENGTH * (1/40e6));" I put "pause(1.2 * (BUFFER_LENGTH*2) * (1/40e6));" and the warnings disappeared. The experiments now take less than 4 minutes!

Last edited by FoufiDoumi (2015-May-29 07:36:05)

Offline

 

#7 2015-May-29 12:19:20

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Great.  I'm glad you were able to get to a better point with your experiments.  Waiting to transfer samples can be very frustrating.

Based on your results, it looks like that even though the OS gave you a 2^22 Ethernet receive buffer, it could not really handle more than 2^16 bytes. 

So I suppose there isn't any reason to continue on with 2^21 and 2^22 buffer size, right?

Definitely not :)  You were able to find the better performance points.

If you look at the documentation for Read IQ, you can see that there is both an offset and a length that can be passed to the command.  From that, you could actually use multiple Read IQ commands to read longer capture periods.  Unfortunately, there is a bug in the WL 7.5.1 reference design when using the offset functionality.  I have fixed the bug in SVN so you will have to pull in two files:

1) M_Code_Reference/mex/wl_mex_udp_transport.c
2) M_Code_Reference/classes/wl_baseband_buffers.m

You can see the changes: 

1) wl_mex_udp_transport.c
2) wl_baseband_buffers.m

The updated code will return the number of samples requested starting at the offset provided vs how to documentation describes it.  This is just a quick fix in case you need it, but we need to internally decide if this is how we want to do offsets vs the way it is described in the documentation where you always get the number of samples requested and the offset determines which samples are valid (i.e. (offset:num_samples) would be valid in the (0:num_samples) array). 

Based on this update, here is how you would have to modify some example code to use two read IQ calls to pull a larger buffer (These excerpts are from  wl_example_siso_txrx.m):

Code:

...

% Set capture lengths
RXLength    = txLength/2;
RSSILength  = txLength/(Ts_RSSI/Ts);

...

% Read the IQ and RSSI data from the RX node 
rx_IQ_0  = wl_basebandCmd(node_rx, [RF_RX], 'read_IQ', 0, RXLength);
rx_IQ_1  = wl_basebandCmd(node_rx, [RF_RX], 'read_IQ', RXLength, RXLength);
rx_IQ    = [rx_IQ_0; rx_IQ_1];
RXLength = RXLength * 2;

...

Basically, this allows you to read sections of the sample buffer and concatenate them to create a larger array.  We will finalize how we want the offset to behave longer term and fix this in the next release.  However, please feel free to use the above updates in your experiments if you need them.


On "results = wl_benchmark(node, 'read_iq', 1000, 2^20)" matlab crashed. I tried again. wl_setup, note init, set 2^16 max request size, but it crashed again and again and again. I maximized the heap space again in case this is the problem, but no, it kept crashing. The report log is the following:

I'm not sure why Matlab would keep crashing.  I'll play around with this but given you are currently able to run your experiments, I won't be able to get to this for a little while.

I tried changing the requested buffer size in the classes/wl_transport_eth_udp_mex.m file, as you told me, to 2^19, but wouldn't this mean that I couldn't set the receiver's buffer size over 2^19?

You should always set the requested buffer size to be less than 80-ish % of the receiver's buffer size.  This is to give you some head room so the host doesn't drop any packets.  However, as you can see from your data, even though you requested a 2^22 byte buffer and the OS granted it, the computer can't really handle a buffer that large.

Edit: Setting max request size at 2^19 I got a bit over 700 Mbps average transfer speed for 4x2^19 samples. (Yeay!) Also, when I tried running again my latest energy-detection experiments that took over 4 hours to finish, I just needed to increase the pause before the read_iq a bit because I got some "Node was not ready to process Write IQ request." warnings. So instead of "pause(1.2 * BUFFER_LENGTH * (1/40e6));" I put "pause(1.2 * (BUFFER_LENGTH*2) * (1/40e6));" and the warnings disappeared. The experiments now take less than 4 minutes!

The pause was an approximation that worked on the machines we tested on.  Increasing it is not a problem.  You would probably be safe by just using "pause(2 * BUFFER_LENGTH * (1/40e6));", but that doesn't matter as long as you have something that works.

Thanks again for your detailed post.  Let us know if you have any other issues.

Offline

 

#8 2015-Jun-02 10:24:35

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Hello again!

I decided to post this one last message to report that I downloaded the files you told me to in order to use the offset in read_iq.

At the moment, my MATLAB can't hold more than 670MB of data in an array, which translates to 10977280 samples buffer length per RF in case of 4 RFs. I put the REQUESTED_BUF_SIZE at 2^19, the max request size at 2^19 and tried to read 4x10977280 samples using an offset of 2^19 samples and this block of code:

Code:

...
BUFFER_LENGTH = 10977280; % multiplied by 4 RFs it equals to the 670 MB room that MATLAB gives to an array.
OFFSET = 2^19; % Equals to 524288 samples.
rx = zeros(BUFFER_LENGTH,4); % So that we fill the array with the samples.
...
for i = 1:floor(BUFFER_LENGTH/OFFSET)
    rx((i-1)*OFFSET+1:i*OFFSET,:) = wl_basebandCmd(RX_NODE,[RX_RF_1 RX_RF_2 RX_RF_3 RX_RF_4],'read_IQ',(i-1)*OFFSET,OFFSET);
end
rx(20*OFFSET+1:end,:) = wl_basebandCmd(RX_NODE,[RX_RF_1 RX_RF_2 RX_RF_3 RX_RF_4],'read_IQ',20*OFFSET,BUFFER_LENGTH-(20*OFFSET));
...

No read IQ warnings were printed but the wl_rx_iq_length_did_warn variable appeared after the experiment having value of 1 and what happened was that the rx array in the end had only read approximately the first 2^17 samples of each 2^19 block of samples for each RF. The rest were zero. I find it a bit weird that only about 1/4 of 2^19 sample blocks were transferred in MATLAB workspace but I think my code is correct. Each time I point at the sample the read_iq can start reading and then the number of samples I need to read. So at first it must read 2^19 samples starting from the sample zero, then 2^19 starting from sample 2^19, etc. The blocks of data that I read were all different to each other, no correlation what so ever.

So I put the OFFSET at 2^17 and re-ran (had to make some changes because 83 blocks of 2^17 samples could fit in this BUFFER_LENGTH)

Code:

...
OFFSET = 2^17; % Equals to 131072 samples.
rx = zeros(BUFFER_LENGTH,4); % So that we fill the array with the samples.
...
for i = 1:floor(BUFFER_LENGTH/OFFSET)
    rx((i-1)*OFFSET+1:i*OFFSET,:) = wl_basebandCmd(RX_NODE,[RX_RF_1 RX_RF_2 RX_RF_3 RX_RF_4],'read_IQ',(i-1)*OFFSET,OFFSET);
end
rx(floor(BUFFER_LENGTH/OFFSET)*OFFSET+1:end,:) = wl_basebandCmd(RX_NODE,[RX_RF_1 RX_RF_2 RX_RF_3 RX_RF_4],'read_IQ',floor(BUFFER_LENGTH/OFFSET)*OFFSET,BUFFER_LENGTH-(floor(BUFFER_LENGTH/OFFSET)*OFFSET));
...

This time there were no zero values in the rx array, not even towards the last received samples. Reading all the samples took 4.82 seconds. But the wl_rx_iq_length_did_warn variable appeared again with a value of 1. What does this mean? Since I set the max receive size at 2^19, which translates to 4x8192 samples, then I can't use an offset bigger than 8192 samples? Is there any possibility that the samples I receive aren't the correct ones and I lose some? How can I be sure that the samples I read are the exact samples the WARPs received?

In the mean time I realized that the REQUESTED_BUF_SIZE in wl_transport_eth_udp_mex.m is the value that appears after the "node.transport.rxBufferSize" command. So I can change it according to my needs everytime. But then I need some things to get clarified please:

1) The MEX max request size is in total samples, samples per RF or in bytes?
2) At what value does the max request size default to anyway?
3) When I use the command "wl_mex_udp_transport('read_iq_set_max_request_size', size) what do I actually overwrite?
and 4) In case of an out of memory error where the experiment aborts before the buffers/RFs disable commands, do the buffers and RFs get disabled or should I run those 2 commands each and everytime something like this happens?

Again thank you very much in advance and I am sorry I try WARPLab in its limits but I am always interested in maximum capacities and time optimization so that is why. :$

Offline

 

#9 2015-Jun-02 22:43:27

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

No problem on the questions, we have been trying to push the performance of WARPLab so you can take advantage of it.  The only issue is that I'm out of the office this week and next so I won't be able to test out any of your code or dig into why you are seeing the issue with 2^19 vs 2^17 buffer sizes.  I'll look into that when I get back and have a setup I can test things on. 

Also, I'll respond to the other questions in your post tomorrow.  I apologize for the delay.

Offline

 

#10 2015-Jun-03 09:14:42

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

No worries! I will be waiting. It's ok. Thank you again very much for everything!

Offline

 

#11 2015-Jun-03 23:03:19

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Thanks.  Since there were a number of questions in the last post, I'll try to go thru them in order.  If I missed something, let me know.

But the wl_rx_iq_length_did_warn variable appeared again with a value of 1. What does this mean?

The wl_rx_iq_length_did_warn is a variable that we using in wl_baseband_buffers.m in order to indicate whether the RX length was explicitly set before the RX buffer was enabled.  If you did not see a warning printed to the Matlab console, then there are no issues and you can ignore this variable.

Since I set the max receive size at 2^19, which translates to 4x8192 samples, then I can't use an offset bigger than 8192 samples? Is there any possibility that the samples I receive aren't the correct ones and I lose some? How can I be sure that the samples I read are the exact samples the WARPs received?

We have built in a number of debug features into the buffers core and you can use these features to help test that everything is working.  In wl_baseband.h in the EDK project, we have two debug defines:
"USE_GENERATED_RX_DATA" and "USE_TX_RX_LOOPBACK". 

  If you set "USE_GENERATED_RX_DATA" to '1' then this will cause the buffers core to use an internal counter to populate the RX data vs what was received on the RF interface.  The counter is a standard up-counter that wraps so you will get saw-tooth patterns in the data.  I believe the counter is 16 bits (I don't have System Generator on this computer, so I can't open the buffers core to check) and the data is inverted between I and Q.  You should be able to run one of the standard examples with a bitstream that has "USE_GENERATED_RX_DATA" enabled, you should be able to get a feel for how the data should look.  Also, one thing to note is that consecutive samples differ by the same amount (except in the case of a wrap), so it is easy to see if the data is correct and complete.

  If you set "USE_TX_RX_LOOPBACK" to '1' then this will cause the buffers core to bypass the RF interface and "directly receive" the data in the TX buffer.  This allows you to put a known waveform in the TX buffer and then check to make sure it was "transmitted" and "received" correctly in the RX buffer.  This is mainly used for to test the TX side of the buffers core while the generated data was more to test the RX side of the buffers core.

  Hopefully, you can use these to help you make sure you are transmitting and receiving all of your data correctly.

1) The MEX max request size is in total samples, samples per RF or in bytes?

The wl_mex_udp_transport('read_iq_set_max_request_size', size) requires a request size in bytes.

2) At what value does the max request size default to anyway?
3) When I use the command "wl_mex_udp_transport('read_iq_set_max_request_size', size) what do I actually overwrite?

The max request size is used here in the mex code.  Basically, you can see that if you have used the command "wl_mex_udp_transport('read_iq_set_max_request_size', size)", then "useful_rx_buffer_size" is set to your value.  Otherwise, it defaults to 80% of the socket RX buffer that you set when you opened the socket (i.e. 2^22 bytes in the release). 

4) In case of an out of memory error where the experiment aborts before the buffers/RFs disable commands, do the buffers and RFs get disabled or should I run those 2 commands each and everytime something like this happens?

When Matlab crashes, the node is left in whatever state it was in when the crash occurred.  In general, if Matlab crashes, it is a good idea to restart the node by re-downloading the bitstream since it can be hard to determine the exact state of the node.

Offline

 

#12 2015-Jun-04 08:06:34

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Hello again!

Thank you very very much for all this information. The USE_GENERATED_RX_DATA will definitely come in handy.

But I am not sure I understand completely when you say

...it is a good idea to restart the node by re-downloading the bitstream since it can be hard to determine the exact state of the node.

You mean that I should turn off the nodes, put the user IO switches to dynamic configuration mode and turn them on again to re-configure them? Doesn't turning them off and on "reset" their state?

Offline

 

#13 2015-Jun-04 09:42:06

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Re-configuring the FPGA is the best way to assure the node is in a known state. You can boot up the node with a static ID (DIP switch in [0,0xE]) or dynamic ID (DIP switch 0xF). Either mode will result in a good initial state for the node.

Offline

 

#14 2015-Jun-23 09:42:27

FoufiDoumi
Member
Registered: 2014-May-05
Posts: 14

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Hello there again!

I finally set up a 64bit machine but I am still having problems, not with memory anymore, but with MEX.

Now I use the latest 64bit R2015a with the academic license our institute has purchased. I am using the same network card as I did in the 32bit machine and the maxPayload and rxBufferSize values are the same (7118 and 4194304).

I could succesfully compile MEX after I faced some problems because the 2015 MATLAB couldn't see the 2010 C++ compiler in my system. So I needed to unistall all redistributables and install the supported and compatible compilers for MATLAB 2015 (http://www.mathworks.com/support/compil … index.html). I succesfully compiled MEX using the c++ compiler from SDK 7.1. So I have MEX on my system as you can see from this message:

Code:

>> wl_mex_udp_transport('version');
Loaded wl_mex_udp_transport version 1.0.2a 
WARPLab MEX UDP Transport v1.0.2a (compiled Jun 18 2015 14:24:13)
Copyright 2013, Mango Communications. All rights reserved.
Distributed under the WARP license:  http://warpproject.org/license

The problem is this: changing the mex max request size doesn't have good results SOMETIMES. What I mean by that "sometimes" is that a few days ago I could have up to 800Mbps transfer speed with a benchmark command of 2^25 samples from 4 RFs and max request size 2^18 bytes. Today I could only read up to 2^13 samples from 4 RFs with max request size 2^14 bytes (any bigger than this printed out read iq warnings) and when I tried to read 2^14 samples MATLAB would crash. No details about what was causing MATLAB to fail and no memory issues.

I am really confused by this. I had this exact problem some days ago again but it somehow fixed itself. I don't know if recompiling mex would help but in order to do that I should again uninstall 2005/2008/2010 redistributables in order for MATLAB to be able to see the compilers of SDK 7.1. Well, those will get re-installed on MATLAB startup, but for that session at least it will be able to use the SDK 7.1 compilers. This is a known issue for MATLAB 2015 you see.

So do you have any idea what might be the problem? The last time it fixed itself as I said above, I just installed windows updates (I am on Windows 7 Enterprise Service Pack 1) and rebooted. I am lost again. :(

Thank you in advance for all your help. You are doing a great job.

Faye

Offline

 

#15 2015-Jun-23 14:03:48

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

That is frustrating. 

First, is that the only NIC that you have available?  Also, are you using a switch between the NIC and the WARP kit or is this a direct connection?  I ask because we have seen issues with flaky NICs and switches which can manifest in performance issues when packets are dropped. 

In terms of a compiler, I believe that the MEX code for the transport should be able to be compiled with Microsoft Visual C++ 2013 if that is easier to use with MATLAB 2015 (while I have not personally tested it, one of our users was able to use it successfully).  As of the WARPLab 7.5 release, we no longer require the Microsoft Visual C++ 2010 compiler (you can see in this SVN commit).  That might make things a bit easier in terms of setup. 

I'll keep looking to see what else might have caused this but a flaky switch or NIC is a prime suspect.

Offline

 

#16 2015-Jun-23 14:20:55

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Also, try a different Ethernet cable (at least CAT 5e, preferably CAT 6). A bad wire or pin in the cable can cause this sort of intermittent packet loss.

Offline

 

#17 2015-Jul-22 20:07:14

dineshb
Member
Registered: 2011-Feb-05
Posts: 25

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

What is the right value to set for read_iq_set_max_request_size ? It seems its all heuristic based and further varies on day to day basis, is that correct ?

Offline

 

#18 2015-Jul-22 22:55:04

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

If you look at how the user settable maximum request size is used, you can see that by default, we make a maximum request to the WARP node that is 80% of the socket buffer we request from the OS during initialization.  By default, we request an 8 MB buffer (i.e. 2^23 bytes).  In most systems, if we request an 8MB socket buffer from the OS, and the OS cannot provide that much buffer space, then it will allocate a smaller buffer and tell us how much buffer space we can actually use.  Therefore, the maximum request that transport issues is adjusted accordingly and there are no issues.  However, we have seen cases where the OS tells us that an 8MB socket buffer is available but in reality there is much less than 8MB available (i.e. the OS begins to drop Ethernet packets way before 8 MBs of data is transferred).  When a situation like this occurs, then you can use the maximum request size to tune the transport for your system. 

Hence, there is no "right value" to set read_iq_set_max_request_size because it is entirely host dependent (i.e. it depends on the specifications of the host computer you are using to interact with the WARP node(s)) and arises from a corner case in which the OS is not being honest with the software.  In general, you should never see any warnings from the transport since all the request sizes should be adjusted automatically for you under the hood during initialization.  However, if you have a flaky NIC, Ethernet switch or Ethernet cables, this can manifest itself as a transport issue since we rely on a stable, uncongested Ethernet connection to reduce the overhead of the Read IQ and Write IQ UDP transfers and increase performance.  As long as your hardware is stable, you should not see any changes in your ability to use the transport without warnings.

For reference, in the WARPLab Benchmarks, you can see the performance we have been able to achieve using the default values of the reference design (i.e. a maximum request size that is 80% of the default 8MB buffer).  The benchmarks also show the hardware and software we used to achieve that performance.

Offline

 

#19 2018-Jul-18 16:30:19

dword1511
Member
Registered: 2018-Jul-18
Posts: 2

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

This is an error in the WARPLab MEX code. At least for WARPLab 7.7.1, gcc 7.3.0 and 64-bit Linux the problem still exists.

The fix is simple: In function wl_read_iq_sample_error(), change
  "start_sample_total = (num_pkts * start_sample) + (((num_pkts * (num_pkts - 1)) * max_sample_size) >> 1);"
to
  "start_sample_total = ((uint64_t)num_pkts * start_sample) + ((((uint64_t)num_pkts * (num_pkts - 1)) * max_sample_size) >> 1);".

Offline

 

#20 2018-Jul-19 09:32:06

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

Thanks for posting. I don't have a Linux/MATLAB machine to test with - can you clarify how the error manifested? Was it a compiler warning/error or incorrect behavior at runtime? It looks like the only change is the uint64_t cast for num_pkts (a uint32 argument).

Offline

 

#21 2018-Jul-22 17:29:06

dword1511
Member
Registered: 2018-Jul-18
Posts: 2

Re: Optimal MEX settings (a.k.a. my PC reads 4*2^23 samples in 36min)

murphpo wrote:

Thanks for posting. I don't have a Linux/MATLAB machine to test with - can you clarify how the error manifested? Was it a compiler warning/error or incorrect behavior at runtime? It looks like the only change is the uint64_t cast for num_pkts (a uint32 argument).

Yes, that's exactly the change needed to fix it. It is probably specific to gcc. Before this change, I was getting exactly the same error as mentioned by OP, with sample indexes and sum differing by the sign bit.

Offline

 

Board footer