LOS function doesn't properly output the LOS state when it's run in using parpool

9 views (last 30 days)
When I run the los function in a squential manner I got some reasonable results, but when I run the same function using Parallel computing using Processes profile, I got a different results, most of the results is 1's only.
Here is the sequential line..
LOS = los(tx, rx);
here is the parallel line:
los1 = parfeval(@los ,1,tx, rx);
LOS = fetchOutputs(los1);
the results are is is the follwing images:
for sequential output, SEE LOS Columns
for sequential input SEE LOS Columns
  5 Comments
Raymond Norris
Raymond Norris on 6 Jan 2024
Can you provide more code as to how to run this (specifically how you build up tx and rx)? I don't think I'm doing it right.
>> tx_rx = readmatrix('1.csv.xlsx','NumHeaderLines',1,'ExpectedNumVariables',2,'OutputType','double','FileType','spreadsheet');
>> tx = txsite("Latitude",13.419169,"Longitude",-16.705148,"AntennaHeight",22);
>> rx = rxsite("Latitude",tx_rx(1,1),"Longitude",tx_rx(1,2),"AntennaHeight",22);
>> LOS = los(tx,rx);
>> LOS2 = parfeval(@los,1,tx,rx);
>> LOS
LOS =
logical
1
>> fetchOutputs(LOS2)
ans =
logical
1
>>
>> rx = txsite("Latitude",-89.8248,"Longitude",-0.30577,"AntennaHeight",22);
>> LOS = los(tx,rx);
>> LOS2 = parfeval(@los,1,tx,rx);
>> LOS
LOS =
logical
0
>> fetchOutputs(LOS2)
ans =
logical
0
>>
Tarek Mohamed Amin
Tarek Mohamed Amin on 6 Jan 2024
Edited: Tarek Mohamed Amin on 6 Jan 2024
rx = rxsite("Latitude",lats, ...
"Longitude",longs, ...
"AntennaHeight",1.5);
this is how I create the Rx, the creation of tx is just passing the the lat and long of the tx,
here Lats and Long is a sequence of latitudes and longitudes of the positions of the receivers, please note that you need to import the map file to be able to get the correct results.
so as your code, you can type:
rxs = rxsite("Latitude", tx_rx(:, 1), "Longitude", tx_rx(:, 2));
and then pass the rxs variable to the loss function.
the problem happens when the rx not a single point, it's a sequence instead @Raymond Norris

Sign in to comment.

Answers (0)

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!