Question

I would like to take advantage of today's CPU mutli-core capabilities when using LIBSVM. What I'd like to know/understand is whether I can safely call LIBSVM services from multiple threads concurrently (e.g., call svm_train() on 8 different models with different parameters for the process of parameter tuning).

The only reference I could find is this one at LIBSVM's site: Q: How can I use OpenMP to parallelize LIBSVM on a multicore/shared-memory computer?

The thing is that it talks about parallelizing the algorithm (code) of the training function itself, but say nothing about calling the training function concurrently multiple times - which I would prefer since it gives me better control on the cross-validation & parameter-tuning/grid-search process.

Note: I'm using LIBSVM package itself (currently the java implementation and potentially python too).

Was it helpful?

Solution

I understand that you want to call svm_train() on 8 different problem instances and different parameters to get different model instances!

When I look at the Java-Sourcecode I see that the problem and parameter instances are only read and nothing is written to them. The method creates all objects itself which it needs to modify and store data and finally returns the created model.

That means that calling svm_train() from multiple threads should be no problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top