@@ -34,6 +34,8 @@ int execute_test(struct run_config *run);
34
34
#define VERBOSE_LEVEL_LOUD (user.verbose >= 2 )
35
35
#define VERBOSE_LEVEL_VERY_LOUD (user.verbose >= 3 )
36
36
37
+ enum test_coll { TEST_ALLTOALL, TEST_ALLTOALLV };
38
+
37
39
struct user_config
38
40
{
39
41
int seed = 0 ;
@@ -50,6 +52,9 @@ struct user_config
50
52
int verbose = 0 ;
51
53
int only_high = 0 ;
52
54
int only_low = 0 ;
55
+
56
+ /* collective */
57
+ int test_coll = TEST_ALLTOALLV;
53
58
};
54
59
55
60
static struct user_config user;
@@ -71,6 +76,11 @@ void dump_user_config(struct user_config *conf) {
71
76
std::cout << " prob-rank: " << conf->prob_rank << " \n " ;
72
77
std::cout << " prob-world: " << conf->prob_world << " \n " ;
73
78
std::cout << " verbose: " << conf->verbose << " \n " ;
79
+ if ( conf->test_coll == TEST_ALLTOALL ) {
80
+ std::cout << " collective: MPI_Alltoall" << " \n " ;
81
+ } else if ( conf->test_coll == TEST_ALLTOALLV ) {
82
+ std::cout << " collective: MPI_Alltoallv" << " \n " ;
83
+ }
74
84
}
75
85
76
86
void dump_type_info (MPI_Datatype dtype, const char *label) {
@@ -104,26 +114,29 @@ struct run_config
104
114
MPI_Datatype rdtype;
105
115
int sdcount_mult;
106
116
int rdcount_mult;
117
+ const char * coll;
107
118
};
108
119
109
120
void print_help ()
110
121
{
111
- printf (" Test alltoallv using various ddt's and validate results.\n " );
122
+ printf (" Test alltoall/ alltoallv using various ddt's and validate results.\n " );
112
123
printf (" This test uses pseudo-random sequences from C++'s mt19937 generator.\n " );
113
124
printf (" The test (but not necessarily the implementation) is deterministic\n " );
114
125
printf (" when the options and number of ranks remain the same.\n " );
115
126
printf (" Options:\n " );
116
- printf (" \t [-s|--seed <seed>] Change the seed to shuffle which datapoints are exchanged\n " );
117
- printf (" \t [-c|--item-count <citems>] Each rank will create <citems> to consider for exchange (default=10).\n " );
118
- printf (" \t [-i|--prob-item <prob>] Probability that rank r will send item k to rank q. (0.50)\n " );
119
- printf (" \t [-r|--prob-rank <prob>] Probability that rank r will send anything to rank q. (0.90)\n " );
120
- printf (" \t [-w|--prob-world <prob>] Probability that rank r will do anything at all. (0.95)\n " );
127
+ printf (" \t [-A|--coll alltoall|alltoallv Pick which collective to test.\n " );
121
128
printf (" \t [-t|--iters <iters>] The number of iterations to test each dtype.\n " );
122
129
printf (" \t [-o|--only <high,low>] Only execute a specific test signified by the pair high,low.\n " );
123
130
printf (" \t low=0 means run all tests in that high level\n " );
124
- printf (" \t [-v|--verbose= level ] Set verbosity during execution (0=quiet (default). 1,2,3: loud).\n " );
131
+ printf (" \t [-v|--verbose < level> ] Set verbosity during execution (0=quiet (default). 1,2,3: loud).\n " );
125
132
printf (" \t [-h|--help] Print this help and exit.\n " );
126
133
printf (" \t [-z|--verbose-rank] Only the provided rank will print. Default=0. ALL = -1.\n " );
134
+ printf (" \t [-c|--item-count <citems>] Each rank will create <citems> to consider for exchange (default=10).\n " );
135
+ printf (" \n The following options only have an effect when using alltoallv:\n " );
136
+ printf (" \t [-s|--seed <seed>] Change the seed to shuffle which datapoints are exchanged\n " );
137
+ printf (" \t [-i|--prob-item <prob>] Probability that rank r will send item k to rank q. (0.50)\n " );
138
+ printf (" \t [-r|--prob-rank <prob>] Probability that rank r will send anything to rank q. (0.90)\n " );
139
+ printf (" \t [-w|--prob-world <prob>] Probability that rank r will do anything at all. (0.95)\n " );
127
140
128
141
printf (" \n " );
129
142
}
@@ -748,11 +761,19 @@ int execute_test(struct run_config *run) {
748
761
ERROR_CHECK (err, on_error);
749
762
750
763
/* exchange data */
751
- err = MPI_Alltoallv (
752
- smsg_buf+lbs_shift, sendcounts, sdispls, run->sdtype ,
753
- rmsg_buf+lbr_shift, recvcounts, rdispls, run->rdtype ,
754
- MPI_COMM_WORLD
755
- );
764
+ if (TEST_ALLTOALLV == run->user ->test_coll ) {
765
+ err = MPI_Alltoallv (
766
+ smsg_buf+lbs_shift, sendcounts, sdispls, run->sdtype ,
767
+ rmsg_buf+lbr_shift, recvcounts, rdispls, run->rdtype ,
768
+ MPI_COMM_WORLD
769
+ );
770
+ } else {
771
+ err = MPI_Alltoall (
772
+ smsg_buf+lbs_shift, sendcounts[0 ], run->sdtype ,
773
+ rmsg_buf+lbr_shift, recvcounts[0 ], run->rdtype ,
774
+ MPI_COMM_WORLD
775
+ );
776
+ }
756
777
ERROR_CHECK (err, on_error);
757
778
err = check_guard_bytes ( msg_guards, guard_len, 127 , " message buffer3" );
758
779
err |= check_guard_bytes ( valb_guards, guard_len, 128 , " validation buffer" );
@@ -831,7 +852,8 @@ int main(int argc, char *argv[]) {
831
852
{ " only" , required_argument, 0 , ' o' },
832
853
{ " verbose" , required_argument, 0 , ' v' },
833
854
{ " verbose-rank" , required_argument, 0 , ' z' },
834
- { " help" , no_argument, 0 , ' h' }
855
+ { " help" , no_argument, 0 , ' h' },
856
+ { " coll" , required_argument, 0 , ' A' }
835
857
};
836
858
837
859
int opt;
@@ -842,7 +864,7 @@ int main(int argc, char *argv[]) {
842
864
while (1 )
843
865
{
844
866
char *s1, *s2;
845
- opt = getopt_long (argc, argv, " s:c:i:r:w:t:v:hz:" , long_options, &option_index);
867
+ opt = getopt_long (argc, argv, " s:c:i:r:w:t:v:hz:A: " , long_options, &option_index);
846
868
if (opt == -1 ) break ;
847
869
switch (opt) {
848
870
case ' s' :
@@ -876,6 +898,13 @@ int main(int argc, char *argv[]) {
876
898
case ' v' :
877
899
user.verbose = atoi (optarg);
878
900
break ;
901
+ case ' A' :
902
+ if (strcmp (optarg, " alltoall" ) == 0 ) {
903
+ user.test_coll = TEST_ALLTOALL;
904
+ } else {
905
+ user.test_coll = TEST_ALLTOALLV;
906
+ }
907
+ break ;
879
908
case ' h' :
880
909
if (rank==0 ) {
881
910
print_help ();
@@ -902,6 +931,12 @@ int main(int argc, char *argv[]) {
902
931
printf (" Requested only test %d,%d\n " ,user.only_high ,user.only_low );
903
932
}
904
933
934
+ if (TEST_ALLTOALL == user.test_coll ) {
935
+ user.prob_item = 1.001 ;
936
+ user.prob_rank = 1.001 ;
937
+ user.prob_world = 1.001 ;
938
+ }
939
+
905
940
if (VERBOSE_LEVEL_LOUD) {
906
941
dump_user_config (&user);
907
942
printf (" -----------\n " );
0 commit comments