Compliments r13351 -- use the new field on the ompi_proc_t struct to
know what my local rank is, and therefore set my paffinity ID as appropriate. Specifically, we're no longer relying on the special/secret mpi_paffinity_processor MCA parameter that the orted would set for us. This allows processor affinity to be used in environments where the orted is not used (e.g., bproc, and someday in the hopefully not too-distant future, SLURM). This commit was SVN r13352. The following SVN revision numbers were found above: r13351 --> open-mpi/ompi@a338b7e533
Этот коммит содержится в:
родитель
a338b7e533
Коммит
0ce78f22fa
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2006 University of Houston. All rights reserved.
|
||||
@ -281,40 +281,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Setup process affinity */
|
||||
|
||||
if (ompi_mpi_paffinity_alone) {
|
||||
bool set = false;
|
||||
param = mca_base_param_find("mpi", NULL, "paffinity_processor");
|
||||
if (param >= 0) {
|
||||
if (OMPI_SUCCESS == mca_base_param_lookup_int(param, &value)) {
|
||||
if (value >= 0) {
|
||||
if (OPAL_SUCCESS == opal_paffinity_base_set(value)) {
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!set) {
|
||||
char *vpid;
|
||||
orte_ns.get_vpid_string(&vpid, orte_process_info.my_name);
|
||||
opal_show_help("help-mpi-runtime",
|
||||
"mpi_init:startup:paffinity-unavailable",
|
||||
true, vpid);
|
||||
free(vpid);
|
||||
}
|
||||
|
||||
/* If we were able to set processor affinity, try setting
|
||||
up memory affinity */
|
||||
|
||||
else {
|
||||
if (OPAL_SUCCESS == opal_maffinity_base_open() &&
|
||||
OPAL_SUCCESS == opal_maffinity_base_select()) {
|
||||
ompi_mpi_maffinity_setup = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* initialize datatypes. This step should be done early as it will
|
||||
* create the local convertor and local arch used in the proc
|
||||
* init.
|
||||
@ -540,6 +506,29 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
gettimeofday(&ompistart, NULL);
|
||||
}
|
||||
|
||||
/* Setup process affinity */
|
||||
|
||||
if (ompi_mpi_paffinity_alone) {
|
||||
if (OPAL_SUCCESS ==
|
||||
opal_paffinity_base_set(ompi_proc_local_proc->local_rank)) {
|
||||
/* If we were able to set processor affinity, also try to
|
||||
setup memory affinity */
|
||||
if (OPAL_SUCCESS == opal_maffinity_base_open() &&
|
||||
OPAL_SUCCESS == opal_maffinity_base_select()) {
|
||||
ompi_mpi_maffinity_setup = true;
|
||||
}
|
||||
} else {
|
||||
/* If we failed to setup paffinity, then print a warning
|
||||
because the user did specifically ask for it */
|
||||
char *vpid;
|
||||
orte_ns.get_vpid_string(&vpid, orte_process_info.my_name);
|
||||
opal_show_help("help-mpi-runtime",
|
||||
"mpi_init:startup:paffinity-unavailable",
|
||||
true, vpid);
|
||||
free(vpid);
|
||||
}
|
||||
}
|
||||
|
||||
/* start PTL's */
|
||||
ret = MCA_PML_CALL(enable(true));
|
||||
if( OMPI_SUCCESS != ret ) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user