[mpich2-commits] r5477 - mpich2/trunk/src/pmi/smpd
jayesh at mcs.anl.gov
jayesh at mcs.anl.gov
Fri Oct 16 11:35:41 CDT 2009
Author: jayesh
Date: 2009-10-16 11:35:41 -0500 (Fri, 16 Oct 2009)
New Revision: 5477
Modified:
mpich2/trunk/src/pmi/smpd/smpd_ipmi.c
Log:
Providing the MPICH2 channel info to SMPD manager when spawning from remote pmi procs
Modified: mpich2/trunk/src/pmi/smpd/smpd_ipmi.c
===================================================================
--- mpich2/trunk/src/pmi/smpd/smpd_ipmi.c 2009-10-16 16:31:58 UTC (rev 5476)
+++ mpich2/trunk/src/pmi/smpd/smpd_ipmi.c 2009-10-16 16:35:41 UTC (rev 5477)
@@ -2483,7 +2483,7 @@
return PMI_FAIL;
}
*(--iter2) = '\0';
- sprintf(key, "%d", j);
+ sprintf(key, "%d", j++);
result = MPIU_Str_add_string_arg(&iter, &maxlen, key, keyval_buf);
if(result != MPIU_STR_SUCCESS){
pmi_err_printf("unable to add %s=%s to the spawn command\n", key, keyval_buf);
@@ -2492,6 +2492,30 @@
info_keyval_sizes[i]++;
}
}
+#ifdef HAVE_WINDOWS_H
+ /* FIXME: We don't support user environment infos for spawn() */
+ if(pmi_process.rpmi == PMI_TRUE){
+ /* Add channel environment for rpmi/singleton_init procs */
+ char *env, env_str[SMPD_MAX_ENV_LENGTH];
+ env = getenv("MPICH2_CHANNEL");
+ if(env != NULL){
+ snprintf(env_str, SMPD_MAX_ENV_LENGTH, "MPICH2_CHANNEL=%s", env);
+ keyval_buf[0] = '\0';
+ iter2 = keyval_buf;
+ maxlen2 = SMPD_MAX_CMD_LENGTH;
+ result = MPIU_Str_add_string_arg(&iter2, &maxlen2, "env", env_str);
+ iter2--;
+ *iter2 = '\0';
+ sprintf(key, "%d", j++);
+ result = MPIU_Str_add_string_arg(&iter, &maxlen, key, keyval_buf);
+ if (result != MPIU_STR_SUCCESS){
+ pmi_err_printf("unable to add %s=%s to the spawn command.\n", key, keyval_buf);
+ return PMI_FAIL;
+ }
+ info_keyval_sizes[i]++;
+ }
+ }
+#endif
if (iter != buffer){
iter--;
*iter = '\0'; /* remove the trailing space */
More information about the mpich2-commits
mailing list