printf("[moldyn] integration start, go get a coffee ...\n");
/* executing the schedule */
- for(sched->count=0;sched->count<sched->total_sched;sched->count++) {
+ sched->count=0;
+ while(sched->count<sched->total_sched) {
/* setting amount of runs and finite time step size */
moldyn->tau=sched->tau[sched->count];
}
/* check for hooks */
- if(sched->count+1<sched->total_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;
}