Project

General

Profile

Revision 94cf1056

ID94cf105604c3e520a475ac6a576575f4695eb5ec

Added by Simon Tenbusch over 9 years ago

[eefscheduler] bugfix with barriermsgs and sequential scheduling:
- the processingDuration was not set correctly everytime
- also now eefscheduler is deleting outdated barriers -> IES may get larger

View differences:

src/sim/cscheduler.cc
145 145
        cAsyncModule* aMod = (cAsyncModule*) mod;
146 146
        simtime_t now = msg->getArrivalTime();
147 147
        simtime_t duration = aMod->getProcessingDelay(msg);
148
        msg->setEventDuration(duration);
148 149

  
149 150
        if (aMod->mayParallelize(msg, duration))
150 151
        {
151
            msg->setEventDuration(duration);
152 152
            // create a new barrier and schedule it
153 153
            cBarrierMessage* barrier = new cBarrierMessage();
154 154
            barrier->setArrival(aMod, -1, now + duration);
155 155
            msg->setBarrier(barrier);
156
            // insert user supplied message in task queue.
157 156
            sim->msgQueue.insert(barrier);
158 157
        }
159 158
    }
......
281 280
        if (barrier != NULL)
282 281
        {
283 282
            /*
283
             * If the barrier has already been signaled, we can just delete it, as we would not have to wait here
284
            */
285
            if(!barrier->isValid()) {
286
                delete barrier;
287
                continue;
288
            }
289
            /*
284 290
             * if we hit a barrier, we are done and return the first independent msg
285 291
             * or we have wait at the barrier if no independent event exists
286 292
             */
......
325 331
            sim->msgQueue.insert(barrier);
326 332

  
327 333
            printf(
328
                     "adding to IEH: %s, tstart=%f, tend= %f, now First in IEH: ", SIMTIME_DBL(msg->getArrivalTime()),
334
                     "adding to IEH: %f, tstart=%s, tend= %f, now First in IEH: ", SIMTIME_DBL(msg->getArrivalTime()),
329 335
                     ((cSimpleModule*) sim->getModule(msg->getArrivalModuleId()))->getName(),
330 336
                     SIMTIME_DBL(msg->getTend()));
331 337

  

Also available in: Unified diff