Browse code

rm RcppParallel

mikejiang authored on 19/07/2021 23:50:37
Showing 4 changed files

... ...
@@ -37,10 +37,9 @@ Imports:
37 37
     corpcor,
38 38
     RUnit,
39 39
     tibble,
40
-    RcppParallel,
41 40
     xml2
42 41
 biocViews: ImmunoOncology, FlowCytometry, DataImport, DataRepresentation
43
-LinkingTo: cpp11, BH(>= 1.62.0-1), RProtoBufLib, cytolib, Rhdf5lib, flowWorkspace, RcppParallel
42
+LinkingTo: cpp11, BH(>= 1.62.0-1), RProtoBufLib, cytolib, Rhdf5lib, flowWorkspace
44 43
 Suggests:
45 44
     testthat,
46 45
     flowWorkspaceData ,
... ...
@@ -55,9 +54,9 @@ Collate:
55 54
     'AllClasses.R'
56 55
     'GatingSet2cytobank.R'
57 56
     'GatingSet2flowJo.R'
58
-    'cpp11.R'
59 57
     'gate-methods.R'
60 58
     'compensation.R'
59
+    'cpp11.R'
61 60
     'cytobank2GatingSet.R'
62 61
     'cytobankExperiment.R'
63 62
     'cytolibml_bin_path.R'
... ...
@@ -62,7 +62,6 @@ importClassesFrom(methods,missing)
62 62
 importClassesFrom(methods,numeric)
63 63
 importClassesFrom(methods,oldClass)
64 64
 importFrom(RBGL,tsort)
65
-importFrom(RcppParallel,RcppParallelLibs)
66 65
 importFrom(Rgraphviz,layoutGraph)
67 66
 importFrom(Rgraphviz,renderGraph)
68 67
 importFrom(XML,"xmlAttrs<-")
... ...
@@ -188,7 +188,6 @@ setMethod("parseWorkspace",signature("flowjo_workspace"),function(obj, ...){
188 188
 #' @rdname flowjo_to_gatingset
189 189
 #' @export 
190 190
 #' @importFrom utils menu
191
-#' @importFrom RcppParallel RcppParallelLibs
192 191
 #' @importFrom dplyr enquo
193 192
 #' @importFrom flowWorkspace cytoset get_default_backend
194 193
 flowjo_to_gatingset <- function(ws, name = NULL
... ...
@@ -15,7 +15,6 @@
15 15
 #include <boost/lexical_cast.hpp>
16 16
 #include <boost/tokenizer.hpp>
17 17
 #include "search_sample.hpp"
18
-#define TBB_PREVIEW_SERIAL_SUBSET 1
19 18
 
20 19
 //solve windows build issues
21 20
 #ifdef Free
... ...
@@ -26,19 +25,13 @@
26 25
 #endif
27 26
 
28 27
 
29
-#include <tbb/tbb.h>
30
-#include "tbb/task_scheduler_init.h"
31
-#include <tbb/spin_mutex.h>
32
-using namespace tbb;
33 28
 namespace CytoML
34 29
 {
35 30
 
36
-typedef tbb::spin_mutex GsMutexType;
37 31
 
38 32
 class flowJoWorkspace:public workspace{
39 33
 private:
40 34
 	string versionList;//used for legacy mac ws
41
-	GsMutexType GsMutex, TransMutex, h5Mutex;
42 35
 
43 36
 public:
44 37
 
... ...
@@ -92,7 +85,6 @@ public:
92 85
 
93 86
 	 		trans_local trans, trans_raw;
94 87
 	 		{
95
-				GsMutexType::scoped_lock lock1(TransMutex);//biexp interpolation could be performed on the shared global trans object
96 88
 
97 89
 				//prefixed version
98 90
 				trans = getTransformation(root,comp,transFlag,_gTrans, true);
... ...
@@ -205,17 +197,10 @@ public:
205 197
 		 * try to parse each sample
206 198
 		 */
207 199
 		GatingSet & gs = *gsPtr;
208
-		tbb::task_scheduler_init init(config.num_threads);
209 200
 
201
+		for (int i = 0; i < sample_infos.size(); i++)
202
+			this->parse_sample(sample_infos[i], config, data_dir, cf_dir, gTrans, gs, cytoset);
210 203
 
211
-		if(config.num_threads <=1)
212
-			tbb::serial::parallel_for<int>(0, sample_infos.size(), 1, [&, this](int i){
213
-				this->parse_sample(sample_infos[i], config, data_dir, cf_dir, gTrans, gs, cytoset);
214
-			});
215
-		else
216
-			tbb::parallel_for<int>(0, sample_infos.size(), 1, [&, this](int i){
217
-							this->parse_sample(sample_infos[i], config, data_dir, cf_dir, gTrans, gs, cytoset);
218
-						});
219 204
 		if(gsPtr->size() == 0)
220 205
 			throw(domain_error("No samples in this workspace to parse!"));
221 206
 		//keep the cs in sync with backend file
... ...
@@ -499,11 +484,7 @@ public:
499 484
 
500 485
 				CytoFramePtr ptr;
501 486
 				{
502
-					if(config_const.fmt == FileFormat::H5)
503
-					{
504
-
505
-						GsMutexType::scoped_lock lock(h5Mutex);
506
-					}
487
+				
507 488
 						frptr->write_to_disk(cf_filename, config_const.fmt);
508 489
 						ptr = load_cytoframe(cf_filename, false);
509 490
 				}
... ...
@@ -514,7 +495,6 @@ public:
514 495
 			  gh->set_cytoframe_view(CytoFrameView(frptr));
515 496
 
516 497
 			{
517
-			  GsMutexType::scoped_lock lock(GsMutex);
518 498
 			  if(gs.find(uid) != gs.end()){
519 499
 			    throw(domain_error("Duplicated GUIDs detected within group: " + uid
520 500
                             + "\n Consider adding additional keywords to the GUID with argument \"additional.keys\""