Skip to content

Commit

Permalink
temporarily set number of threads in octave to one, known issue shogu…
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Apr 22, 2017
1 parent 0c79949 commit bdac1db
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/interfaces/octave_modular/swig_typemaps.i
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <octave/Cell.h>

#include <shogun/lib/DataType.h>

// this is for the hack that sets the number of threads to 1 below
// see #3772
#include <shogun/io/SGIO.h>
%}

/* One dimensional input arrays */
Expand Down Expand Up @@ -114,7 +118,9 @@ TYPEMAP_OUT_SGVECTOR(uint16NDArray, uint16_t, uint16_t, "Word")
const octave_value mat_feat=$input;
if (!mat_feat.is_matrix_type() || !mat_feat.oct_type_check())
{
/*SG_ERROR("Expected " error_string " Matrix as argument\n");*/
/*SG_ER%init %{
init_variables();
%}ROR("Expected " error_string " Matrix as argument\n");*/
SWIG_fail;
}

Expand Down Expand Up @@ -486,3 +492,10 @@ TYPEMAP_SPARSEFEATURES_IN(float64_t, Matrix)

TYPEMAP_SPARSEFEATURES_OUT(float64_t, NPY_FLOAT64)
#undef TYPEMAP_SPARSEFEATURES_OUT

%init %{
// set number of threads to 1
// see issue #3772
SG_SWARNING("Using Shogun single-threaded. Multi-threaded Octave is currently broken. See https://github.com/shogun-toolbox/shogun/issues/3772\n");
shogun::get_global_parallel()->set_num_threads(1);
%}

0 comments on commit bdac1db

Please sign in to comment.