本文整理汇总了C++中MPI_Info_free函数的典型用法代码示例。如果您正苦于以下问题:C++ MPI_Info_free函数的具体用法?C++ MPI_Info_free怎么用?C++ MPI_Info_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MPI_Info_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
MPI_Info i1, i2;
int errs = 0;
char value[64];
int flag;
MTest_Init(&argc, &argv);
MPI_Info_create(&i1);
MPI_Info_create(&i2);
MPI_Info_set(i1, (char *) "key1", (char *) "value1");
MPI_Info_set(i2, (char *) "key2", (char *) "value2");
MPI_Info_get(i1, (char *) "key2", 64, value, &flag);
if (flag) {
printf("Found key2 in info1\n");
errs++;
}
MPI_Info_get(i1, (char *) "key1", 64, value, &flag);
if (!flag) {
errs++;
printf("Did not find key1 in info1\n");
} else if (strcmp(value, "value1")) {
errs++;
printf("Found wrong value (%s), expected value1\n", value);
}
MPI_Info_free(&i1);
MPI_Info_free(&i2);
MTest_Finalize(errs);
return MTestReturnValue(errs);
}
开发者ID:ParaStation,项目名称:psmpi2,代码行数:34,代码来源:infotest.c
示例2: main
int main(int argc, char *argv[]) {
int thread_support;
char root_path[MPI_PMEM_MAX_ROOT_PATH];
MPI_Info info;
MPI_Win_pmem win;
char *window_name = "test_window";
char *win_data;
MPI_Aint win_size = 1024;
int error_code;
int result = 0;
MPI_Init_thread_pmem(&argc, &argv, MPI_THREAD_MULTIPLE, &thread_support);
sprintf(root_path, "%s/0", argv[1]);
MPI_Win_pmem_set_root_path(root_path);
// Allocate window.
MPI_Info_create(&info);
MPI_Info_set(info, "pmem_is_pmem", "true");
MPI_Info_set(info, "pmem_name", window_name);
MPI_Info_set(info, "pmem_mode", "checkpoint");
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
error_code = MPI_Win_allocate_pmem(win_size, 1, info, MPI_COMM_WORLD, &win_data, &win);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
MPI_Info_free(&info);
if (error_code != MPI_ERR_PMEM_NAME) {
mpi_log_error("Error code is %d, expected %d.", error_code, MPI_ERR_PMEM_NAME);
result = 1;
}
MPI_Finalize_pmem();
return result;
}
开发者ID:pmem,项目名称:mpi-pmem-ext,代码行数:34,代码来源:MPI_Win_allocate_pmem_checkpoint_non_existing.c
示例3: main
int main(int argc, char* argv[])
{
MPI_Init(&argc,&argv);
MPI_Aint bytes = (argc>1) ? atol(argv[1]) : 128*1024*1024;
printf("bytes = %zu\n", bytes);
MPI_Comm comm_shared = MPI_COMM_NULL;
MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0 /* key */, MPI_INFO_NULL, &comm_shared);
MPI_Info info_win = MPI_INFO_NULL;
MPI_Info_create(&info_win);
MPI_Info_set(info_win, "alloc_shared_noncontig", "true");
MPI_Win win_shared = MPI_WIN_NULL;
void * base_ptr = NULL;
int rc = MPI_Win_allocate_shared(bytes, 1 /* disp_unit */, info_win, comm_shared, &base_ptr, &win_shared);
memset(base_ptr,255,bytes);
MPI_Info_free(&info_win);
MPI_Comm_free(&comm_shared);
MPI_Finalize();
return 0;
}
开发者ID:jeffhammond,项目名称:oshmpi,代码行数:26,代码来源:win_alloc_shared.c
示例4: serverWinCreate
static void
serverWinCreate(void)
{
int ranks[1], modelID;
MPI_Comm commCalc = commInqCommCalc ();
MPI_Group groupCalc;
int nProcsModel = commInqNProcsModel ();
MPI_Info no_locks_info;
xmpi(MPI_Info_create(&no_locks_info));
xmpi(MPI_Info_set(no_locks_info, "no_locks", "true"));
xmpi(MPI_Win_create(MPI_BOTTOM, 0, 1, no_locks_info, commCalc, &getWin));
/* target group */
ranks[0] = nProcsModel;
xmpi ( MPI_Comm_group ( commCalc, &groupCalc ));
xmpi ( MPI_Group_excl ( groupCalc, 1, ranks, &groupModel ));
rxWin = xcalloc((size_t)nProcsModel, sizeof (rxWin[0]));
size_t totalBufferSize = collDefBufferSizes();
rxWin[0].buffer = (unsigned char*) xmalloc(totalBufferSize);
size_t ofs = 0;
for ( modelID = 1; modelID < nProcsModel; modelID++ )
{
ofs += rxWin[modelID - 1].size;
rxWin[modelID].buffer = rxWin[0].buffer + ofs;
}
xmpi(MPI_Info_free(&no_locks_info));
xdebug("%s", "created mpi_win, allocated getBuffer");
}
开发者ID:AZed,项目名称:cdo,代码行数:32,代码来源:pio_server.c
示例5: MPI_Info_create
void *mpp_alloc (size_t len)
{
MPI_Info info;
void *buf = NULL;
#if HAVE_MPI_ALLOC_MEM
if (use_mpi_alloc) {
MPI_Info_create (&info);
#if 0
MPI_Info_set (info, "alignment", "4096");
MPI_Info_set (info, "type", "private");
#endif
MPI_Alloc_mem (len, info, &buf);
MPI_Info_free (&info);
} else
#endif
buf = malloc(len);
if (buf == NULL) {
fprintf (stderr, "Could not allocate %d byte buffer\n", len);
MPI_Abort (MPI_COMM_WORLD, -1);
}
return buf;
}
开发者ID:RWTH-OS,项目名称:MP-MPICH,代码行数:25,代码来源:mem.c
示例6: mpi_info_free_
void mpi_info_free_(MPI_Fint *info, int *ierr )
{
MPI_Info info_c;
info_c = MPI_Info_f2c(*info);
*ierr = MPI_Info_free(&info_c);
*info = MPI_Info_c2f(info_c);
}
开发者ID:DmitrySigaev,项目名称:ompi-release,代码行数:8,代码来源:info_freef.c
示例7: main
int main(int argc, char **argv)
{
int rank;
MPI_Info info_in, info_out;
int errors = 0, all_errors = 0;
MPI_Comm comm;
char __attribute__((unused)) invalid_key[] = "invalid_test_key";
char buf[MPI_MAX_INFO_VAL];
int flag;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Info_create(&info_in);
MPI_Info_set(info_in, invalid_key, (char *) "true");
MPI_Comm_dup(MPI_COMM_WORLD, &comm);
MPI_Comm_set_info(comm, info_in);
MPI_Comm_get_info(comm, &info_out);
MPI_Info_get(info_out, invalid_key, MPI_MAX_INFO_VAL, buf, &flag);
#ifndef USE_STRICT_MPI
/* Check if our invalid key was ignored. Note, this check's MPICH's
* behavior, but this behavior may not be required for a standard
* conforming MPI implementation. */
if (flag) {
printf("%d: %s was not ignored\n", rank, invalid_key);
errors++;
}
#endif
MPI_Info_free(&info_in);
MPI_Info_free(&info_out);
MPI_Comm_free(&comm);
MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
if (rank == 0 && all_errors == 0)
printf(" No Errors\n");
MPI_Finalize();
return 0;
}
开发者ID:Julio-Anjos,项目名称:simgrid,代码行数:46,代码来源:comm_info.c
示例8: main
int main(int argc, char ** argv)
{
MPI_Info info = MPI_INFO_NULL;
MPI_File fh;
MPI_Offset off=0;
MPI_Status status;
int errcode;
int i, rank, errs=0, toterrs, buffer[BUFSIZE], buf2[BUFSIZE];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Info_create(&info);
MPI_Info_set(info, "romio_cb_write", "enable");
MPI_Info_set(info, "cb_nodes", "1");
for (i=0; i<BUFSIZE; i++) {
buffer[i] = 10000+rank;
}
off = rank*sizeof(buffer);
errcode = MPI_File_open(MPI_COMM_WORLD, argv[1],
MPI_MODE_WRONLY|MPI_MODE_CREATE, info, &fh);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_open");
errcode = MPI_File_write_at_all(fh, off, buffer, BUFSIZE,
MPI_INT, &status);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_write_at_all");
errcode = MPI_File_close(&fh);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_close");
errcode = MPI_File_open(MPI_COMM_WORLD, argv[1],
MPI_MODE_RDONLY, info, &fh);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_open");
errcode = MPI_File_read_at_all(fh, off, buf2, BUFSIZE,
MPI_INT, &status);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_read_at_all");
errcode = MPI_File_close(&fh);
if (errcode != MPI_SUCCESS) handle_error(errcode, "MPI_File_close");
for (i=0; i<BUFSIZE; i++) {
if (buf2[i] != 10000+rank)
errs++;
}
MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0) {
if( toterrs > 0) {
fprintf( stderr, "Found %d errors\n", toterrs );
}
else {
fprintf( stdout, " No Errors\n" );
}
}
MPI_Info_free(&info);
MPI_Finalize();
return 0;
}
开发者ID:DmitrySigaev,项目名称:ompi-release,代码行数:58,代码来源:aggregation2.c
示例9: dump_mpi_file_info
static void dump_mpi_file_info( MPI_File f, const char * prefix = NULL ) {
MPI_Info info;
MPI_CHECK( MPI_File_get_info( f, &info ) );
dump_mpi_info( info, prefix );
MPI_CHECK( MPI_Info_free( &info ) );
}
开发者ID:HPCProjectsTry,项目名称:grappa,代码行数:9,代码来源:FileIO.cpp
示例10: main
int
main( int argc, char *argv[] ) {
int nproc = 1, rank = 0;
char *target = NULL;
int c;
MPI_Info info;
int mpi_ret;
int corrupt_blocks = 0;
MPI_Init( &argc, &argv );
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if( (mpi_ret = MPI_Info_create(&info)) != MPI_SUCCESS) {
if(rank == 0) fatal_error( mpi_ret, NULL, "MPI_info_create.\n");
}
prog = strdup( argv[0] );
while( ( c = getopt( argc, argv, "df:h" ) ) != EOF ) {
switch( c ) {
case 'd':
debug = 1;
break;
case 'f':
target = strdup( optarg );
break;
case 'h':
set_hints( &info );
break;
default:
Usage( __LINE__ );
}
}
if ( ! target ) {
Usage( __LINE__ );
}
write_file( target, rank, &info );
read_file( target, rank, &info, &corrupt_blocks );
corrupt_blocks = reduce_corruptions( corrupt_blocks );
if ( rank == 0 ) {
if (corrupt_blocks == 0) {
fprintf(stdout, " No Errors\n");
} else {
fprintf(stdout, "%d/%d blocks corrupt\n",
corrupt_blocks, nproc * NUM_OBJS );
}
}
MPI_Info_free(&info);
MPI_Finalize();
free(prog);
exit( 0 );
}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:56,代码来源:aggregation1.c
示例11: win_info_set
static void win_info_set(MPI_Win win, const char *key, const char *set_val)
{
MPI_Info info_in = MPI_INFO_NULL;
MPI_Info_create(&info_in);
MPI_Info_set(info_in, key, set_val);
MPI_Win_set_info(win, info_in);
MPI_Info_free(&info_in);
}
开发者ID:NexMirror,项目名称:MPICH,代码行数:10,代码来源:win_info.c
示例12: ADIO_End
void ADIO_End(int *error_code)
{
ADIOI_Flatlist_node *curr, *next;
ADIOI_Datarep *datarep, *datarep_next;
/* FPRINTF(stderr, "reached end\n"); */
/* if a default errhandler was set on MPI_FILE_NULL then we need to ensure
* that our reference to that errhandler is released */
/* Open MPI: The call to PMPI_File_set_errhandler has to be done in romio/src/io_romio_file_open.c
in routine mca_io_romio_file_close()
*/
#if 0
PMPI_File_set_errhandler(MPI_FILE_NULL, MPI_ERRORS_RETURN);
#endif
/* delete the flattened datatype list */
curr = ADIOI_Flatlist;
while (curr) {
if (curr->blocklens) ADIOI_Free(curr->blocklens);
if (curr->indices) ADIOI_Free(curr->indices);
next = curr->next;
ADIOI_Free(curr);
curr = next;
}
ADIOI_Flatlist = NULL;
/* free file and info tables used for Fortran interface */
if (ADIOI_Ftable) ADIOI_Free(ADIOI_Ftable);
#ifndef HAVE_MPI_INFO
if (MPIR_Infotable) ADIOI_Free(MPIR_Infotable);
#endif
/* free the memory allocated for a new data representation, if any */
datarep = ADIOI_Datarep_head;
while (datarep) {
datarep_next = datarep->next;
ADIOI_Free(datarep->name);
ADIOI_Free(datarep);
datarep = datarep_next;
}
if( ADIOI_syshints != MPI_INFO_NULL)
MPI_Info_free(&ADIOI_syshints);
MPI_Op_free(&ADIO_same_amode);
*error_code = MPI_SUCCESS;
}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:50,代码来源:ad_end.c
示例13: IMB_print_info
void IMB_print_info()
/*
Prints MPI_Info selections (MPI-2 only)
*/
{
int nkeys,ikey,vlen,exists;
MPI_Info tmp_info;
char key[MPI_MAX_INFO_KEY], *value;
IMB_user_set_info(&tmp_info);
/* July 2002 fix V2.2.1: handle NULL case */
if( tmp_info!=MPI_INFO_NULL )
{
/* end change */
MPI_Info_get_nkeys(tmp_info, &nkeys);
if( nkeys > 0) fprintf(unit,"# Got %d Info-keys:\n\n",nkeys);
for( ikey=0; ikey<nkeys; ikey++ )
{
MPI_Info_get_nthkey(tmp_info, ikey, key);
MPI_Info_get_valuelen(tmp_info, key, &vlen, &exists);
value = (char*)IMB_v_alloc((vlen+1)* sizeof(char), "Print_Info");
MPI_Info_get(tmp_info, key, vlen, value, &exists);
printf("# %s = \"%s\"\n",key,value);
IMB_v_free ((void**)&value);
}
MPI_Info_free(&tmp_info);
/* July 2002 fix V2.2.1: end if */
}
/* end change */
}
开发者ID:hoelzlw,项目名称:hpc-lab,代码行数:46,代码来源:IMB_output.c
示例14: ncmpio_free_NC
/*----< ncmpio_free_NC() >----------------------------------------------------*/
void
ncmpio_free_NC(NC *ncp)
{
if (ncp == NULL) return;
ncmpio_free_NC_dimarray(&ncp->dims);
ncmpio_free_NC_attrarray(&ncp->attrs);
ncmpio_free_NC_vararray(&ncp->vars);
if (ncp->mpiinfo != MPI_INFO_NULL) MPI_Info_free(&ncp->mpiinfo);
if (ncp->get_list != NULL) NCI_Free(ncp->get_list);
if (ncp->put_list != NULL) NCI_Free(ncp->put_list);
if (ncp->abuf != NULL) NCI_Free(ncp->abuf);
if (ncp->path != NULL) NCI_Free(ncp->path);
NCI_Free(ncp);
}
开发者ID:live-clones,项目名称:pnetcdf,代码行数:19,代码来源:ncmpio_close.c
示例15: main
int main(int argc, char * argv[])
{
MPI_Init(&argc, &argv);
int wrank, wsize;
MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
MPI_Comm_size(MPI_COMM_WORLD, &wsize);
int nrank, nsize;
MPI_Comm MPI_COMM_NODE;
MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0 /* key */, MPI_INFO_NULL, &MPI_COMM_NODE);
MPI_Comm_rank(MPI_COMM_NODE, &nrank);
MPI_Comm_size(MPI_COMM_NODE, &nsize);
int * shptr = NULL;
MPI_Win shwin;
MPI_Info win_info;
MPI_Info_create(&win_info);
MPI_Info_set(win_info, "alloc_shared_noncontig", "true");
MPI_Win_allocate_shared(sizeof(int), sizeof(int), win_info, MPI_COMM_NODE, &shptr, &shwin);
MPI_Info_free(&win_info);
MPI_Win_lock_all(0 /* assertion */, shwin);
MPI_Win_sync(shwin);
MPI_Barrier(MPI_COMM_NODE);
MPI_Aint rsize[nsize];
int rdisp[nsize];
int * rptr[nsize];
for (int i=0; i<nsize; i++) {
MPI_Win_shared_query(shwin, i, &(rsize[i]), &(rdisp[i]), &(rptr[i]));
printf("rank=%d target=%d rptr=%p rsize=%zu rdisp=%d \n", nrank, i, rptr[i], (size_t)rsize[i], rdisp[i]);
}
MPI_Win_unlock_all(shwin);
MPI_Win_free(&shwin);
MPI_Comm_free(&MPI_COMM_NODE);
MPI_Finalize();
return 0;
}
开发者ID:jeffhammond,项目名称:MPI-plus-MPI-slides,代码行数:44,代码来源:hello-mpi.c
示例16: launch_turbine
int launch_turbine(MPI_Comm comm, char* cmd, int argc, char** argv) {
int status = 0;
char** argvc = (char**)malloc((argc+1)*sizeof(char*));
int i;
for(i=0; i<argc; i++) {
argvc[i] = argv[i];
}
argvc[argc] = NULL;
MPI_Info info;
MPI_Info_create(&info);
MPI_Info_set(info,"launcher","turbine");
MPIX_Comm_launch(cmd, argvc, info, 0, comm, &status);
MPI_Info_free(&info);
free(argvc);
if(comm != MPI_COMM_SELF) {
MPI_Comm_free(&comm);
}
return status;
}
开发者ID:swift-lang,项目名称:swift-t,代码行数:19,代码来源:launch.c
示例17: oshmpi_allock
void oshmpi_allock(MPI_Comm comm)
{
MPI_Info lock_info=MPI_INFO_NULL;
MPI_Info_create(&lock_info);
/* We define the sheap size to be symmetric and assume it for the global static data. */
MPI_Info_set(lock_info, "same_size", "true");
MPI_Win_allocate (4 * sizeof (int), sizeof (int), lock_info,
comm, &oshmpi_lock_base, &oshmpi_lock_win);
oshmpi_lock_base[NEXT_DISP] = -1;
oshmpi_lock_base[PREV_DISP] = -1;
oshmpi_lock_base[TAIL_DISP] = -1;
oshmpi_lock_base[LOCK_DISP] = -1;
MPI_Win_lock_all (TAIL, oshmpi_lock_win);
MPI_Info_free(&lock_info);
return;
}
开发者ID:jeffhammond,项目名称:oshmpi,代码行数:20,代码来源:oshmpi-mcs-lock.c
示例18: f_numagg
void f_numagg(hid_t *file_id, int *num)
{
#ifndef USE_HDF5
*num = 0;
#else
int ierr;
MPI_File *pFH = NULL;
MPI_Info infoF = MPI_INFO_NULL;
T3PIO_results_t results;
ierr = MPI_Info_create(&infoF);
ierr = H5Fget_vfd_handle(*file_id, H5P_DEFAULT, (void **) &pFH);
ierr = MPI_File_get_info(*pFH, &infoF);
t3pio_extract_key_values(infoF, &results);
*num = results.numIO;
ierr = MPI_Info_free(&infoF);
#endif
}
开发者ID:TACC,项目名称:t3pio,代码行数:20,代码来源:numaggregators.c
示例19: main
int main(int argc, char *argv[]) {
int thread_support;
MPI_Info info;
int parsed;
int result = 0;
MPI_Init_thread_pmem(&argc, &argv, MPI_THREAD_MULTIPLE, &thread_support);
MPI_Info_create(&info);
parse_mpi_info_checkpoint_version(MPI_COMM_WORLD, info, &parsed);
MPI_Info_free(&info);
if (parsed != -1) {
mpi_log_error("Checkpoint version is %d, expected -1.", parsed);
result = 1;
}
MPI_Finalize_pmem();
return result;
}
开发者ID:pmem,项目名称:mpi-pmem-ext,代码行数:21,代码来源:parse_mpi_info_checkpoint_version_not_set.c
示例20: main
int main(int argc, char *argv[]) {
int thread_support;
char root_path[MPI_PMEM_MAX_ROOT_PATH];
MPI_Info info;
MPI_Win_pmem win, expected_win;
char win_data[1024];
MPI_Aint win_size = 1024;
int result = 0;
MPI_Init_thread_pmem(&argc, &argv, MPI_THREAD_MULTIPLE, &thread_support);
sprintf(root_path, "%s/0", argv[1]);
MPI_Win_pmem_set_root_path(root_path);
MPI_Info_create(&info);
MPI_Info_set(info, "pmem_is_pmem", "true");
MPI_Win_create_pmem(win_data, win_size, 1, info, MPI_COMM_WORLD, &win);
MPI_Info_set(info, "pmem_is_pmem", "false");
MPI_Info_set(info, "pmem_dont_use_transactions", "true");
MPI_Info_set(info, "pmem_keep_all_checkpoints", "true");
MPI_Info_set(info, "pmem_volatile", "true");
MPI_Info_set(info, "pmem_name", "test_window");
MPI_Info_set(info, "pmem_mode", "checkpoint");
MPI_Info_set(info, "pmem_checkpoint_version", "-1");
MPI_Info_set(info, "pmem_append_checkpoints", "true");
MPI_Info_set(info, "pmem_global_checkpoint", "true");
MPI_Win_set_info_pmem(win, info);
MPI_Info_free(&info);
set_default_window_metadata(&expected_win, MPI_COMM_WORLD);
expected_win.is_pmem = true;
result |= check_window_object(win, expected_win, false, true);
result |= check_memory_areas_list_element(win.modifiable_values->memory_areas, win_data, win_size, true, false);
free(expected_win.modifiable_values);
MPI_Win_free_pmem(&win);
MPI_Finalize_pmem();
return result;
}
开发者ID:pmem,项目名称:mpi-pmem-ext,代码行数:40,代码来源:MPI_Win_set_info_pmem_create.c
注:本文中的MPI_Info_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论