Commit 7d5644fb authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Improve option to disable lonely runs of only comp or only comm

parent 2b614c06
......@@ -71,7 +71,7 @@ static void* ping_pong_thread_func(void* arg)
pthread_barrier_wait(&thread_barrier);
int k = !params.do_alone;
int k = !(params.do_alone & DO_COMM_ALONE);
/* k = 0: comm without computation
* k = 1: comm with computation */
for (; k < 2; k++)
......@@ -380,7 +380,7 @@ int main(int argc, char* argv[])
int nb_computing_run = params.computing.get_nb_runs(params.comm_bench_type);
/*** Computing without communication */
if (RANK_DOES_COMPUTATIONS && params.do_alone)
if (RANK_DOES_COMPUTATIONS && (params.do_alone & DO_COMP_ALONE))
{
PRINTF_RANK0("# Computing without communications...\n");
FREQ_EVENT("Computing without comm start");
......@@ -416,12 +416,12 @@ int main(int argc, char* argv[])
/*** Launch thread which will do ping pongs */
pthread_t ping_pong_thread;
pthread_barrier_init(&thread_barrier, NULL, 2);
if (params.do_alone)
if (params.do_alone & DO_COMM_ALONE)
{
PRINTF_RANK0("# Communications without computing\n");
}
pthread_create(&ping_pong_thread, NULL, ping_pong_thread_func, NULL);
if (params.do_alone)
if (params.do_alone & DO_COMM_ALONE)
{
pthread_barrier_wait(&thread_barrier);
pthread_barrier_wait(&thread_barrier);
......
......@@ -77,7 +77,7 @@ void parse_args(int argc, char* argv[], struct params_s* params)
params->enable_comm = 1;
params->display_comm = 1;
params->do_warmup = 1;
params->do_alone = 1;
params->do_alone = DO_COMP_ALONE | DO_COMM_ALONE;
params->comm_bench_type = LATENCY;
params->computing = stream_get_functions();
params->ping_thread_location = LAST;
......@@ -161,10 +161,21 @@ void parse_args(int argc, char* argv[], struct params_s* params)
CHECK_PARAM(NO_WARMUP);
params->do_warmup = 0;
}
else if (strcmp(argv[i], "--no_alone") == 0)
else if (strncmp(argv[i], "--no_alone", 10) == 0)
{
CHECK_PARAM(NO_WARMUP);
params->do_alone = 0;
if (strcmp(argv[i], "--no_alone") == 0 || strcmp(argv[i], "--no_alone=all") == 0)
{
params->do_alone = 0;
}
else if (strcmp(argv[i], "--no_alone=comp") == 0)
{
params->do_alone = DO_COMM_ALONE;
}
else if (strcmp(argv[i], "--no_alone=comm") == 0)
{
params->do_alone = DO_COMP_ALONE;
}
}
else if (strcmp(argv[i], "--display_binding") == 0)
{
......@@ -323,7 +334,8 @@ void print_params(struct params_s params)
if (enabled_params[NO_ALONE])
{
printf("# Individual runs %sabled\n", params.do_alone ? "en" : "dis");
printf("# Individual runs of communications %sabled\n", (params.do_alone & DO_COMM_ALONE) ? "en" : "dis");
printf("# Individual runs of computations %sabled\n", (params.do_alone & DO_COMP_ALONE) ? "en" : "dis");
}
if (enabled_params[DISPLAY_BINDING])
......@@ -421,7 +433,7 @@ void print_help(struct params_s params)
}
if (enabled_params[NO_ALONE])
{
printf("--no_alone to disable individual runs\n");
printf("--no_alone={all,comm,comp} to disable individual runs\n");
}
if (enabled_params[BIND_MEMORY_COMP])
{
......
......@@ -3,6 +3,9 @@
#include "helper.h"
#define DO_COMP_ALONE (1 << 0)
#define DO_COMM_ALONE (1 << 1)
enum param_e {
DISABLE_COMM,
PING_THREAD,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment