f



problem with parallel matlab

for i=1:size(APLocation,1)
    point=APLocation(i,:);
    parfor j=1:length (RXpoint)
        rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal strength from all AP's
    end
end

when i'm running the following code, i get the same value for each element of rssi (serially i get different results)


where is my problem?
0
michael
5/19/2010 2:36:04 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
1082 Views

Similar Articles

[PageSpeed] 12

Creating some fake data and and implementing a simple LOSS function, I do 
not see a different between the serial and parallel execution.  Does LOSS 
use any persistent or global variables?



function [ rssi rssi2 ] = foo



APLocation = rand(10);

RXpoint = rand(10) * 5;



for i=1:size(APLocation,1)

    point=APLocation(i,:);

    parfor j=1:length (RXpoint)

        rssi(i,j) = LOSS(point,RXpoint(:,j)');

    end

end



for i=1:size(APLocation,1)

    point=APLocation(i,:);

    for j=1:length (RXpoint)

        rssi2(i,j) = LOSS(point,RXpoint(:,j)');

    end

end



end



function rv = LOSS( a,b )

rv = sum( a+b );

end


"michael" <bezenchu@gmail.com> wrote in message 
news:ht0t0k$fce$1@fred.mathworks.com...
> for i=1:size(APLocation,1)
>    point=APLocation(i,:);
>    parfor j=1:length (RXpoint)
>        rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal 
> strength from all AP's
>    end
> end
>
> when i'm running the following code, i get the same value for each element 
> of rssi (serially i get different results)
>
>
> where is my problem?
> 


0
Jeremy
5/19/2010 2:55:10 PM
yes

LOSS uses some global variables but they doesn't change in LOSS.
they have constant value and i use them only to simplify my program.

"Jeremy Greenwald" <jgreenwa@mathworks.com> wrote in message <ht0u4f$d5$1@fred.mathworks.com>...
> Creating some fake data and and implementing a simple LOSS function, I do 
> not see a different between the serial and parallel execution.  Does LOSS 
> use any persistent or global variables?
> 
> 
> 
> function [ rssi rssi2 ] = foo
> 
> 
> 
> APLocation = rand(10);
> 
> RXpoint = rand(10) * 5;
> 
> 
> 
> for i=1:size(APLocation,1)
> 
>     point=APLocation(i,:);
> 
>     parfor j=1:length (RXpoint)
> 
>         rssi(i,j) = LOSS(point,RXpoint(:,j)');
> 
>     end
> 
> end
> 
> 
> 
> for i=1:size(APLocation,1)
> 
>     point=APLocation(i,:);
> 
>     for j=1:length (RXpoint)
> 
>         rssi2(i,j) = LOSS(point,RXpoint(:,j)');
> 
>     end
> 
> end
> 
> 
> 
> end
> 
> 
> 
> function rv = LOSS( a,b )
> 
> rv = sum( a+b );
> 
> end
> 
> 
> "michael" <bezenchu@gmail.com> wrote in message 
> news:ht0t0k$fce$1@fred.mathworks.com...
> > for i=1:size(APLocation,1)
> >    point=APLocation(i,:);
> >    parfor j=1:length (RXpoint)
> >        rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal 
> > strength from all AP's
> >    end
> > end
> >
> > when i'm running the following code, i get the same value for each element 
> > of rssi (serially i get different results)
> >
> >
> > where is my problem?
> > 
> 
0
michael
5/19/2010 3:09:05 PM
It may be that the global variables used by LOSS are not initialized on the 
workers.  Can you verify that the values of the global variables are set on 
the workers?
"michael" <bezenchu@gmail.com> wrote in message 
news:ht0uuh$p08$1@fred.mathworks.com...
> yes
>
> LOSS uses some global variables but they doesn't change in LOSS.
> they have constant value and i use them only to simplify my program.
>
> "Jeremy Greenwald" <jgreenwa@mathworks.com> wrote in message 
> <ht0u4f$d5$1@fred.mathworks.com>...
>> Creating some fake data and and implementing a simple LOSS function, I do 
>> not see a different between the serial and parallel execution.  Does LOSS 
>> use any persistent or global variables?
>>
>>
>>
>> function [ rssi rssi2 ] = foo
>>
>>
>>
>> APLocation = rand(10);
>>
>> RXpoint = rand(10) * 5;
>>
>>
>>
>> for i=1:size(APLocation,1)
>>
>>     point=APLocation(i,:);
>>
>>     parfor j=1:length (RXpoint)
>>
>>         rssi(i,j) = LOSS(point,RXpoint(:,j)');
>>
>>     end
>>
>> end
>>
>>
>>
>> for i=1:size(APLocation,1)
>>
>>     point=APLocation(i,:);
>>
>>     for j=1:length (RXpoint)
>>
>>         rssi2(i,j) = LOSS(point,RXpoint(:,j)');
>>
>>     end
>>
>> end
>>
>>
>>
>> end
>>
>>
>>
>> function rv = LOSS( a,b )
>>
>> rv = sum( a+b );
>>
>> end
>>
>>
>> "michael" <bezenchu@gmail.com> wrote in message 
>> news:ht0t0k$fce$1@fred.mathworks.com...
>> > for i=1:size(APLocation,1)
>> >    point=APLocation(i,:);
>> >    parfor j=1:length (RXpoint)
>> >        rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal 
>> > strength from all AP's
>> >    end
>> > end
>> >
>> > when i'm running the following code, i get the same value for each 
>> > element of rssi (serially i get different results)
>> >
>> >
>> > where is my problem?
>> >
>>
> 


0
Jeremy
5/19/2010 5:06:01 PM
Reply:

Similar Artilces:

parallel matlab
Hi all, I'm going to work on a project involving a parallel version of MATLAB - I'm aware of various efforts like MATLAB-*P and so on Right now I need to read up on some material regarding MATLAB internals eg: How are the ATLAS(or is it BLAS) routines called in MATLAB? How does MATLAB's C code store information in memory, cache'ing etc? How is one to get at those? Do you know of any suitable reference(s)/resource(s)? Thank you very much, Aravind ...

Matlab 7
I have Matlab 7.0, including Matlab Web server (ver 1.2.3). I have a problem using it. My computer is XP Prof (SP2), Pentium 1GHz. This problem does not occur with Matlab 6.5. The Matlab server is executed from a Web page and it launches Matlab 7 functions. The Matlab functions compute results and display these (using Matlab server) on other Web pages. The problem and observations are: 1. After the server-launched Matlab finishes its work, if I open a new Matlab 7, this runs very slowly because it uses up more than 80% of computer CPU (and about 60MB memory). 2. The launched Matlab, even af...

Matlab parallel for loop or Matlab open pool
I am trying to to some computations and I would like to do it in parallel using parfor or by Opening the matlabpool.. as the current implementations is too slow: result=zeros(25,16000); for i = 1:length(vector1) % length is 25 for j = 1:length(vector2) % length is 16000 temp1 = vector1(i); temp2 = vector2(j); t1 = load(matfiles1(temp1).name) %load image1 from matfile1 t2 = load(matfiles2(temp2).name) % load image2 from matfile2 result(i,j)=t1.*t2 end end It work fine but I would re...

technical problem with matlab 7R14sp1 start matlab
Its for a problem when i start matlab there is an error message and i can t use matlab --------------------------------------------------------- the message is: microsoft visual c++ runtime library runtime error! program:c\Apllications\matlab7\bin\win32 \matlab.exe this application has requested the runtime to terminate it in an unusual way. Please contact the application's support team for more information ------------------------------------------------------- It is very annoying because i work very much with matlab. ...

Problems calling from Matlab a Matlab compiled dll
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

problems when changing from matlab R2007a to matlab R2008b
Hi all, I have problems when changing from matlab R2007a to matlab R2008b. I have a simulink model running in R2007a which i use to obtain certain results. Nevertheless, these results are differents when i try to run the same simulink model in R2008b. I have done nothing different but running the same model in the new matlab version. I don?t know if i have to change some configuration parameter connected to the new matlab version. If someone could help i would appreciate it. Thank you Dami?n Palenzuela ...

Problems calling from Matlab a Matlab compiled dll #2
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits platform . Thanks in advance, Nicolas On 10-12-03 01:22 AM, Nicolas wrote: > Is there any limitation to run Matlab from Matlab, as a system command, > on Linux platforms ? > I tried to start Matlab, both using the ! syntax (!matlab&) or the > system command (system('matlab&')), the Matlab splash screen appears, > but the new Matlab session closes rapidly . > When I do the same with a script of mine (system('matlab -r > "myscript"&')), my script is being executed, but Matlab finally crashes . > If I remove the &, it works well, but the first Matlab session is > blocked till I close the second one . > I run Matlab on a Linux 64bits platform . It appears there is a parsing problem in the script that invokes Matlab. Here's an example of what I had to do to get around it: !matlab -r \""...

Problems calling from Matlab a Matlab compiled dll #3
Hi, I'm trying to make a dll from an m-file and use the dll function calling from the workspace or from an m file using 2008A version: Step 1 function [output] = addizione (a,b) output = a+b; end Step 2 I compile it with matlab compiler mcc -l addizione I obtain addizione.dll, .lib, .h etc Step 3 load the newly created addizione.dll loadlibrary ('addizione','addizione') with the following warnings: Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr. Found on line 20522 of input from line 7673 of file C:\Programmi\MATLAB\R2008a\sys\lcc\inclu...

matlab parallel computing problem
in pmode, I creaed a segment and output is: lab1: 1 2 3 lab2: 11 12 13 lab3: 21 22 23 lab4: 31 32 33 When I am using " whole = codistributed(segment, codistributor()) " The system told " ??? Undefined function or variable 'codistributor'. " What's the problem.... flycod <jby1985@gmail.com> writes: > in pmode, I creaed a segment and output is: > lab1: 1 2 3 > lab2: 11 12 13 > lab3: 21 22 23 > lab4: 31 32 33 > > When I am using " whole = codistributed(segment, codistributor()) " > > The system told " ??? Undef...

problem opening Matlab figures created by MATLAB installed at the other PC
Hi there, I have a Matlab Version 7.0.0.19920(R14). when opening a figure created at the other PC (Also MATLAB 7) > open('Fig5PRL.fig'); one gets the message ??? Error using ==> open Unable to find function containerDelete within C:\MATLAB7\toolbox\matlab\uitools\javacomponent.m Meanwhile, the figure can be successfully opened at the computer where it was created and at the other with MATLAB 7 installed. Any ideas how to treat this? Yours, Petr. ...

Problem using Matlab 6.5 codes in Matlab 2007b
I have written some code in Matlab 6.5 and they are running perfectly in that version. But if I try to run the same using Matlab 2007b, I am facing problem. It starts giving error like dimensional mismatch and etc. Why the program written in lower version is not running in higher version? "Dwaipayan Dasgupta" <ddg.abhhih@rediffmail.com> wrote in message <gvto39$jsf$1@fred.mathworks.com>... > I have written some code in Matlab 6.5 and they are running perfectly in that version. But if I try to run the same using Matlab 2007b, I am facing problem. It starts giving error...

Display problem in Matlab Figure windows on mac running matlab remotely
I am running matlab remotely using x11 and I am having trouble with the display in figure windows, such as with use of plot() command. The figure will appear with the correct information, but the color mapping seems to be off, and most often the window appears with a mix of purple and green colors instead of black and white. I am running a mac (10.4.11) where I connect remotely using x11 to a linux server where matlab 2007a is installed. I would appreciate any assistance. ...

Problems with Matlab 6.5.1 R13 to Matlab 7 R14
I've written a GUI, with text in it. When I open it with Matlab 6.5.1 R13 there are no problems to show the full text for Matlab. But when I try it with Matlab 7 R14 the text is shown incomplete. This is because Matlab 7 prints the font bigger than Matlab 6.5.1... Is there a font, which is in the same size in Matlab 7 R14 AND Matlab 6.5.1 R13? Thanks ...

some problems of codes of MATLAB 7.0 working on MATLAB 6.5
I have used MATLAB for few hours.So I don't know the differences between version 6.5 and 7.0.I want to use some codes of MATLAB 7.0, but they doesn't work in MATLAB 6.5.How to change these codes so that they can work in matlab 6.5.Waiting for your help. Thank you . The codes are like this .I think changing the function findPI may work ,but I don'y know how % PIfun.m % Evaluate a function used to find the PI-line, using Kyle Champley's % method. % % Adam Wunderlich % last update: 5/18/06 function y = PIfun(r,R,h,gamma,x3,sb) temp = R - r*cos(gamma-sb); y = h*((pi - 2*atan(...

problems with code to convert ncs file in matlab under Matlab R14(2004)
Hello to everyone, Ill try to run Nlx2MatCSC ( a code from neuralynx than convert continuous file to matlab variables) in Matlab R14 (2004), and it doesn't work: When I type: >> [Timestamp, ChanNum, SampleFrequency, NumValSamples, Samples] = Nlx2MatCSC(Filename, [1 1 1 1 1], 0, 3, [0 4 9]); ??? Attempt to execute SCRIPT Nlx2MatCSC as a function. I heard that this code is running in Matlab 2007a and newer, but...what about this old version? Any help, Cheers ...

MATLAB parallel to parallel communication
Hi, I am using MATLAB to communicate between two computers using the parallel port. Right now I am having issues where either I can read or write on either computer (using digitalio and addline to add input and output lines), but I am unable to do both. I have been tinkering with the BIOS settings and it looks like the computer that is set to ECP is able to write, and the one set to EPP is able to read, but I can't write form the EPP to ECP computer. Does anyone have any suggestions as to what is the best way to configure MATLAB to read and write on both computers? Tha...

Problem in solving a problem by matlab.
Hello Everybody, I am having a problem in back propagation network. It is not a direct one to use sofwares like matlab for simulation. The problem is briefly described as follows. I want to specify the number of interconnections in the hidden layer or between the hidden layers. Can this possible using Matlab? Also I want to share the weights between two sets of hidden layers how to do that in Matlab? Please suggest me any other GUI softwares that can solve both the above problems or give me suggestions or atleast the posibility of doing this in Matlab(any...

problem with matlab compile error in matlab6.5 work in matlab 7, help!
hi to all, i have a problem running this code on Matlab 6.5, it running fine on matlab Version 7.1.0.183 (R14) Service Pack 3 (but i have not this version) Matlab 6.5 give me a compilation error: ?? Error: File: C:\Documents and Settings\Roby\Documenti\Tesi\portoni_sd_sa\portoni_sd_sa\portoni_2d.m Line: 23 Column: 19 "identifier" expected, "(" found. row 23 col 19 start from @(points) ... (at line begining with error_function = ) Can u help me to resolve this error? can u give me sugestion how can write this line i'm a beginner and i can't understand why t...

problem using parallel port with MATLAB DAQ
Hi, I am using PARALLEL port for data acquisition using MATLAB DAQ. Sometimes it gives an error "failed to open the data acquisition device"... May be because it was not released properly in the previous usage. But is there a way to release it using MATLAB code. Presently I have to restart the machine to do this. Any ideas? Thanks, Kaushik I've never run across that one. What version of MATLAB and Data Acqusition Toolbox are you using? We start a service called WINIO.SYS when we open the port. You might check to see if that service is being closed down correctly when the ...

Problem running exe compiled using Matlab Compiler 7.6 on a PC with Matlab 6.5
Hi, I have some Matlab code which I compiled using Matlab Compiler 7.6. Using the MCRInstaller and the Visual C++ Runtime library, I was able to install MCR 7.6 on the client machine. However, the client machine already had Matlab 6.5. Now when I try to run my exe, I get the following error message: Fatal error finding symbol mxCalcSingleSubscript_76 in c:\matlab6p5\bin\win32\libmx.dll I understand that the error shows up since the exe tries to go and look for the necessary information in the win32 folder for Matlab 6.5 rather than the v76 folder for the runtime. Can anyone give ...

a problem in matlab
Hi I have a lot of files with ".ls1" as extention. I must read them in Matlab but they are not recognizable For Matlab! Ls1 files could be imported in excel software and be saved as ..xls or .xlsx files. Since number of .ls1 files are about 100 so i cannot save them as .xls file one after another one because there are a lot of such fills. i should do it by the use of a simple way. * it should be noted when i save as a .ls1 file as a .xls file a message appear and i must click on "yes" so i cannot change their extention using windows extention control. Please guide ...

I have a problem with matlab
I'm universitary student, I need to risolve an exercice with matlab 5.0 student: bisection of function exp(x)-2 in [0,1] Please help me. Thanks in advenced. easy wrote: > I'm universitary student, I need to risolve an exercice with matlab > 5.0 student: > bisection of function exp(x)-2 in [0,1] > Please help me. > Thanks in advenced. If you post the code that you've started with and explain exactly where you're getting stuck, we may be able to help you. We don't want to rewrite the code that you've already written, after all. -- Steve Lord slord...

Web resources about - problem with parallel matlab - comp.soft-sys.matlab

Parallel - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Parallels, a new platformer, is not as relaxing as it looks
A new platformer from Appsolute Games called Parallels will have you thinking it is a simple, casual game, when it is really a danger-packed ...


Panasonic Introduced Its Tomato-picking Robot and Parallel Link Robot at International Robot Exhibition ...
Panasonic proposed numerous robotics solutions such as the tomato-picking robot and the parallel link robot at one of the world's largest robot ...

Charting the Parallels Between Rey and Luke Skywalker in Star Wars: The Force Awakens
[SPOILER WARNING: This article discusses plot elements from Star Wars: The Force Awakens. Do not [...]

Trust and Democracy: The Odd Parallels between Trump and Apple
... Apple in its fight against the FBI and Justice Department wouldn’t be caught dead voting for Trump. And yet Apple’s position has some odd parallels ...

‘Homeland’ Evoked Amidst School Threats In Latest Real-Life Parallel For Season 5
When New York Commissioner Bill Bratton spoke today about the email bomb threats sent to schools in the country’s two biggest cities that shut ...

Parallels Updates Remote Application Server for PCs, Macs
Parallels Remote Application Server v15 brings Windows applications and desktops to employees on any device, anywhere in the world.

The Rebirth of Parallel I/O
The transition from a dependence on rotating disk to solid-state storage is under way. And as the cost per unit of solid state storage capacity ...

Parallels brings server-based desktop apps to iPhone and Android in first big update since company split ...
No one wants to work on their phone, but sometimes you just have to get something done while on the go. And the latest version of Parallels Remote ...

Resources last updated: 3/4/2016 4:21:49 AM