base fix for parallelism made more efficient

This commit is contained in:
Dhanya Maliakal 2017-09-15 09:20:43 +02:00
parent 67cdfe8b41
commit e6125c3c7f
3 changed files with 66 additions and 56 deletions

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
Repsitory UUID: 5d45181f177b552819bd60947c6cf4f0abae7681
Revision: 1543
Repsitory UUID: 3c1eb747d1930d6d38030a5a607f72d3b58a7a21
Revision: 1544
Branch: 3.0
Last Changed Author: Dhanya_Maliakal
Last Changed Rev: 1548
Last Changed Date: 2017-08-28 12:02:38.000000002 +0200 ./multiSlsDetector/multiSlsDetector.cpp
Last Changed Rev: 1549
Last Changed Date: 2017-09-14 17:05:04.000000002 +0200 ./threadFiles/ThreadPool.o

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
//#define SVNREPPATH ""
#define SVNREPUUIDLIB "5d45181f177b552819bd60947c6cf4f0abae7681"
//#define SVNREV 0x1548
#define SVNREPUUIDLIB "3c1eb747d1930d6d38030a5a607f72d3b58a7a21"
//#define SVNREV 0x1549
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTHLIB "Dhanya_Maliakal"
#define SVNREVLIB 0x1548
#define SVNDATELIB 0x20170828
#define SVNREVLIB 0x1549
#define SVNDATELIB 0x20170914
//

View File

@ -8,10 +8,12 @@
#include <errno.h>
#include <string.h>
#include "Global.h"
#include "sls_detector_defs.h"
#include <iostream>
#include <stdio.h>
using namespace std;
class slsDetector;
@ -107,67 +109,75 @@ private:
class SuperTask: public virtual slsDetectorDefs {
public:
SuperTask():m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
~SuperTask(){};
protected:
/** Function defined
/** Function signature defined
* First argument is Return type, the remaining are arguments
*/
func00_t <void >* m1;
func0_t <int >* m2;
func1_t <int, int>* m3;
func1_t <string, string>* m4;
func1_t <detectorSettings, int>* m5;
func2_t <int, int,int>* m6;
func2_t <int, string,int>* m7;
func2_t <dacs_t, dacIndex,int>* m8;
func2_t <detectorSettings, detectorSettings,int>* m9;
func2_t <string, networkParameter,string>* m10;
func3_t <int, int,int,int>* m11;
func4_t <int, trimMode,int,int,int>* m12;
func4_t <int, int,int,detectorSettings,int>* m13;
func4_t <dacs_t, dacs_t,dacIndex,int,int>* m14;
func00_t <void >* m1;
func0_t <int >* m2;
func1_t <int, int>* m3;
func1_t <string, string>* m4;
func1_t <detectorSettings, int>* m5;
func2_t <int, int,int>* m6;
func2_t <int, string,int>* m7;
func2_t <dacs_t, dacIndex,int>* m8;
func2_t <detectorSettings, detectorSettings,int>* m9;
func2_t <string, networkParameter,string>* m10;
func3_t <int, int,int,int>* m11;
func4_t <int, trimMode,int,int,int>* m12;
func4_t <int, int,int,detectorSettings,int>* m13;
func4_t <dacs_t, dacs_t,dacIndex,int,int>* m14;
};
class Task: public virtual SuperTask{
class Task: public virtual SuperTask {
public:
/** Constructors
/** Task Constructors using appropriate function signature
* First argument is Return type, the remaining are arguments
*/
Task(func00_t <void >* t): SuperTask(),m1(t){};
Task(func0_t <int >* t): m1(0),m2(t),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func1_t <int, int>* t): m1(0),m2(0),m3(t),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func1_t <string, string>* t): m1(0),m2(0),m3(0),m4(t),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func1_t <detectorSettings, int>* t): m1(0),m2(0),m3(0),m4(0),m5(t),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func2_t <int, int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(t),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func2_t <int, string,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(t),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func2_t <dacs_t, dacIndex,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(t),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func2_t <detectorSettings, detectorSettings,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(t),m10(0),m11(0),m12(0),m13(0),m14(0){};
Task(func2_t <string, networkParameter,string>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(t),m11(0),m12(0),m13(0),m14(0){};
Task(func3_t <int, int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(t),m12(0),m13(0),m14(0){};
Task(func4_t <int, trimMode,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(t),m13(0),m14(0){};
Task(func4_t <int, int,int,detectorSettings,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(t),m14(0){};
Task(func4_t <dacs_t, dacs_t,dacIndex,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(t){};
Task(func00_t <void >* t): SuperTask(),fnum(1){m1 = t;};
Task(func0_t <int >* t): SuperTask(),fnum(2){m2 = t;};
Task(func1_t <int, int>* t): SuperTask(),fnum(3){m3 = t;};
Task(func1_t <string, string>* t): SuperTask(),fnum(4){m4 = t;};
Task(func1_t <detectorSettings, int>* t): SuperTask(),fnum(5){m5 = t;};
Task(func2_t <int, int,int>* t): SuperTask(),fnum(6){m6 = t;};
Task(func2_t <int, string,int>* t): SuperTask(),fnum(7){m7 = t;};
Task(func2_t <dacs_t, dacIndex,int>* t): SuperTask(),fnum(8){m8 = t;};
Task(func2_t <detectorSettings, detectorSettings,int>* t): SuperTask(),fnum(9){m9 = t;};
Task(func2_t <string, networkParameter,string>* t): SuperTask(),fnum(10){m10 = t;};
Task(func3_t <int, int,int,int>* t): SuperTask(),fnum(11){m11 = t;};
Task(func4_t <int, trimMode,int,int,int>* t): SuperTask(),fnum(12){m12 = t;};
Task(func4_t <int, int,int,detectorSettings,int>* t): SuperTask(),fnum(13){m13 = t;};
Task(func4_t <dacs_t, dacs_t,dacIndex,int,int>* t): SuperTask(),fnum(14){m14 = t;};
~Task(){}
void operator()(){
if(m1) (*m1)();
else if(m2) (*m2)();
else if(m3) (*m3)();
else if(m4) (*m4)();
else if(m5) (*m5)();
else if(m6) (*m6)();
else if(m7) (*m7)();
else if(m8) (*m8)();
else if(m9) (*m9)();
else if(m10) (*m10)();
else if(m11) (*m11)();
else if(m12) (*m12)();
else if(m13) (*m13)();
else if(m14) (*m14)();
switch(fnum) {
case 1: (*m1)(); break;
case 2: (*m2)(); break;
case 3: (*m3)(); break;
case 4: (*m4)(); break;
case 5: (*m5)(); break;
case 6: (*m6)(); break;
case 7: (*m7)(); break;
case 8: (*m8)(); break;
case 9: (*m9)(); break;
case 10: (*m10)(); break;
case 11: (*m11)(); break;
case 12: (*m12)(); break;
case 13: (*m13)(); break;
case 14: (*m14)(); break;
default:
cprintf(RED, "Error: Task not defined. Abort!\n");
break;
}
}
private:
/** function number */
int fnum;
};