1
1

It is valid to call MPI_Init(NULL, NULL), so be sure to handle the

case where the passed-in argv is NULL.

This commit was SVN r27029.
Этот коммит содержится в:
Jeff Squyres 2012-08-14 16:33:53 +00:00
родитель d5824f7800
Коммит 7a4d6f05cf

Просмотреть файл

@ -386,9 +386,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* if we were not externally started, then we need to setup /* if we were not externally started, then we need to setup
* two envars so the MPI_INFO_ENV can get the cmd name * two envars so the MPI_INFO_ENV can get the cmd name
* and argv * and argv (but only if the user supplied a non-NULL argv!)
*/ */
if (NULL == getenv("OMPI_COMMAND")) { if (NULL == getenv("OMPI_COMMAND") && NULL != argv && NULL != argv[0]) {
asprintf(&cmd, "OMPI_COMMAND=%s", argv[0]); asprintf(&cmd, "OMPI_COMMAND=%s", argv[0]);
putenv(cmd); putenv(cmd);
} }