Skip to content
Snippets Groups Projects
Commit 280f4142 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add scaling option

parent 22a83474
Branches
Tags
1 merge request!8Draft: RDMA version with wrapped infinity calls
...@@ -66,6 +66,9 @@ static size_t MESSAGE_SIZE = 0; ...@@ -66,6 +66,9 @@ static size_t MESSAGE_SIZE = 0;
/* Are we verbose. */ /* Are we verbose. */
static int verbose = 0; static int verbose = 0;
/* Scale to apply to the size of the messages we send. */
static float messagescale = 1.0;
/* Set a data pattern and check we get this back, slow... */ /* Set a data pattern and check we get this back, slow... */
static int datacheck = 0; static int datacheck = 0;
...@@ -377,6 +380,10 @@ static size_t pick_logs() { ...@@ -377,6 +380,10 @@ static size_t pick_logs() {
log->injtic = 0; log->injtic = 0;
log->endtic = 0; log->endtic = 0;
log->data = NULL; log->data = NULL;
/* Scale size. */
log->size *= messagescale;
if (log->type == task_type_send) { if (log->type == task_type_send) {
send_queue[nr_send] = log; send_queue[nr_send] = log;
nr_send++; nr_send++;
...@@ -463,7 +470,7 @@ int main(int argc, char *argv[]) { ...@@ -463,7 +470,7 @@ int main(int argc, char *argv[]) {
/* Handle the command-line, we expect a mpiuse data file to read and various /* Handle the command-line, we expect a mpiuse data file to read and various
* options. */ * options. */
int opt; int opt;
while ((opt = getopt(argc, argv, "vd")) != -1) { while ((opt = getopt(argc, argv, "vds:")) != -1) {
switch (opt) { switch (opt) {
case 'd': case 'd':
datacheck = 1; datacheck = 1;
...@@ -471,6 +478,9 @@ int main(int argc, char *argv[]) { ...@@ -471,6 +478,9 @@ int main(int argc, char *argv[]) {
case 'v': case 'v':
verbose = 1; verbose = 1;
break; break;
case 's':
messagescale = atof(optarg);
break;
default: default:
if (myrank == 0) usage(argv); if (myrank == 0) usage(argv);
return 1; return 1;
...@@ -565,9 +575,10 @@ int main(int argc, char *argv[]) { ...@@ -565,9 +575,10 @@ int main(int argc, char *argv[]) {
} }
message("All servers are started"); message("All servers are started");
// And make sure all remotes are also ready. /* Reset time as previous can be thought of as setup costs? */
MPI_Barrier(MPI_COMM_WORLD); // Vital... MPI_Barrier(MPI_COMM_WORLD); // Vital...
message("All synchronized"); message("All synchronized");
clocks_set_cpufreq(0);
/* Now we have a thread per rank to send the messages. */ /* Now we have a thread per rank to send the messages. */
pthread_t sendthread[nr_ranks]; pthread_t sendthread[nr_ranks];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment