Skip to content

Conversation

@rhc54
Copy link
Contributor

@rhc54 rhc54 commented Aug 9, 2017

Apps might want to make use of the relative patterns used to place/assign their procs

Signed-off-by: Ralph Castain rhc@open-mpi.org

Apps might want to make use of the relative patterns used to place/assign their procs

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
@rhc54 rhc54 self-assigned this Aug 9, 2017
@rhc54
Copy link
Contributor Author

rhc54 commented Aug 9, 2017

@edgargabriel This provides the info you wanted. You can retrieve it by something like the following:

opal_proc_t wildcard = {myjobid, OPAL_VPID_WILDCARD};
char *str=NULL;
int rc;

OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_MAPBY, &wildcard, &str, OPAL_STRING);

The string is being generated by the orte_rmaps_base_print_mapping function down in orte/mca/rmaps/base/rmaps_base_print_fns.c.

I have also included similar values for OPAL_PMIX_RANKBY and OPAL_PMIX_BINDTO, with the latter being printed by the opal_hwloc_base_print_binding function in opal/mca/hwloc/base/hwloc_base_util.c.

The "optional" just means that we will return the info if it is available. This will protect you against earlier versions of OMPI where we don't provide it. So you should check the rc value for success before using the returned value. Of course, you should also check the string for NULL just for safety.

@rhc54 rhc54 merged commit 9324193 into open-mpi:master Aug 9, 2017
@rhc54 rhc54 deleted the topic/patterns branch August 9, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant