Coder Social home page Coder Social logo

fCWT matlab crash on Mac about fcwt HOT 9 OPEN

keigoyoshida7 avatar keigoyoshida7 commented on August 15, 2024
fCWT matlab crash on Mac

from fcwt.

Comments (9)

fastlib avatar fastlib commented on August 15, 2024 2

What a coincidence! I was discovering exactly the same pragmatic solution as you did yesterday evening. After a few hours of tedious commenting and uncommenting and restarting Matlab 120+ times, I discovered that Matlab doesn't like OpenMP anymore. I'm not sure what the problem is, but for now a good solution is to use fCWT singlethreaded like you did in your pull-request.

Eventually, I merged your pull-request with mine and created a build time variable which I only use when building the mex-files via CMake. Additionally, I added some warnings for Matlab-users to make clear that their fCWT implementation does not support threads at the moment.

For now, the Matlab-wrapper should work again, but be it only single-threaded. I will leave this issue open as this is only a temporary solution.

from fcwt.

fastlib avatar fastlib commented on August 15, 2024

Thank you for pointing this out. We will release a fix soon.

from fcwt.

keigoyoshida7 avatar keigoyoshida7 commented on August 15, 2024

Thank you for answer me.
Also, I'm trying MEX file in matlab on windows (intel CORE i7)
but, there is a error with omp file may be...
Are there any wrong code in this picture or other problem?

(please teach us how can We use fCWT in matlab on windows...)

best regards,

a

from fcwt.

fastlib avatar fastlib commented on August 15, 2024

It seems no easy fix. If you want to use fCWT without C++, your best option would be to use the Python package. We will be looking into fixing the Matlab wrapper but that could take some time. Our apologies for the inconvenience.

from fcwt.

keigoyoshida7 avatar keigoyoshida7 commented on August 15, 2024

Thank you! please let us know when it is fixed.
best regards,

from fcwt.

felixdollack avatar felixdollack commented on August 15, 2024

@fastlib I am wondering about O1 in this line of fcwt.cpp:

pinv = fftwf_plan_dft_1d(newsize, O1, (fftwf_complex*)poutput, FFTW_BACKWARD, FFTW_ESTIMATE);

It is initialized to 0

memset(O1,0,sizeof(fftwf_complex)*newsize);

but not filled with any data or used as output variable.

I can compile fcwtmex (on macOS) after adjusting for the new path of fcwt, but Matlab crashes randomly when calling fcwt.

That seems to work. See next comment...

from fcwt.

felixdollack avatar felixdollack commented on August 15, 2024

fCWT_plan is redefining PI (comment it out) from fctw.h and it is missing
mwSize c0 = mxGetScalar(prhs[1]); before using it in Morl(c0);
After those modifications it compiles. But still does not run.

If I remove omp_set_num_threads(threads); from create_FFT_optimization_plan, I can run it.

%%%%%%
Edit: Nevermind, I missed another comment I made.

All calls to OMP and fftwf_plan_with_nthreads need to be commented out:

//omp_set_num_threads(threads);
//std::cout << "Threads:" << omp_get_max_threads() << std::endl;

fftwf_init_threads();
// fftwf_plan_with_nthreads(omp_get_max_threads());

%%%%%%

The same does work for cwt.

If fftw is run with a single thread there are no issues (except that it might be slower than intended? ^^)

from fcwt.

liu7645 avatar liu7645 commented on August 15, 2024

Hi
I want to run the code in matlab. My gcc could find openmp_c, but not find openmp_cxx. Could you please give me some advice? Oh, it's on windows.

from fcwt.

whip123 avatar whip123 commented on August 15, 2024

Hi @fastlib,
Is there any way to run the full potential of fCWT in MATLAB such as using an older version of MATLAB?
Thanks

from fcwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.