diff --git a/mpiuse.c b/mpiuse.c index 07b6f6f160b1834563a920ee7004513671842d8d..ab6a03111e6a60958c04f0bcddff0ee81e694e25 100644 --- a/mpiuse.c +++ b/mpiuse.c @@ -363,7 +363,7 @@ void mpiuse_log_generate(int nr_nodes, int nr_logs, int size, int random, for (int k = 0; k < nr_logs; k++) { /* Set size for this messages. */ - int logsize = size; + double logsize = size; if (random) { if (cdf || odata) { /* CDF based randoms. */ @@ -391,12 +391,18 @@ void mpiuse_log_generate(int nr_nodes, int nr_logs, int size, int random, } } + /* Cannot send more than 2^31-1 bytes at a time, so truncate. */ + if (logsize > 2147483647.0) { + message("CDF size too large : %f, truncating", logsize); + logsize = 2147483647.0; + } + for (int i = 0; i < nr_nodes; i++) { for (int j = 0; j < nr_nodes; j++) { if (i != j) { - mpiuse_log_allocation(i, 1, k, SEND_TYPE, NO_SUBTYPE, 1, logsize, j, + mpiuse_log_allocation(i, 1, k, SEND_TYPE, NO_SUBTYPE, 1, (size_t)logsize, j, tag); - mpiuse_log_allocation(j, 1, k, RECV_TYPE, NO_SUBTYPE, 1, logsize, i, + mpiuse_log_allocation(j, 1, k, RECV_TYPE, NO_SUBTYPE, 1, (size_t)logsize, i, tag); } } diff --git a/swiftmpifakestepsim.c b/swiftmpifakestepsim.c index f5e0190855043fa7e1e929be18ae3ec5ac99a9ea..777531c73ec753cc378bffa6069b42297082675b 100644 --- a/swiftmpifakestepsim.c +++ b/swiftmpifakestepsim.c @@ -391,7 +391,8 @@ static void usage(char *argv[]) { fprintf(stderr, "Usage: %s [options] nr_messages logfile.dat\n", argv[0]); fprintf(stderr, " options: -v verbose, -d data check, -s size (bytes/scale), \n" - "\t -f randomize injection order, \n" + "\t -f <1|2> randomize injection order, 1 == just sends, " + "2 == sends and recvs\n" "\t[-r uniform random from 1 to size, | \n" "\t-r -g half gaussian random from 1 with 2.5 sigma size., | \n" "\t-r -c <file> use cdf from file, size is a scale factor., |\n"