⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ns_replica_recv.c

📁 MPI stands for the Message Passing Interface. Written by the MPI Forum (a large committee comprising
💻 C
📖 第 1 页 / 共 2 页
字号:
                    goto RETURN_ERROR;                }                break;                    case ORTE_NS_GET_ROOT_JOB_CMD:            count = 1;            if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&job, &count, ORTE_JOBID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (ORTE_SUCCESS != (rc = orte_ns_replica_get_root_job(&root, job))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                        if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&root, 1, ORTE_JOBID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (0 > (rc = orte_rml.send_buffer(sender, &answer, tag, 0))) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_GET_PARENT_JOB_CMD:            count = 1;            if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&job, &count, ORTE_JOBID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                            if (ORTE_SUCCESS != (rc = orte_ns_replica_get_parent_job(&root, job))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                        if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&root, 1, ORTE_JOBID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                        if (0 > (rc = orte_rml.send_buffer(sender, &answer, tag, 0))) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                                case ORTE_NS_RESERVE_RANGE_CMD:            count = 1;            if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&job, &count, ORTE_JOBID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                            count = 1;            if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&range, &count, ORTE_VPID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                            if (ORTE_SUCCESS != (rc = orte_ns_replica_reserve_range(job, range, &startvpid))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                       if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&startvpid, 1, ORTE_VPID))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                        if (0 > (rc = orte_rml.send_buffer(sender, &answer, tag, 0))) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_ASSIGN_OOB_TAG_CMD:            count = 1;            if (0 > orte_dss.unpack(buffer, &tagname, &count, ORTE_STRING)) {                rc = ORTE_ERR_UNPACK_FAILURE;                goto RETURN_ERROR;            }                            if (0 == strncmp(tagname, "NULL", 4)) {                if (ORTE_SUCCESS != (rc = orte_ns_replica_assign_rml_tag(&oob_tag, NULL))) {                    goto RETURN_ERROR;                }            } else {                if (ORTE_SUCCESS != (rc = orte_ns_replica_assign_rml_tag(&oob_tag, tagname))) {                    goto RETURN_ERROR;                }            }                        if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&oob_tag, 1, ORTE_RML_TAG))) {                goto RETURN_ERROR;            }                        if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_DEFINE_DATA_TYPE_CMD:            count = 1;            if (0 > orte_dss.unpack(buffer, &tagname, &count, ORTE_STRING)) {                rc = ORTE_ERR_UNPACK_FAILURE;                goto RETURN_ERROR;            }                            if (ORTE_SUCCESS != (rc = orte_ns_replica_define_data_type(tagname, &type))) {                goto RETURN_ERROR;            }                        if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&type, 1, ORTE_DATA_TYPE))) {                goto RETURN_ERROR;            }                        if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_CREATE_MY_NAME_CMD:            /* ignore this command */            break;                    case ORTE_NS_GET_PEERS_CMD:            /* get the list of attributes */            OBJ_CONSTRUCT(&attrs, opal_list_t);            count = 1;            if(ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, &attrs, &count, ORTE_ATTR_LIST))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                            /* process the request */            if (ORTE_SUCCESS != (rc = orte_ns_replica_get_peers(&procs, &nprocs, &attrs))) {                ORTE_ERROR_LOG(rc);                OBJ_DESTRUCT(&attrs);                goto RETURN_ERROR;            }            OBJ_DESTRUCT(&attrs);                        /* pack the answer */            if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, &nprocs, 1, ORTE_STD_CNTR))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }                        if (nprocs > 0) {                if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, procs, nprocs, ORTE_NAME))) {                    ORTE_ERROR_LOG(rc);                    goto RETURN_ERROR;                }            }                            if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_DUMP_CELLS_CMD:            if (ORTE_SUCCESS != (rc = orte_ns_replica_dump_cells_fn(&answer))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_DUMP_JOBIDS_CMD:            if (ORTE_SUCCESS != (rc = orte_ns_replica_dump_jobs_fn(&answer))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_DUMP_TAGS_CMD:            if (ORTE_SUCCESS != (rc = orte_ns_replica_dump_tags_fn(&answer))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    case ORTE_NS_DUMP_DATATYPES_CMD:            if (ORTE_SUCCESS != (rc = orte_ns_replica_dump_datatypes_fn(&answer))) {                ORTE_ERROR_LOG(rc);                goto RETURN_ERROR;            }            if (0 > orte_rml.send_buffer(sender, &answer, tag, 0)) {                ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);                goto RETURN_ERROR;            }            break;                    default:            goto RETURN_ERROR;    }    goto CLEANUP;    RETURN_ERROR:    OBJ_CONSTRUCT(&error_answer, orte_buffer_t);    orte_dss.pack(&error_answer, (void*)&command, 1, ORTE_NS_CMD);    orte_dss.pack(&error_answer, (void*)&rc, 1, ORTE_INT32);    orte_rml.send_buffer(sender, &error_answer, tag, 0);    OBJ_DESTRUCT(&error_answer);    CLEANUP:        /* cleanup */        OBJ_DESTRUCT(&answer);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -