Commit 0dd4cea5 authored by Haizhu Liu's avatar Haizhu Liu Committed by Michael Blocksome
Browse files

Exit with error when dynamic tasking is used in an invalid environment



Flag an error and exit when dynamic tasking APIs are called on
jobs that are not launched in dynamic mode in PE.

closes ticket #1961

(ibm) D192324
Signed-off-by: default avatarMichael Blocksome <blocksom@us.ibm.com>
parent 4d435f8c
......@@ -13,6 +13,8 @@
#ifdef DYNAMIC_TASKING
extern mpidi_dynamic_tasking;
/* Define the name of the kvs key used to provide the port name to the
children */
#define MPIDI_PARENT_PORT_KVSKEY "PARENT_ROOT_PORT_NAME"
......@@ -107,6 +109,12 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
{
int mpi_errno = MPI_SUCCESS;
if(mpidi_dynamic_tasking == 0) {
fprintf(stderr, "Received spawn request for non-dynamic jobs\n");
MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_SPAWN,
return mpi_errno, "**spawn");
}
/* We allow an empty implementation of this function to
simplify building MPICH on systems that have difficulty
supporing process creation */
......
......@@ -16,6 +16,8 @@
#define MPI_MAX_TASKID_NAME 8
#define MPIDI_TASKID_TAG_KEY "taskid"
extern mpidi_dynamic_tasking;
static int MPIDI_Open_port(MPID_Info *, char *);
static int MPIDI_Close_port(const char *);
......@@ -93,6 +95,13 @@ int MPID_Comm_accept(const char * port_name, MPID_Info * info, int root,
{
int mpi_errno = MPI_SUCCESS;
if(mpidi_dynamic_tasking == 0) {
fprintf(stderr, "Dynamic tasking API is called on non-dynamic jobs\n");
MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_SPAWN,
return mpi_errno, "**spawn");
}
if (portFns.CommAccept) {
mpi_errno = portFns.CommAccept( port_name, info, root, comm,
newcomm_ptr );
......@@ -110,6 +119,13 @@ int MPID_Comm_connect(const char * port_name, MPID_Info * info, int root,
{
int mpi_errno=MPI_SUCCESS;
if(mpidi_dynamic_tasking == 0) {
fprintf(stderr, "Dynamic tasking API is called on non-dynamic jobs\n");
MPIU_ERR_SETANDSTMT(mpi_errno, MPI_ERR_SPAWN,
return mpi_errno, "**spawn");
}
if (portFns.CommConnect) {
mpi_errno = portFns.CommConnect( port_name, info, root, comm,
newcomm_ptr );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment