Skip to content

Commit 23c2d39

Browse files
committed
#39 disable multithreading on Windows
1 parent 647a61e commit 23c2d39

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: ruimtehol
22
Type: Package
33
Title: Learn Text 'Embeddings' with 'Starspace'
4-
Version: 0.3
4+
Version: 0.3.1
55
Maintainer: Jan Wijffels <[email protected]>
66
Authors@R: c(
77
person('Jan', 'Wijffels', role = c('aut', 'cre', 'cph'), email = '[email protected]', comment = "R wrapper"),
@@ -22,5 +22,5 @@ Depends: R (>= 2.10)
2222
Imports: Rcpp (>= 0.11.5), utils, graphics, stats
2323
Suggests: udpipe, data.table
2424
LinkingTo: Rcpp, BH
25-
RoxygenNote: 7.1.1
25+
RoxygenNote: 7.1.2
2626
SystemRequirements: C++11

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## CHANGES IN ruimtehol VERSION 0.3.1
2+
3+
- Changes in src/Starspace/src/model.cpp (EmbedModel::train). On Windows, no longer use threads as on CRAN that seems to make the package FAIL.
4+
15
## CHANGES IN ruimtehol VERSION 0.3
26

37
- Fixed a bug in saving models trained with ngrams > 1. Embeddings of hashed buckets were not saved.

src/Starspace/src/model.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ Real EmbedModel::train(shared_ptr<InternDataHandler> data,
214214
assert(rate >= finishRate);
215215
assert(rate >= 0.0);
216216

217-
#ifdef __APPLE__
217+
#if defined(__APPLE__) || defined(_WIN32)
218218
if(numThreads > 1){
219-
Rcpp::Rcerr << "Mac OS does not work with threads > 1, will perform training using 1 thread instead." << "\n";
219+
Rcpp::Rcerr << "Mac OS / Windows does not work with threads > 1, will perform training using 1 thread instead." << "\n";
220220
}
221221
#endif
222222

@@ -343,7 +343,7 @@ Real EmbedModel::train(shared_ptr<InternDataHandler> data,
343343
assert(b >= indices.begin());
344344
assert(e >= b);
345345
assert(e <= indices.end());
346-
#ifdef __APPLE__
346+
#if defined(__APPLE__) || defined(_WIN32)
347347
trainThread(i, b, e);
348348
#else
349349
threads.emplace_back(thread([=] {
@@ -371,7 +371,7 @@ Real EmbedModel::train(shared_ptr<InternDataHandler> data,
371371
}
372372
}
373373
};
374-
#ifdef __APPLE__
374+
#if defined(__APPLE__) || defined(_WIN32)
375375
doneTraining = true;
376376
normThread();
377377
#else

0 commit comments

Comments
 (0)