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

조회 수: 9 (최근 30일)
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
Raymond Norris
Raymond Norris 2024년 1월 6일
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 2024년 1월 6일
편집: Tarek Mohamed Amin 2024년 1월 6일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by