The Tag Field of labSendReceive() Function
Mostra commenti meno recenti
Hello, the Forum!
The following code allows the dataReceived vector of each node has the same values in its nodeList. But my question is how to make use of the "tag". I wish to inform the neighboring agents, say j, that some data corresponds to Agent i. I did it this way: dataReceived = [dataReceived, labSendReceive(nodeList{labindex}(i),nodeList{labindex}(i),labindex, labindex)], but it turned out to be something like an infinite loop. Thank you!
nodeList{1} = [2,4];
nodeList{2}= [1,4];
nodeList{3} = 4;
nodeList{4} = [1,2,3];
parpool('local',4);
spmd
% mydata = magic(labindex);
dataReceived = [ ];
for i = 1:length(nodeList{labindex})
% labSend(labindex,nodeList{labindex}(i));
% dataReceived = [dataReceived, labReceive(nodeList{labindex}(i))];
dataReceived = [dataReceived, labSendReceive(nodeList{labindex}(i),nodeList{labindex}(i),labindex)];
end
end
Risposta accettata
Più risposte (1)
Walter Roberson
il 20 Lug 2020
0 voti
The tag parameter is mostly intended to permit priority queuing. Except rather than the standard priority according to numeric values, the receiving end can query for a particular value to handle those first
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!