VOL-3431: Following enhancement/changes are done in this patch
- Process ONUs in bulk rather than serial, significantly improves run time
- Used a separate API to get flow-id. This flow-id is not freed on failure,
  as this adds to unnecessary complexity and unwarranted for a test tool .
- Print the total execution time at the end of the test
- Fixed the Dockerfile to not build vendor module at each docker build time
- Introduced new functions to retry scheduler, queue and flow adds on failure,
  but these are not currently used
- Add vendor modules to repo just like all other ONF VOLTHA golang projects do
- Tested all three workflows - ATT, DT and TT
- Bump version to 1.1.0

Change-Id: I6102cb206e78ea04b49b7125b101946ca6f36bfb
diff --git a/core/subscriber_manager.go b/core/subscriber_manager.go
index d84fad9..3cf65ad 100644
--- a/core/subscriber_manager.go
+++ b/core/subscriber_manager.go
@@ -18,6 +18,7 @@
 
 import (
 	"fmt"
+	"sync"
 
 	"github.com/opencord/openolt-scale-tester/config"
 	"github.com/opencord/voltha-lib-go/v3/pkg/log"
@@ -86,9 +87,11 @@
 	OpenOltClient oop.OpenoltClient
 	TestConfig    *config.OpenOltScaleTesterConfig
 	RsrMgr        *OpenOltResourceMgr
+	subWg         *sync.WaitGroup
 }
 
-func (subs *Subscriber) Start(onuCh chan bool, isGroup bool) {
+func (subs *Subscriber) Start(isGroup bool) {
+
 	var err error
 
 	log.Infow("workflow-deploy-started-for-subscriber", log.Fields{"subsName": subs.SubscriberName})
@@ -97,22 +100,20 @@
 
 	for _, tpID := range subs.TestConfig.TpIDList {
 		uniPortName := fmt.Sprintf(UniPortName, subs.PonIntf, subs.OnuID, subs.UniID)
-		if subs.TpInstance[tpID], err =
-			subs.RsrMgr.ResourceMgrs[subs.PonIntf].TechProfileMgr.CreateTechProfInstance(context.Background(),
-				uint32(tpID), uniPortName, subs.PonIntf); err != nil {
+		subs.RsrMgr.GemIDAllocIDLock[subs.PonIntf].Lock()
+		subs.TpInstance[tpID], err = subs.RsrMgr.ResourceMgrs[subs.PonIntf].TechProfileMgr.CreateTechProfInstance(context.Background(),
+			uint32(tpID), uniPortName, subs.PonIntf)
+		subs.RsrMgr.GemIDAllocIDLock[subs.PonIntf].Unlock()
+		if err != nil {
 			log.Errorw("error-creating-tp-instance-for-subs",
 				log.Fields{"subsName": subs.SubscriberName, "onuID": subs.OnuID, "tpID": tpID})
 
 			subs.Reason = ReasonCodeToReasonString(TP_INSTANCE_CREATION_FAILED)
-			onuCh <- true
-
 			return
 		}
 	}
 
-	DeployWorkflow(subs, isGroup)
+	go DeployWorkflow(subs, isGroup)
 
-	log.Infow("workflow-deploy-completed-for-subscriber", log.Fields{"subsName": subs.SubscriberName})
-
-	onuCh <- true
+	log.Infow("workflow-deploy-started-for-subscriber", log.Fields{"subsName": subs.SubscriberName})
 }