static int ConnectToHost(char *host, int port, smpd_state_t state, SMPDU_Sock_set_t set, SMPDU_Sock_t *sockp, smpd_context_t **contextpp)
{
    int result;
    char error_msg[SMPD_MAX_ERROR_LEN];
    int len;

    /*printf("posting a connect to %s:%d\n", host, port);fflush(stdout);*/
    result = smpd_create_context(SMPD_CONTEXT_PMI, set, SMPDU_SOCK_INVALID_SOCK/**sockp*/, -1, contextpp);
    if (result != SMPD_SUCCESS)
    {
	smpd_err_printf("ConnectToHost failed: unable to create a context to connect to %s:%d with.\n", host, port);
	return SMPD_FAIL;
    }

    result = SMPDU_Sock_post_connect(set, *contextpp, host, port, sockp);
    if (result != SMPD_SUCCESS)
    {
	len = SMPD_MAX_ERROR_LEN;
	PMPI_Error_string(result, error_msg, &len);
	smpd_err_printf("ConnectToHost failed: unable to post a connect to %s:%d, error: %s\n", host, port, error_msg);
	return SMPD_FAIL;
    }

    (*contextpp)->sock = *sockp;
    (*contextpp)->state = state;

    result = smpd_enter_at_state(set, state);
    if (result != SMPD_SUCCESS)
    {
	smpd_err_printf("ConnectToHost failed: unable to connect to %s:%d.\n", host, port);
	return SMPD_FAIL;
    }

    return SMPD_SUCCESS;
}
/**
 * Measurement wrapper for MPI_Error_string
 * @note Auto-generated by wrapgen from template: std.w
 * @note C interface
 * @note Introduced with MPI 1.0
 * @ingroup err
 */
int MPI_Error_string(int   errorcode,
                     char* string,
                     int*  resultlen)
{
    int return_val;

    if (IS_EVENT_GEN_ON_FOR(ERR))
    {
        EVENT_GEN_OFF();
        esd_enter(epk_mpi_regid[EPK__MPI_ERROR_STRING]);

        return_val = PMPI_Error_string(errorcode, string, resultlen);

        esd_exit(epk_mpi_regid[EPK__MPI_ERROR_STRING]);
        EVENT_GEN_ON();
    }
    else
    {
        return_val = PMPI_Error_string(errorcode, string, resultlen);
    }

    return return_val;
}
Exemple #3
0
int MPI_Error_string( int errorcode, char *string, int *resultlen )
{
  _MPI_COVERAGE();
  return PMPI_Error_string (errorcode, string, resultlen);
}
Exemple #4
0
int MPI_Error_string(int errorcode, char* string, int* resultlen) {
  return PMPI_Error_string(errorcode, string, resultlen);
}