From ad894b050bf12436fbe3293864df20cb5865edc5 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 1 May 2008 15:24:03 +0000 Subject: [PATCH] Set the bookmark so the first process of a comm_spawn'd job will be mapped to the same node as the spawning proc, assuming it has space. If not, then the mapper will automatically move to the next node. This commit was SVN r18346. --- orte/mca/plm/base/plm_base_receive.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/orte/mca/plm/base/plm_base_receive.c b/orte/mca/plm/base/plm_base_receive.c index 1f5f982841..e63b5dd6ed 100644 --- a/orte/mca/plm/base/plm_base_receive.c +++ b/orte/mca/plm/base/plm_base_receive.c @@ -135,8 +135,14 @@ void orte_plm_base_receive_process_msg(int fd, short event, void *data) ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); goto ANSWER_LAUNCH; } - /* xfer the parent's bookmark so the child starts from that place */ - jdata->bookmark = parent->bookmark; + /* find the sender's node in the job map */ + procs = (orte_proc_t**)parent->procs->addr; + /* set the bookmark so the child starts from that place - this means + * that the first child process could be co-located with the proc + * that called comm_spawn, assuming slots remain on that node. Otherwise, + * the procs will start on the next available node + */ + jdata->bookmark = procs[mev->sender.vpid]->node; /* launch it */ if (ORTE_SUCCESS != (rc = orte_plm.spawn(jdata))) {