mpich-gm shmem with mpiexec-0.70

Pete Wyckoff pw at osc.edu
Tue Sep 10 15:52:14 EDT 2002


marc at atmos.washington.edu said:
> Shared memory mpich-gm isn't enabled in mpiexec-0.70.
> The following change enables it for me.

Thanks plenty for fixing this problem.  Your patch was ideal.  I
reformatted it a teensy bit and changed the comments around.  I'll do
another release sometime soon, but until then, here is the important
diff that went into the CVS (plus credit notice in the ChangeLog of
course).

		-- Pete

diff -u -r1.21 start_tasks.c
--- start_tasks.c	2002/08/26 22:14:23	1.21
+++ start_tasks.c	2002/09/09 21:43:44
@@ -664,7 +664,7 @@
 	  gmpi_info[i].node);
     growstr_append(g, "|||");
     for (i=0; i<numtask; i++) {
-	int magic, id, cc, fd;
+	int magic, id, cc, fd, j;
 	growstr_t *h = growstr_init();
 
 	fd = accept(gmpi_fd[1], 0, 0);
@@ -688,9 +688,16 @@
 	    error("%s: received duplicate response for id %d", __func__, id);
 	gmpi_info[id].port = -1;
 	growstr_append(h, g->s);
-	/* duh, why do they not know this already, since we passed it in
-	 * as GMPI_ID? */
-	growstr_printf(h, "<%d>]]]", id);
+	/*
+	 * Search for SMP nodes and send the list of ids using that node.  Note
+	 * that it is not sufficient to compare tm_node_id values since PBS
+	 * hands out one per each "virtual CPU".
+	 */
+	for (j=0; j<numtask; j++) {
+	    if (!strcmp(tasks[id].name, tasks[j].name))
+		growstr_printf(h, "<%d>", j);
+	}
+	growstr_append(h, "]]]");
 	cc = write_full(fd, h->s, h->len);
 	if (cc < 0)
 	    error_errno("%s: write gmpi_port#2 id %d", __func__, i);




More information about the mpiexec mailing list