本文整理汇总了C++中MPIR_ERR_CHKANDJUMP函数的典型用法代码示例。如果您正苦于以下问题:C++ MPIR_ERR_CHKANDJUMP函数的具体用法?C++ MPIR_ERR_CHKANDJUMP怎么用?C++ MPIR_ERR_CHKANDJUMP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MPIR_ERR_CHKANDJUMP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MPIDU_Ftb_init
int MPIDU_Ftb_init(void)
{
int mpi_errno = MPI_SUCCESS;
int ret;
FTB_client_t ci;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPIDU_FTB_INIT);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPIDU_FTB_INIT);
MPL_strncpy(ci.event_space, "ftb.mpi.mpich", sizeof(ci.event_space));
MPL_strncpy(ci.client_name, "mpich " MPICH_VERSION, sizeof(ci.client_name));
MPL_strncpy(ci.client_subscription_style, "FTB_SUBSCRIPTION_NONE", sizeof(ci.client_subscription_style));
ci.client_polling_queue_len = -1;
#ifdef USE_PMI2_API
ret = PMI2_Job_GetId(ci.client_jobid, sizeof(ci.client_jobid));
MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_jobgetid");
#else
ret = PMI_KVS_Get_my_name(ci.client_jobid, sizeof(ci.client_jobid));
MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**pmi_get_id");
#endif
ret = FTB_Connect(&ci, &client_handle);
MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_connect");
ret = FTB_Declare_publishable_events(client_handle, NULL, event_info, sizeof(event_info) / sizeof(event_info[0]));
MPIR_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ftb_declare_publishable_events");
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPIDU_FTB_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:NexMirror,项目名称:MPICH,代码行数:34,代码来源:ftb.c
示例2: MPID_Rget_accumulate
int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPIR_Win * win_ptr, MPIR_Request ** request)
{
int mpi_errno = MPI_SUCCESS;
int dt_contig ATTRIBUTE((unused));
MPIR_Datatype*dtp;
MPI_Aint dt_true_lb ATTRIBUTE((unused));
intptr_t data_sz, trg_data_sz;
MPIR_Request *ureq;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPID_RGET_ACCUMULATE);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPID_RGET_ACCUMULATE);
/* request-based RMA operations are only valid within a passive epoch */
MPIR_ERR_CHKANDJUMP(win_ptr->states.access_state != MPIDI_RMA_PER_TARGET &&
win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_CALLED &&
win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED &&
win_ptr->states.access_state != MPIDI_RMA_LOCK_ALL_GRANTED,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
/* Create user request, initially cc=1, ref=1 */
ureq = MPIR_Request_create(MPIR_REQUEST_KIND__RMA);
MPIR_ERR_CHKANDJUMP(ureq == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
/* This request is referenced by user and ch3 by default. */
MPIR_Object_set_ref(ureq, 2);
/* Note that GACC is only a no-op if no data goes in both directions */
MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, trg_data_sz, dtp, dt_true_lb);
/* Enqueue or perform the RMA operation */
if (target_rank != MPI_PROC_NULL && (data_sz != 0 || trg_data_sz != 0)) {
mpi_errno = MPIDI_CH3I_Get_accumulate(origin_addr, origin_count,
origin_datatype, result_addr,
result_count, result_datatype,
target_rank, target_disp,
target_count, target_datatype, op, win_ptr, ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIR_ERR_POP(mpi_errno);
}
}
else {
mpi_errno = MPID_Request_complete(ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIR_ERR_POP(mpi_errno);
}
}
*request = ureq;
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPID_RGET_ACCUMULATE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:jeffhammond,项目名称:mpich,代码行数:60,代码来源:ch3u_rma_reqops.c
示例3: MPID_nem_tcp_get_business_card
int MPID_nem_tcp_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
int str_errno = MPIU_STR_SUCCESS;
MPIDU_Sock_ifaddr_t ifaddr;
char ifname[MAX_HOST_DESCRIPTION_LEN];
int ret;
struct sockaddr_in sock_id;
socklen_t len;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD);
mpi_errno = GetSockInterfaceAddr(my_rank, ifname, sizeof(ifname), &ifaddr);
if (mpi_errno) MPIR_ERR_POP(mpi_errno);
str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_HOST_DESCRIPTION_KEY, ifname);
if (str_errno) {
MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
len = sizeof(sock_id);
ret = getsockname (MPID_nem_tcp_g_lstn_sc.fd, (struct sockaddr *)&sock_id, &len);
MPIR_ERR_CHKANDJUMP1 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**getsockname", "**getsockname %s", MPIU_Strerror (errno));
str_errno = MPIU_Str_add_int_arg (bc_val_p, val_max_sz_p, MPIDI_CH3I_PORT_KEY, ntohs(sock_id.sin_port));
if (str_errno) {
MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
if (ifaddr.len > 0 && ifaddr.type == AF_INET)
{
unsigned char *p;
p = (unsigned char *)(ifaddr.ifaddr);
MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u", p[0], p[1], p[2], p[3] );
MPIU_DBG_MSG_S(CH3_CONNECT,VERBOSE,"ifname = %s",ifname );
str_errno = MPIU_Str_add_string_arg(bc_val_p, val_max_sz_p, MPIDI_CH3I_IFNAME_KEY, ifname);
if (str_errno) {
MPIR_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIR_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
}
/* printf("MPID_nem_tcp_get_business_card. port=%d\n", sock_id.sin_port); */
fn_exit:
/* fprintf(stdout, "MPID_nem_tcp_get_business_card Exit, mpi_errno=%d\n", mpi_errno); fflush(stdout); */
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_BUSINESS_CARD);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:56,代码来源:tcp_init.c
示例4: MPIDI_check_for_failed_procs
int MPIDI_check_for_failed_procs(void)
{
int mpi_errno = MPI_SUCCESS;
int pmi_errno;
int len;
char *kvsname = MPIDI_global.jobid;
char *failed_procs_string = NULL;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPIDI_CHECK_FOR_FAILED_PROCS);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPIDI_CHECK_FOR_FAILED_PROCS);
/* FIXME: Currently this only handles failed processes in
* comm_world. We need to fix hydra to include the pgid along
* with the rank, then we need to create the failed group from
* something bigger than comm_world. */
#ifdef USE_PMIX_API
MPIR_Assert(0);
#elif defined(USE_PMI2_API)
{
int vallen = 0;
len = PMI2_MAX_VALLEN;
failed_procs_string = MPL_malloc(len, MPL_MEM_OTHER);
MPIR_Assert(failed_procs_string);
pmi_errno =
PMI2_KVS_Get(kvsname, PMI2_ID_NULL, "PMI_dead_processes", failed_procs_string,
len, &vallen);
MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
MPL_free(failed_procs_string);
}
#else
pmi_errno = PMI_KVS_Get_value_length_max(&len);
MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get_value_length_max");
failed_procs_string = MPL_malloc(len, MPL_MEM_OTHER);
MPIR_Assert(failed_procs_string);
pmi_errno = PMI_KVS_Get(kvsname, "PMI_dead_processes", failed_procs_string, len);
MPIR_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**pmi_kvs_get");
MPL_free(failed_procs_string);
#endif
MPL_DBG_MSG_FMT(MPIDI_CH4_DBG_GENERAL, VERBOSE,
(MPL_DBG_FDEST, "Received proc fail notification: %s", failed_procs_string));
/* FIXME: handle ULFM failed groups here */
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPIDI_CHECK_FOR_FAILED_PROCS);
return mpi_errno;
fn_fail:
MPL_free(failed_procs_string);
goto fn_exit;
}
开发者ID:jeffhammond,项目名称:mpich,代码行数:50,代码来源:ch4_globals.c
示例5: MPIR_Dist_graph_neighbors_impl
int MPIR_Dist_graph_neighbors_impl(MPIR_Comm * comm_ptr,
int maxindegree, int sources[], int sourceweights[],
int maxoutdegree, int destinations[], int destweights[])
{
int mpi_errno = MPI_SUCCESS;
MPIR_Topology *topo_ptr = NULL;
topo_ptr = MPIR_Topology_get(comm_ptr);
MPIR_ERR_CHKANDJUMP(!topo_ptr ||
topo_ptr->kind != MPI_DIST_GRAPH, mpi_errno, MPI_ERR_TOPOLOGY,
"**notdistgraphtopo");
MPIR_Memcpy(sources, topo_ptr->topo.dist_graph.in, maxindegree * sizeof(int));
MPIR_Memcpy(destinations, topo_ptr->topo.dist_graph.out, maxoutdegree * sizeof(int));
if (sourceweights != MPI_UNWEIGHTED && topo_ptr->topo.dist_graph.is_weighted) {
MPIR_Memcpy(sourceweights, topo_ptr->topo.dist_graph.in_weights, maxindegree * sizeof(int));
}
if (destweights != MPI_UNWEIGHTED && topo_ptr->topo.dist_graph.is_weighted) {
MPIR_Memcpy(destweights, topo_ptr->topo.dist_graph.out_weights, maxoutdegree * sizeof(int));
}
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:ParaStation,项目名称:psmpi2,代码行数:27,代码来源:dist_gr_neighb.c
示例6: MPIR_Graph_neighbors_impl
int MPIR_Graph_neighbors_impl(MPIR_Comm * comm_ptr, int rank, int maxneighbors, int neighbors[])
{
int mpi_errno = MPI_SUCCESS;
MPIR_Topology *graph_ptr;
int i, is, ie;
graph_ptr = MPIR_Topology_get(comm_ptr);
MPIR_ERR_CHKANDJUMP((!graph_ptr ||
graph_ptr->kind != MPI_GRAPH), mpi_errno, MPI_ERR_TOPOLOGY,
"**notgraphtopo");
MPIR_ERR_CHKANDJUMP2((rank < 0 ||
rank >= graph_ptr->topo.graph.nnodes), mpi_errno, MPI_ERR_RANK, "**rank",
"**rank %d %d", rank, graph_ptr->topo.graph.nnodes);
/* Get location in edges array of the neighbors of the specified rank */
if (rank == 0)
is = 0;
else
is = graph_ptr->topo.graph.index[rank - 1];
ie = graph_ptr->topo.graph.index[rank];
/* Get neighbors */
for (i = is; i < ie; i++)
*neighbors++ = graph_ptr->topo.graph.edges[i];
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:jeffhammond,项目名称:mpich,代码行数:30,代码来源:graph_nbr.c
示例7: MPIR_Comm_create
int MPIR_Comm_create(MPID_Comm ** newcomm_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *newptr;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_COMM_CREATE);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_COMM_CREATE);
newptr = (MPID_Comm *) MPIU_Handle_obj_alloc(&MPID_Comm_mem);
MPIR_ERR_CHKANDJUMP(!newptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
*newcomm_ptr = newptr;
mpi_errno = MPIR_Comm_init(newptr);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
/* Insert this new communicator into the list of known communicators.
* Make this conditional on debugger support to match the test in
* MPIR_Comm_release . */
MPIR_COMML_REMEMBER(newptr);
fn_fail:
MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_COMM_CREATE);
return mpi_errno;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:27,代码来源:commutil.c
示例8: do_readv
static int do_readv(MPID_Request *rreq, int pipe_fd, MPL_IOV iov[],
int *iov_offset, int *iov_count, int *complete)
{
int mpi_errno = MPI_SUCCESS;
ssize_t nread;
nread = readv(pipe_fd, &rreq->dev.iov[rreq->dev.iov_offset], rreq->dev.iov_count);
MPIR_ERR_CHKANDJUMP2(nread < 0 && errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**read",
"**readv %d %s", errno, MPIU_Strerror(errno));
if (nread < 0) {
if (errno == EAGAIN) goto fn_exit;
MPIR_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
"**vmsplice %d %s", errno, MPIU_Strerror(errno));
}
*complete = adjust_partially_xferred_iov(iov, iov_offset, iov_count, nread);
if (*complete) {
/* look for additional data to send and reload IOV if there is more */
mpi_errno = check_req_complete(rreq->ch.vc, rreq, complete);
if (mpi_errno) MPIR_ERR_POP(mpi_errno);
if (*complete) {
nread = close(pipe_fd);
MPIR_ERR_CHKANDJUMP(nread < 0, mpi_errno, MPI_ERR_OTHER, "**close");
MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
}
}
fn_fail:
fn_exit:
return mpi_errno;
}
开发者ID:zhanglt,项目名称:mpich,代码行数:33,代码来源:mpid_nem_lmt_vmsplice.c
示例9: do_vmsplice
static int do_vmsplice(MPID_Request *sreq, int pipe_fd, MPL_IOV iov[],
int *iov_offset, int *iov_count, int *complete)
{
int mpi_errno = MPI_SUCCESS;
ssize_t err;
#if 1
err = vmsplice(pipe_fd, &iov[*iov_offset], *iov_count, SPLICE_F_NONBLOCK);
#else
err = writev(pipe_fd, &iov[*iov_offset], *iov_count);
#endif
if (err < 0) {
if (errno == EAGAIN) goto fn_exit;
MPIR_ERR_CHKANDJUMP2(errno != EAGAIN, mpi_errno, MPI_ERR_OTHER, "**vmsplice",
"**vmsplice %d %s", errno, MPIU_Strerror(errno));
}
*complete = adjust_partially_xferred_iov(iov, iov_offset, iov_count, err);
if (*complete) {
/* look for additional data to send and reload IOV if there is more */
mpi_errno = check_req_complete(sreq->ch.vc, sreq, complete);
if (mpi_errno) MPIR_ERR_POP(mpi_errno);
if (*complete) {
err = close(pipe_fd);
MPIR_ERR_CHKANDJUMP(err < 0, mpi_errno, MPI_ERR_OTHER, "**close");
MPL_DBG_MSG(MPIDI_CH3_DBG_CHANNEL, VERBOSE, ".... complete");
}
}
fn_fail:
fn_exit:
return mpi_errno;
}
开发者ID:zhanglt,项目名称:mpich,代码行数:35,代码来源:mpid_nem_lmt_vmsplice.c
示例10: MPIR_Get_intercomm_contextid
int MPIR_Get_intercomm_contextid(MPIR_Comm * comm_ptr, MPIR_Context_id_t * context_id,
MPIR_Context_id_t * recvcontext_id)
{
MPIR_Context_id_t mycontext_id, remote_context_id;
int mpi_errno = MPI_SUCCESS;
int tag = 31567; /* FIXME - we need an internal tag or
* communication channel. Can we use a different
* context instead?. Or can we use the tag
* provided in the intercomm routine? (not on a dup,
* but in that case it can use the collective context) */
MPIR_Errflag_t errflag = MPIR_ERR_NONE;
MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID);
MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID);
if (!comm_ptr->local_comm) {
/* Manufacture the local communicator */
mpi_errno = MPII_Setup_intercomm_localcomm(comm_ptr);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
}
mpi_errno = MPIR_Get_contextid_sparse(comm_ptr->local_comm, &mycontext_id, FALSE);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
MPIR_Assert(mycontext_id != 0);
/* MPIC routine uses an internal context id. The local leads (process 0)
* exchange data */
remote_context_id = -1;
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv(&mycontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
comm_ptr, MPI_STATUS_IGNORE, &errflag);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
}
/* Make sure that all of the local processes now have this
* id */
mpi_errno = MPID_Bcast(&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE,
0, comm_ptr->local_comm, &errflag);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
MPIR_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
/* The recvcontext_id must be the one that was allocated out of the local
* group, not the remote group. Otherwise we could end up posting two
* MPI_ANY_SOURCE,MPI_ANY_TAG recvs on the same context IDs even though we
* are attempting to post them for two separate communicators. */
*context_id = remote_context_id;
*recvcontext_id = mycontext_id;
fn_fail:
MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID);
return mpi_errno;
}
开发者ID:michael-chuvelev,项目名称:mpich,代码行数:55,代码来源:contextid.c
示例11: MPID_nem_tcp_get_addr_port_from_bc
int MPID_nem_tcp_get_addr_port_from_bc(const char *business_card, struct in_addr *addr, in_port_t *port)
{
int mpi_errno = MPI_SUCCESS;
int ret;
int port_int;
/*char desc_str[256];*/
char ifname[256];
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC);
/* fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */
/* desc_str is only used for debugging
ret = MPIU_Str_get_string_arg (business_card, MPIDI_CH3I_HOST_DESCRIPTION_KEY, desc_str, sizeof(desc_str));
MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missinghost");
*/
/* sizeof(in_port_t) != sizeof(int) on most platforms, so we need to use
* port_int as the arg to MPIU_Str_get_int_arg. */
ret = MPIU_Str_get_int_arg (business_card, MPIDI_CH3I_PORT_KEY, &port_int);
/* MPIU_STR_FAIL is not a valid MPI error code so we store the result in ret
* instead of mpi_errno. */
MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingport");
MPIU_Assert((port_int >> (8*sizeof(*port))) == 0); /* ensure port_int isn't too large for *port */
*port = htons((in_port_t)port_int);
ret = MPIU_Str_get_string_arg(business_card, MPIDI_CH3I_IFNAME_KEY, ifname, sizeof(ifname));
MPIR_ERR_CHKANDJUMP (ret != MPIU_STR_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**argstr_missingifname");
ret = inet_pton (AF_INET, (const char *)ifname, addr);
MPIR_ERR_CHKANDJUMP(ret == 0, mpi_errno,MPI_ERR_OTHER,"**ifnameinvalid");
MPIR_ERR_CHKANDJUMP(ret < 0, mpi_errno, MPI_ERR_OTHER, "**afinetinvalid");
fn_exit:
/* fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_ADDR_PORT_FROM_BC);
return mpi_errno;
fn_fail:
/* fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:42,代码来源:tcp_init.c
示例12: MPI_Add_error_class
/*@
MPI_Add_error_class - Add an MPI error class to the known classes
Output Parameters:
. errorclass - New error class
.N ThreadSafe
.N Fortran
.N Errors
.N MPI_SUCCESS
.N MPI_ERR_OTHER
@*/
int MPI_Add_error_class(int *errorclass)
{
int mpi_errno = MPI_SUCCESS;
int new_class;
MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_ADD_ERROR_CLASS);
MPIR_ERRTEST_INITIALIZED_ORDIE();
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPI_ADD_ERROR_CLASS);
/* Validate parameters, especially handles needing to be converted */
#ifdef HAVE_ERROR_CHECKING
{
MPID_BEGIN_ERROR_CHECKS;
{
MPIR_ERRTEST_ARGNULL(errorclass, "errorclass", mpi_errno);
}
MPID_END_ERROR_CHECKS;
}
#endif /* HAVE_ERROR_CHECKING */
/* ... body of routine ... */
new_class = MPIR_Err_add_class();
MPIR_ERR_CHKANDJUMP(new_class < 0, mpi_errno, MPI_ERR_OTHER, "**noerrclasses");
*errorclass = ERROR_DYN_MASK | new_class;
/* FIXME why isn't this done in MPIR_Err_add_class? */
if (*errorclass > MPIR_Process.attrs.lastusedcode) {
MPIR_Process.attrs.lastusedcode = *errorclass;
}
/* ... end of body of routine ... */
fn_exit:
MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPI_ADD_ERROR_CLASS);
MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
return mpi_errno;
fn_fail:
/* --BEGIN ERROR HANDLING-- */
#ifdef HAVE_ERROR_CHECKING
{
mpi_errno =
MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
"**mpi_add_error_class", "**mpi_add_error_class %p", errorclass);
}
#endif
mpi_errno = MPIR_Err_return_comm(NULL, FCNAME, mpi_errno);
goto fn_exit;
/* --END ERROR HANDLING-- */
}
开发者ID:ParaStation,项目名称:psmpi2,代码行数:68,代码来源:add_error_class.c
示例13: MPIR_Setup_intercomm_localcomm
int MPIR_Setup_intercomm_localcomm(MPID_Comm * intercomm_ptr)
{
MPID_Comm *localcomm_ptr;
int mpi_errno = MPI_SUCCESS;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_SETUP_INTERCOMM_LOCALCOMM);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_SETUP_INTERCOMM_LOCALCOMM);
localcomm_ptr = (MPID_Comm *) MPIU_Handle_obj_alloc(&MPID_Comm_mem);
MPIR_ERR_CHKANDJUMP(!localcomm_ptr, mpi_errno, MPI_ERR_OTHER, "**nomem");
/* get sensible default values for most fields (usually zeros) */
mpi_errno = MPIR_Comm_init(localcomm_ptr);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
/* use the parent intercomm's recv ctx as the basis for our ctx */
localcomm_ptr->recvcontext_id =
MPID_CONTEXT_SET_FIELD(IS_LOCALCOMM, intercomm_ptr->recvcontext_id, 1);
localcomm_ptr->context_id = localcomm_ptr->recvcontext_id;
MPIU_DBG_MSG_FMT(COMM, TYPICAL,
(MPIU_DBG_FDEST,
"setup_intercomm_localcomm ic=%p ic->context_id=%d ic->recvcontext_id=%d lc->recvcontext_id=%d",
intercomm_ptr, intercomm_ptr->context_id, intercomm_ptr->recvcontext_id,
localcomm_ptr->recvcontext_id));
/* Save the kind of the communicator */
localcomm_ptr->comm_kind = MPID_INTRACOMM;
/* Set the sizes and ranks */
localcomm_ptr->remote_size = intercomm_ptr->local_size;
localcomm_ptr->local_size = intercomm_ptr->local_size;
localcomm_ptr->rank = intercomm_ptr->rank;
MPIR_Comm_map_dup(localcomm_ptr, intercomm_ptr, MPIR_COMM_MAP_DIR_L2L);
/* TODO More advanced version: if the group is available, dup it by
* increasing the reference count instead of recreating it later */
/* FIXME : No coll_fns functions for the collectives */
/* FIXME : No local functions for the topology routines */
intercomm_ptr->local_comm = localcomm_ptr;
/* sets up the SMP-aware sub-communicators and tables */
mpi_errno = MPIR_Comm_commit(localcomm_ptr);
if (mpi_errno)
MPIR_ERR_POP(mpi_errno);
fn_fail:
MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_SETUP_INTERCOMM_LOCALCOMM);
return mpi_errno;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:54,代码来源:commutil.c
示例14: MPIDI_Open_port
/*
* MPIDI_Open_port()
*/
static int MPIDI_Open_port(MPIR_Info *info_ptr, char *port_name)
{
int mpi_errno = MPI_SUCCESS;
int str_errno = MPL_STR_SUCCESS;
int len;
int port_name_tag = 0; /* this tag is added to the business card,
which is then returned as the port name */
int myRank = MPIR_Process.comm_world->rank;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPIDI_OPEN_PORT);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPIDI_OPEN_PORT);
mpi_errno = get_port_name_tag(&port_name_tag);
MPIR_ERR_CHKANDJUMP(mpi_errno,mpi_errno,MPI_ERR_OTHER,"**argstr_port_name_tag");
len = MPI_MAX_PORT_NAME;
str_errno = MPL_str_add_int_arg(&port_name, &len,
MPIDI_CH3I_PORT_NAME_TAG_KEY, port_name_tag);
MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_port_name_tag");
/* This works because Get_business_card uses the same MPL_str_xxx
functions as above to add the business card to the input string */
/* FIXME: We should instead ask the mpid_pg routines to give us
a connection string. There may need to be a separate step to
restrict us to a connection information that is only valid for
connections between processes that are started separately (e.g.,
may not use shared memory). We may need a channel-specific
function to create an exportable connection string. */
mpi_errno = MPIDI_CH3_Get_business_card(myRank, port_name, len);
MPL_DBG_MSG_FMT(MPIDI_CH3_DBG_OTHER, VERBOSE, (MPL_DBG_FDEST, "port_name = %s", port_name));
mpi_errno = MPIDI_CH3I_Port_init(port_name_tag);
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPIDI_OPEN_PORT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:jeffhammond,项目名称:mpich,代码行数:42,代码来源:mpid_port.c
示例15: MPI_Add_error_code
/*@
MPI_Add_error_code - Add an MPI error code to an MPI error class
Input Parameters:
. errorclass - Error class to add an error code.
Output Parameters:
. errorcode - New error code for this error class.
.N ThreadSafe
.N Fortran
.N Errors
.N MPI_SUCCESS
.N MPI_ERR_OTHER
@*/
int MPI_Add_error_code(int errorclass, int *errorcode)
{
int mpi_errno = MPI_SUCCESS;
int new_code;
MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_ADD_ERROR_CODE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPI_ADD_ERROR_CODE);
/* Validate parameters, especially handles needing to be converted */
#ifdef HAVE_ERROR_CHECKING
{
MPID_BEGIN_ERROR_CHECKS;
{
/* FIXME: verify that errorclass is a dynamic class */
MPIR_ERRTEST_ARGNULL(errorcode, "errorcode", mpi_errno);
}
MPID_END_ERROR_CHECKS;
}
#endif /* HAVE_ERROR_CHECKING */
/* ... body of routine ... */
new_code = MPIR_Err_add_code(errorclass);
MPIR_ERR_CHKANDJUMP(new_code < 0, mpi_errno, MPI_ERR_OTHER, "**noerrcodes");
*errorcode = new_code;
/* ... end of body of routine ... */
fn_exit:
MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPI_ADD_ERROR_CODE);
MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
return mpi_errno;
fn_fail:
/* --BEGIN ERROR HANDLING-- */
#ifdef HAVE_ERROR_CHECKING
{
mpi_errno =
MPIR_Err_create_code(mpi_errno, MPIR_ERR_RECOVERABLE, __func__, __LINE__, MPI_ERR_OTHER,
"**mpi_add_error_code", "**mpi_add_error_code %d %p", errorclass,
errorcode);
}
#endif
mpi_errno = MPIR_Err_return_comm(NULL, __func__, mpi_errno);
goto fn_exit;
/* --END ERROR HANDLING-- */
}
开发者ID:jeffhammond,项目名称:mpich,代码行数:68,代码来源:add_error_code.c
示例16: MPIDI_GetTagFromPort
/*
* The connect and accept routines use this routine to get the port tag
* from the port name.
*/
int MPIDI_GetTagFromPort( const char *port_name, int *port_name_tag )
{
int mpi_errno = MPI_SUCCESS;
int str_errno = MPIU_STR_SUCCESS;
str_errno = MPIU_Str_get_int_arg(port_name, MPIDI_CH3I_PORT_NAME_TAG_KEY,
port_name_tag);
MPIR_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**argstr_no_port_name_tag");
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:18,代码来源:mpid_port.c
示例17: MPID_nem_llc_finalize
int MPID_nem_llc_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int rc;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPID_NEM_LLC_FINALIZE);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPID_NEM_LLC_FINALIZE);
rc = LLC_finalize();
MPIR_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPID_NEM_LLC_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:NexMirror,项目名称:MPICH,代码行数:17,代码来源:llc_fini.c
示例18: MPIDI_Close_port
static int MPIDI_Close_port(const char *port_name)
{
int mpi_errno = MPI_SUCCESS;
int port_name_tag;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CLOSE_PORT);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CLOSE_PORT);
mpi_errno = MPIDI_GetTagFromPort(port_name, &port_name_tag);
MPIR_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,"**argstr_port_name_tag");
free_port_name_tag(port_name_tag);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CLOSE_PORT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:19,代码来源:mpid_port.c
示例19: MPID_nem_tcp_bind
int MPID_nem_tcp_bind (int sockfd)
{
int mpi_errno = MPI_SUCCESS;
int ret;
struct sockaddr_in sin;
int port;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_BIND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_BIND);
MPIR_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
/* default MPICH_PORT_RANGE is {0,0} so bind will use any available port */
ret = 0;
for (port = MPIR_CVAR_CH3_PORT_RANGE.low; port <= MPIR_CVAR_CH3_PORT_RANGE.high; ++port)
{
memset ((void *)&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port = htons(port);
ret = bind (sockfd, (struct sockaddr *)&sin, sizeof(sin));
if (ret == 0)
break;
/* check for real error */
MPIR_ERR_CHKANDJUMP3 (errno != EADDRINUSE && errno != EADDRNOTAVAIL, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port, errno, MPIU_Strerror (errno));
}
/* check if an available port was found */
MPIR_ERR_CHKANDJUMP3 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**sock|poll|bind", "**sock|poll|bind %d %d %s", port-1, errno, MPIU_Strerror (errno));
fn_exit:
/* if (ret == 0) */
/* fprintf(stdout, "sockfd=%d port=%d bound\n", sockfd, port); */
/* fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_BIND);
return mpi_errno;
fn_fail:
/* fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:42,代码来源:tcp_init.c
示例20: MPID_nem_ptl_get_id_from_bc
int MPID_nem_ptl_get_id_from_bc(const char *business_card, ptl_process_t *id, ptl_pt_index_t *pt, ptl_pt_index_t *ptg, ptl_pt_index_t *ptc, ptl_pt_index_t *ptr, ptl_pt_index_t *ptrg, ptl_pt_index_t *ptrc)
{
int mpi_errno = MPI_SUCCESS;
int ret;
int len;
MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
ret = MPL_str_get_binary_arg(business_card, NID_KEY, (char *)&id->phys.nid, sizeof(id->phys.nid), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(id->phys.nid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PID_KEY, (char *)&id->phys.pid, sizeof(id->phys.pid), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(id->phys.pid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTI_KEY, (char *)pt, sizeof(*pt), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*pt), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTIG_KEY, (char *)ptg, sizeof(*ptg), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTIC_KEY, (char *)ptc, sizeof(*ptc), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTIR_KEY, (char *)ptr, sizeof(*ptr), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptr), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTIRG_KEY, (char *)ptrg, sizeof(*ptrg), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptrg), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPL_str_get_binary_arg(business_card, PTIRC_KEY, (char *)ptrc, sizeof(*ptrc), &len);
MPIR_ERR_CHKANDJUMP(ret != MPL_STR_SUCCESS || len != sizeof(*ptrc), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
fn_exit:
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:michael-chuvelev,项目名称:mpich,代码行数:39,代码来源:ptl_init.c
注:本文中的MPIR_ERR_CHKANDJUMP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论