-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAOloopControl_aorun.c
775 lines (517 loc) · 22.3 KB
/
AOloopControl_aorun.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
/**
* @file AOloopControl_aorun.c
* @brief AO loop Control compute functions
*
* REAL TIME COMPUTING ROUTINES
*
* @bug No known bugs.
*
*/
#define _GNU_SOURCE
// uncomment for test print statements to stdout
//#define _PRINT_TEST
#ifdef __MACH__ // for Mac OS X -
//#include <mach/mach_time.h>
//#define CLOCK_REALTIME 0
//#define CLOCK_MONOTONIC 0
int clock_gettime(int clk_id, struct mach_timespec *t) {
mach_timebase_info_data_t timebase;
mach_timebase_info(&timebase);
uint64_t time;
time = mach_absolute_time();
double nseconds = ((double)time * (double)timebase.numer)/((double)timebase.denom);
double seconds = ((double)time * (double)timebase.numer)/((double)timebase.denom * 1e9);
t->tv_sec = seconds;
t->tv_nsec = nseconds;
return 0;
}
#else
#include <time.h>
#endif
#include <string.h>
#include <sched.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_blas.h>
#include <pthread.h>
#include "info/info.h"
#include "CommandLineInterface/CLIcore.h"
#include "AOloopControl/AOloopControl.h"
#include "00CORE/00CORE.h"
#include "COREMOD_memory/COREMOD_memory.h"
#include "COREMOD_iofits/COREMOD_iofits.h"
#include "AOloopControl_IOtools/AOloopControl_IOtools.h"
#include <ncurses.h>
#ifdef HAVE_CUDA
#include "cudacomp/cudacomp.h"
#endif
# ifdef _OPENMP
# include <omp.h>
#define OMP_NELEMENT_LIMIT 1000000
# endif
#define NB_AOloopcontrol 10 // max number of loops
static int AOlooploadconf_init = 0;
static int wcol, wrow; // window size
extern AOLOOPCONTROL_CONF *AOconf; // configuration - this can be an array
extern AOloopControl_var aoloopcontrol_var;
static int AOloopControl_aorun_ProcessInit_Value = 0; // toggles to 1 when AOloopControl_aorun() started
// ********************************************************************
// This initialization runs once per process
// ********************************************************************
int AOloopControl_aorun_ProcessInit()
{
return 0;
}
int printstatus_AOloopControl_aorun(int loop)
{
printw("LOOPiteration %8ld\n", AOconf[loop].aorun.LOOPiteration);
printw("kill %d\n", AOconf[loop].aorun.kill);
printw("on %d\n", AOconf[loop].aorun.on);
printw("DMprimaryWriteON %d\n", AOconf[loop].aorun.DMprimaryWriteON);
printw("CMMODE %d\n", AOconf[loop].aorun.CMMODE);
printw("DMfilteredWriteON %d\n", AOconf[loop].aorun.DMfilteredWriteON);
printw("ARPFon %d\n", AOconf[loop].aorun.ARPFon);
return 0;
}
int AOloopControl_aorun_GUI(
long loop,
double frequ
)
{
char monstring[200];
int loopOK = 1;
int freeze = 0;
long cnt = 0;
// Connect to shared memory
AOloopControl_InitializeMemory(1);
/* Initialize ncurses */
if ( initscr() == NULL ) {
fprintf(stderr, "Error initialising ncurses.\n");
exit(EXIT_FAILURE);
}
getmaxyx(stdscr, wrow, wcol); /* get the number of rows and columns */
cbreak();
keypad(stdscr, TRUE); /* We get F1, F2 etc.. */
nodelay(stdscr, TRUE);
curs_set(0);
noecho(); /* Don't echo() while we do getch */
start_color();
init_pair(1, COLOR_BLACK, COLOR_WHITE);
init_pair(2, COLOR_BLACK, COLOR_RED);
init_pair(3, COLOR_GREEN, COLOR_BLACK);
init_pair(4, COLOR_YELLOW, COLOR_BLACK);
init_pair(5, COLOR_RED, COLOR_BLACK);
init_pair(6, COLOR_BLACK, COLOR_RED);
while( loopOK == 1 )
{
usleep((long) (1000000.0/frequ));
int ch = getch();
if(freeze==0)
{
attron(A_BOLD);
sprintf(monstring, "PRESS x TO STOP MONITOR");
print_header(monstring, '-');
attroff(A_BOLD);
}
switch (ch)
{
case 'f':
if(freeze==0)
freeze = 1;
else
freeze = 0;
break;
case 'x':
loopOK=0;
break;
}
if(freeze==0)
{
clear();
printstatus_AOloopControl_aorun(loop);
refresh();
cnt++;
}
}
endwin();
return(0);
}
/**
* ## Purpose
*
* Main AO loop function
*
* ## Overview
*
* Runs the AO loop\n
* Calls AOcompute(), which computes the correction to the applied.\n
* Then, the correction is applied by calling set_DM_modes() if modal correction, or by direct write to the DM otherwise.\n
*
*
* ## Details
*
*/
int_fast8_t __attribute__((hot)) AOloopControl_aorun() {
FILE *fp;
char fname[200];
long loop;
int vOK;
long ii;
long ID;
long j, m;
struct tm *uttime;
time_t t;
struct timespec *thetime = (struct timespec *)malloc(sizeof(struct timespec));
char logfname[1000];
char command[1000];
int r;
int RT_priority = 90; //any number from 0-99
struct sched_param schedpar;
double a;
long cnttest;
float tmpf1;
struct timespec tnow;
struct timespec t1;
struct timespec t2;
struct timespec tdiff;
int semval;
struct timespec functionTestTimerStart;
struct timespec functionTestTimerEnd;
struct timespec functionTestTimer00;
struct timespec functionTestTimer01;
struct timespec functionTestTimer02;
struct timespec functionTestTimer03;
struct timespec functionTestTimer04;
loop = aoloopcontrol_var.LOOPNUMBER;
PROCESSINFO *processinfo;
char pinfoname[200];
sprintf(pinfoname, "aol%ld-aorun", loop);
char pinfodescr[200];
sprintf(pinfodescr, "run AOloop %ld", loop);
char pinfomsg[200];
sprintf(pinfomsg, "Initialize AO loop %ld", loop);
processinfo = processinfo_setup(
pinfoname, // short name for the processinfo instance, no spaces, no dot, name should be human-readable
pinfodescr, // description
pinfomsg, // message on startup
__FUNCTION__, __FILE__, __LINE__
);
// OPTIONAL SETTINGS
processinfo->MeasureTiming = 1; // Measure timing
processinfo->RT_priority = RT_priority; // RT_priority, 0-99. Larger number = higher priority. If <0, ignore
int loopOK = 1;
// LOG function start
int logfunc_level = 0;
int logfunc_level_max = 1;
char commentstring[200];
sprintf(commentstring, "Main function, loop %ld", loop);
CORE_logFunctionCall(logfunc_level, logfunc_level_max, 0, __FILE__, __func__, __LINE__, commentstring);
if(aoloopcontrol_var.AOloopcontrol_meminit == 0) {
AOloopControl_InitializeMemory(0);
}
if(AOloopControl_aorun_ProcessInit_Value == 0) {
AOloopControl_aorun_ProcessInit();
AOloopControl_aorun_ProcessInit_Value = 1;
}
/** ### STEP 1: Setting up
*
* Load arrays
* */
printf("SETTING UP...\n");
AOloopControl_loadconfigure(aoloopcontrol_var.LOOPNUMBER, 1, 10);
// pixel streaming ?
aoloopcontrol_var.COMPUTE_PIXELSTREAMING = 1;
if(AOconf[loop].AOcompute.GPUall == 0) {
aoloopcontrol_var.COMPUTE_PIXELSTREAMING = 0;
}
printf("============ pixel streaming ? =============\n");
fflush(stdout);
if(aoloopcontrol_var.COMPUTE_PIXELSTREAMING == 1) {
aoloopcontrol_var.aoconfID_pixstream_wfspixindex = load_fits("pixstream_wfspixindex.fits", "pixstream", 1);
}
if(aoloopcontrol_var.aoconfID_pixstream_wfspixindex == -1) {
aoloopcontrol_var.COMPUTE_PIXELSTREAMING = 0;
} else {
printf("Testing data type\n");
fflush(stdout);
if(data.image[aoloopcontrol_var.aoconfID_pixstream_wfspixindex].md[0].datatype != _DATATYPE_UINT16) {
aoloopcontrol_var.COMPUTE_PIXELSTREAMING = 0;
}
}
if(aoloopcontrol_var.COMPUTE_PIXELSTREAMING == 1) {
long xsize = data.image[aoloopcontrol_var.aoconfID_pixstream_wfspixindex].md[0].size[0];
long ysize = data.image[aoloopcontrol_var.aoconfID_pixstream_wfspixindex].md[0].size[1];
aoloopcontrol_var.PIXSTREAM_NBSLICES = 0;
for(ii = 0; ii < xsize * ysize; ii++)
if(data.image[aoloopcontrol_var.aoconfID_pixstream_wfspixindex].array.UI16[ii] > aoloopcontrol_var.PIXSTREAM_NBSLICES) {
aoloopcontrol_var.PIXSTREAM_NBSLICES = data.image[aoloopcontrol_var.aoconfID_pixstream_wfspixindex].array.UI16[ii];
}
aoloopcontrol_var.PIXSTREAM_NBSLICES++;
printf("PIXEL STREAMING: %d image slices\n", aoloopcontrol_var.PIXSTREAM_NBSLICES);
}
printf("============ FORCE pixel streaming = 0\n");
fflush(stdout);
aoloopcontrol_var.COMPUTE_PIXELSTREAMING = 0; // TEST
vOK = 1;
if(AOconf[loop].aorun.init_wfsref0 == 0) {
processinfo_error(processinfo, "ERROR: no WFS reference");
loopOK = 0;
vOK = 0;
}
// if(AOconf[loop].init_CM==0)
if(aoloopcontrol_var.init_CM_local == 0) {
char msgstring[200];
printf("ERROR: CANNOT RUN LOOP WITHOUT CONTROL MATRIX\n");
printf("aoloopcontrol_var.init_CM_local = 0\n");
printf("FILE %s line %d\n", __FILE__, __LINE__);
processinfo_error(processinfo, "ERROR: no control matrix");
loopOK = 0;
vOK = 0;
}
aoloopcontrol_var.aoconfcnt0_wfsref_current = data.image[aoloopcontrol_var.aoconfID_wfsref].md[0].cnt0;
AOconf[loop].aorun.initmapping = 0;
AOconf[loop].aorun.init_CMc = 0;
clock_gettime(CLOCK_REALTIME, &t1);
if(vOK == 1) {
AOconf[loop].aorun.LOOPiteration = 0;
AOconf[loop].aorun.kill = 0;
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.DMprimaryWriteON = 0;
AOconf[loop].aorun.DMfilteredWriteON = 0;
AOconf[loop].aorun.ARPFon = 0;
#ifdef _PRINT_TEST
printf("[%s] [%d] AOloopControl_aorun: Entering loop\n", __FILE__, __LINE__);
fflush(stdout);
#endif
int timerinit = 0;
if(data.processinfo == 1) {
processinfo->loopstat = 1;
}
processinfo_WriteMessage(processinfo, "Entering loop");
int processinfoUpdate = 0;
// ==================================
// STARTING LOOP
// ==================================
processinfo_loopstart(processinfo); // Notify processinfo that we are entering loop
while(AOconf[loop].aorun.kill == 0) {
if(timerinit == 1) {
processinfoUpdate = 1;
clock_gettime(CLOCK_REALTIME, &t1);
printf("timer init\n");
if(data.processinfo == 1) {
char msgstring[200];
sprintf(msgstring, "Waiting");
processinfo_WriteMessage(processinfo, msgstring);
}
}
clock_gettime(CLOCK_REALTIME, &t2);
tdiff = info_time_diff(t1, t2);
double tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
printf(" WAITING %20.3lf sec \r", tdiffv);
fflush(stdout);
usleep(1000);
processinfoUpdate = 1;
timerinit = 0;
sprintf(pinfomsg, "WAITING (on=%d loopOK=%d)", AOconf[loop].aorun.on, loopOK);
processinfo_WriteMessage(processinfo, pinfomsg);
long loopcnt = 0;
while((AOconf[loop].aorun.on==1) && (loopOK==1)) {
loopOK = processinfo_loopstep(processinfo);
if(loopOK == 0)
{
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
}
if ( processinfoUpdate == 1) {
processinfo_WriteMessage(processinfo, "LOOP RUNNING");
}
clock_gettime(CLOCK_REALTIME, &functionTestTimer00); //TEST timing in function
if(timerinit == 0) {
// Read_cam_frame(loop, 0, AOconf[loop].WFSim.WFSnormalize, 0, 1);
clock_gettime(CLOCK_REALTIME, &t1);
timerinit = 1;
}
#ifdef _PRINT_TEST
printf("[%s] [%d] AOloopControl_aorun: Starting AOcompute, AOconf[%d].WFSim.WFSnormalize = %d\n", __FILE__, __LINE__, loop, AOconf[loop].WFSim.WFSnormalize);
fflush(stdout);
#endif
// CTRLval = 5 will disable computations in loop (usually for testing)
int doComputation = 1;
if(data.processinfo == 1)
if(processinfo->CTRLval == 5) {
doComputation = 0;
}
//
// Most computation are performed inside AOcompute
//
// note: processinfo_exec_start is launched in Read_cam_frame() in AOcompute()
//
if(doComputation == 1) {
AOcompute(loop, AOconf[loop].WFSim.WFSnormalize);
}
else
processinfo_exec_start(processinfo);
clock_gettime(CLOCK_REALTIME, &functionTestTimerStart); //TEST timing in function
AOconf[loop].AOtiminginfo.status = 12; // 12
clock_gettime(CLOCK_REALTIME, &tnow);
tdiff = info_time_diff(data.image[aoloopcontrol_var.aoconfID_looptiming].md[0].atime, tnow);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
data.image[aoloopcontrol_var.aoconfID_looptiming].array.F[19] = tdiffv;
if(AOconf[loop].aorun.CMMODE == 0) { // 2-step : WFS -> mode coeffs -> DM act
if(AOconf[loop].aorun.DMprimaryWriteON == 1) { // if Writing to DM
if(doComputation == 1) {
if(fabs(AOconf[loop].aorun.gain) > 1.0e-6) {
set_DM_modes(loop);
}
}
}
} else { // 1 step: WFS -> DM act
if(AOconf[loop].aorun.DMprimaryWriteON == 1) { // if Writing to DM
data.image[aoloopcontrol_var.aoconfID_dmC].md[0].write = 1;
for(ii = 0; ii < AOconf[loop].DMctrl.sizeDM; ii++) { //TEST
if(isnan(data.image[aoloopcontrol_var.aoconfID_meas_act].array.F[ii]) != 0) {
printf("image aol2_meas_act element %ld is NAN -> replacing by 0\n", ii);
data.image[aoloopcontrol_var.aoconfID_meas_act].array.F[ii] = 0.0;
}
}
AOconf[loop].AOtiminginfo.status = 13; // enforce limits
clock_gettime(CLOCK_REALTIME, &tnow);
tdiff = info_time_diff(data.image[aoloopcontrol_var.aoconfID_looptiming].md[0].atime, tnow);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
data.image[aoloopcontrol_var.aoconfID_looptiming].array.F[20] = tdiffv;
if(doComputation == 1) {
for(ii = 0; ii < AOconf[loop].DMctrl.sizeDM; ii++) {
data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] -= AOconf[loop].aorun.gain * data.image[aoloopcontrol_var.aoconfID_meas_act].array.F[ii];
data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] *= AOconf[loop].aorun.mult;
if(data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] > AOconf[loop].aorun.maxlimit) {
data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] = AOconf[loop].aorun.maxlimit;
}
if(data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] < -AOconf[loop].aorun.maxlimit) {
data.image[aoloopcontrol_var.aoconfID_dmC].array.F[ii] = -AOconf[loop].aorun.maxlimit;
}
}
}
AOconf[loop].AOtiminginfo.status = 14; // write to DM
clock_gettime(CLOCK_REALTIME, &tnow);
tdiff = info_time_diff(data.image[aoloopcontrol_var.aoconfID_looptiming].md[0].atime, tnow);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
data.image[aoloopcontrol_var.aoconfID_looptiming].array.F[21] = tdiffv;
/* int semnb;
for(semnb=0; semnb<data.image[aoloopcontrol_var.aoconfID_dmC].md[0].sem; semnb++)
{
sem_getvalue(data.image[aoloopcontrol_var.aoconfID_dmC].semptr[semnb], &semval);
if(semval<SEMAPHORE_MAXVAL)
sem_post(data.image[aoloopcontrol_var.aoconfID_dmC].semptr[semnb]);
}*/
COREMOD_MEMORY_image_set_sempost_byID(aoloopcontrol_var.aoconfID_dmC, -1);
data.image[aoloopcontrol_var.aoconfID_dmC].md[0].cnt1 = AOconf[loop].aorun.LOOPiteration;
data.image[aoloopcontrol_var.aoconfID_dmC].md[0].cnt0++;
data.image[aoloopcontrol_var.aoconfID_dmC].md[0].write = 0;
// inform dmdisp that new command is ready in one of the channels
if(aoloopcontrol_var.aoconfID_dmdisp != -1)
if(data.image[aoloopcontrol_var.aoconfID_dmdisp].md[0].sem > 1) {
sem_getvalue(data.image[aoloopcontrol_var.aoconfID_dmdisp].semptr[0], &semval);
if(semval < SEMAPHORE_MAXVAL) {
sem_post(data.image[aoloopcontrol_var.aoconfID_dmdisp].semptr[1]);
}
}
AOconf[loop].aorun.DMupdatecnt ++;
}
}
AOconf[loop].AOtiminginfo.status = 18; // 18
clock_gettime(CLOCK_REALTIME, &tnow);
tdiff = info_time_diff(data.image[aoloopcontrol_var.aoconfID_looptiming].md[0].atime, tnow);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
data.image[aoloopcontrol_var.aoconfID_looptiming].array.F[22] = tdiffv;
AOconf[loop].aorun.cnt++;
AOconf[loop].aorun.LOOPiteration++;
data.image[aoloopcontrol_var.aoconfID_looptiming].md[0].cnt1 = AOconf[loop].aorun.LOOPiteration;
// REAL TIME LOGGING
data.image[aoloopcontrol_var.aoconfIDlogdata].md[0].cnt0 = AOconf[loop].aorun.cnt;
data.image[aoloopcontrol_var.aoconfIDlogdata].md[0].cnt1 = AOconf[loop].aorun.LOOPiteration;
data.image[aoloopcontrol_var.aoconfIDlogdata].array.F[0] = AOconf[loop].aorun.gain;
if(AOconf[loop].aorun.cnt == AOconf[loop].aorun.cntmax) {
AOconf[loop].aorun.on = 0;
}
clock_gettime(CLOCK_REALTIME, &functionTestTimerEnd);
tdiff = info_time_diff(functionTestTimerStart, functionTestTimerEnd);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
double tdiffv02 = tdiffv;
//TEST TIMING
/*
if(tdiffv > 30.0e-6)
{
printf("TIMING WARNING: %12.3f us %10ld AOloopControl_aorun() - excluding AOcompute\n", tdiffv*1.0e6, (long) AOconf[loop].aorun.LOOPiteration);
fflush(stdout);
}*/
tdiff = info_time_diff(functionTestTimer00, functionTestTimerEnd);
tdiffv = 1.0 * tdiff.tv_sec + 1.0e-9 * tdiff.tv_nsec;
//TEST TIMING
/*
if(tdiffv > 600.0e-6)
{
printf("TIMING WARNING: %12.3f us %10ld AOloopControl_aorun()\n", tdiffv*1.0e6, (long) AOconf[loop].aorun.LOOPiteration);
printf(" AOcompute() read cam : %12.3f us \n", tdiffv00*1.0e6);
printf(" AOcompute() post read cam : %12.3f us \n", tdiffv01*1.0e6);
printf(" AOloopControl_aorun() post-AOcompute : %12.3f us \n", tdiffv02*1.0e6);
fflush(stdout);
}
*/
processinfo_exec_end(processinfo);
// process signals
/*
if(data.signal_INT == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGINT);
}
}
if(data.signal_ABRT == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGABRT);
}
}
if(data.signal_BUS == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGBUS);
}
}
if(data.signal_SEGV == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGSEGV);
}
}
if(data.signal_HUP == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGHUP);
}
}
if(data.signal_PIPE == 1) {
AOconf[loop].aorun.on = 0;
AOconf[loop].aorun.kill = 1;
if(data.processinfo == 1) {
processinfo_SIGexit(processinfo, SIGPIPE);
}
}
*/
loopcnt++;
}
if(AOconf[loop].aorun.kill == 1) {
loopOK = 0;
}
} // loop has been killed (normal exit)
processinfo_cleanExit(processinfo);
}
free(thetime);
// LOG function end
CORE_logFunctionCall(logfunc_level, logfunc_level_max, 1, __FILE__, __func__, __LINE__, commentstring);
return(0);
}