Skip to content
aprod.c 41.1 KiB
Newer Older
            /// Mode 2 InstrConstr
            if (nOfInstrConstr )
            {
                time_t startTime_nOfInstrConstr = time(NULL);

                localSum = 0.0;
                int offSetInstr;
                long off1;
                long offInstrUnk = VrIdAstroPDimMax * nAstroPSolved + nAttAxes * nDegFreedomAtt;
                long off2 = mapNoss[myid] + nEqExtConstr + nEqBarConstr;
                long off3 = mapNcoeff[myid] + nOfElextObs * nEqExtConstr + nOfElBarObs * nEqBarConstr;
                long off4 = mapNoss[myid] * nInstrPSolved;
                long off5;
                long off6;
                for (int k1 = myid; k1 < nOfInstrConstr; k1 = k1 + nproc)
                {
                    yi = knownTerms[off2 + k1];
                    offSetInstr = 0;
                    for (int m = 0; m < k1; m++)
                        offSetInstr += instrConstrIlung[m];

                    off1 = off3 + offSetInstr;
                    off5 = off4 + offSetInstr;
                    //FV_ EDIT ompSs
                    //#pragma omp for
                    for (int j = 0; j < instrConstrIlung[k1]; j++)
                    {
                        localSum = systemMatrix[off1 + j] * yi;
                        off6 = offInstrUnk + instrCol[off5 + j];
                        vVect[off6] += localSum;
                    }
                }
                
                if (comlsqr.itn <= 2 && (myid == 0 || myid == nproc - 1 || debugMode == 1))
                    printf("\tPE=%d AprodTiming: nOfInstrConstr  sec=%ld\n", myid, time(NULL) - startTime_nOfInstrConstr);
            }
            ////////////

        } //pragma
        *ompSec += time(NULL) - startTime;
        if (comlsqr.itn <= 2 && (myid == 0 || myid == nproc - 1 || debugMode == 1))
            printf("PE=%d AprodTiming: mode=2.2  OmpSec=%ld\n", myid, time(NULL) - startTime);
    
    
    }
    

        #pragma omp task in(vVect_aux_AttP,vVect_aux_InstP)
        //freeing aux vect
        for (int i=0;i<omp_get_num_threads();i++)
        {
      
            free(vVect_aux_AttP[i]);
            free(vVect_aux_InstP[i]);
        }
        free(vVect_aux_AttP);
        free(vVect_aux_InstP);


   
    
    } // else if(mode==2)
    
    */