f



build a mex for parallel computing without matlabpool ?

Hi all,
I'm an absolute newbie in C/C++ and I must say that I found the tutorials to make mex functions very complex. Also, I found threads that said that the speed gain is not as significant anymore because of JIT.
My code is already very vectorized, uses preallocation, works mostly in columns and has bsxfun type functions to make it faster. Currently, I would want to make the code able to be run on a computing cluster so that it's faster than on my 4-core workstation.
There is no communication between the processes so I'm imagining the speed increase would be linear with the number of nodes used.
Below is the code (the initial script is not efficient but it runs only once and serves only to load the parameters. The meat is the parfor loop with cycle.m in it)

############################################
v1=[1 2 3 4]';
v2=(0:0.02:0.2)';
v3=(0:0.02:0.2)';

ln=size(v1,1)*size(v2,1)*size(v3,1);
test_var=zeros(ln,3);
line=0;
for c1=1:size(v1)
    for c2=1:size(v2)
        for c3=1:size(v3)
           line=line+1;
           test_var(line,:)=[v1(c1) v2(c2) v3(c3)];
         end
    end
end

param_shared= init_param();%this only loads some fixed simulations parameters
param_shared.test_var=test_var;

matlabpool open local
parfor con=1:ln
    cycle(con, param_shared);%cycle is the heavy part, with plenty of subroutines and then stores the results in .csv files
end
matlabpool close
clear
###########################################

Ideally, I would want to turn cycle.m into a function that runs outside of Matlab. I would input "con" and "param_shared" and run it on 1 core. And do so on as many cores as available. Matlabpool is limited in number of labs, if I understand correctly. 
Then I want to call the basic script above in Octave from command line in order for it to run the mex function on each core. (I have a Matlab licence but it can't be used on the cluster and matlabpool makes things slower than I think they could be).
Could you please indicate if that makes sense or if there are simpler ways.
Any alternatives are most welcome and thanks for the support.

Adnane
0
Adnane
11/1/2010 6:59:04 AM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
988 Views

Similar Articles

[PageSpeed] 16

Also, on an unrelated note, can anybody suggest a faster way to calculate the following:
szt1=size(t1,1);
szt2=size(t1,2);
t1=fix(t1)+(rand(szt1,szt2)<mod(t1,1));

I don't want to use "fix","ceil" or "round" as I want to approximate to an integer but in a random fashion. For example a value of 1.5 would give 1 and 2 at a 50% frequency.

Thanks
0
Adnane
11/1/2010 7:58:04 AM
"Adnane " <haryuken@gmail.com> wrote in message <ialruc$4ac$1@fred.mathworks.com>...
> Also, on an unrelated note, can anybody suggest a faster way to calculate the following:
> szt1=size(t1,1);
> szt2=size(t1,2);
> t1=fix(t1)+(rand(szt1,szt2)<mod(t1,1));

 t=fix(t1+rand(szt1,szt2))

Bruno
0
Bruno
11/1/2010 8:30:11 AM
>  t=fix(t1+rand(szt1,szt2))

Of course, I should have thought of that. Thank you !
0
Adnane
11/1/2010 11:47:04 PM
Reply:

Similar Artilces:

parallel for loops without parallel computing toolbox
Is this possible? On 11-03-07 10:12 AM, Nathan Jensen wrote: > Is this possible? That depends on what you mean by "parallel for loops". Matlab has a published external interface. That interface could be used to call out to arbitrary routines that might _somehow_ do computations in parallel, such as by using OpenMP or POSIX Threads or using an operating-system-specific method. Or you could start multiple Matlab instances and have them communicate with each other somehow, such as via shared memory or TCP; there are a couple of Mathworks File Exchange (FEX) contributions for...

parallel computing toolbox without distributive computing toolbox
Hi, Is it true that the parallel computing toolbox won't work if the distributive computing toolbox has not been installed? Because then if I type in 'matlabpool', I received the following err msg: " License checkout failed. License Manager Error -4 Maximum number of users for Distrib_Computing_Toolbox reached. Try again later. To see a list of current users use the lmstat utility or contact your License Administrator. Troubleshoot this issue by visiting: http://www.mathworks.com/support/lme/R2008b/4 Diagnostic Information: Feature: Distrib_Computing_Toolbox License pa...

parallel computing with matlab
Hello friends, I want to know that ,is it possible to do parallel computing with MATLAB on a single computer.I want that different modules communicate and interlinked with each other so that called by other functions also. Hi, have a look at the distributed computing toolbox: http://www.mathworks.com/products/distribtb/ Although mainly intended to seperate the workload to different machines you may also run it on one machine... Titus www.mathworks.com\products\dis "shivi chaturvedi" <shivi79@rediffmail.com> schrieb im Newsbeitrag news:ef3d35a.-1@webcrossing...

matlab for parallel computing
Is any body doing parallel computing with matlab here? ...

Call For Papers: Soft Computing for Bioinformatics (SOFT COMPUTING Journal
=20 SOFT COMPUTING Journal - SPRINGER =20 Special Issue on =20 Soft Computing for Bioinformatics =20 CALL FOR PAPERS =20 The past few years have witnessed phenomenal growth of=20 bioinformatics, an exciting field devoted to the interpretation and=20 analysis of biological data using computational techniques. Among=20 the large number of computational techniques used, soft computing,=20 which incorporates=20 =20 * neural networks,=20 * evolutionary computation,=20 * fuzzy systems, and=20 * chaos,=20 =20 stands out because of its demonstrated strength in handling=20 imprecise information and providing novel solutions to hard=20 problems.=20 =20 This special issue aims at not only showcasing innovative=20 applications of soft computing techniques to bioinformatics, but=20 also clarifying outstanding issues for future progress.=20 =20 Biological areas of interest include but are not limited to the=20 following:=20 =20 * protein structure and function,=20 * genomics,=20 * proteomics,=20 * molecular sequence analysis,=20 * evolution and phylogenetics,=20 * molecular interactions and structure,=20 * gene expression,=20 * metabolic pathways,=20 * regulatory networks,=20 * developmental control and systems biology. =20 =20 Papers should be submitted in PDF format via email to any of the=20 following guest editors by 30 March 2004: =20 * David Corne (D.W.Corne@exeter.ac....

Call For Papers: Soft Computing for Bioinformatics (SOFT COMPUTING Journal
=20 SOFT COMPUTING Journal - SPRINGER =20 Special Issue on =20 Soft Computing for Bioinformatics =20 CALL FOR PAPERS =20 The past few years have witnessed phenomenal growth of=20 bioinformatics, an exciting field devoted to the interpretation and=20 analysis of biological data using computational techniques. Among=20 the large number of computational techniques used, soft computing,=20 which incorporates=20 =20 * neural networks,=20 * evolutionary computation,=20 * fuzzy systems, and=20 * chaos,=20 =20 stands out because of its demonstrated strength in handling=20 imprecise information and providing novel solutions to hard=20 problems.=20 =20 This special issue aims at not only showcasing innovative=20 applications of soft computing techniques to bioinformatics, but=20 also clarifying outstanding issues for future progress.=20 =20 Biological areas of interest include but are not limited to the=20 following:=20 =20 * protein structure and function,=20 * genomics,=20 * proteomics,=20 * molecular sequence analysis,=20 * evolution and phylogenetics,=20 * molecular interactions and structure,=20 * gene expression,=20 * metabolic pathways,=20 * regulatory networks,=20 * developmental control and systems biology. =20 =20 Papers should be submitted in PDF format via email to any of the=20 following guest editors by 30 March 2004:...

Use .exe in computer without Matlab
I have generated a .exe file with the comtool. With this file I try to run the application in a computer without Matlab but it does not work. At the beginning it extracs some libraries with the dll's but the application does not start running. Which is the problem? The .m is translated into a .dll file but I don�t know how to make it run. Thanks in advance. This is an ex: it will compile the "maintest.m, testtest.m" files into a standalone executable. The directory I use here is the destination/output directory. Better create it first, I'm not sure if it will create ot for you. "sgl" is the c graphical library. "sglcpp" is the c++ graphical library mcc -B sgl -d C:\MATLAB6p5\work\code2 maintest testtest Miguel Avello wrote: > > > I have generated a .exe file with the comtool. With this file I try > to run the application in a computer without Matlab but it does not > work. At the beginning it extracs some libraries with the dll's but > the application does not start running. Which is the problem? > > The .m is translated into a .dll file but I don�t know how to make > it run. > > Thanks in advance. Miguel Avello wrote: > > > I have generated a .exe file with the comtool. With this file I try > to run the application in a computer without Matlab but it does not > work. At the beginning it extracs some libraries with the dll's but > the application does not start running. Whic...

Recent soft computing papers and MATLAB Toolboxes
Dear Colleagues, I would like to call your kind attention to the updated website of the Soft Computing Research Group at the University of Veszprem (Hungary) http://www.fmt.vein.hu/softcomp/ You can download MATLAB Toolboxes: - Fuzzy Clustering MATLAB Toolbox - Genetic Programming MATLAB Toolbox - Interactive Evolutionary Strategy (EASy) MATLAB Toolbox - Constrained Fuzzy Model Identification for the FMID Toolbox independent MATLAB programs related to: - Data mining * Fuzzy clustering based time-series segmentation * Supervised Fuzzy Clustering for the Identification of Fuzzy Classifiers * Fuzzy Modeling with Multidimensional Membership Functions: Grey-Box Identification and Control Design * Compact TS-Fuzzy Models through Clustering and OLS plus FIS Model Reduction * Inconsistency Analysis of Labeled Data * Star plots - MATLAB files for Graphical Representation of trace elements of clinkers - Process control and monitoring * Feedback Linearizing Control Using Hybrid Neural Networks Identified by Sensitivity Approach * Incorporating Prior Knowledge in Cubic Spline Approximation - Application to the Identification of Reaction Kinetic Models * Identification and Control of Nonlinear Systems Using Fuzzy Hammerstein Models - A Simple Fuzzy Classifier based on manuscripts in PDF about - fuzzy model based process control and monitoring - fuzzy clustering and classification - incorpor...

Recent soft computing papers and MATLAB Toolboxes
Dear Colleagues, I would like to call your kind attention to the updated website of the Soft Computing Research Group at the University of Veszprem (Hungary) http://www.fmt.vein.hu/softcomp/ You can download MATLAB Toolboxes: - Fuzzy Clustering MATLAB Toolbox - Genetic Programming MATLAB Toolbox - Interactive Evolutionary Strategy (EASy) MATLAB Toolbox - Constrained Fuzzy Model Identification for the FMID Toolbox independent MATLAB programs related to: - Data mining * Fuzzy clustering based time-series segmentation * Supervised Fuzzy Clustering for the Identification of Fuzzy Classifiers * Fuzzy Modeling with Multidimensional Membership Functions: Grey-Box Identification and Control Design * Compact TS-Fuzzy Models through Clustering and OLS plus FIS Model Reduction * Inconsistency Analysis of Labeled Data * Star plots - MATLAB files for Graphical Representation of trace elements of clinkers - Process control and monitoring * Feedback Linearizing Control Using Hybrid Neural Networks Identified by Sensitivity Approach * Incorporating Prior Knowledge in Cubic Spline Approximation - Application to the Identification of Reaction Kinetic Models * Identification and Control of Nonlinear Systems Using Fuzzy Hammerstein Models - A Simple Fuzzy Classifier based on manuscripts in PDF about - fuzzy model based process control and monitoring - fuzzy clustering and classification - incorporation of a priori knowledge in the identif...

computer 2008 model for soft ware sys..
wf fefh dfkl http://www.freewebs.com/thuiss/ http://indianfriendfinder.com/go/g906725-pmem ...

Recent soft computing papers and MATLAB Toolboxes
Dear Colleagues, I would like to call your kind attention to the updated website of the Soft Computing Research Group at the University of Veszprem (Hungary) http://www.fmt.vein.hu/softcomp/ You can download MATLAB Toolboxes: - Fuzzy Clustering MATLAB Toolbox - Genetic Programming MATLAB Toolbox - Interactive Evolutionary Strategy (EASy) MATLAB Toolbox - Constrained Fuzzy Model Identification for the FMID Toolbox independent MATLAB programs related to: - Data mining * Fuzzy clustering based time-series segmentation * Supervised Fuzzy Clustering for the Identification of Fuzzy Classifiers * Fuzzy Modeling with Multidimensional Membership Functions: Grey-Box Identification and Control Design * Compact TS-Fuzzy Models through Clustering and OLS plus FIS Model Reduction * Inconsistency Analysis of Labeled Data * Star plots - MATLAB files for Graphical Representation of trace elements of clinkers - Process control and monitoring * Feedback Linearizing Control Using Hybrid Neural Networks Identified by Sensitivity Approach * Incorporating Prior Knowledge in Cubic Spline Approximation - Application to the Identification of Reaction Kinetic Models * Identification and Control of Nonlinear Systems Using Fuzzy Hammerstein Models - A Simple Fuzzy Classifier based on manuscripts in PDF about - fuzzy model based process control and monitoring - fuzzy clustering and classification - incorpor...

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 ...

Executable file does not run on computer without Matlab
I converted my main.m file, which has recourse on several functions These subroutines are provided by some Matlab Toolbox o coded by myself. I used this command to generate the exe file: mcc -m main.m I copied main.exe in other pc where Matlab is not installed. The program does not run, because it is not able to find a dll (I do not remember the name). Do the executable files need a valid installation of Matlab to run? ...

Return matrix from DLL to Matlab without MEX
I am writing a DLL that I would like to be portable for a very of systems and applications, including systems that do not have Matlab installed. Additionally, I'd like to be able to easily port this C code to an embedded target simply by recompiling for the right processor. This requires that I not link to any external libraries unless I also have the source for that library. This DLL must be able to create and operate on matrices, and I would like to be able to pass these matrices to and from Matlab for the purpose of user interface and algorithm development. Starting point: * from an m...

parallel computing, distributed computing
HI, I have an optimization code which has some part code is common and required as inputs for the two optimization routines within. However once this is done, the remaining could be run parallely independednt of each other and imrovized on the speed and finally the two results could be fetched in one single main optimization file and compared. Though i feel this could be done, i do not knopw the exact procedure as well do not know if there is some setting to be done in matlab and modify my main code as well. Please note i have matlab 2007b and distributed computing toolbox v3.2. I...

Matlab Student Version and Parallel computing toolbox
I am planning to order the Matlab student version and the parallel computing toolbox. I have access to an Nvidia cuda enabled GPU card.Does the parallel computing toolbox (student version) support GPU computing? I thought I will ask before placing my order. Many Thanks for any help. H On 01/01/11 11:22 PM, Hamdi wrote: > > I am planning to order the Matlab student version and the parallel > computing toolbox. > > I have access to an Nvidia cuda enabled GPU card.Does the parallel > computing toolbox (student version) support GPU computing? > > I tho...

Matlab 2011a student version/ Parallel computing box
Hi, Does the parallel tool box version 4.3 support GPU computing? If not, how to get GPU computing capanility with Matlab 2011a student version? I thought I will order the Matlab 2011a student but the parallel tool box that is available to students (v 4.3) does not mention GPU computing. I will appreciate any advice. Thank you, H You might consider the student version of Jacket, here: http://www.accelereyes.com See comparison description: http://www.accelereyes.com/products/compare "Hamdi " <hamdi.mani@asu.edu> wrote in message <inoni0$fh7$1@fred.mathworks.com>....

Wireless network for large-scall parallel computer build
Dear All, For large-scale parallel computer (more than 100000 node), one big issues is the space. If you check those big systems like Earth Simulator or BlueGene/L. They built such big building to hold the systems. One big parts of the space comes from those network cable. I am not a wireless expert and do not have even the basic knowledge of it. But I want to know, whether it is possible to build a large-scale supercomputer networked by wireless, just local wireless. What I want to know is the possiblity of doing this in technology. Those wireless should be fast enough at least 1.0 Gb/s in bandwidth, and latency... Thanks very much. Noah Yan yanyh@cs.uh.edu (yanyh@cs.uh.edu) writes: > For large-scale parallel computer (more than 100000 node), one big > issues is the space. If you check those big systems like Earth > Simulator or BlueGene/L. They built such big building to hold the systems. > > One big parts of the space comes from those network cable. I am not a > wireless expert and do not have even the basic knowledge of it. But I > want to know, whether it is possible to build a large-scale > supercomputer networked by wireless, just local wireless. What I want to > know is the possiblity of doing this in technology. Those wireless > should be fast enough at least 1.0 Gb/s in bandwidth, and latency... This is one of the issues facing deeply embedded networks (ad-hoc or otherwise). I'm no expert in the field, but from what I unders...

Importing configuration into parallel computing toolbox without GUI?
Hi, Does anyone know of a way to import a configuration into parallel computing toolbox programatically (i.e. without using the Configurations Manager GUI) ? I created a configuration that I'd like to share with a colleague. I exported this config as a .mat file from the Configuration Manager. But my colleague doesn't have X windows access for his Matlab. I'd like him to be able to run "matlabpool open myconfig" without having to run the GUI. Does anyone know how to do this? I can't seem to find where the Configuration Manager stores its information. thanks, ma...

Compute SVD of a Matrix Without use loop (For ... End ) in matlab
HI ALL. i must compute svd of matrix a=64 x 8357 that each column of a related to one block of image. for compute svd of each column, i need all svd's of each column , then i must use reshape(a(:,1) , [8,8]) and then, compute svd of this result. i can not use loop , because so time consuming. Does Anybody Know how can use reshape with change numbers (that number of numbers equal to columns) and without use loop, compute all columns reshape? Thanks. Mansour Hashemi <mansur.hashemi@gmail.com> wrote in message <2f545a93-2b97-4260-8b90-ffc1e29de7f7@p13g2000yqh.googlegroups.com>...

Using Condor With Matlab to run jobs in parallel among many computers in my lab.
Hello, I have recently heard of a program called Condor which can be used with Matlab to run jobs in parallel among many computers in my lab. I have downloaded the software but can't seem to set it up correctly to connect to it. I believe I need to change the configuration file "condor_config" but I'm not sure what to change in it. I expected to set up condor and set it as my default parallel configuration in Matlab so I could send batch jobs to it and have it run on other computers. I was wondering if anyone has used Condor for this purpose before? How do I set i...

Multicore distributed computing
I'm running R2008B on a 2 PC cluster (XP Pro). Each PC has four cores. I've confirmed that the Matlab distributed computing toolboox and parallel computing toolbox are properly installed and running on both machines. 4 green checks appear when I validate through the configuration manager. Max number of workers set to 16. My question: I want to confirm that when I run a job all 4 cores on each machine are utilized for a total of 8 cores. My error when I try to open a pool with 8 cores is below. Is there another command I should try? Thanks. >> matlabpool open 8 Starti...

parallel computing in distributed computing server
Hi, there, Is there some way that can use the parallel computing code such as parfor or spmd in the distributed computing server? I currently ran a test for comparing the difference between the parallel toolbox with in stand alone mode in a computer with two CPUs, and the distributed computing server in two computers(each of them using just one CPU). I found the computing capabilities are pretty much the same with each other. I was curious how to run a parallel computing in the distributed server. Thanks, Wei Wei, The Parallel Computing Toolbox (PCT) serves two purposes: leverage...

matlab crashes (win 7 64 bit) without messages, logs or dumps while using mex-files linked with itpp library and compiled with mingw
Hello, I know, that this a very special problem and I would like to provide an error log or something like this, but this is the problem. Following situation: Matlab 2010a (64bit) on Win 7 64bit Enterprise Mingw-w64 with basis msys environment used modified gnumex to create .def and .lib files mexopt.bat modified to work with mingw This setup works perfectly. I can write,compile,link and run mex files. Moreover, I compiled the itpp library with msys/mingw and created static libs as well as shared libs. Now, the problem: At the point, when I include an itpp related class of fu...

Web resources about - build a mex for parallel computing without matlabpool ? - comp.soft-sys.matlab

Newest 'parallel-processing' Questions - Stack Overflow
Q&A for professional and enthusiast programmers

MATLAB Answers - MATLAB Central
Search: MATLAB Central File Exchange Answers Newsgroup Link Exchange Blogs Trendy Cody Contest MathWorks.com Create Account Log In File Exchange ...

Resources last updated: 3/30/2016 7:31:04 AM