[FieldTrip] parallelizing ft_statistics_montecarlo to enhance computation speed for time-frequency data

Frédéric Roux f.roux at bcbl.eu
Wed Jul 16 15:07:36 CEST 2014


Hi Eelke,

thanks for your response - that sounds promising.

I am running fieldtrip-20140527 on a 64 bit Linux server, so I'd
be keen to give your suggestion a try. 

This is actually the first time I am calling mex-files using Matlab,
but I assume that the way to go is to comment out the part of the code
in ft_findcluster that combines the cluster and to call the mex-file instead?

If yes, here is what I did: I copied the combineClusters.mexa64 file into
a spearate folder and added that folder to my Matlab path. 

% combine clusters that are connected in neighbouring channel(s)
% (combinations). Convert inputs to uint32 as that is required by the mex
% file (and the values will be positive integers anyway).
addpath('/path2home/mex/');
cluster = combineClusters(uint32(labelmat), logical(spatdimneighbstructmat), uint32(total));

I am not sure however how to call the mex function. Is this done automatically or do
I need to add some further steps? May I ask you which approach you are using?

Best,
Fred



Frédéric Roux

----- Original Message -----
From: "Eelke Spaak" <eelke.spaak at donders.ru.nl>
To: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
Sent: Wednesday, July 16, 2014 9:39:03 AM
Subject: Re: [FieldTrip] parallelizing ft_statistics_montecarlo to enhance computation speed for time-frequency data

Hi Fred,

Some time ago, I replaced parts of the clustering routine with a
mex-file. For me this greatly sped up the cluster stats. I guess you
are using a fairly recent (<1yr old) FT version? The platform you're
using might also be relevant, I just noticed that the mex-file
(private/combineClusters.mex*) is distributed in compiled form only
for Linux 64 and Windows 32/64 bit. If you're e.g. on a Macintosh, you
could compile it yourself from the src/combineClusters.cpp source
file.

I know of no attempts to parallelise the clustering code.

Best,
Eelke

On 15 July 2014 17:40, Frédéric Roux <f.roux at bcbl.eu> wrote:
> Dear all,
>
> I would like to ask if anyone has ever tried to speed up the ft_statistics_montecarlo function
> by using Matlab's parallel computing toolbox ?
>
> I would like to run clusterstatistics on time-frequency data, but as a result of the large number
> of time and frequency bins, the function runs very slowly. So I was thinking to try and modify
> the code by running the loops over the frequency bins in parallel and see if that could save
> some time.
>
> Before starting to adapt the code on my own, however, I wanted to ask if anyone had ever tried that
> and also if there could be any possible reasons which would make that this is not a feasible project.
>
> Any thoughts or suggestions would be highly appreciated.
>
> Best,
> Fred
>
>
> ---------------------------------------------------------------------------
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list