uti: Workaround not to share CPU with OpenMP threads

* Assign uti thread to the last idle CPU so that it's not shared with
  an OpenMP thread

Change-Id: Ia42cae056ce81fde9b6dab6286b39a52f3c9e172
This commit is contained in:
Masamichi Takagi
2018-09-03 18:08:03 +09:00
parent dbba7dea18
commit 5cb8a1f10f
8 changed files with 34 additions and 14 deletions

View File

@ -234,6 +234,7 @@ static long stack_max = -1;
static struct rlimit rlim_stack;
static char *mpol_bind_nodes = NULL;
static int uti_thread_rank = 0;
static int uti_use_last_cpu = 0;
/* Partitioned execution (e.g., for MPI) */
static int nr_processes = 0;
@ -1794,6 +1795,12 @@ static struct option mcexec_options[] = {
.flag = NULL,
.val = 'u',
},
{
.name = "uti-use-last-cpu",
.has_arg = no_argument,
.flag = &uti_use_last_cpu,
.val = 1,
},
/* end */
{ NULL, 0, NULL, 0, },
};
@ -2610,6 +2617,7 @@ int main(int argc, char **argv)
}
desc->uti_thread_rank = uti_thread_rank;
desc->uti_use_last_cpu = uti_use_last_cpu;
/* user_start and user_end are set by this call */
if (ioctl(fd, MCEXEC_UP_PREPARE_IMAGE, (unsigned long)desc) != 0) {