X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=moldyn.c;h=433be6824c9663f9bfa745ca0b82d08b566abd2b;hb=refs%2Fheads%2Forigin;hp=992d112622ce35341fa2e3bab745c8b8b683f0e3;hpb=998262afd7a8593832a8cbb80f02c0eb42a493ff;p=physik%2Fposic.git diff --git a/moldyn.c b/moldyn.c index 992d112..433be68 100644 --- a/moldyn.c +++ b/moldyn.c @@ -1391,7 +1391,8 @@ return 0; printf("[moldyn] integration start, go get a coffee ...\n"); /* executing the schedule */ - for(sched->count=0;sched->counttotal_sched;sched->count++) { + sched->count=0; + while(sched->counttotal_sched) { /* setting amount of runs and finite time step size */ moldyn->tau=sched->tau[sched->count]; @@ -1489,13 +1490,15 @@ return 0; } /* check for hooks */ - if(sched->count+1total_sched) - if(sched->hook) { - printf("\n ## schedule hook %d/%d start ##\n", - sched->count+1,sched->total_sched); - sched->hook(moldyn,sched->hook_params); - printf(" ## schedule hook end ##\n"); - } + if(sched->hook) { + printf("\n ## schedule hook %d/%d start ##\n", + sched->count+1,sched->total_sched-1); + sched->hook(moldyn,sched->hook_params); + printf(" ## schedule hook end ##\n"); + } + + /* increase the schedule counter */ + sched->count+=1; }