本文整理汇总了C++中MPIU_Free函数的典型用法代码示例。如果您正苦于以下问题:C++ MPIU_Free函数的具体用法?C++ MPIU_Free怎么用?C++ MPIU_Free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MPIU_Free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: RemoveLevel
void RemoveLevel(int rank)
{
RecursionStruct *pLevel = g_pLevel, *pTrailer = g_pLevel;
while (pLevel)
{
if (pLevel->rank == rank)
{
if (pLevel == pTrailer)
{
if (g_pLevel == pLevel)
g_pLevel = g_pLevel->next;
pLevel = pLevel->next;
fclose(pTrailer->fout);
unlink(pTrailer->filename);
MPIU_Free(pTrailer);
pTrailer = pLevel;
}
else
{
pTrailer->next = pLevel->next;
fclose(pLevel->fout);
unlink(pLevel->filename);
MPIU_Free(pLevel);
pLevel = pTrailer->next;
}
}
else
{
if (pTrailer != pLevel)
pTrailer = pTrailer->next;
pLevel = pLevel->next;
}
}
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:34,代码来源:irlog2rlog.c
示例2: MPIU_Thread_cond_signal
void MPIU_Thread_cond_signal(MPIU_Thread_cond_t * cond, int * err)
{
MPIU_Thread_cond_fifo_t *fifo;
MPIU_Thread_mutex_lock(&cond->fifo_mutex, err);
if (err != NULL && *err != MPIU_THREAD_SUCCESS)
{
return;
}
fifo = cond->fifo_head;
if (fifo)
{
cond->fifo_head = cond->fifo_head->next;
if (cond->fifo_head == NULL)
cond->fifo_tail = NULL;
}
MPIU_Thread_mutex_unlock(&cond->fifo_mutex, err);
if (err != NULL && *err != MPIU_THREAD_SUCCESS)
{
return;
}
if (fifo)
{
if (!SetEvent(fifo->event) && err != NULL)
{
*err = GetLastError();
MPIU_Free(fifo);
return;
}
MPIU_Free(fifo);
}
if (err != NULL)
{
*err = MPIU_THREAD_SUCCESS;
}
}
开发者ID:adevress,项目名称:MPICH-BlueGene,代码行数:35,代码来源:mpiu_thread.c
示例3: MPIR_T_enum_env_finalize
static void MPIR_T_enum_env_finalize(void)
{
int i, j;
MPIR_T_enum_t *e;
enum_item_t *item;
if (enum_table) {
/* Free all entries */
for (i = 0; i < utarray_len(enum_table); i++) {
e = (MPIR_T_enum_t *)utarray_eltptr(enum_table, i);
MPIU_Free((void *)e->name);
/* Free items in this enum */
for (j = 0; j < utarray_len(e->items); j++) {
item = (enum_item_t *)utarray_eltptr(e->items, j);
MPIU_Free((void *)item->name);
}
utarray_free(e->items);
}
/* Free enum_table itself */
utarray_free(enum_table);
enum_table = NULL;
}
}
开发者ID:kleiter,项目名称:mpich,代码行数:26,代码来源:mpit_finalize.c
示例4: MPIDI_SHM_Win_free
int MPIDI_SHM_Win_free(MPID_Win **win_ptr)
{
static char FCNAME[] = "MPID_SHM_Win_free";
int rc;
int mpi_errno = MPI_SUCCESS;
/* Free shared memory region */
/* free shm_base_addrs that's only used for shared memory windows */
if ((*win_ptr)->mpid.shm->allocated) {
OPA_fetch_and_add_int((OPA_int_t *) &((*win_ptr)->mpid.shm->ctrl->shm_count),-1);
while((*win_ptr)->mpid.shm->ctrl->shm_count !=0) MPIDI_QUICKSLEEP;
if ((*win_ptr)->comm_ptr->rank == 0) {
MPIDI_SHM_MUTEX_DESTROY(*win_ptr);
}
#ifdef USE_SYSV_SHM
mpi_errno = shmdt((*win_ptr)->mpid.shm->base_addr);
if ((*win_ptr)->comm_ptr->rank == 0) {
rc=shmctl((*win_ptr)->mpid.shm->shm_id,IPC_RMID,NULL);
MPIU_ERR_CHKANDJUMP((rc == -1), errno,MPI_ERR_RMA_SHARED, "**shmctl");
}
#elif USE_MMAP_SHM
munmap ((*win_ptr)->mpid.shm->base_addr, (*win_ptr)->mpid.shm->segment_len);
if (0 == (*win_ptr)->comm_ptr->rank) shm_unlink ((*win_ptr)->mpid.shm->shm_key);
#else
MPID_Abort(NULL, MPI_ERR_RMA_SHARED, -1, "MPI_Win_free error");
#endif
} else {/* one task on a node */
MPIU_Free((*win_ptr)->mpid.shm->base_addr);
}
MPIU_Free((*win_ptr)->mpid.shm);
(*win_ptr)->mpid.shm = NULL;
fn_fail:
return mpi_errno;
}
开发者ID:kleiter,项目名称:mpich,代码行数:35,代码来源:mpid_win_free.c
示例5: MPID_nem_ptl_rptl_ptfini
int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index)
{
int i;
int ret = PTL_OK;
struct rptl *rptl;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
/* find the right rptl */
for (rptl = rptl_info.rptl_list; rptl && rptl->data.pt != pt_index; rptl = rptl->next);
assert(rptl);
/* free control portals that were created */
if (rptl->control.pt != PTL_PT_ANY) {
for (i = 0; i < rptl_info.world_size * 2; i++) {
ret = PtlMEUnlink(rptl->control.me[i]);
RPTLU_ERR_POP(ret, "Error unlinking control buffers\n");
}
MPIU_Free(rptl->control.me);
}
MPL_DL_DELETE(rptl_info.rptl_list, rptl);
MPIU_Free(rptl);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
return ret;
fn_fail:
goto fn_exit;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:32,代码来源:rptl_init.c
示例6: smpd_spn_list_finalize
int smpd_spn_list_finalize(smpd_spn_list_hnd_t *spn_list_hnd_p)
{
smpd_host_spn_node_t *spn_list_head, *cur_node;
smpd_enter_fn(FCNAME);
if(spn_list_hnd_p == NULL){
smpd_err_printf("Invalid pointer to spn list handle\n");
smpd_exit_fn(FCNAME);
return SMPD_FAIL;
}
if(!SMPD_SPN_LIST_HND_IS_INIT(*spn_list_hnd_p)){
smpd_dbg_printf("Trying to finalize an uninitialized handle\n");
smpd_exit_fn(FCNAME);
return SMPD_FAIL;
}
spn_list_head = **spn_list_hnd_p;
while(spn_list_head != NULL){
cur_node = spn_list_head;
spn_list_head = cur_node->next;
MPIU_Free(cur_node);
}
/* Free contents of the spn handle */
MPIU_Free(*spn_list_hnd_p);
*spn_list_hnd_p = NULL;
smpd_exit_fn(FCNAME);
return SMPD_SUCCESS;
}
开发者ID:dbrowneup,项目名称:pmap,代码行数:29,代码来源:smpd_ad.cpp
示例7: MPID_nem_ib_finalize_hash_table
void MPID_nem_ib_finalize_hash_table(
MPID_nem_ib_hash_table_ptr_t table)
{
int i;
MPID_nem_ib_hash_elem_ptr_t start_elem;
MPID_nem_ib_hash_elem_ptr_t elem, next_elem;
pthread_mutex_lock(&table->hash_table_lock);
MPIU_Assert(table->entries != NULL);
for(i = 0; i < table->num_entries; i++) {
start_elem = &table->entries[i];
/* Walk through the list freeing
* elements as we go */
elem = start_elem->next;
while(elem != NULL) {
next_elem = elem->next;
MPIU_Free(elem);
elem = next_elem;
}
}
pthread_mutex_unlock(&table->hash_table_lock);
MPIU_Free(table->entries);
}
开发者ID:hpc,项目名称:mvapich2-cce,代码行数:30,代码来源:ib_ds_hash.c
示例8: MPIR_T_cat_env_finalize
static void MPIR_T_cat_env_finalize(void)
{
int i;
cat_table_entry_t *cat;
if (cat_table) {
/* Free all entries */
for (i = 0; i < utarray_len(cat_table); i++) {
cat = (cat_table_entry_t *)utarray_eltptr(cat_table, i);
MPIU_Free((void *)cat->name);
MPIU_Free((void *)cat->desc);
utarray_free(cat->cvar_indices);
utarray_free(cat->pvar_indices);
utarray_free(cat->subcat_indices);
}
/* Free cat_table itself */
utarray_free(cat_table);
cat_table = NULL;
}
if (cat_hash) {
name2index_hash_t *current, *tmp;
/* Free all entries */
HASH_ITER(hh, cat_hash, current, tmp) {
HASH_DEL(cat_hash, current);
MPIU_Free(current);
}
/* Free cat_hash itself */
HASH_CLEAR(hh, cat_hash);
cat_hash = NULL;
}
开发者ID:kleiter,项目名称:mpich,代码行数:33,代码来源:mpit_finalize.c
示例9: _mxm_handle_sreq
int _mxm_handle_sreq(MPID_Request * req)
{
int complete = FALSE;
MPID_nem_mxm_vc_area *vc_area = NULL;
MPID_nem_mxm_req_area *req_area = NULL;
vc_area = VC_BASE(req->ch.vc);
req_area = REQ_BASE(req);
_dbg_mxm_out_buf(req_area->iov_buf[0].ptr,
(req_area->iov_buf[0].length > 16 ? 16 : req_area->iov_buf[0].length));
vc_area->pending_sends -= 1;
if (req->dev.tmpbuf) {
if (req->dev.datatype_ptr || req->ch.noncontig) {
MPIU_Free(req->dev.tmpbuf);
}
}
if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
MPIU_Free(req_area->iov_buf);
req_area->iov_buf = req_area->tmp_buf;
req_area->iov_count = 0;
}
MPIDI_CH3U_Handle_send_req(req->ch.vc, req, &complete);
MPIU_Assert(complete == TRUE);
return complete;
}
开发者ID:Niharikareddy,项目名称:mpich,代码行数:30,代码来源:mxm_send.c
示例10: MPIDI_Win_GetAccSendAckDoneCB
static void
MPIDI_Win_GetAccSendAckDoneCB(pami_context_t context,
void * _info,
pami_result_t result)
{
MPIDI_Win_GetAccMsgInfo *msginfo = (MPIDI_Win_GetAccMsgInfo *) _info;
MPIU_Free(msginfo->tptr);
MPIU_Free(msginfo);
}
开发者ID:abhinavvishnu,项目名称:matex,代码行数:9,代码来源:mpid_win_get_accumulate.c
示例11: MPIR_FreeProctable
/* This routine is the finalize callback used to free the procable */
static int MPIR_FreeProctable( void *ptable )
{
int i;
MPIR_PROCDESC *proctable = (MPIR_PROCDESC *)ptable;
for (i=0; i<MPIR_proctable_size; i++) {
if (proctable[i].host_name) { MPIU_Free( proctable[i].host_name ); }
}
MPIU_Free( proctable );
return 0;
}
开发者ID:tjhei,项目名称:fgmpi,代码行数:12,代码来源:dbginit.c
示例12: MPID_NS_Free
int MPID_NS_Free( MPID_NS_Handle *handle_ptr )
{
static const char FCNAME[] = "MPID_NS_Free";
int err;
MPIU_Free( (*handle_ptr)->kvsname );
MPIU_Free( *handle_ptr );
*handle_ptr = 0;
return 0;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:11,代码来源:pmi_nameserv.c
示例13: reinit_pmi
static int reinit_pmi(void)
{
int ret;
int has_parent = 0;
int pg_rank, pg_size;
int kvs_name_sz, pg_id_sz;
MPIDI_STATE_DECL(MPID_STATE_REINIT_PMI);
MPIDI_FUNC_ENTER(MPID_STATE_REINIT_PMI);
/* Init pmi and do some sanity checks */
ret = PMI_Init(&has_parent);
CHECK_ERR(ret, "pmi_init");
ret = PMI_Get_rank(&pg_rank);
CHECK_ERR(ret, "pmi_get_rank");
ret = PMI_Get_size(&pg_size);
CHECK_ERR(ret, "pmi_get_size");
CHECK_ERR(pg_size != MPIDI_Process.my_pg->size, "pg size differs after restart");
CHECK_ERR(pg_rank != MPIDI_Process.my_pg_rank, "pg rank differs after restart");
/* get new pg_id */
ret = PMI_KVS_Get_name_length_max(&pg_id_sz);
CHECK_ERR(ret, "pmi_get_id_length_max");
MPIU_Free(MPIDI_Process.my_pg->id);
MPIDI_Process.my_pg->id = MPIU_Malloc(pg_id_sz + 1);
CHECK_ERR(MPIDI_Process.my_pg->id == NULL, "malloc failed");
ret = PMI_KVS_Get_my_name(MPIDI_Process.my_pg->id, pg_id_sz);
CHECK_ERR(ret, "pmi_kvs_get_my_name");
/* get new kvsname */
ret = PMI_KVS_Get_name_length_max(&kvs_name_sz);
CHECK_ERR(ret, "PMI_KVS_Get_name_length_max");
MPIU_Free(MPIDI_Process.my_pg->connData);
MPIDI_Process.my_pg->connData = MPIU_Malloc(kvs_name_sz + 1);
CHECK_ERR(MPIDI_Process.my_pg->connData == NULL, "malloc failed");
ret = PMI_KVS_Get_my_name(MPIDI_Process.my_pg->connData, kvs_name_sz);
CHECK_ERR(ret, "PMI_Get_my_name");
MPIDI_FUNC_EXIT(MPID_STATE_REINIT_PMI);
return 0;
}
开发者ID:adevress,项目名称:MPICH-BlueGene,代码行数:52,代码来源:mpid_nem_ckpt.c
示例14: MPIDI_close_pe_extension
void MPIDI_close_pe_extension() {
extern MPIDI_printenv_t *mpich_env;
extern MPIX_stats_t *mpid_statp;
int rc;
/* PAMI_Extension_open in pami_init */
rc = PAMI_Extension_close (pe_extension);
if (rc != PAMI_SUCCESS) {
TRACE_ERR("ERROR close PAMI_Extension failed rc %d", rc);
}
if (mpich_env)
MPIU_Free(mpich_env);
if (mpid_statp)
MPIU_Free(mpid_statp);
}
开发者ID:adevress,项目名称:MPICH-BlueGene,代码行数:15,代码来源:mpid_finalize.c
示例15: MPIU_Handle_free
/* This routine is called by finalize when MPI exits */
static int MPIU_Handle_free( void *((*indirect)[]), int indirect_size )
{
int i;
/* Remove any allocated storage */
for (i=0; i<indirect_size; i++) {
MPIU_Free( (*indirect)[i] );
}
if (indirect) {
MPIU_Free( indirect );
}
/* This does *not* remove any objects that the user created
and then did not destroy */
return 0;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:16,代码来源:handlemem.c
示例16: smpd_dbs_finalize
int smpd_dbs_finalize()
{
smpd_database_node_t *pNode, *pNext;
smpd_database_element_t *pElement;
smpd_enter_fn(FCNAME);
smpd_process.nInitDBSRefCount--;
if (smpd_process.nInitDBSRefCount == 0)
{
#ifdef USE_WIN_MUTEX_PROTECT
WaitForSingleObject(smpd_process.hDBSMutex, INFINITE);
#endif
/* FIXME: Should this cleanup be done here ?
* This lets one forget to do a smpd_dbs_destroy() for
* every smpd_dbs_create()
*/
pNode = smpd_process.pDatabase;
while (pNode)
{
pNext = pNode->pNext;
while (pNode->pData)
{
pElement = pNode->pData;
pNode->pData = pNode->pData->pNext;
MPIU_Free(pElement);
}
MPIU_Free(pNode);
pNode = pNext;
}
smpd_process.pDatabase = NULL;
smpd_process.pDatabaseIter = NULL;
#ifdef USE_WIN_MUTEX_PROTECT
ReleaseMutex(smpd_process.hDBSMutex);
CloseHandle(smpd_process.hDBSMutex);
smpd_process.hDBSMutex = NULL;
#endif
}
smpd_exit_fn(FCNAME);
return SMPD_DBS_SUCCESS;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:48,代码来源:smpd_database.c
示例17: MPID_nem_newmad_anysource_matched
int MPID_nem_newmad_anysource_matched(MPID_Request *rreq)
{
/* This function is called when an anysource request in the posted
receive queue is matched and dequeued */
nm_sr_request_t *nmad_request = NULL;
int ret;
int matched = FALSE;
#ifdef DEBUG
fprintf(stdout,"========> Any Source : MPID_nem_newmad_anysource_matched , req is %p\n",rreq);
#endif
MPID_NEM_NMAD_GET_REQ_FROM_HASH(rreq,nmad_request);
if(nmad_request != NULL)
{
#ifdef DEBUG
fprintf(stdout,"========> Any Source nmad req found :%p \n",nmad_request);
#endif
ret = nm_sr_rcancel(mpid_nem_newmad_session,nmad_request);
if (ret != NM_ESUCCESS)
{
#ifdef DEBUG
fprintf(stdout,"========> Any Source nmad req (%p) not cancelled \n",nmad_request);
#endif
size_t size;
nm_tag_t match_info;
MPIU_Assert(MPIDI_Request_get_type(rreq) != MPIDI_REQUEST_TYPE_GET_RESP);
ret = nm_sr_rwait(mpid_nem_newmad_session,nmad_request);
MPIU_Assert(ret == NM_ESUCCESS);
nm_sr_request_unset_completion_queue(mpid_nem_newmad_session,nmad_request);
nm_sr_get_rtag(mpid_nem_newmad_session,nmad_request,&match_info);
nm_sr_get_size(mpid_nem_newmad_session,nmad_request,&size);
MPID_nem_newmad_handle_rreq(rreq,match_info, size);
matched = TRUE;
}
else
{
MPID_Segment_free(rreq->dev.segment_ptr);
if (REQ_FIELD(rreq,iov) != NULL)
MPIU_Free(REQ_FIELD(rreq,iov));
}
MPIU_Free(nmad_request);
}
return matched;
}
开发者ID:addy004,项目名称:mpich2-yarn,代码行数:48,代码来源:newmad_poll.c
示例18: MPIU_Error_printf
IRLOG_IOStruct *IRLOG_CreateOutputStruct(const char *filename)
{
IRLOG_IOStruct *pOutput = NULL;
/* allocate a data structure */
pOutput = (IRLOG_IOStruct*)MPIU_Malloc(sizeof(IRLOG_IOStruct));
if (pOutput == NULL)
{
MPIU_Error_printf("malloc failed - %s\n", strerror(errno));
return NULL;
}
/* open the output clog file */
pOutput->f = fopen(filename, "wb");
if (pOutput->f == NULL)
{
MPIU_Error_printf("Unable to open output file '%s' - %s\n", filename, strerror(errno));
MPIU_Free(pOutput);
return NULL;
}
/* set all the data fields */
pOutput->header.type = RLOG_INVALID_TYPE;
pOutput->pCurHeader = pOutput->buffer;
pOutput->pNextHeader = pOutput->buffer;
pOutput->pEnd = &pOutput->buffer[RLOG_BUFFSIZE];
return pOutput;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:29,代码来源:irlogutil.c
示例19: IRLOG_CloseInputStruct
int IRLOG_CloseInputStruct(IRLOG_IOStruct **ppInput)
{
fclose((*ppInput)->f);
MPIU_Free(*ppInput);
*ppInput = NULL;
return 0;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:7,代码来源:irlogutil.c
示例20: MPID_nem_gm_finalize
int
MPID_nem_gm_finalize()
{
int mpi_errno = MPI_SUCCESS;
int max_send_tokens;
MPID_nem_gm_send_queue_t *e;
max_send_tokens = gm_num_send_tokens (MPID_nem_module_gm_port);
while (MPID_nem_module_gm_num_send_tokens < max_send_tokens && !MPID_nem_gm_queue_empty (send))
{
mpi_errno = MPID_nem_gm_recv_poll();
if (mpi_errno) MPIU_ERR_POP (mpi_errno);
}
while (MPID_nem_gm_send_free_queue)
{
e = MPID_nem_gm_send_free_queue;
MPID_nem_gm_send_free_queue = e->next;
MPIU_Free (e);
}
mpi_errno = MPID_nem_gm_lmt_finalize();
if (mpi_errno) MPIU_ERR_POP (mpi_errno);
gm_finalize();
fn_exit:
return mpi_errno;
fn_fail:
goto fn_exit;
}
开发者ID:OngOngoing,项目名称:219351_homework,代码行数:32,代码来源:gm_finalize.c
注:本文中的MPIU_Free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论