Source

mpi3-fortran / ompi / contrib / vt / vt / extlib / otf / tools / otfaux / Handler.cpp

Full commit
  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
/*
 This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2012.
 Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/


#include <cassert>

#include <OTF_CopyHandler.h>
#include <OTF_CopyHandler_stream.h>

#include "Handler.h"
#include "Control.h"


/* *** Definition handler *** ************************************* */


int handleDeftimerresolution( void* firsthandlerarg, uint32_t streamid,
        uint64_t ticksPerSecond, OTF_KeyValueList* list ) {


	Control* control= (Control*) firsthandlerarg;

	/* fprintf( stderr, "  %s\n", __PRETTY_FUNCTION__ ); */
	
    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefTimerResolution( control->def_wstream,
            0, ticksPerSecond, list );
}


int handleDefprocess( void* firsthandlerarg, uint32_t streamid,
        uint32_t deftoken, const char* name, uint32_t parent,
        OTF_KeyValueList* list ) {
	
	
	/* fprintf( stderr, "  %s\n", __PRETTY_FUNCTION__ ); */

	Control* control= (Control*) firsthandlerarg;

	control->all_processes.push_back( deftoken );
	if ( control->stats )
		control->stats->defProcess( deftoken );

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefProcess( control->def_wstream,
            0, deftoken, name, parent, list );
}


int handleDefFunction( void* firsthandlerarg, uint32_t streamid,
	uint32_t deftoken, const char* name, uint32_t group, uint32_t scltoken,
        OTF_KeyValueList* list ) {
	

	/* fprintf( stderr, "  %s\n", __PRETTY_FUNCTION__ ); */
	
	Control* control= (Control*) firsthandlerarg;
	
	if ( control->stats )
		control->stats->defFunction( deftoken, group );

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefFunction( control->def_wstream,
            0, deftoken, name, group, scltoken, list );
}


int handleDefFile( void* firsthandlerarg, uint32_t stream, uint32_t token,
        const char* name, uint32_t group, OTF_KeyValueList* list ) {


	/* fprintf( stderr, "  %s\n", __PRETTY_FUNCTION__ ); */
	
	Control* control= (Control*) firsthandlerarg;
	if ( control->stats )
		control->stats->defFile( token, group );

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefFile( control->def_wstream,
            0, token, name, group, list );
}

int handleDefCollectiveOperation(void *firsthandlerarg, uint32_t stream,
        uint32_t collOp, const char *name, uint32_t type,
        OTF_KeyValueList* list) {


	Control* control= (Control*) firsthandlerarg;
	
	if ( control->stats )
		control->stats->defCollOp( collOp, type );

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefCollectiveOperation( control->def_wstream,
            0, collOp, name, type, list );
}


int handleDefTimeRange( void* firsthandlerarg, uint32_t streamid, uint64_t minTime,
        uint64_t maxTime, OTF_KeyValueList* kvlist ) {

    Control* control= (Control*) firsthandlerarg;

    control->haveTimeRange = true;
    control->minTime = minTime;
    control->maxTime = maxTime;

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefTimeRange( control->def_wstream,
            0, minTime, maxTime, kvlist );
}

int handlerDefKeyValue( void* firsthandlerarg, uint32_t stream, uint32_t key,
        OTF_Type type, const char* name, const char *description,
        OTF_KeyValueList* list ) {

    Control* control= (Control*) firsthandlerarg;

    if ( control->msgMatching ) {

        if ( control->maxKeyToken < key )
            control->maxKeyToken = key;

        if ( 0 == strcmp( name, OTFAUX_KEYVALUE_TUD_P2P_RECEIVED_TIME_NAME ) ) {
            control->recvTimeToken = key;
            return OTF_RETURN_OK;
        }
        if ( 0 == strcmp( name, OTFAUX_KEYVALUE_TUD_P2P_RECEIVED_SIZE_NAME ) ) {
            control->recvLengthToken = key;
            return OTF_RETURN_OK;
        }
        if ( 0 == strcmp( name, OTFAUX_KEYVALUE_TUD_P2P_RECEIVED_SCL_NAME ) ) {
            control->recvSclToken = key;
            return OTF_RETURN_OK;
        }
    }

    /* copy definition to new def file */
    return OTF_CopyHandler_stream_DefKeyValue( control->def_wstream,
            0, key, type, name, description, list );
}


/* *** Event handler *** ****************************************** */


int handleCounter( void* firsthandlerarg,
                   uint64_t time,
                   uint32_t process,
                   uint32_t counter,
                   uint64_t value,
                   OTF_KeyValueList *kvlist ) {


    /* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */

    Control* control= (Control*) firsthandlerarg;

    while ( control->checkTime( time ) )
        ;

    if ( control->doSnapshots && control->aux_state )
    {
        OTFAUX_State_processCounter( control->aux_state,
                                     time,
                                     process,
                                     counter,
                                     value,
                                     OTF_KeyValueList_clone( kvlist ) );
    }

    if ( control->copyEvents )
        return OTF_CopyHandler_Counter( control->writer,
                                        time,
                                        process,
                                        counter,
                                        value,
                                        kvlist );

    return OTF_RETURN_OK;
}


int handleEnter( void* firsthandlerarg, uint64_t time, uint32_t statetoken,
		uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList *kvlist ) {


	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */

	Control* control= (Control*) firsthandlerarg;
	
	while ( control->checkTime( time ) )
		;

	if ( control->aux_state )
	{
		OTFAUX_State_processEnter( control->aux_state,
		                           time,
		                           cpuid,
		                           statetoken,
		                           scltoken,
		                           control->doSnapshots ?
		                               OTF_KeyValueList_clone( kvlist ) :
		                               NULL );
	}
	if ( control->stats )
		control->stats->enterFunction( time, cpuid, statetoken );

	if ( control->copyEvents )
		return OTF_CopyHandler_Enter( control->writer, time, statetoken,
				cpuid, scltoken, kvlist );

	return OTF_RETURN_OK;
}


int handleLeave( void* firsthandlerarg, uint64_t time, uint32_t statetoken,
		uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList *kvlist ) {


	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */
	Control* control= (Control*) firsthandlerarg;
	
	while ( control->checkTime( time ) )
		;

	if ( control->aux_state )
	{
		OTFAUX_State_processLeave( control->aux_state,
		                           time,
		                           cpuid,
		                           statetoken );
	}
	if ( control->stats )
		control->stats->leaveFunction( time, cpuid, statetoken );

	if ( control->copyEvents )
		return OTF_CopyHandler_Leave( control->writer, time, statetoken,
				cpuid, scltoken, kvlist );

	return OTF_RETURN_OK;
}


int handleRecvmsg( void* firsthandlerarg, uint64_t time, uint32_t receiver,
		uint32_t sender, uint32_t procGroup, uint32_t msgtag, 
		uint32_t msglength, uint32_t scltoken, OTF_KeyValueList *kvlist ) {


	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */
	
	Control* control= (Control*) firsthandlerarg;
	
	if ( ( control->doSnapshots || control->msgMatching )
	     && control->collectRecvsOnly
	     && control->aux_state ) {
		OTFAUX_State_enqueueRecvMsg( control->aux_state,
		                             time,
		                             receiver,
		                             sender,
		                             procGroup,
		                             msgtag,
		                             msglength,
		                             scltoken );

		return OTF_RETURN_OK;
	}


	if ( !control->collectRecvsOnly )
	{
		while ( control->checkTime( time ) )
			;

		if ( control->stats )
			control->stats->recvMessage( receiver, msglength );

		if ( control->copyEvents )
			return OTF_CopyHandler_RecvMsg( control->writer, time,
					receiver, sender, procGroup, msgtag,
					msglength, scltoken, kvlist );
	}

	return OTF_RETURN_OK;
}


int handleSendmsg( void* firsthandlerarg, uint64_t time, uint32_t sender,
		uint32_t receiver, uint32_t procGroup, uint32_t msgtag, 
		uint32_t msglength, uint32_t scltoken, OTF_KeyValueList *kvlist ) {

	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */
	
	uint64_t recvTime;
	uint32_t recvLength;
	uint32_t recvScl;
	int ret = 0;
	Control* control= (Control*) firsthandlerarg;
	
	while ( control->checkTime( time ) )
		;

	if ( ( control->doSnapshots || control->msgMatching )
	     && control->aux_state ) {
		ret = OTFAUX_State_processSendMsg( control->aux_state,
		                                   time,
		                                   sender,
		                                   receiver,
		                                   procGroup,
		                                   msgtag,
		                                   msglength,
		                                   scltoken,
		                                   &recvTime,
		                                   &recvLength,
		                                   &recvScl,
		                                   OTF_KeyValueList_clone( kvlist ) );

	}

	if ( control->stats )
		control->stats->sendMessage( sender, msglength );

	if ( control->copyEvents ) {
		if ( control->msgMatching && ret == 1 ) {
			OTF_KeyValueList_removeKey( kvlist, control->recvTimeToken );
			OTF_KeyValueList_appendUint64( kvlist,
			                               control->recvTimeToken,
			                               recvTime );
			OTF_KeyValueList_removeKey( kvlist, control->recvLengthToken );
			OTF_KeyValueList_appendUint32( kvlist,
			                               control->recvLengthToken,
			                               recvLength );
			OTF_KeyValueList_removeKey( kvlist, control->recvSclToken );
			OTF_KeyValueList_appendUint32( kvlist,
			                               control->recvSclToken,
			                               recvScl );
		}
		return OTF_CopyHandler_SendMsg( control->writer, time,
				sender, receiver, procGroup, msgtag,
				msglength, scltoken, kvlist );
	}
	return OTF_RETURN_OK;
}


int handleCollectiveOperation( void* firsthandlerarg, uint64_t time, 
    uint32_t process, uint32_t collective, uint32_t communicator, 
    uint32_t rootprocess, uint32_t sent, uint32_t received, 
    uint64_t duration, uint32_t scltoken, OTF_KeyValueList *kvlist ) {
	
	
	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */

	Control* control= (Control*) firsthandlerarg;
	
	while ( control->checkTime( time ) )
		;

	if ( control->doSnapshots && control->aux_state ) {
		OTFAUX_State_processCollectiveOperation( control->aux_state,
		                                         time,
		                                         process,
		                                         communicator,
		                                         rootprocess,
		                                         collective,
		                                         sent,
		                                         received,
		                                         scltoken );
	}

	if ( control->stats )
		control->stats->collOperation( process, rootprocess, collective,
		                               sent, received );

	if ( control->copyEvents )
		return OTF_CopyHandler_CollectiveOperation( control->writer,
				time, process, collective, communicator,
				rootprocess, sent, received,
				duration, scltoken, kvlist );

	return OTF_RETURN_OK;
}


static void processFileOperation( Control* control, uint64_t time, uint32_t fileid,
	uint32_t process, uint64_t handleid, uint32_t operation, uint64_t bytes,
	uint32_t source, OTF_KeyValueList *kvlist ) {

	if ( control->doSnapshots && control->aux_state ) {

		switch( operation & OTF_FILEOP_BITS ) {

		case OTF_FILEOP_OPEN:
			OTFAUX_State_processFileOpen( control->aux_state,
			                              time,
			                              process,
			                              fileid,
			                              handleid,
			                              source,
			                              OTF_KeyValueList_clone( kvlist ) );
			break;

		case OTF_FILEOP_CLOSE:
			OTFAUX_State_processFileClose( control->aux_state,
			                               time,
			                               process,
			                               handleid );
			break;
		}
	}

	if ( control->stats )
		control->stats->fileOperation( process, fileid, operation, bytes );
}

int handleFileOperation( void* firsthandlerarg, uint64_t time, uint32_t fileid,
	uint32_t process, uint64_t handleid, uint32_t operation, uint64_t bytes,
	uint64_t duration, uint32_t source, OTF_KeyValueList *kvlist ) {


	/* fprintf( stderr, " %llu:  %s\n", (unsigned long long) time, __PRETTY_FUNCTION__ ); */

	Control* control= (Control*) firsthandlerarg;

	while ( control->checkTime( time ) )
		;

        processFileOperation( control, time, fileid, process, handleid,
			operation, bytes, source, kvlist );

	if ( control->copyEvents )
		return OTF_CopyHandler_FileOperation( control->writer,
				time, fileid, process, handleid, operation,
				bytes, duration, source, kvlist );

	return OTF_RETURN_OK;
}


int handleBeginCollectiveOperation( void *firsthandlerarg, uint64_t time, uint32_t process,
    uint32_t collOp, uint64_t matchingId, uint32_t procGroup, uint32_t rootProc,
    uint64_t sent, uint64_t received, uint32_t scltoken, OTF_KeyValueList *kvlist ) {
  
  
    Control* control= (Control*) firsthandlerarg;
        
    while ( control->checkTime( time ) )
        ;
    
    if ( control->doSnapshots && control->aux_state ) {
	OTFAUX_State_processBeginCollectiveOperation( control->aux_state,
	                                              time,
	                                              process,
	                                              procGroup,
	                                              rootProc,
	                                              collOp,
	                                              matchingId,
	                                              sent,
	                                              received,
	                                              scltoken,
	                                              OTF_KeyValueList_clone( kvlist ) );
    }

    if ( control->stats )
	control->stats->beginCollOperation( process, rootProc,
	collOp,matchingId, sent, received );
    
    if ( control->copyEvents )
	return OTF_CopyHandler_BeginCollectiveOperation( control->writer, time,
	                                                 process, collOp,
	                                                 matchingId, procGroup,
	                                                 rootProc, sent,
	                                                 received, scltoken,
	                                                 kvlist );

        return OTF_RETURN_OK;
  
}

int handleEndCollectiveOperation( void *firsthandlerarg, uint64_t time,
    uint32_t process, uint64_t matchingId, OTF_KeyValueList *kvlist ) {
  
    
    Control* control= (Control*) firsthandlerarg;
        
    while ( control->checkTime( time ) )
        ;
    
    if ( control->doSnapshots && control->aux_state ) {
        OTFAUX_State_processEndCollectiveOperation( control->aux_state,
                                                    time,
                                                    process,
                                                    matchingId );
    }

    if ( control->stats )
	control->stats->endCollOperation( process, matchingId );
  
    if ( control->copyEvents )
	return OTF_CopyHandler_EndCollectiveOperation( control->writer, time,
	                                               process, matchingId,
	                                               kvlist );

    return OTF_RETURN_OK;
    
}

int handleBeginFileOperation( void *firsthandlerarg, uint64_t time, uint32_t process,
    uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList *kvlist ) {
  
  
    Control* control= (Control*) firsthandlerarg;
        
    while ( control->checkTime( time ) )
        ;
    
    if ( control->doSnapshots && control->aux_state ) {
        OTFAUX_State_processBeginFileOperation( control->aux_state,
                                                time,
                                                process,
                                                matchingId,
                                                scltoken,
                                                OTF_KeyValueList_clone( kvlist ) );
    }

    if ( control->copyEvents )
        return OTF_CopyHandler_BeginFileOperation( control->writer, time,
                                                   process, matchingId,
                                                   scltoken, kvlist );

    return OTF_RETURN_OK;
}

int handleEndFileOperation( void *firsthandlerarg, uint64_t time, uint32_t process,
    uint32_t fileid, uint64_t matchingId, uint64_t handleId, uint32_t operation,
    uint64_t bytes, uint32_t scltoken, OTF_KeyValueList *kvlist ) {
  
  
    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->doSnapshots && control->aux_state ) {
        OTFAUX_State_processEndFileOperation( control->aux_state,
                                              time,
                                              process,
                                              matchingId );
    }

    processFileOperation( control, time, fileid, process, handleId,
                          operation, bytes, scltoken, kvlist );

    if ( control->copyEvents )
        OTF_CopyHandler_EndFileOperation( control->writer, time, process,
                                          fileid, matchingId, handleId,
                                          operation, bytes, scltoken, kvlist );


    return OTF_RETURN_OK;
}


int handleNoOp( void *firsthandlerarg, uint64_t time, uint32_t process,
		OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
	return ( 0 == OTF_Writer_writeNoOpKV( control->writer, time,
		process, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleEventComment( void *firsthandlerarg, uint64_t time, uint32_t process,
		const char* comment, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
	return ( 0 == OTF_Writer_writeEventCommentKV( control->writer, time,
		process, comment, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleBeginProcess( void *firsthandlerarg, uint64_t time,
		uint32_t process, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
	return ( 0 == OTF_Writer_writeBeginProcessKV( control->writer, time,
		process, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleEndProcess( void *firsthandlerarg, uint64_t time,
		uint32_t process, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
	return ( 0 == OTF_Writer_writeEndProcessKV( control->writer, time,
		process, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleRMAPut( void *firsthandlerarg, uint64_t time, uint32_t process,
        uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
        uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
        return ( 0 == OTF_Writer_writeRMAPutKV( control->writer, time,
                process, origin, target, communicator, tag, bytes, scltoken, list )
                 ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleRMAPutRemoteEnd( void *firsthandlerarg, uint64_t time,
        uint32_t process, uint32_t origin, uint32_t target, uint32_t communicator,
        uint32_t tag, uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
        return ( 0 == OTF_Writer_writeRMAPutRemoteEndKV( control->writer,
                time, process, origin, target, communicator, tag, bytes, scltoken, list )
                 ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleRMAGet( void *firsthandlerarg, uint64_t time, uint32_t process,
        uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
        uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
        return ( 0 == OTF_Writer_writeRMAGetKV( control->writer, time,
                process, origin, target, communicator, tag, bytes, scltoken, list )
                 ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}


int handleRMAEnd( void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t remote,
	uint32_t communicator, uint32_t tag, uint32_t scltoken, OTF_KeyValueList* list ) {


    Control* control= (Control*) firsthandlerarg;
       
    while ( control->checkTime( time ) )
        ;
  
    if ( control->copyEvents )
        return ( 0 == OTF_Writer_writeRMAEndKV( control->writer, time,
                process, remote, communicator, tag, scltoken, list )
                 ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;

    return OTF_RETURN_OK;
}