Skip to content

Commit 5f58453

Browse files
committed
MTL/OFI: Lower priority when all procs are local
So far Vader is faster than OFI MTL for doing shared memory. Therefore, let it run by default when all procs are local. Reviewed-by: Spruit, Neil R <neil.r.spruit@intel.com> Reviewed-by: Gopalakrishnan, Aravind <aravind.gopalakrishnan@intel.com> Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
1 parent 592e2cc commit 5f58453

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,21 @@ ompi_mtl_ofi_component_register(void)
116116
int ret;
117117
mca_base_var_enum_t *new_enum = NULL;
118118
char *desc;
119+
int num_total_procs = (int)ompi_process_info.num_procs;
120+
/* num_local_peers does not include us in
121+
* its calculation, so adjust for that */
122+
int num_local_procs = (int)(1 + ompi_process_info.num_local_peers);
123+
124+
/* Lower priority when all porcesses are loal (vader is faster for shm).
125+
* However, if running only one process assume it is ompi_info or this
126+
* is most likely going to spawn.
127+
*/
128+
if ((num_local_procs == num_total_procs) && (1 < num_total_procs)) {
129+
param_priority = 10;
130+
} else {
131+
param_priority = 25; /* for now give a lower priority than the psm mtl */
132+
}
119133

120-
param_priority = 25; /* for now give a lower priority than the psm mtl */
121134
mca_base_component_var_register(&mca_mtl_ofi_component.super.mtl_version,
122135
"priority", "Priority of the OFI MTL component",
123136
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

0 commit comments

Comments
 (0)