-
Notifications
You must be signed in to change notification settings - Fork 7
/
tst_types.c
1351 lines (1221 loc) · 63.2 KB
/
tst_types.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
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
*/
#include "config.h"
#ifdef HAVE_VALUES_H
# include <values.h>
#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef HAVE_FLOAT_H
# include <float.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include <mpi.h>
#include "mpi_test_suite.h"
#ifndef LLONG_MAX
# define LLONG_MAX 9223372036854775807LL
# define LLONG_MIN (-LLONG_MAX - 1LL)
#endif
/*
#ifdef __USE_ISOC99
#error "ISOC99 defined"
#endif
*/
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#define MAX_TYPES 128 /* One of the largest type_maaings is for MPI_TYPE_MIX_ARRAY */
#define TYPES_NUM_REPEAT 7
#define OVERHEAD 8
#define CHECK_ARG(i,ret) do { \
if ((i) < 0 || (i) > TST_TYPES_NUM) \
return (ret); \
} while (0)
#define TST_TYPES_NUM (sizeof (types) / sizeof (types[0]))
#define TST_TYPES_CLASS_NUM (sizeof (tst_types_class_strings) / sizeof (tst_types_class_strings[0]))
#define SIZEOF_TYPE_MIX_LB_UB (sizeof(char)+sizeof(short)+sizeof(int)+sizeof(long)+sizeof(float)+sizeof(double))
/*
* Local static Functions
*/
static int tst_type_gettypelb (int type);
static int tst_type_search (const int search_test, const int * test_list, const int test_list_num);
/*
* Local variables and declaration
*/
struct tst_type_class {
char * class_string;
tst_uint64 class;
};
static const struct tst_type_class tst_types_class_strings [] =
{
{"STANDARD_C_INT_TYPES", TST_MPI_STANDARD_C_INT_TYPES},
{"STANDARD_C_FLOAT_TYPES", TST_MPI_STANDARD_C_FLOAT_TYPES},
{"STANDARD_C_TYPES", TST_MPI_STANDARD_C_TYPES},
{"STRUCT_C_TYPES", TST_MPI_STRUCT_C_TYPES},
{"ALL_C_TYPES", TST_MPI_ALL_C_TYPES},
/* {"STANDARD_FORTRAN_INT_TYPES", TST_MPI_STANDARD_FORTRAN_INT_TYPES},
{"STANDARD_FORTRAN_FLOAT_TYPES", TST_MPI_STANDARD_FORTRAN_FLOAT_TYPES},
{"STANDARD_FORTRAN_COMPLEX_TYPES", TST_MPI_STANDARD_FORTRAN_COMPLEX_TYPES},
{"STANDARD_FORTRAN_TYPES", TST_MPI_STANDARD_FORTRAN_TYPES},
{"STRUCT_FORTRAN_TYPES", TST_MPI_STRUCT_FORTRAN_TYPES},
{"ALL_FORTRAN_TYPES", TST_MPI_ALL_FORTRAN_TYPES} */
};
struct type {
MPI_Datatype mpi_datatype;
char description [TST_DESCRIPTION_LEN];
MPI_Aint lb;
MPI_Aint ub;
tst_uint64 type_class;
int type_num;
int type_mapping[MAX_TYPES];
};
static struct type types[32] = {
/* Standard C Types */
{MPI_CHAR, "MPI_CHAR", 0, sizeof (char), TST_MPI_CHAR, 1, {TST_MPI_CHAR}},
{MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR", 0, sizeof (unsigned char), TST_MPI_UNSIGNED_CHAR, 1, {TST_MPI_UNSIGNED_CHAR}},
#ifdef HAVE_MPI2
{MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR", 0, sizeof (signed char), TST_MPI_SIGNED_CHAR, 1, {TST_MPI_SIGNED_CHAR}},
#else
{MPI_DATATYPE_NULL, "MPI_SIGNED_CHAR n/a", 0, 0, 0, 0, {0}},
#endif
{MPI_BYTE, "MPI_BYTE", 0, sizeof (char), TST_MPI_BYTE, 1, {TST_MPI_BYTE}},
{MPI_SHORT, "MPI_SHORT", 0, sizeof (short), TST_MPI_SHORT, 1, {TST_MPI_SHORT}},
/*5*/ {MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT", 0, sizeof (unsigned short), TST_MPI_UNSIGNED_SHORT, 1, {TST_MPI_UNSIGNED_SHORT}},
{MPI_INT, "MPI_INT", 0, sizeof (int), TST_MPI_INT, 1, {TST_MPI_INT}},
{MPI_UNSIGNED, "MPI_UNSIGNED", 0, sizeof (unsigned int), TST_MPI_UNSIGNED, 1, {TST_MPI_UNSIGNED}},
{MPI_LONG, "MPI_LONG", 0, sizeof (long), TST_MPI_LONG, 1, {TST_MPI_LONG}},
{MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG", 0, sizeof (unsigned long), TST_MPI_UNSIGNED_LONG, 1, {TST_MPI_UNSIGNED_LONG}},
/*10*/{MPI_FLOAT, "MPI_FLOAT", 0, sizeof (float), TST_MPI_FLOAT, 1, {TST_MPI_FLOAT}},
{MPI_DOUBLE, "MPI_DOUBLE", 0, sizeof (double), TST_MPI_DOUBLE, 1, {TST_MPI_DOUBLE}},
#if defined(HAVE_LONG_DOUBLE) && defined(LDBL_MAX)
{MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE", 0, sizeof (long double), TST_MPI_LONG_DOUBLE, 1, {TST_MPI_LONG_DOUBLE}},
#else
{MPI_DATATYPE_NULL, "MPI_LONG_DOUBLE n/a", 0, 0, 0, 0, {0}},
#endif
#if defined(HAVE_C_MPI_LONG_LONG_INT)
{MPI_LONG_LONG, "MPI_LONG_LONG", 0, sizeof (long long int), TST_MPI_LONG_LONG, 1, {TST_MPI_LONG_LONG}},
#else
{MPI_DATATYPE_NULL, "MPI_LONG_LONG n/a", 0, 0, 0, 0, {0}},
#endif /* HAVE_C_MPI_LONG_LONG_INT */
/* {MPI_PACKED, "MPI_PACKED", 0, 0, 0, NULL},
{MPI_LB, "MPI_LB", 0, sizeof (), 1, {TST_}},
{MPI_UB, "MPI_UB", 0, sizeof (), 1, {TST_}},*/
/* Composed C types */
{MPI_FLOAT_INT, "MPI_FLOAT_INT", 0, sizeof (struct tst_mpi_float_int), TST_MPI_FLOAT_INT, 1, {TST_MPI_FLOAT_INT}},
/*15*/{MPI_DOUBLE_INT, "MPI_DOUBLE_INT", 0, sizeof (struct tst_mpi_double_int), TST_MPI_DOUBLE_INT, 1, {TST_MPI_DOUBLE_INT}},
{MPI_LONG_INT, "MPI_LONG_INT", 0, sizeof (struct tst_mpi_long_int), TST_MPI_LONG_INT, 1, {TST_MPI_LONG_INT}},
{MPI_SHORT_INT, "MPI_SHORT_INT", 0, sizeof (struct tst_mpi_short_int), TST_MPI_SHORT_INT, 1, {TST_MPI_SHORT_INT}},
{MPI_2INT, "MPI_2INT", 0, sizeof (struct tst_mpi_2int), TST_MPI_2INT, 1, {TST_MPI_2INT}},
#if defined(HAVE_LONG_DOUBLE) && defined (LDBL_MAX)
{MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT", 0, sizeof (struct tst_mpi_long_double_int), TST_MPI_LONG_DOUBLE_INT, 1, {TST_MPI_LONG_DOUBLE_INT}},
#else
{MPI_DATATYPE_NULL, "MPI_LONG_DOUBLE_INT n/a", 0, 0, 0, 0, {0}},
#endif /* HAVE_MPI_LONG_DOUBLE */
#define PREDEFINED_DATATYPES 20
/*
* First of all a representation of 7 MPI_INTs with different MPI_Type-creation calls
*/
/*20*/{MPI_DATATYPE_NULL, "MPI_CONTIGUOUS_INT", 0, 7*sizeof(int), TST_MPI_INT_CONTI, 7, {TST_MPI_INT}},
{MPI_DATATYPE_NULL, "MPI_VECTOR_INT", 0, 7*sizeof(int), TST_MPI_INT_VECTOR, 7, {TST_MPI_INT}},
{MPI_DATATYPE_NULL, "MPI_HVECTOR_INT", 0, 7*sizeof(int), TST_MPI_INT_HVECTOR, 7, {TST_MPI_INT}},
{MPI_DATATYPE_NULL, "MPI_INDEXED_INT", 0, 7*sizeof(int), TST_MPI_INT_INDEXED, 7, {TST_MPI_INT}},
{MPI_DATATYPE_NULL, "MPI_HINDEXED_INT", 0, 7*sizeof(int), TST_MPI_INT_HINDEXED, 7, {TST_MPI_INT}},
/*25*/{MPI_DATATYPE_NULL, "MPI_STRUCT_INT", 0, 7*sizeof(int), TST_MPI_INT_STRUCT, 7, {TST_MPI_INT}},
/*
* Now, more complex derived MPI_Datattypes
*/
{MPI_DATATYPE_NULL, "MPI_TYPE_MIX", 0, sizeof(struct tst_mpi_type_mix), TST_MPI_TYPE_MIX, 11, {TST_MPI_INT}},
{MPI_DATATYPE_NULL, "MPI_TYPE_MIX_ARRAY", 0, sizeof(struct tst_mpi_type_mix_array), TST_MPI_TYPE_MIX_ARRAY, 6, {TST_MPI_INT}},
#ifndef HAVE_MPI_NECSX
{MPI_DATATYPE_NULL, "MPI_TYPE_MIX_LB_UB", 0, 0, TST_MPI_TYPE_MIX_LB_UB, 6, {TST_MPI_INT}},
#endif
/*
* Two examples for MPI_Type_dup usage on a predefined- and a derived datatype.
*/
#if defined(HAVE_MPI2)
{MPI_DATATYPE_NULL, "Dup MPI_CHAR", 0, sizeof (char), TST_MPI_CHAR, 1, {TST_MPI_CHAR}},
#ifndef HAVE_MPI_NECSX
/*30*/{MPI_DATATYPE_NULL, "Dup MPI_TYPE_MIX_LB_UB", 0, 0, TST_MPI_TYPE_MIX_LB_UB, 6, {TST_MPI_INT}},
#endif
#else
{MPI_DATATYPE_NULL, "function MPI_Type_dup() n/a", 0, 0, 0, 0, {0}},
{MPI_DATATYPE_NULL, "function MPI_Type_dup() n/a", 0, 0, 0, 0, {0}},
#endif /* HAVE_MPI2 */
/* Fortran Types */
/* {MPI_COMPLEX, "MPI_COMPLEX", 0, sizeof (complex), 1, {TST_}},
{MPI_DOUBLE_COMPLEX, "MPI_DOUBLE_COMPLEX", 0, sizeof (), 1, {TST_}},
{MPI_LOGICAL, "MPI_LOGICAL", 0, sizeof (), 1, {TST_}},
{MPI_REAL, "MPI_REAL", 0, sizeof (), 1, {TST_}},
{MPI_DOUBLE_PRECISION, "MPI_DOUBLE_PRECISION", 0, sizeof (), 1, {TST_}},
{MPI_INTEGER, "MPI_INTEGER", 0, sizeof (), 1, {TST_}},
{MPI_2INTEGER, "MPI_2INTEGER", 0, sizeof (), 1, {TST_}},
{MPI_2COMPLEX, "MPI_2COMPLEX", 0, sizeof (), 1, {TST_}},
{MPI_2DOUBLE_COMPLEX, "MPI_2DOUBLE_COMPLEX", 0, sizeof (), 1, {TST_}},
{MPI_2REAL, "MPI_2REAL", 0, sizeof (), 1, {TST_}},
{MPI_2DOUBLE_PRECISION, "MPI_2DOUBLE_PRECISION", 0, sizeof (), 1, {TST_}},
{MPI_CHARACTER, "MPI_CHARACTER", 0, sizeof (), 1, {TST_}}*/
/*
* The last element
*/
{MPI_DATATYPE_NULL, "", 0, 0, 0, 0, {TST_MPI_INT}}
};
int tst_type_init (int * num_types)
{
int i;
int num = PREDEFINED_DATATYPES;
{
/*
* MPI_CONTIGUOUS_INT
*/
MPI_Type_contiguous (TYPES_NUM_REPEAT, MPI_INT, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0 ; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i] = TST_MPI_INT;
num++;
}
{
/*
* MPI_VECTOR_INT
*/
MPI_Type_vector (TYPES_NUM_REPEAT, 1, 1, MPI_INT, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i] = TST_MPI_INT;
num++;
}
{
/*
* MPI_HVECTOR_INT
*/
MPI_Type_create_hvector (TYPES_NUM_REPEAT, 1, sizeof(int), MPI_INT, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i] = TST_MPI_INT;
num++;
}
{
/*
* MPI_INDEXED_INT
*/
int block[TYPES_NUM_REPEAT];
int dis[TYPES_NUM_REPEAT];
for(i=0; i < TYPES_NUM_REPEAT; i++) {
block[i] = 1;
dis[i] = i;
}
MPI_Type_indexed (TYPES_NUM_REPEAT, block, dis, MPI_INT, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i]=TST_MPI_INT;
num++;
}
/*
* Intel-MPI1.0 segfaults with this datatype
*/
#if !defined(HAVE_MPI_INTEL10) && !defined(HAVE_MPI_INTEL20)
{
/*
* MPI_HINDEXED_INT
*/
int block[TYPES_NUM_REPEAT];
MPI_Aint dis[TYPES_NUM_REPEAT];
for(i=0; i < TYPES_NUM_REPEAT; i++) {
block[i] = 1;
dis[i] = i*sizeof(int);
}
MPI_Type_create_hindexed (TYPES_NUM_REPEAT, block, dis, MPI_INT, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0 ; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i]=TST_MPI_INT;
num++;
}
#else
{
types[num].mpi_datatype = MPI_DATATYPE_NULL;
num++;
}
#endif
{
/*
* MPI_STRUCT_INT
*/
int block_struct[1];
MPI_Aint dis_struct[1];
MPI_Datatype dtype[1];
block_struct[0] = TYPES_NUM_REPEAT;
dis_struct[0] = 0;
dtype[0] = MPI_INT;
MPI_Type_create_struct (1, block_struct, dis_struct, dtype, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = TYPES_NUM_REPEAT;
for(i=0; i < TYPES_NUM_REPEAT; i++)
types[num].type_mapping[i] = TST_MPI_INT;
num++;
}
#ifndef HAVE_MPI_INTEL20
{
/*
* MPI_TYPE_MIX
*/
int block_mix[11];
MPI_Aint disp_mix[11];
MPI_Datatype mix_type[11] = {MPI_CHAR, MPI_SHORT, MPI_INT, MPI_LONG,
MPI_FLOAT, MPI_DOUBLE, MPI_FLOAT_INT,
MPI_DOUBLE_INT, MPI_LONG_INT, MPI_SHORT_INT, MPI_2INT};
MPI_Aint mix_base;
struct tst_mpi_type_mix type_tmp;
MPI_Get_address (&(type_tmp.a), disp_mix);
MPI_Get_address (&(type_tmp.b), disp_mix+1);
MPI_Get_address (&(type_tmp.c), disp_mix+2);
MPI_Get_address (&(type_tmp.d), disp_mix+3);
MPI_Get_address (&(type_tmp.e), disp_mix+4);
MPI_Get_address (&(type_tmp.f), disp_mix+5);
MPI_Get_address (&(type_tmp.g), disp_mix+6);
MPI_Get_address (&(type_tmp.h), disp_mix+7);
MPI_Get_address (&(type_tmp.i), disp_mix+8);
MPI_Get_address (&(type_tmp.j), disp_mix+9);
MPI_Get_address (&(type_tmp.k), disp_mix+10);
mix_base = disp_mix[0];
for(i=0; i < 11; i++) disp_mix[i] -= mix_base;
for(i=0; i < 11; i++) block_mix[i] = 1;
MPI_Type_create_struct (11, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = 11;
types[num].type_mapping[0] = TST_MPI_CHAR;
types[num].type_mapping[1] = TST_MPI_SHORT;
types[num].type_mapping[2] = TST_MPI_INT;
types[num].type_mapping[3] = TST_MPI_LONG;
types[num].type_mapping[4] = TST_MPI_FLOAT;
types[num].type_mapping[5] = TST_MPI_DOUBLE;
types[num].type_mapping[6] = TST_MPI_FLOAT_INT;
types[num].type_mapping[7] = TST_MPI_DOUBLE_INT;
types[num].type_mapping[8] = TST_MPI_LONG_INT;
types[num].type_mapping[9] = TST_MPI_SHORT_INT;
types[num].type_mapping[10] = TST_MPI_2INT;
num++;
}
#else
{
types[num].mpi_datatype = MPI_DATATYPE_NULL;
num++;
}
#endif
{
/*
* MPI_TYPE_MIX_ARRAY
*/
int block_mix[6];
MPI_Aint disp_mix[6];
MPI_Datatype mix_type[6];
MPI_Aint mix_base;
struct tst_mpi_type_mix_array type_tmp_array;
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_CHAR, &(mix_type[0]));
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_SHORT, &(mix_type[1]));
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_INT, &(mix_type[2]));
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_LONG, &(mix_type[3]));
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_FLOAT, &(mix_type[4]));
MPI_Type_contiguous (TST_MPI_TYPE_MIX_ARRAY_NUM, MPI_DOUBLE, &(mix_type[5]));
/*
MPI_Type_commit (&(mix_type[0]));
MPI_Type_commit (&(mix_type[1]));
MPI_Type_commit (&(mix_type[2]));
MPI_Type_commit (&(mix_type[3]));
MPI_Type_commit (&(mix_type[4]));
MPI_Type_commit (&(mix_type[5]));
*/
MPI_Get_address(&(type_tmp_array.a[0]), disp_mix);
MPI_Get_address(&(type_tmp_array.b[0]), disp_mix+1);
MPI_Get_address(&(type_tmp_array.c[0]), disp_mix+2);
MPI_Get_address(&(type_tmp_array.d[0]), disp_mix+3);
MPI_Get_address(&(type_tmp_array.e[0]), disp_mix+4);
MPI_Get_address(&(type_tmp_array.f[0]), disp_mix+5);
mix_base = disp_mix[0];
for(i=0; i < 6; i++) disp_mix[i] -= mix_base;
for(i=0; i < 6; i++) block_mix[i] = 1;
MPI_Type_create_struct (6, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
MPI_Type_free (&(mix_type[0]));
MPI_Type_free (&(mix_type[1]));
MPI_Type_free (&(mix_type[2]));
MPI_Type_free (&(mix_type[3]));
MPI_Type_free (&(mix_type[4]));
MPI_Type_free (&(mix_type[5]));
MPI_Type_commit (&(types[num].mpi_datatype));
types[num].type_num = 6 * TST_MPI_TYPE_MIX_ARRAY_NUM;
for (i = 0; i < TST_MPI_TYPE_MIX_ARRAY_NUM; i++)
{
types[num].type_mapping[0*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_CHAR;
types[num].type_mapping[1*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_SHORT;
types[num].type_mapping[2*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_INT;
types[num].type_mapping[3*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_LONG;
types[num].type_mapping[4*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_FLOAT;
types[num].type_mapping[5*TST_MPI_TYPE_MIX_ARRAY_NUM+i] = TST_MPI_DOUBLE;
}
num++;
}
#if MPI_VERSION < 3
#ifndef HAVE_MPI_NECSX
{
/*
* MPI_TYPE_MIX_LB_UB
*/
int block_mix[8];
MPI_Aint disp_array[8] = {
-1*(sizeof(char)+sizeof(long)+sizeof(double)), /* Position of LB */
-1*sizeof(char), /* Position of char */
0, /* Position of short */
sizeof(short), /* Position of int */
-1*(sizeof(char)+sizeof(long)), /* Position of long */
sizeof(short)+sizeof(int), /* Position of float */
-1*(sizeof(char)+sizeof(long)+sizeof(double)), /* Position of double */
sizeof(short)+sizeof(int)+sizeof(float) /* Position of UB */
};
MPI_Datatype mix_type[8] = {
MPI_LB,
MPI_CHAR,
MPI_SHORT,
MPI_INT,
MPI_LONG,
MPI_FLOAT,
MPI_DOUBLE,
MPI_UB };
for(i=0 ; i < 8; i++) block_mix[i]=1;
MPI_Type_create_struct(8, block_mix, disp_array, mix_type, &(types[num].mpi_datatype));
MPI_Type_commit(&(types[num].mpi_datatype));
types[num].type_num = 6;
types[num].type_mapping[0] = TST_MPI_CHAR;
types[num].type_mapping[1] = TST_MPI_SHORT;
types[num].type_mapping[2] = TST_MPI_INT;
types[num].type_mapping[3] = TST_MPI_LONG;
types[num].type_mapping[4] = TST_MPI_FLOAT;
types[num].type_mapping[5] = TST_MPI_DOUBLE;
MPI_Type_lb ((types[num].mpi_datatype), &(types[num].lb));
MPI_Type_ub ((types[num].mpi_datatype), &(types[num].ub));
num++;
}
#endif
#endif
#if defined(HAVE_MPI2)
{
/*
* Dup MPI_CHAR
* Just duplicate the Type -- everthing else is setup already.
*/
if (strcmp (types[0].description, "MPI_CHAR"))
ERROR (EINVAL, "Internal Error");
MPI_Type_dup (types[0].mpi_datatype, &(types[num].mpi_datatype));
/* types[num].lb = types[0].lb;
types[num].ub = types[0].ub;
types[num].type_class = types[0].type_class;
types[num].type_num = types[0].type_num;
types[num].type_mapping[0] = types[0].type_mapping[0];*/
num++;
}
#if MPI_VERSION < 3
#if !defined (HAVE_MPI_NECSX) && !defined(HAVE_MPI_OPENMPI)
/*
* OpenMPI fails here!!!
*/
{
/*
* Dup MPI_TYPE_MIX_LB_UB
*/
if (strcmp(types[num-2].description, "MPI_TYPE_MIX_LB_UB"))
ERROR (EINVAL, "Internal Error");
MPI_Type_dup (types[num-2].mpi_datatype, &(types[num].mpi_datatype));
types[num].type_num = types[num-1].type_num;
types[num].type_mapping[0] = types[num-1].type_mapping[0];
types[num].type_mapping[1] = types[num-1].type_mapping[1];
types[num].type_mapping[2] = types[num-1].type_mapping[2];
types[num].type_mapping[3] = types[num-1].type_mapping[3];
types[num].type_mapping[4] = types[num-1].type_mapping[4];
types[num].type_mapping[5] = types[num-1].type_mapping[5];
MPI_Type_lb ((types[num].mpi_datatype), &(types[num].lb));
MPI_Type_ub ((types[num].mpi_datatype), &(types[num].ub));
num++;
}
#endif
#endif
#endif /* HAVE_MPI2 */
*num_types = num;
return 0;
}
int tst_type_cleanup (void)
{
int i;
for (i=PREDEFINED_DATATYPES; i < TST_TYPES_NUM; i++)
{
if (MPI_DATATYPE_NULL == types[i].mpi_datatype)
continue;
MPI_Type_free (&types[i].mpi_datatype);
}
return 0;
}
MPI_Datatype tst_type_getdatatype (int type)
{
CHECK_ARG (type, MPI_DATATYPE_NULL);
return types[type].mpi_datatype;
}
tst_uint64 tst_type_gettypeclass (int type)
{
CHECK_ARG (type, -1);
return types[type].type_class;
}
const char * tst_type_getdescription (int type)
{
CHECK_ARG (type, NULL);
return types[type].description;
}
int tst_type_gettypesize (int type)
{
CHECK_ARG (type, -1);
return (types[type].ub - types[type].lb);
}
void tst_type_hexdump (const char * text, const char * data, int num)
{
#define NUM_COL 8
int i;
printf ("(Rank:%d) %s [%d Bytes]\n(Rank:%d) [ 0-%d]:\t",
tst_global_rank, text, num,
tst_global_rank, NUM_COL-1);
for (i = 0; i < num; i++)
{
printf (" 0x%.2x", data[i] & 0xFF);
if ((i % NUM_COL) == NUM_COL-1 && i != num-1)
printf ("\n(Rank:%d) [%d-%d]:\t",
tst_global_rank, i+1, MIN(i+NUM_COL, num-1));
}
printf("\n");
}
char * tst_type_allocvalues (const int type, const int values_num)
{
char * buffer;
int type_size;
CHECK_ARG (type, NULL);
type_size = tst_type_gettypesize(type);
buffer = malloc ((values_num+OVERHEAD) * type_size);
if (buffer == NULL)
ERROR (errno, "malloc");
memset (buffer, DEFAULT_INIT_BYTE, (values_num+OVERHEAD) * type_size);
buffer -= tst_type_gettypelb(type);
return buffer;
}
int tst_type_freevalues (const int type, char * buffer, const int values_num)
{
CHECK_ARG (type, -1);
buffer += tst_type_gettypelb(type);
free (buffer);
return 0;
}
#ifndef UCHAR_MIN
# define UCHAR_MIN 0
#endif
#ifndef USHRT_MIN
# define USHRT_MIN 0
#endif
#ifndef UINT_MIN
# define UINT_MIN 0
#endif
#ifndef ULONG_MIN
# define ULONG_MIN 0
#endif
#ifndef ULLONG_MIN
# define ULLONG_MIN 0
#endif
/*
#define TST_TYPE_VALUE_BOUNDED(tst_type,c_type,c_type_caps) \
if (direct_value > c_type_caps##_MAX) { \
*(c_type*)buffer = c_type_caps##_MAX; \
} else if (direct_value < c_type_caps##_MIN) { \
*(c_type*)buffer = c_type_caps##_MIN; \
} else { \
*(c_type*)buffer = direct_value; break; \
} \
*/
#define TST_TYPE_SET(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: *(c_type*)buffer = 0; break; \
case TST_TYPE_SET_MAX: *(c_type*)buffer = c_type_caps##_MAX; break; \
case TST_TYPE_SET_MIN: *(c_type*)buffer = c_type_caps##_MIN; break; \
case TST_TYPE_SET_VALUE: \
if (direct_value > c_type_caps##_MAX) { \
*(c_type*)buffer = c_type_caps##_MAX; \
} else if (direct_value < c_type_caps##_MIN) { \
*(c_type*)buffer = c_type_caps##_MIN; \
} else { \
*(c_type*)buffer = direct_value; \
} \
break; \
} \
break; \
}
#define TST_TYPE_SET_UNSIGNED(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: *(c_type*)buffer = 0; break; \
case TST_TYPE_SET_MAX: *(c_type*)buffer = c_type_caps##_MAX; break; \
case TST_TYPE_SET_MIN: *(c_type*)buffer = 0; break; \
case TST_TYPE_SET_VALUE: \
if (direct_value > c_type_caps##_MAX) { \
*(c_type*)buffer = c_type_caps##_MAX; \
} else if (direct_value < c_type_caps##_MIN) { \
*(c_type*)buffer = c_type_caps##_MIN; \
} else { \
*(c_type*)buffer = direct_value; \
} \
break; \
} \
break; \
}
#define TST_TYPE_SET_STRUCT(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: \
(*(c_type*)buffer).a = 0; \
(*(c_type*)buffer).b = 0; \
break; \
case TST_TYPE_SET_MAX: \
(*(c_type*)buffer).a = c_type_caps##_MAX; \
(*(c_type*)buffer).b = INT_MAX; \
break; \
case TST_TYPE_SET_MIN: \
(*(c_type*)buffer).a = c_type_caps##_MIN; \
(*(c_type*)buffer).b = INT_MIN; \
break; \
case TST_TYPE_SET_VALUE: \
if (direct_value > c_type_caps##_MAX) { \
(*(c_type*)buffer).a = c_type_caps##_MAX; \
} else if (direct_value < c_type_caps##_MIN) { \
(*(c_type*)buffer).a = c_type_caps##_MIN; \
} else { \
(*(c_type*)buffer).a = direct_value; \
} \
if (direct_value > INT_MAX) { \
(*(c_type*)buffer).b = INT_MAX; \
} else if (direct_value < INT_MIN) { \
(*(c_type*)buffer).b = INT_MIN; \
} else { \
(*(c_type*)buffer).b = direct_value; \
} \
break; \
default: \
return -1; \
} \
break; \
}
#define TST_TYPE_SET_CONTI(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
int __i; \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: \
for(__i=0 ; __i<7 ; __i++) \
((c_type*)buffer)[__i] = 0; \
break; \
case TST_TYPE_SET_MAX: \
for(__i=0 ; __i<7 ; __i++) \
((c_type*)buffer)[__i] = c_type_caps##_MAX; \
break; \
case TST_TYPE_SET_MIN: \
for(__i=0 ; __i<7 ; __i++) \
((c_type*)buffer)[__i] = c_type_caps##_MIN; \
break; \
case TST_TYPE_SET_VALUE: \
for(__i=0 ; __i<7 ; __i++) \
((c_type*)buffer)[__i] = direct_value; \
break; \
} \
break; \
}
#define TST_TYPE_SET_STRUCT_MIX(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: \
(*(c_type*)buffer).a = 0; \
(*(c_type*)buffer).b = 0; \
(*(c_type*)buffer).c = 0; \
(*(c_type*)buffer).d = 0; \
(*(c_type*)buffer).e = 0; \
(*(c_type*)buffer).f = 0; \
(*(c_type*)buffer).g.a = 0; \
(*(c_type*)buffer).g.b = 0; \
(*(c_type*)buffer).h.a = 0; \
(*(c_type*)buffer).h.b = 0; \
(*(c_type*)buffer).i.a = 0; \
(*(c_type*)buffer).i.b = 0; \
(*(c_type*)buffer).j.a = 0; \
(*(c_type*)buffer).j.b = 0; \
(*(c_type*)buffer).k.a = 0; \
(*(c_type*)buffer).k.b = 0; \
break; \
case TST_TYPE_SET_MAX: \
(*(c_type*)buffer).a = CHAR_MAX; \
(*(c_type*)buffer).b = SHRT_MAX; \
(*(c_type*)buffer).c = INT_MAX; \
(*(c_type*)buffer).d = LONG_MAX; \
(*(c_type*)buffer).e = FLT_MAX; \
(*(c_type*)buffer).f = DBL_MAX; \
(*(c_type*)buffer).g.a = FLT_MAX; \
(*(c_type*)buffer).g.b = INT_MAX; \
(*(c_type*)buffer).h.a = DBL_MAX; \
(*(c_type*)buffer).h.b = INT_MAX; \
(*(c_type*)buffer).i.a = LONG_MAX; \
(*(c_type*)buffer).i.b = INT_MAX; \
(*(c_type*)buffer).j.a = SHRT_MAX; \
(*(c_type*)buffer).j.b = INT_MAX; \
(*(c_type*)buffer).k.a = INT_MAX; \
(*(c_type*)buffer).k.b = INT_MAX; \
break; \
case TST_TYPE_SET_MIN: \
(*(c_type*)buffer).a = CHAR_MIN; \
(*(c_type*)buffer).b = SHRT_MIN; \
(*(c_type*)buffer).c = INT_MIN; \
(*(c_type*)buffer).d = LONG_MIN; \
(*(c_type*)buffer).e = FLT_MIN; \
(*(c_type*)buffer).f = DBL_MIN; \
(*(c_type*)buffer).g.a = FLT_MIN; \
(*(c_type*)buffer).g.b = INT_MIN; \
(*(c_type*)buffer).h.a = DBL_MIN; \
(*(c_type*)buffer).h.b = INT_MIN; \
(*(c_type*)buffer).i.a = LONG_MIN; \
(*(c_type*)buffer).i.b = INT_MIN; \
(*(c_type*)buffer).j.a = SHRT_MIN; \
(*(c_type*)buffer).j.b = INT_MIN; \
(*(c_type*)buffer).k.a = INT_MIN; \
(*(c_type*)buffer).k.b = INT_MIN; \
break; \
case TST_TYPE_SET_VALUE: \
(*(c_type*)buffer).a = direct_value; \
(*(c_type*)buffer).b = direct_value; \
(*(c_type*)buffer).c = direct_value; \
(*(c_type*)buffer).d = direct_value; \
(*(c_type*)buffer).e = direct_value; \
(*(c_type*)buffer).f = direct_value; \
(*(c_type*)buffer).g.a = direct_value; \
(*(c_type*)buffer).g.b = direct_value; \
(*(c_type*)buffer).h.a = direct_value; \
(*(c_type*)buffer).h.b = direct_value; \
(*(c_type*)buffer).i.a = direct_value; \
(*(c_type*)buffer).i.b = direct_value; \
(*(c_type*)buffer).j.a = direct_value; \
(*(c_type*)buffer).j.b = direct_value; \
(*(c_type*)buffer).k.a = direct_value; \
(*(c_type*)buffer).k.b = direct_value; \
break; \
default: \
return -1; \
} \
break; \
}
#define TST_TYPE_SET_STRUCT_MIX_ARRAY(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
switch (type_set) \
{ \
int __i; \
case TST_TYPE_SET_ZERO: \
for (__i=0; __i < TST_MPI_TYPE_MIX_ARRAY_NUM; __i++) { \
((*(c_type*)buffer).a)[__i] = 0; \
((*(c_type*)buffer).b)[__i] = 0; \
((*(c_type*)buffer).c)[__i] = 0; \
((*(c_type*)buffer).d)[__i] = 0; \
((*(c_type*)buffer).e)[__i] = 0; \
((*(c_type*)buffer).f)[__i] = 0; \
} \
break; \
case TST_TYPE_SET_MAX: \
for(__i=0; __i < TST_MPI_TYPE_MIX_ARRAY_NUM; __i++){ \
((*(c_type*)buffer).a)[__i] = CHAR_MAX; \
((*(c_type*)buffer).b)[__i] = SHRT_MAX; \
((*(c_type*)buffer).c)[__i] = INT_MAX; \
((*(c_type*)buffer).d)[__i] = LONG_MAX; \
((*(c_type*)buffer).e)[__i] = FLT_MAX; \
((*(c_type*)buffer).f)[__i] = DBL_MAX; \
} \
break; \
case TST_TYPE_SET_MIN: \
for(__i=0; __i < TST_MPI_TYPE_MIX_ARRAY_NUM; __i++) { \
((*(c_type*)buffer).a)[__i] = CHAR_MIN; \
((*(c_type*)buffer).b)[__i] = SHRT_MIN; \
((*(c_type*)buffer).c)[__i] = INT_MIN; \
((*(c_type*)buffer).d)[__i] = LONG_MIN; \
((*(c_type*)buffer).e)[__i] = FLT_MIN; \
((*(c_type*)buffer).f)[__i] = DBL_MIN; \
} \
break; \
case TST_TYPE_SET_VALUE: \
for(__i=0; __i < TST_MPI_TYPE_MIX_ARRAY_NUM; __i++) { \
((*(c_type*)buffer).a)[__i] = direct_value; \
((*(c_type*)buffer).b)[__i] = direct_value; \
((*(c_type*)buffer).c)[__i] = direct_value; \
((*(c_type*)buffer).d)[__i] = direct_value; \
((*(c_type*)buffer).e)[__i] = direct_value; \
((*(c_type*)buffer).f)[__i] = direct_value; \
} \
break; \
default: \
return -1; \
} \
break; \
}
#define TST_TYPE_SET_STRUCT_MIX_LB_UB(tst_type,c_type,c_type_caps) \
case tst_type: \
{ \
MPI_Aint __disp_array[8]={ \
-1*(sizeof(char)+sizeof(long)+sizeof(double)), /* Position of LB */ \
-1*sizeof(char), /* Position of char */ \
0, /* Position of short */ \
sizeof(short), /* Position of int */ \
-1*(sizeof(char)+sizeof(long)), /* Position of long */ \
sizeof(short)+sizeof(int), /* Position of float */ \
-1*(sizeof(char)+sizeof(long)+sizeof(double)), /* Position of double */ \
sizeof(short)+sizeof(int)+sizeof(float) /* Position of UB */ \
}; \
switch (type_set) \
{ \
case TST_TYPE_SET_ZERO: \
buffer[__disp_array[1]]=0; \
*((short*)(&buffer[__disp_array[2]]))= 0; \
*((int*)(&buffer[__disp_array[3]]))= 0; \
*((long*)(&buffer[__disp_array[4]]))= 0; \
*((float*)(&buffer[__disp_array[5]]))= 0; \
*((double*)(&buffer[__disp_array[6]]))= 0; \
break; \
case TST_TYPE_SET_MAX: \
buffer[__disp_array[1]]=CHAR_MAX; \
*((short*)(&buffer[__disp_array[2]]))= SHRT_MAX; \
*((int*)(&buffer[__disp_array[3]]))= INT_MAX; \
*((long*)(&buffer[__disp_array[4]]))= LONG_MAX; \
*((float*)(&buffer[__disp_array[5]]))= FLT_MAX; \
*((double*)(&buffer[__disp_array[6]]))= DBL_MAX; \
break; \
case TST_TYPE_SET_MIN: \
buffer[__disp_array[1]]=CHAR_MIN; \
*((short*)(&buffer[__disp_array[2]]))= SHRT_MIN; \
*((int*)(&buffer[__disp_array[3]]))= INT_MIN; \
*((long*)(&buffer[__disp_array[4]]))= LONG_MIN; \
*((float*)(&buffer[__disp_array[5]]))= FLT_MIN; \
*((double*)(&buffer[__disp_array[6]]))= DBL_MIN; \
break; \
case TST_TYPE_SET_VALUE: \
buffer[__disp_array[1]]= direct_value; \
*((short*)(&buffer[__disp_array[2]]))= direct_value; \
*((int*)(&buffer[__disp_array[3]]))= direct_value; \
*((long*)(&buffer[__disp_array[4]]))= direct_value; \
*((float*)(&buffer[__disp_array[5]]))= direct_value; \
*((double*)(&buffer[__disp_array[6]]))= direct_value; \
break; \
default: \
return -1; \
} \
break; \
}
int tst_type_setvalue (int type, char * buffer, int type_set, long long direct_value)
{
CHECK_ARG (type, -1);
memset (buffer, DEFAULT_INIT_BYTE, tst_type_gettypesize (type));
/* Workaround a small problem. In many tests we want to set
* a float or a double or a long double to 0. This is all
* well and good, but if I was to set it by value,
* then we go and check if (for floats) 0 < FLT_MIN.
* This is true, since FLT_MIN is usually something like
* 1.17549435e-38. So we set the buffer to be FLT_MIN.
* This is ok for most tests, but it screws up the scan sum
* test because we expect the value to be exactly 0.
* So if we are setting TST_MPI_FLOAT, TST_MPI_DOUBLE,
* or TST_MPI_LONG_DOUBLE to 0, use TST_TYPE_SET_ZERO
* instead of TST_TYPE_SET_VALUE */
if(TST_TYPE_SET_VALUE == type_set && 0 == direct_value &&
(TST_MPI_FLOAT == types[type].type_class
|| TST_MPI_DOUBLE == types[type].type_class
#if defined(HAVE_LONG_DOUBLE) && defined (LDBL_MAX)
|| TST_MPI_LONG_DOUBLE == types[type].type_class
#endif
)) {
type_set = TST_TYPE_SET_ZERO;
}
switch (types[type].type_class)
{
TST_TYPE_SET (TST_MPI_CHAR, char, CHAR);
TST_TYPE_SET_UNSIGNED (TST_MPI_UNSIGNED_CHAR, unsigned char, UCHAR);
#ifdef HAVE_MPI2
TST_TYPE_SET (TST_MPI_SIGNED_CHAR, signed char, SCHAR);
#endif
TST_TYPE_SET (TST_MPI_BYTE, char, CHAR);
TST_TYPE_SET (TST_MPI_SHORT, short, SHRT);
TST_TYPE_SET_UNSIGNED (TST_MPI_UNSIGNED_SHORT, unsigned short, USHRT);
TST_TYPE_SET (TST_MPI_INT, int, INT);
TST_TYPE_SET_UNSIGNED (TST_MPI_UNSIGNED, unsigned int, UINT);
TST_TYPE_SET (TST_MPI_LONG, long, LONG);
TST_TYPE_SET_UNSIGNED (TST_MPI_UNSIGNED_LONG, unsigned long, ULONG);
TST_TYPE_SET (TST_MPI_FLOAT, float, FLT);
TST_TYPE_SET (TST_MPI_DOUBLE, double, DBL);
#if defined(HAVE_LONG_DOUBLE) && defined (LDBL_MAX)
TST_TYPE_SET (TST_MPI_LONG_DOUBLE, long double, LDBL);
#endif
#if defined(HAVE_C_MPI_LONG_LONG_INT)
TST_TYPE_SET (TST_MPI_LONG_LONG, long long, LLONG);
#endif /* HAVE_C_MPI_LONG_LONG_INT */
TST_TYPE_SET (TST_MPI_PACKED, char, CHAR);
/*
TST_TYPE_SET (TST_MPI_LB, char, CHAR);
TST_TYPE_SET (TST_MPI_UB, char, CHAR);
*/
TST_TYPE_SET_STRUCT (TST_MPI_FLOAT_INT, struct tst_mpi_float_int, FLT);
TST_TYPE_SET_STRUCT (TST_MPI_DOUBLE_INT, struct tst_mpi_double_int, DBL);
TST_TYPE_SET_STRUCT (TST_MPI_LONG_INT, struct tst_mpi_long_int, LONG);
TST_TYPE_SET_STRUCT (TST_MPI_SHORT_INT, struct tst_mpi_short_int, SHRT);
TST_TYPE_SET_STRUCT (TST_MPI_2INT, struct tst_mpi_2int, INT);
#if defined(HAVE_LONG_DOUBLE) && defined (LDBL_MAX)
TST_TYPE_SET_STRUCT (TST_MPI_LONG_DOUBLE_INT, struct tst_mpi_long_double_int, LDBL);
#endif
TST_TYPE_SET_CONTI (TST_MPI_INT_CONTI, int, INT);
TST_TYPE_SET_CONTI (TST_MPI_INT_VECTOR, int, INT);
TST_TYPE_SET_CONTI (TST_MPI_INT_HVECTOR, int, INT);
TST_TYPE_SET_CONTI (TST_MPI_INT_INDEXED, int, INT);
TST_TYPE_SET_CONTI (TST_MPI_INT_HINDEXED, int, INT);
TST_TYPE_SET_CONTI (TST_MPI_INT_STRUCT, int, INT);
TST_TYPE_SET_STRUCT_MIX (TST_MPI_TYPE_MIX, struct tst_mpi_type_mix, NOT_USED);
TST_TYPE_SET_STRUCT_MIX_ARRAY (TST_MPI_TYPE_MIX_ARRAY, struct tst_mpi_type_mix_array, NOT_USED);
TST_TYPE_SET_STRUCT_MIX_LB_UB (TST_MPI_TYPE_MIX_LB_UB, NOT_USED, NOT_USED);
/*
TST_TYPE_SET (TST_MPI_COMPLEX
TST_TYPE_SET (TST_MPI_DOUBLE_COMPLEX
TST_TYPE_SET (TST_MPI_LOGICAL
TST_TYPE_SET (TST_MPI_REAL
TST_TYPE_SET (TST_MPI_DOUBLE_PRECISION
TST_TYPE_SET (TST_MPI_INTEGER
TST_TYPE_SET (TST_MPI_2INTEGER
TST_TYPE_SET (TST_MPI_2COMPLEX
TST_TYPE_SET (TST_MPI_2DOUBLE_COMPLEX
TST_TYPE_SET (TST_MPI_2REAL
TST_TYPE_SET (TST_MPI_2DOUBLE_PRECISION
*/
default: ERROR (EINVAL, "Unknown type in tst_type_setvalue");
}