本文整理汇总了C++中pmix_output_verbose函数的典型用法代码示例。如果您正苦于以下问题:C++ pmix_output_verbose函数的具体用法?C++ pmix_output_verbose怎么用?C++ pmix_output_verbose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmix_output_verbose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PMIx_Register_errhandler
PMIX_EXPORT void PMIx_Register_errhandler(pmix_info_t info[], size_t ninfo,
pmix_notification_fn_t errhandler,
pmix_errhandler_reg_cbfunc_t cbfunc,
void *cbdata)
{
if (pmix_globals.init_cntr <= 0) {
return;
}
/* common err handler registration */
if (pmix_globals.server) {
/* PMIX server: store the error handler, process info keys and call
* cbfunc with reference to the errhandler */
pmix_output_verbose(2, pmix_globals.debug_output,
"registering server err handler");
pmix_server_register_errhandler(info, ninfo,
errhandler,
cbfunc,cbdata);
} else {
/* PMIX client: store the error handler, process info keys &
* call pmix_server_register_for_events, and call cbfunc with
* reference to the errhandler */
pmix_output_verbose(2, pmix_globals.debug_output,
"registering client err handler");
pmix_client_register_errhandler(info, ninfo,
errhandler,
cbfunc, cbdata);
}
}
示例2: PMIx_Notify_error
PMIX_EXPORT pmix_status_t PMIx_Notify_error(pmix_status_t status,
pmix_proc_t procs[], size_t nprocs,
pmix_proc_t error_procs[], size_t error_nprocs,
pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
if (pmix_globals.init_cntr <= 0) {
return PMIX_ERR_INIT;
}
if (pmix_globals.server) {
rc = pmix_server_notify_error(status, procs, nprocs, error_procs,
error_nprocs, info, ninfo,
cbfunc, cbdata);
pmix_output_verbose(0, pmix_globals.debug_output,
"pmix_server_notify_error error =%d, rc=%d", status, rc);
} else {
rc = pmix_client_notify_error(status, procs, nprocs, error_procs,
error_nprocs, info, ninfo,
cbfunc, cbdata);
pmix_output_verbose(0, pmix_globals.debug_output,
"pmix_client_notify_error error =%d, rc=%d", status, rc);
}
return rc;
}
示例3: _mmap_segment_attach
int _mmap_segment_attach(pmix_sm_seg_t *sm_seg)
{
if (-1 == (sm_seg->seg_id = open(sm_seg->seg_name, O_RDWR))) {
return PMIX_ERROR;
}
if (MAP_FAILED == (sm_seg->seg_base_addr = (unsigned char *)
mmap(NULL, sm_seg->seg_size,
PROT_READ | PROT_WRITE, MAP_SHARED,
sm_seg->seg_id, 0))) {
/* mmap failed, so close the file and return NULL - no error check
* here because we are already in an error path...
*/
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call mmap(2) fail\n");
close(sm_seg->seg_id);
return PMIX_ERROR;
}
/* all is well */
/* if close fails here, that's okay. just let the user know and
* continue. if we got this far, open and mmap were successful...
*/
if (0 != close(sm_seg->seg_id)) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call close(2) fail\n");
}
sm_seg->seg_cpid = 0;/* FIXME */
return PMIX_SUCCESS;
}
示例4: pmix_usock_send_blocking
/*
* A blocking send on a non-blocking socket. Used to send the small amount of connection
* information that identifies the peers endpoint.
*/
pmix_status_t pmix_usock_send_blocking(int sd, char *ptr, size_t size)
{
size_t cnt = 0;
int retval;
pmix_output_verbose(8, pmix_globals.debug_output,
"send blocking of %"PRIsize_t" bytes to socket %d",
size, sd );
while (cnt < size) {
retval = send(sd, (char*)ptr+cnt, size-cnt, 0);
if (retval < 0) {
if (EAGAIN == pmix_socket_errno ||
EWOULDBLOCK == pmix_socket_errno) {
/* just cycle and let it try again */
pmix_output_verbose(8, pmix_globals.debug_output,
"blocking_send received error %d:%s from remote - cycling",
pmix_socket_errno, strerror(pmix_socket_errno));
continue;
}
if (pmix_socket_errno != EINTR) {
pmix_output(8, "usock_peer_send_blocking: send() to socket %d failed: %s (%d)\n",
sd, strerror(pmix_socket_errno),
pmix_socket_errno);
return PMIX_ERR_UNREACH;
}
continue;
}
cnt += retval;
}
pmix_output_verbose(8, pmix_globals.debug_output,
"blocking send complete to socket %d", sd);
return PMIX_SUCCESS;
}
示例5: pmix_bfrop_unpack_array
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
pmix_info_array_t *ptr;
int32_t i, n, m;
pmix_status_t ret;
pmix_output_verbose(20, pmix_globals.debug_output,
"pmix_bfrop_unpack: %d info arrays", *num_vals);
ptr = (pmix_info_array_t*) dest;
n = *num_vals;
for (i = 0; i < n; ++i) {
pmix_output_verbose(20, pmix_globals.debug_output,
"pmix_bfrop_unpack: init array[%d]", i);
memset(&ptr[i], 0, sizeof(pmix_info_array_t));
/* unpack the size of this array */
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_sizet(buffer, &ptr[i].size, &m, PMIX_SIZE))) {
return ret;
}
if (0 < ptr[i].size) {
ptr[i].array = (pmix_info_t*)malloc(ptr[i].size * sizeof(pmix_info_t));
m=ptr[i].size;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_value(buffer, ptr[i].array, &m, PMIX_INFO))) {
return ret;
}
}
}
return PMIX_SUCCESS;
}
示例6: PMIx_Deregister_errhandler
PMIX_EXPORT void PMIx_Deregister_errhandler(int errhandler_ref,
pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
if (pmix_globals.init_cntr <= 0) {
return;
}
if (errhandler_ref < 0) {
return;
}
/* common err handler registration */
if (pmix_globals.server) {
/* PMIX server: store the error handler, process info keys and call
* cbfunc with reference to the errhandler */
pmix_server_deregister_errhandler(errhandler_ref,cbfunc,cbdata);
pmix_output_verbose(2, pmix_globals.debug_output,
"deregistering server err handler");
} else {
/* PMIX client: store the error handler, process info keys &
* call pmix_server_register_for_events, and call cbfunc with
* reference to the errhandler */
pmix_client_deregister_errhandler(errhandler_ref, cbfunc, cbdata);
pmix_output_verbose(2, pmix_globals.debug_output,
"deregistering client err handler");
}
}
示例7: PMIx_Disconnect_nb
int PMIx_Disconnect_nb(const pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
pmix_buffer_t *msg;
pmix_cmd_t cmd = PMIX_DISCONNECTNB_CMD;
int rc;
pmix_cb_t *cb;
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix: disconnect called");
if (pmix_client_globals.init_cntr <= 0) {
return PMIX_ERR_INIT;
}
/* if we aren't connected, don't attempt to send */
if (!pmix_globals.connected) {
return PMIX_ERR_UNREACH;
}
/* check for bozo input */
if (NULL == procs || 0 >= nprocs) {
return PMIX_ERR_BAD_PARAM;
}
msg = PMIX_NEW(pmix_buffer_t);
/* pack the cmd */
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &cmd, 1, PMIX_CMD))) {
PMIX_ERROR_LOG(rc);
return rc;
}
/* pack the number of procs */
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &nprocs, 1, PMIX_SIZE))) {
PMIX_ERROR_LOG(rc);
return rc;
}
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, procs, nprocs, PMIX_PROC))) {
PMIX_ERROR_LOG(rc);
return rc;
}
/* create a callback object as we need to pass it to the
* recv routine so we know which callback to use when
* the return message is recvd */
cb = PMIX_NEW(pmix_cb_t);
cb->op_cbfunc = cbfunc;
cb->cbdata = cbdata;
/* push the message into our event base to send to the server */
PMIX_ACTIVATE_SEND_RECV(&pmix_client_globals.myserver, msg, wait_cbfunc, cb);
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix: disconnect completed");
return PMIX_SUCCESS;
}
示例8: pmix_usock_recv_blocking
/*
* A blocking recv on a non-blocking socket. Used to receive the small amount of connection
* information that identifies the peers endpoint.
*/
pmix_status_t pmix_usock_recv_blocking(int sd, char *data, size_t size)
{
size_t cnt = 0;
pmix_output_verbose(8, pmix_globals.debug_output,
"waiting for blocking recv of %"PRIsize_t" bytes", size);
while (cnt < size) {
int retval = recv(sd, (char *)data+cnt, size-cnt, MSG_WAITALL);
/* remote closed connection */
if (retval == 0) {
pmix_output_verbose(8, pmix_globals.debug_output,
"usock_recv_blocking: remote closed connection");
return PMIX_ERR_UNREACH;
}
/* handle errors */
if (retval < 0) {
if (EAGAIN == pmix_socket_errno ||
EWOULDBLOCK == pmix_socket_errno) {
/* just cycle and let it try again */
pmix_output_verbose(8, pmix_globals.debug_output,
"blocking_recv received error %d:%s from remote - cycling",
pmix_socket_errno, strerror(pmix_socket_errno));
continue;
}
if (pmix_socket_errno != EINTR ) {
/* If we overflow the listen backlog, it's
possible that even though we finished the three
way handshake, the remote host was unable to
transition the connection from half connected
(received the initial SYN) to fully connected
(in the listen backlog). We likely won't see
the failure until we try to receive, due to
timing and the like. The first thing we'll get
in that case is a RST packet, which receive
will turn into a connection reset by peer
errno. In that case, leave the socket in
CONNECT_ACK and propogate the error up to
recv_connect_ack, who will try to establish the
connection again */
pmix_output_verbose(8, pmix_globals.debug_output,
"blocking_recv received error %d:%s from remote - aborting",
pmix_socket_errno, strerror(pmix_socket_errno));
return PMIX_ERR_UNREACH;
}
continue;
}
cnt += retval;
}
pmix_output_verbose(8, pmix_globals.debug_output,
"blocking receive complete from remote");
return PMIX_SUCCESS;
}
示例9: pmix_compress_bzip_compress_nb
int pmix_compress_bzip_compress_nb(char * fname, char **cname, char **postfix, pid_t *child_pid)
{
char **argv = NULL;
char * base_fname = NULL;
char * dir_fname = NULL;
int status;
bool is_dir;
is_dir = is_directory(fname);
*child_pid = fork();
if( *child_pid == 0 ) { /* Child */
char * cmd;
dir_fname = pmix_dirname(fname);
base_fname = pmix_basename(fname);
chdir(dir_fname);
if( is_dir ) {
pmix_asprintf(cname, "%s.tar.bz2", base_fname);
pmix_asprintf(&cmd, "tar -jcf %s %s", *cname, base_fname);
} else {
pmix_asprintf(cname, "%s.bz2", base_fname);
pmix_asprintf(&cmd, "bzip2 %s", base_fname);
}
pmix_output_verbose(10, mca_compress_bzip_component.super.output_handle,
"compress:bzip: compress_nb(%s -> [%s])",
fname, *cname);
pmix_output_verbose(10, mca_compress_bzip_component.super.output_handle,
"compress:bzip: compress_nb() command [%s]",
cmd);
argv = pmix_argv_split(cmd, ' ');
status = execvp(argv[0], argv);
pmix_output(0, "compress:bzip: compress_nb: Failed to exec child [%s] status = %d\n", cmd, status);
exit(PMIX_ERROR);
}
else if( *child_pid > 0 ) {
if( is_dir ) {
*postfix = strdup(".tar.bz2");
} else {
*postfix = strdup(".bz2");
}
pmix_asprintf(cname, "%s%s", fname, *postfix);
}
else {
return PMIX_ERROR;
}
return PMIX_SUCCESS;
}
示例10: pmix_bfrop_unpack_info
pmix_status_t pmix_bfrop_unpack_info(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
pmix_info_t *ptr;
int32_t i, n, m;
pmix_status_t ret;
char *tmp;
pmix_output_verbose(20, pmix_globals.debug_output,
"pmix_bfrop_unpack: %d info", *num_vals);
ptr = (pmix_info_t *) dest;
n = *num_vals;
for (i = 0; i < n; ++i) {
memset(ptr[i].key, 0, sizeof(ptr[i].key));
memset(&ptr[i].value, 0, sizeof(pmix_value_t));
/* unpack key */
m=1;
tmp = NULL;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_string(buffer, &tmp, &m, PMIX_STRING))) {
PMIX_ERROR_LOG(ret);
return ret;
}
if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERROR);
return PMIX_ERROR;
}
(void)strncpy(ptr[i].key, tmp, PMIX_MAX_KEYLEN);
free(tmp);
/* unpack the flags */
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_infodirs(buffer, &ptr[i].flags, &m, PMIX_INFO_DIRECTIVES))) {
PMIX_ERROR_LOG(ret);
return ret;
}
/* unpack value - since the value structure is statically-defined
* instead of a pointer in this struct, we directly unpack it to
* avoid the malloc */
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_int(buffer, &ptr[i].value.type, &m, PMIX_INT))) {
PMIX_ERROR_LOG(ret);
return ret;
}
pmix_output_verbose(20, pmix_globals.debug_output,
"pmix_bfrop_unpack: info type %d", ptr[i].value.type);
m=1;
if (PMIX_SUCCESS != (ret = unpack_val(buffer, &ptr[i].value))) {
PMIX_ERROR_LOG(ret);
return ret;
}
}
return PMIX_SUCCESS;
}
示例11: query_cbfunc
static void query_cbfunc(struct pmix_peer_t *peer,
pmix_ptl_hdr_t *hdr,
pmix_buffer_t *buf, void *cbdata)
{
pmix_query_caddy_t *cd = (pmix_query_caddy_t*)cbdata;
pmix_status_t rc;
pmix_shift_caddy_t *results;
int cnt;
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:query cback from server");
results = PMIX_NEW(pmix_shift_caddy_t);
/* unpack the status */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, peer, buf, &results->status, &cnt, PMIX_STATUS);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
results->status = rc;
goto complete;
}
if (PMIX_SUCCESS != results->status) {
goto complete;
}
/* unpack any returned data */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, peer, buf, &results->ninfo, &cnt, PMIX_SIZE);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
results->status = rc;
goto complete;
}
if (0 < results->ninfo) {
PMIX_INFO_CREATE(results->info, results->ninfo);
cnt = results->ninfo;
PMIX_BFROPS_UNPACK(rc, peer, buf, results->info, &cnt, PMIX_INFO);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
results->status = rc;
goto complete;
}
}
complete:
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:query cback from server releasing");
/* release the caller */
if (NULL != cd->cbfunc) {
cd->cbfunc(results->status, results->info, results->ninfo, cd->cbdata, relcbfunc, results);
}
PMIX_RELEASE(cd);
}
示例12: pmix_bfrops_base_unpack_pdata
pmix_status_t pmix_bfrops_base_unpack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
pmix_pdata_t *ptr;
int32_t i, n, m;
pmix_status_t ret;
char *tmp;
pmix_output_verbose(20, pmix_bfrops_base_framework.framework_output,
"pmix_bfrop_unpack: %d pdata", *num_vals);
ptr = (pmix_pdata_t *) dest;
n = *num_vals;
for (i = 0; i < n; ++i) {
PMIX_PDATA_CONSTRUCT(&ptr[i]);
/* unpack the proc */
m=1;
PMIX_BFROPS_UNPACK_TYPE(ret, buffer, &ptr[i].proc, &m, PMIX_PROC, regtypes);
if (PMIX_SUCCESS != ret) {
return ret;
}
/* unpack key */
m=1;
tmp = NULL;
PMIX_BFROPS_UNPACK_TYPE(ret, buffer, &tmp, &m, PMIX_STRING, regtypes);
if (PMIX_SUCCESS != ret) {
return ret;
}
if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERROR);
return PMIX_ERROR;
}
pmix_strncpy(ptr[i].key, tmp, PMIX_MAX_KEYLEN);
free(tmp);
/* unpack value - since the value structure is statically-defined
* instead of a pointer in this struct, we directly unpack it to
* avoid the malloc */
if (PMIX_SUCCESS != (ret = pmix_bfrop_get_data_type(regtypes, buffer, &ptr[i].value.type))) {
PMIX_ERROR_LOG(ret);
return ret;
}
pmix_output_verbose(20, pmix_bfrops_base_framework.framework_output,
"pmix_bfrop_unpack: pdata type %d %s", ptr[i].value.type, ptr[i].value.data.string);
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_val(regtypes, buffer, &ptr[i].value))) {
PMIX_ERROR_LOG(ret);
return ret;
}
}
return PMIX_SUCCESS;
}
示例13: pmix_bfrops_base_unpack_info
pmix_status_t pmix_bfrops_base_unpack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
pmix_info_t *ptr;
int32_t i, n, m;
pmix_status_t ret;
char *tmp;
pmix_output_verbose(20, pmix_bfrops_base_framework.framework_output,
"pmix_bfrop_unpack: %d info", *num_vals);
ptr = (pmix_info_t *) dest;
n = *num_vals;
for (i = 0; i < n; ++i) {
memset(ptr[i].key, 0, sizeof(ptr[i].key));
memset(&ptr[i].value, 0, sizeof(pmix_value_t));
/* unpack key */
m=1;
tmp = NULL;
PMIX_BFROPS_UNPACK_TYPE(ret, buffer, &tmp, &m, PMIX_STRING, regtypes);
if (PMIX_SUCCESS != ret) {
PMIX_ERROR_LOG(ret);
return ret;
}
if (NULL == tmp) {
return PMIX_ERROR;
}
pmix_strncpy(ptr[i].key, tmp, PMIX_MAX_KEYLEN);
free(tmp);
/* unpack the directives */
m=1;
PMIX_BFROPS_UNPACK_TYPE(ret, buffer, &ptr[i].flags, &m, PMIX_INFO_DIRECTIVES, regtypes);
if (PMIX_SUCCESS != ret) {
return ret;
}
/* unpack value - since the value structure is statically-defined
* instead of a pointer in this struct, we directly unpack it to
* avoid the malloc */
if (PMIX_SUCCESS != (ret = pmix_bfrop_get_data_type(regtypes, buffer, &ptr[i].value.type))) {
return ret;
}
pmix_output_verbose(20, pmix_bfrops_base_framework.framework_output,
"pmix_bfrop_unpack: info type %d", ptr[i].value.type);
m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_val(regtypes, buffer, &ptr[i].value))) {
return ret;
}
}
return PMIX_SUCCESS;
}
示例14: _mmap_segment_create
int _mmap_segment_create(pmix_sm_seg_t *sm_seg, const char *file_name, size_t size)
{
int rc = PMIX_SUCCESS;
void *seg_addr = MAP_FAILED;
pid_t my_pid = getpid();
_segment_ds_reset(sm_seg);
/* enough space is available, so create the segment */
if (-1 == (sm_seg->seg_id = open(file_name, O_CREAT | O_RDWR, 0600))) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call open(2) fail\n");
rc = PMIX_ERROR;
goto out;
}
/* size backing file - note the use of real_size here */
if (0 != ftruncate(sm_seg->seg_id, size)) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call ftruncate(2) fail\n");
rc = PMIX_ERROR;
goto out;
}
if (MAP_FAILED == (seg_addr = mmap(NULL, size,
PROT_READ | PROT_WRITE, MAP_SHARED,
sm_seg->seg_id, 0))) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call mmap(2) fail\n");
rc = PMIX_ERROR;
goto out;
}
sm_seg->seg_cpid = my_pid;
sm_seg->seg_size = size;
sm_seg->seg_base_addr = (unsigned char *)seg_addr;
(void)strncpy(sm_seg->seg_name, file_name, PMIX_PATH_MAX - 1);
out:
if (-1 != sm_seg->seg_id) {
if (0 != close(sm_seg->seg_id)) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call close(2) fail\n");
rc = PMIX_ERROR;
}
}
/* an error occured, so invalidate the shmem object and munmap if needed */
if (PMIX_SUCCESS != rc) {
if (MAP_FAILED != seg_addr) {
munmap((void *)seg_addr, size);
}
_segment_ds_reset(sm_seg);
}
return rc;
}
示例15: pmix_output_hexdump
void pmix_output_hexdump(int verbose_level, int output_id,
void *ptr, int buflen)
{
unsigned char *buf = (unsigned char *) ptr;
char out_buf[120];
int ret = 0;
int out_pos = 0;
int i, j;
if (output_id >= 0 && output_id < PMIX_OUTPUT_MAX_STREAMS &&
info[output_id].ldi_verbose_level >= verbose_level) {
pmix_output_verbose(verbose_level, output_id, "dump data at %p %d bytes\n", ptr, buflen);
for (i = 0; i < buflen; i += 16) {
out_pos = 0;
ret = sprintf(out_buf + out_pos, "%06x: ", i);
if (ret < 0)
return;
out_pos += ret;
for (j = 0; j < 16; j++) {
if (i + j < buflen)
ret = sprintf(out_buf + out_pos, "%02x ",
buf[i + j]);
else
ret = sprintf(out_buf + out_pos, " ");
if (ret < 0)
return;
out_pos += ret;
}
ret = sprintf(out_buf + out_pos, " ");
if (ret < 0)
return;
out_pos += ret;
for (j = 0; j < 16; j++)
if (i + j < buflen) {
ret = sprintf(out_buf + out_pos, "%c",
isprint(buf[i+j]) ?
buf[i + j] :
'.');
if (ret < 0)
return;
out_pos += ret;
}
ret = sprintf(out_buf + out_pos, "\n");
if (ret < 0)
return;
pmix_output_verbose(verbose_level, output_id, "%s", out_buf);
}
}
}