• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ H5Pclose函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中H5Pclose函数的典型用法代码示例。如果您正苦于以下问题:C++ H5Pclose函数的具体用法?C++ H5Pclose怎么用?C++ H5Pclose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了H5Pclose函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
        /* check if all the parents groups exist. skip root group */
        for (i = 1; i < len; i++)
        {
            if ('/'==oname_dst[i])
            {
                str_ptr = (char*)HDcalloc((size_t)i+1, sizeof(char));
                HDstrncpy (str_ptr, oname_dst, (size_t)i);
                str_ptr[i]='\0';
                if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0)
                {
                    error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr);
                    HDfree(str_ptr);
                    goto error;
                }
                HDfree(str_ptr);
            }
        }
    }

   /*-------------------------------------------------------------------------
    * do the copy
    *-------------------------------------------------------------------------*/
 
    if(verbose)
        linkinfo.opt.msg_mode = 1;
 
    li_ret = H5tools_get_symlink_info(fid_src, oname_src, &linkinfo, 1);
    if (li_ret == 0) /* dangling link */
    {
        if(H5Lcopy(fid_src, oname_src, 
                   fid_dst, oname_dst,
                   H5P_DEFAULT, H5P_DEFAULT) < 0)
            goto error;
    }
    else /* valid link */
    {
        if (H5Ocopy(fid_src,          /* Source file or group identifier */
                  oname_src,        /* Name of the source object to be copied */
                  fid_dst,          /* Destination file or group identifier  */
                  oname_dst,        /* Name of the destination object  */
                  ocpl_id,          /* Object copy property list */
                  lcpl_id)<0)       /* Link creation property list */
            goto error;
    }

    /* free link info path */
    if (linkinfo.trg_path)
        HDfree(linkinfo.trg_path);

    /* close propertis */
    if(H5Pclose(ocpl_id)<0)
        goto error;
    if(H5Pclose(lcpl_id)<0)
        goto error;

    /* close files */
    if (H5Fclose(fid_src)<0)
        goto error;
    if (H5Fclose(fid_dst)<0)
        goto error;

    if (fname_src)
        HDfree(fname_src);
    if (fname_dst)
        HDfree(fname_dst);
    if (oname_dst)
        HDfree(oname_dst);
    if (oname_src)
        HDfree(oname_src);

    h5tools_close();

    return EXIT_SUCCESS;

error:
    printf("Error in copy...Exiting\n");

    /* free link info path */
    if (linkinfo.trg_path)
        HDfree(linkinfo.trg_path);

 H5E_BEGIN_TRY {
    H5Pclose(ocpl_id);
    H5Pclose(lcpl_id);
    H5Fclose(fid_src);
    H5Fclose(fid_dst);
 } H5E_END_TRY;
    if (fname_src)
        HDfree(fname_src);
    if (fname_dst)
        HDfree(fname_dst);
    if (oname_dst)
        HDfree(oname_dst);
    if (oname_src)
        HDfree(oname_src);

    h5tools_close();

    return EXIT_FAILURE;
}
开发者ID:Len3d,项目名称:appleseed,代码行数:101,代码来源:h5copy.c


示例2: main


//.........这里部分代码省略.........
            for(k = 0; k < n; k++)
               buffer[k] = value;

            start[0] = j;
            start[1] = 0;
            start[2] = 0;
            if(H5Sselect_hyperslab(fsid, H5S_SELECT_SET, start, NULL, UC_5_PLANE, NULL) < 0)
                UC_ERROR
            if(H5Dwrite(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, buffer) < 0)
                UC_ERROR

        } /* end for */

        /* set up hyperslabs for source and destination datasets */
        start[0] = 0;
        start[1] = 0;
        start[2] = 0;
        if(H5Sselect_hyperslab(src_sid, H5S_SELECT_SET, start, NULL,
                    UC_5_SOURCE_MAX_DIMS, NULL) < 0)
            UC_ERROR
        start[0] = map_start;
        if(H5Sselect_hyperslab(vds_sid, H5S_SELECT_SET, start, stride,
                    count, UC_5_PLANE) < 0)
            UC_ERROR
        map_start += 1;

        /* Add VDS mapping */
        if(H5Pset_virtual(vds_dcplid, vds_sid, UC_5_FILE_NAMES[i],
                    UC_5_SOURCE_DSET_PATH, src_sid) < 0)
            UC_ERROR

        /* close */
        if(H5Sclose(msid) < 0)
            UC_ERROR
        if(H5Sclose(fsid) < 0)
            UC_ERROR
        if(H5Sclose(src_sid) < 0)
            UC_ERROR
        if(H5Pclose(src_dcplid) < 0)
            UC_ERROR
        if(H5Dclose(did) < 0)
            UC_ERROR
        if(H5Fclose(fid) < 0)
            UC_ERROR
        free(buffer);

    } /* end for */

    /*******************
     * Create VDS file *
     *******************/

    /* file */
    if((fid = H5Fcreate(UC_5_VDS_FILE_NAME, H5F_ACC_TRUNC,
                    H5P_DEFAULT, H5P_DEFAULT)) < 0)
        UC_ERROR

    /* dataset */
    if((did = H5Dcreate2(fid, UC_5_VDS_DSET_NAME, UC_5_VDS_DATATYPE, vds_sid,
                    H5P_DEFAULT, vds_dcplid, H5P_DEFAULT)) < 0)
        UC_ERROR

    /* close */
    if(H5Pclose(vds_dcplid) < 0)
        UC_ERROR
    if(H5Sclose(vds_sid) < 0)
        UC_ERROR
    if(H5Dclose(did) < 0)
        UC_ERROR
    if(H5Fclose(fid) < 0)
        UC_ERROR

    return EXIT_SUCCESS;

error:

    H5E_BEGIN_TRY {
        if(src_sid >= 0)
            (void)H5Sclose(src_sid);
        if(src_dcplid >= 0)
            (void)H5Pclose(src_dcplid);
        if(vds_sid >= 0)
            (void)H5Sclose(vds_sid);
        if(vds_dcplid >= 0)
            (void)H5Pclose(vds_dcplid);
        if(fid >= 0)
            (void)H5Fclose(fid);
        if(did >= 0)
            (void)H5Dclose(did);
        if(msid >= 0)
            (void)H5Sclose(msid);
        if(fsid >= 0)
            (void)H5Sclose(fsid);
        if(buffer != NULL)
            free(buffer);
    } H5E_END_TRY

    return EXIT_FAILURE;

} /* end main() */
开发者ID:ElaraFX,项目名称:hdf5,代码行数:101,代码来源:UC_5_stride_gen.c


示例3: main

int main(void)
{
    hid_t       file=(-1), fapl, space=(-1), dset=(-1);
    char        dname[]="dataset";
    int         i, j;
    int         buf[FAMILY_NUMBER][FAMILY_SIZE];
    hsize_t     dims[2]={FAMILY_NUMBER, FAMILY_SIZE};

    /* Set property list and file name for FAMILY driver */
    if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) {
        perror ("H5Pcreate");
        exit (1);
    }

    if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) {
        perror ("H5Pset_fapl_family");
        exit (1);
    }

    if((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
        perror("H5Fcreate");
        exit(1);
    }

    /* Create and write dataset */
    if((space = H5Screate_simple(2, dims, NULL)) < 0) {
        perror("H5Screate_simple");
        exit(1);
    }


    if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
        perror("H5Dcreate2");
        exit(1);
    }


    for(i = 0; i<FAMILY_NUMBER; i++)
        for(j = 0; j<FAMILY_SIZE; j++)
            buf[i][j] = i * 10000 + j;

    if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
        perror("H5Dwrite");
        exit(1);
    }


    if(H5Sclose(space) < 0) {
        perror ("H5Sclose");
        exit (1);
    }

    if(H5Dclose(dset) < 0) {
        perror ("H5Dclose");
        exit (1);
    }

    if(H5Pclose(fapl) < 0) {
        perror ("H5Pclose");
        exit (1);
    }

    if(H5Fclose(file) < 0) {
        perror ("H5Fclose");
        exit (1);
    }

    puts(" PASSED"); fflush(stdout);

    return 0;
}
开发者ID:ihutch,项目名称:sceptic3D,代码行数:71,代码来源:h5repart_gentest.c


示例4: test_ohdr_cache

/*
 *  Verify that object headers are held in the cache until they are linked
 *      to a location in the graph, or assigned an ID.  This is done by
 *      creating an object header, then forcing it out of the cache by creating
 *      local heaps until the object header is evicted from the cache, then
 *      modifying the object header.  The refcount on the object header is
 *      checked as verifying that the object header has remained in the cache.
 */
static herr_t
test_ohdr_cache(char *filename, hid_t fapl)
{
    hid_t	file = -1;              /* File ID */
    hid_t       my_fapl;                /* FAPL ID */
    hid_t       my_dxpl;                /* DXPL ID */
    H5AC_cache_config_t mdc_config;     /* Metadata cache configuration info */
    H5F_t	*f = NULL;              /* File handle */
    H5HL_t      *lheap, *lheap2, *lheap3; /* Pointer to local heaps */
    haddr_t     lheap_addr, lheap_addr2, lheap_addr3; /* Local heap addresses */
    H5O_loc_t	oh_loc;                 /* Object header location */
    time_t	time_new;               /* Time value for modification time message */
    unsigned    rc;                     /* Refcount for object */

    TESTING("object header creation in cache");

    /* Make a copy of the FAPL */
    if((my_fapl = H5Pcopy(fapl)) < 0)
        FAIL_STACK_ERROR

    /* Tweak down the size of the metadata cache to only 64K */
    mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
    if(H5Pget_mdc_config(my_fapl, &mdc_config) < 0)
        FAIL_STACK_ERROR
    mdc_config.set_initial_size = TRUE;
    mdc_config.initial_size = 32 * 1024;
    mdc_config.max_size = 64 * 1024;
    mdc_config.min_size = 8 * 1024;
    if(H5Pset_mdc_config(my_fapl, &mdc_config) < 0)
        FAIL_STACK_ERROR

    /* Make a copy of the default DXPL */
    if((my_dxpl = H5Pcopy(H5P_DATASET_XFER_DEFAULT)) < 0)
        FAIL_STACK_ERROR

    /* Create the file to operate on */
    if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
        FAIL_STACK_ERROR
    if(H5Pclose(my_fapl) < 0)
	FAIL_STACK_ERROR
    if(NULL == (f = (H5F_t *)H5I_object(file)))
        FAIL_STACK_ERROR

    /* Create object (local heap) that occupies most of cache */
    if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr) < 0)
        FAIL_STACK_ERROR

    /* Protect local heap (which actually pins it in the cache) */
    if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC_READ)))
        FAIL_STACK_ERROR

    /* Create an object header */
    HDmemset(&oh_loc, 0, sizeof(oh_loc));
    if(H5O_create(f, my_dxpl, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0)
        FAIL_STACK_ERROR

    /* Query object header information */
    rc = 0;
    if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0)
        FAIL_STACK_ERROR
    if(0 != rc)
        TEST_ERROR

    /* Create object (local heap) that occupies most of cache */
    if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr2) < 0)
        FAIL_STACK_ERROR

    /* Protect local heap (which actually pins it in the cache) */
    if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC_READ)))
        FAIL_STACK_ERROR

    /* Unprotect local heap (which actually unpins it from the cache) */
    if(H5HL_unprotect(lheap2) < 0)
        FAIL_STACK_ERROR

    /* Create object header message in new object header */
    time_new = 11111111;
    if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, my_dxpl) < 0)
        FAIL_STACK_ERROR

    /* Create object (local heap) that occupies most of cache */
    if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr3) < 0)
        FAIL_STACK_ERROR

    /* Protect local heap (which actually pins it in the cache) */
    if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC_READ)))
        FAIL_STACK_ERROR

    /* Unprotect local heap (which actually unpins it from the cache) */
    if(H5HL_unprotect(lheap3) < 0)
        FAIL_STACK_ERROR

//.........这里部分代码省略.........
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:101,代码来源:ohdr.c


示例5: H5Pcreate

    int FileIO::create(Setup *setup) {
     
        hid_t file_plist = H5Pcreate(H5P_FILE_ACCESS);
#ifdef GKC_PARALLEL_MPI
   //       pass some information onto the underlying MPI_File_open call 
          MPI_Info file_info;
          check(MPI_Info_create(&file_info), DMESG("File info"));
          /* 
          H5Pset_sieve_buf_size(file_plist, 262144); 
          H5Pset_alignment(file_plist, 524288, 262144);
                
          MPI_Info_set(file_info, (char *) "access_style"        , (char *) "write_once");
          MPI_Info_set(file_info, (char *) "collective_buffering", (char *) "true");
          MPI_Info_set(file_info, (char *) "cb_block_size"       , (char *) "1048576");
          MPI_Info_set(file_info, (char *) "cb_buffer_size"      , (char *) "4194304");
           * */

          check( H5Pset_fapl_mpio(file_plist, parallel->Comm[DIR_ALL], file_info), DMESG("Set MPI Property"));
#endif
        file = check(H5Fcreate(outputFileName.c_str(), (overwriteFile ? H5F_ACC_TRUNC : H5F_ACC_EXCL),
                        H5P_DEFAULT, file_plist ), DMESG("H5FCreate : HDF5 File (File already exists ? use -f to overwrite) : " + outputFileName));
        check( H5Pclose(file_plist),   DMESG("H5Pclose"));

#ifdef GKC_PARALLEL_MPI
        MPI_Info_free(&file_info);
#endif
        
         //////////////////////////////////////////////////////////////// Info Group ////////////////////////////////////////////////////////

          hid_t infoGroup = check(H5Gcreate(file, "/Info",H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT), DMESG("Error creating group file for Phasespace : H5Gcreate"));

         check(H5LTset_attribute_string(infoGroup, ".", "Output", outputFileName.c_str()), DMESG("H5LTset_attribute"));
         check(H5LTset_attribute_string(infoGroup, ".", "Input",  inputFileName.c_str()), DMESG("H5LTset_attribute"));
         
         
         check(H5LTset_attribute_string(infoGroup, ".", "Version", PACKAGE_VERSION), DMESG("H5LTset_attribute"));
         // Some Simulation specific stuff
         //check(H5LTset_attribute_string(infoGroup, ".", "Solver", ((setup->Solver & VL_LIN) ? "Linear" : "Non-Linear")), DMESG("H5LTset_attribute"));
         //heck(H5LTset_attribute_string(infoGroup, ".", "Type",   ((setup->VlasovType   & VLASOV_LOCAL ) ? "Local"  : "Global"    )), DMESG("H5LTset_attribute"));
         //heck(H5LTset_attribute_string(infoGroup, ".", "FFTSolverS",   ((setup->VlasovType   & VLASOV_LOCAL ) ? "Local"  : "Global"    )), DMESG("H5LTset_attribute"));
         //check(H5LTset_attribute_string(infoGroup, ".", "Initial Condition", setup->PerturbationMethod.c_str()), DMESG("H5LTset_attribute"));
         check(H5LTset_attribute_string(infoGroup, ".", "Info", info.c_str()), DMESG("H5LTset_attribute"));
         
         check(H5LTset_attribute_string(infoGroup, ".", "Config", setup->configFileString.c_str()), DMESG("H5LTset_attribute"));

         H5Gclose(infoGroup);
         
         
         /// Wrote setup constants, ugly here ////
         hid_t constantsGroup = check(H5Gcreate(file, "/Constants",H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT), DMESG("Error creating group file for Phasespace : H5Gcreate"));
         //
         if (!setup->parser_constants.empty()) { 
            
           std::vector<std::string> const_vec = Setup::split(setup->parser_constants, ",");

            for(int s = 0; s < const_vec.size(); s++) { 
                std::vector<std::string> key_value = Setup::split(const_vec[s],"=");
                double value = Setup::string_to_double(key_value[1]);
                int dim[] = { 1 };
   //           check(H5LTmake_dataset_double(constantsGroup, Setup::trimLower(key_value[0], false).c_str(), 1, dim, &value ), DMESG("Write Constants Attributes"));
                check(H5LTset_attribute_double(constantsGroup, ".", Setup::trimLower(key_value[0], false).c_str(), &value, 1), DMESG("H5LTset_attribute"));
                //check(H5LTset_attribute_double(constantsGroup, ".", Setup::trimLower(key_value[0], false).c_str(), &(Setup::string_to_double(key_value[1])), 1), DMESG("H5LTset_attribute"));
            };
         
         }
         
          H5Gclose(constantsGroup);

         
         // ********************* setup Table for CFL   *****************88
         cfl_table = new CFLTable();
         
         cfl_offset[0] =  HOFFSET( CFLTable, timeStep );
         cfl_offset[1] =  HOFFSET( CFLTable, time );
         cfl_offset[2] =  HOFFSET( CFLTable, Fx );
         cfl_offset[3] =  HOFFSET( CFLTable, Fy );
         cfl_offset[4] =  HOFFSET( CFLTable, Fz  );
         cfl_offset[5] =  HOFFSET( CFLTable, Fv );
         cfl_offset[6] =  HOFFSET( CFLTable, total );
          

         for(int i = 1; i < 7; i++)  cfl_sizes[i] = sizeof(double); cfl_sizes[0] = sizeof(int);
         hid_t   cfl_type[7]; for(int i = 1; i < 7; i++)  cfl_type [i] = H5T_NATIVE_DOUBLE; cfl_type[0] = H5T_NATIVE_INT;

         const char *cfl_names[7];
         cfl_names[0] = "timeStep";
         cfl_names[1] = "time";
         cfl_names[2] = "Fx"; cfl_names[3] = "Fy"; cfl_names[4] = "Fz"; cfl_names[5] = "Fv"; cfl_names[6] = "Total";

          check(H5TBmake_table("cflTable", file, "cfl", (hsize_t) 7, (hsize_t) 0, sizeof(CFLTable), (const char**) cfl_names,
                               cfl_offset, cfl_type, 32, NULL, 0, cfl_table ), DMESG("H5Tmake_table : cfl"));
         

         return HELIOS_SUCCESS;
    }
开发者ID:xyuan,项目名称:gkc,代码行数:95,代码来源:FileIO.cpp


示例6: check_file

/*-------------------------------------------------------------------------
 * Function:	check_file
 *
 * Purpose:	Part 2 of a two-part H5Fflush() test.
 *
 * Return:	Success:	0
 *
 *		Failure:	1
 *
 * Programmer:	Leon Arber
 *              Sept. 26, 2006.
 *
 *-------------------------------------------------------------------------
 */
static int
check_file(char* name, hid_t fapl)
{
    hid_t	file, space, dset, groups, grp, plist;
    hsize_t	ds_size[2];
    double	error;
    hsize_t	i, j;

    plist = H5Pcreate(H5P_DATASET_XFER);
    H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE);
    if((file = H5Fopen(name, H5F_ACC_RDONLY, fapl)) < 0) goto error;

    /* Open the dataset */
    if((dset = H5Dopen2(file, "dset", H5P_DEFAULT)) < 0) goto error;
    if((space = H5Dget_space(dset)) < 0) goto error;
    if(H5Sget_simple_extent_dims(space, ds_size, NULL) < 0) goto error;
    assert(100==ds_size[0] && 100==ds_size[1]);

    /* Read some data */
    if (H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, plist,
		the_data) < 0) goto error;
    for (i=0; i<ds_size[0]; i++) {
	for (j=0; j<ds_size[1]; j++) {
	    /*
	     * The extra cast in the following statement is a bug workaround
	     * for the Win32 version 5.0 compiler.
	     * 1998-11-06 ptl
	     */
	    error = fabs(the_data[i][j]-(double)(hssize_t)i/((hssize_t)j+1));
	    if (error>0.0001) {
		H5_FAILED();
		printf("    dset[%lu][%lu] = %g\n",
			(unsigned long)i, (unsigned long)j, the_data[i][j]);
		printf("    should be %g\n",
			(double)(hssize_t)i/(hssize_t)(j+1));
		goto error;
	    }
	}
    }

    /* Open some groups */
    if((groups = H5Gopen2(file, "some_groups", H5P_DEFAULT)) < 0) goto error;
    for(i = 0; i < 100; i++) {
	sprintf(name, "grp%02u", (unsigned)i);
	if((grp = H5Gopen2(groups, name, H5P_DEFAULT)) < 0) goto error;
	if(H5Gclose(grp) < 0) goto error;
    }

    if(H5Gclose(groups) < 0) goto error;
    if(H5Dclose(dset) < 0) goto error;
    if(H5Fclose(file) < 0) goto error;
    if(H5Pclose(plist) < 0) goto error;
    if(H5Sclose(space) < 0) goto error;

    return 0;

error:
    H5E_BEGIN_TRY {
        H5Pclose(plist);
        H5Gclose(groups);
        H5Dclose(dset);
        H5Fclose(file);
        H5Sclose(space);
    } H5E_END_TRY;
    return 1;
}
开发者ID:ElaraFX,项目名称:hdf5,代码行数:80,代码来源:t_pflush2.c


示例7: writehdf5file


//.........这里部分代码省略.........
     *       |       |    |       |    |
     *       -       +----+       -   -+-
     *       |                    |
     *       |                    |
     *       +-------|----|-------+
     *               localnx
     *
     *  In this case the blocksizes are (localnx,localny) and the offsets are 
     *  (offx,offy) = ((myx)/nxp*globalnx, (myy/nyp)*globalny)
     */

    offsets[0] = (rundata.globalnx/rundata.npx)*rundata.myx;
    offsets[1] = (rundata.globalny/rundata.npy)*rundata.myy;
    blocks[0]  = rundata.localnx;
    blocks[1]  = rundata.localny;
    strides[0] = strides[1] = 1;
    counts[0] = counts[1] = 1;

    /* select this subset of the density variable's space in the file */
    globaldensspace = H5Dget_space(dens_dataset_id);
    H5Sselect_hyperslab(globaldensspace,H5S_SELECT_SET, offsets, strides, counts, blocks);

    /* For the velocities, it's the same thing but there's a count of two,
     * (one for each velocity component) */

    offsets[1] = (rundata.globalnx/rundata.npx)*rundata.myx;
    offsets[2] = (rundata.globalny/rundata.npy)*rundata.myy;
    blocks[1]  = rundata.localnx;
    blocks[2]  = rundata.localny;
    strides[0] = strides[1] = strides[2] = 1;
    counts[0] = 2; counts[1] = counts[2] = 1;
    offsets[0] = 0;
    blocks[0] = 1;

    globalvelspace = H5Dget_space(vel_dataset_id);
    H5Sselect_hyperslab(globalvelspace,H5S_SELECT_SET, offsets, strides, counts, blocks);

    /* Write the data.  We're writing it from memory, where it is saved 
     * in NATIVE_DOUBLE format */
    status = H5Dwrite(dens_dataset_id, H5T_NATIVE_DOUBLE, loc_dens_dataspace_id, globaldensspace, dist_id, &(dens[0][0]));
    status = H5Dwrite(vel_dataset_id,  H5T_NATIVE_DOUBLE, loc_vel_dataspace_id, globalvelspace, dist_id, &(vel[0][0][0]));

    /* We'll create another group for related info and put some things in there */

    {
        hid_t other_group_id;
        hid_t timestep_id, timestep_space;
        hid_t comptime_id, comptime_space;
        hid_t author_id, author_space, author_type;
        char *authorname="Jonathan Dursi";
        int timestep=13;
        float comptime=81.773;

        /* create group */
        other_group_id = H5Gcreate(file_id,"/OtherStuff", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);

        /* scalar space, data for integer timestep */
        timestep_space = H5Screate(H5S_SCALAR);
        timestep_id = H5Dcreate(other_group_id, "Timestep", H5T_STD_U32LE, 
                                timestep_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
        status = H5Dwrite(timestep_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timestep);
        H5Dclose(timestep_id);
        H5Sclose(timestep_space);
   
        /* scalar space, data for floating compute time */
        comptime_space = H5Screate(H5S_SCALAR);
        comptime_id = H5Dcreate(other_group_id, "Compute Time", H5T_IEEE_F32LE, 
                                comptime_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
        status = H5Dwrite(comptime_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comptime);
        H5Dclose(comptime_id);
        H5Sclose(comptime_space);
   
        /* scalar space, data for author name */
        author_space = H5Screate(H5S_SCALAR);
        author_type  = H5Tcopy(H5T_C_S1);   /* copy the character type.. */
        status = H5Tset_size (author_type, strlen(authorname));  /* and make it longer */
        author_id = H5Dcreate(other_group_id, "Simulator Name", author_type, author_space, 
                                 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); 
        status = H5Dwrite(author_id, author_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, authorname);
        H5Dclose(author_id);
        H5Sclose(author_space);
        H5Tclose(author_type);

        H5Gclose(other_group_id);
    } 


    /* End access to groups & data sets and release resources used by them */
    status = H5Sclose(dens_dataspace_id);
    status = H5Dclose(dens_dataset_id);
    status = H5Sclose(vel_dataspace_id);
    status = H5Dclose(vel_dataset_id);
    status = H5Gclose(arr_group_id);
    status = H5Pclose(fap_id);
    status = H5Pclose(dist_id);
    
    /* Close the file */
    status = H5Fclose(file_id);
    return;
}
开发者ID:haghakhani,项目名称:parallel-IO-tutorial,代码行数:101,代码来源:parallel2darray.c


示例8: main

/*-------------------------------------------------------------------------
 * Function:    main
 *
 * Purpose:     HDF5 user block unjammer
 *
 * Return:      Success:    0
 *              Failure:    1
 *
 * Programmer:
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
int
main (int argc, const char *argv[])
{
  char *ifname;
  void *edata;
  H5E_auto2_t func;
  hid_t ifile;
  hsize_t usize;
  htri_t testval;
  herr_t status;
  hid_t plist;

  h5tools_setprogname(PROGRAMNAME);
  h5tools_setstatus(EXIT_SUCCESS);

  /* Initialize h5tools lib */
  h5tools_init();

  /* Disable error reporting */
  H5Eget_auto2(H5E_DEFAULT, &func, &edata);
  H5Eset_auto2(H5E_DEFAULT, NULL, NULL);

  parse_command_line (argc, argv);

  if (argc <= (opt_ind))
    {
      error_msg("missing file name\n");
      usage (h5tools_getprogname());
      return (EXIT_FAILURE);
    }

  ifname = HDstrdup (argv[opt_ind]);

  testval = H5Fis_hdf5 (ifname);

  if (testval <= 0)
    {
      error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname);
      return (EXIT_FAILURE);
    }

  ifile = H5Fopen (ifname, H5F_ACC_RDONLY, H5P_DEFAULT);

  if (ifile < 0)
    {
      error_msg("Can't open input HDF5 file \"%s\"\n", ifname);
      return (EXIT_FAILURE);
    }

  plist = H5Fget_create_plist (ifile);
  if (plist < 0)
    {
      error_msg("Can't get file creation plist for file \"%s\"\n",
     ifname);
      return (EXIT_FAILURE);
    }

  status = H5Pget_userblock (plist, &usize);
  if (status < 0)
    {
      error_msg("Can't get user block for file \"%s\"\n", ifname);
      return (EXIT_FAILURE);
    }

  printf ("%ld\n", (long) usize);

  H5Pclose (plist);
  H5Fclose (ifile);

  return (EXIT_SUCCESS);
}
开发者ID:Starlink,项目名称:hdf5,代码行数:85,代码来源:tellub.c


示例9: main

int main(int argc, char **argv)
{

  MPI_Init(&argc, &argv);

  int mpirank;
  MPI_Comm_rank(MPI_COMM_WORLD, &mpirank);

  int nbprocess;
  MPI_Comm_size(MPI_COMM_WORLD, &nbprocess);

  if(nbprocess != 3)
  {
    print(mpirank, "Please relaunch with three process.\n");
    return EXIT_FAILURE;
  }


  // Open properties of the file

  hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);

  MPI_Info info = MPI_INFO_NULL;

  // Create the pro

  herr_t status = H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, info);

  // Create the file
  hid_t hdf = H5Fcreate("ut_paral2.h5", H5F_ACC_TRUNC, H5P_DEFAULT, plist_id);

  // close the properties
  H5Pclose(plist_id);



  char *message;



  message = test_assym_low(hdf, mpirank);

  if(message!=NULL)
  {
    printf("%d** %s\n", mpirank, message);
    return EXIT_FAILURE;
  }







  message = test_assym(hdf, mpirank);

  if(message!=NULL)
  {
    printf("%d** %s\n", mpirank, message);
    return EXIT_FAILURE;
  }


  H5Fclose(hdf);

  MPI_Finalize();

  print(mpirank, "SUCCESS\n");

  return EXIT_SUCCESS;
}
开发者ID:axessim,项目名称:amelethdf-c,代码行数:71,代码来源:edataset_parallel2.c


示例10: woffset

  void HDFWalkerIOEngine::readAll(hid_t grp, const char* name, Communicate* comm) 
  {
    int mynode=comm->rank();
    int nprocs=comm->size();
    vector<int> woffset(nprocs+1,0);

    const int RANK = 3;
    hsize_t offset[]={1,1,1};
    hsize_t gcount[RANK],count[RANK];
    hsize_t stride[]={1,1,1};

    hid_t dataset = H5Dopen(grp,name);
    hid_t dataspace = H5Dget_space(dataset);
    int rank_n = H5Sget_simple_extent_ndims(dataspace);
    int status_n = H5Sget_simple_extent_dims(dataspace, gcount, NULL);

    //assign offsets and size
    FairDivideLow(gcount[0],nprocs,woffset);
    offset[0]=woffset[mynode]; offset[1] = 0; offset[2] = 0;
    count[0]=woffset[mynode+1]-woffset[mynode];
    count[1]=gcount[1];
    count[2]=gcount[2];

    app_log() << "   Initial walker distribution: ";
    std::copy(woffset.begin(),woffset.end(),ostream_iterator<int>(app_log()," "));
    app_log() << endl;

    vector<MCWalkerConfiguration::PosType> posIn(count[0]*count[1]);

    hid_t memspace = H5Screate_simple(RANK, count, NULL);
    herr_t status = H5Sselect_hyperslab(dataspace,H5S_SELECT_SET, offset,NULL,count,NULL);

#if defined(H5_HAVE_PARALLEL)
    xfer_plist = H5Pcreate(H5P_DATASET_XFER);
    H5Pset_dxpl_mpio(xfer_plist,H5FD_MPIO_COLLECTIVE);
#else
    xfer_plist =  H5P_DEFAULT;
#endif
    hid_t type_id=get_h5_datatype(posIn[0][0]);
    status = H5Dread(dataset, type_id, memspace, dataspace, xfer_plist, &(posIn[0][0]));

    H5Sclose(dataspace);
    H5Sclose(memspace);
    H5Dclose(dataset);

#if defined(H5_HAVE_PARALLEL)
    H5Pclose(xfer_plist);
#endif

    int curWalker = W.getActiveWalkers();
    if(curWalker) {
      W.createWalkers(count[0]);
    } else {
      W.resize(count[0],count[1]);
    }

    MCWalkerConfiguration::iterator it = W.begin()+curWalker; 
    int ii=0;
    for(int iw=0; iw<count[0]; iw++) {
      //std::copy(Post_temp[iw],Post_temp[iw+1], (*it)->R.begin());
      for(int iat=0; iat < count[1]; iat++,ii++){
        (*it)->R(iat) = posIn[ii];
      }
      ++it;
    }
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:66,代码来源:HDFWalkerIOEngine.cpp


示例11: H5Pcreate

void Simulation3D::dumpFields(std::string filename) {
  unsigned int p_x = xLine.rank(), p_y = yLine.rank(), p_z = zLine.rank();
  hsize_t start[4];
  start[0] = xLine.rank()*blockSize; start[1] = yLine.rank()*blockSize;
  start[2] = zLine.rank()*blockSize; start[3] = 0;

  hsize_t rhsx_start[3];
  rhsx_start[0] = p_y*blockSize; rhsx_start[1] = p_z*blockSize; rhsx_start[2] = p_x*blockSize;
  hsize_t rhsy_start[3];
  rhsy_start[0] = p_x*blockSize; rhsy_start[1] = p_z*blockSize; rhsy_start[2] = p_y*blockSize;
  hsize_t rhsz_start[3];
  rhsz_start[0] = p_x*blockSize; rhsz_start[1] = p_y*blockSize; rhsz_start[2] = p_z*blockSize;
  hsize_t rhs_count[3];
  rhs_count[0] = blockSize; rhs_count[1] = blockSize; rhs_count[2] = blockSize;

  hsize_t count[4];
  count[0] = blockSize; count[1] = blockSize; count[2] = blockSize; count[3] = 3;
  
  hsize_t dims[4];
  dims[0] = blockSize*procsX; dims[1] = blockSize*procsY; dims[2] = blockSize*procsZ; dims[3] = 3;
  hsize_t mem_dims[4];
  mem_dims[0] = blockSize; mem_dims[1] = blockSize; mem_dims[2] = blockSize; mem_dims[3] = 3;

  hid_t fa_p_list = H5Pcreate(H5P_FILE_ACCESS);
  H5Pset_fapl_mpio(fa_p_list, world, MPI_INFO_NULL);

  hid_t file_id=H5Fcreate(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, fa_p_list);
  H5Pclose(fa_p_list);

  hsize_t rhs_dims[3];
  rhs_dims[0] = blockSize*procsX; rhs_dims[1] = blockSize*procsY; rhs_dims[2] = blockSize*procsZ;
  hsize_t rhs_mem_dims[3];
  rhs_mem_dims[0] = blockSize; rhs_mem_dims[1] = blockSize; rhs_mem_dims[2] = blockSize;
  
  hid_t E_filespace = H5Screate_simple(4, dims, NULL);
  hid_t E_memspace = H5Screate_simple(4, mem_dims, NULL);
  hid_t B_filespace = H5Screate_simple(4, dims, NULL);
  hid_t B_memspace = H5Screate_simple(4, mem_dims, NULL);
  hid_t rhsx_filespace = H5Screate_simple(3, rhs_dims, NULL);
  hid_t rhsx_memspace = H5Screate_simple(3, rhs_mem_dims, NULL);
  hid_t rhsy_filespace = H5Screate_simple(3, rhs_dims, NULL);
  hid_t rhsy_memspace = H5Screate_simple(3, rhs_mem_dims, NULL);
  hid_t rhsz_filespace = H5Screate_simple(3, rhs_dims, NULL);
  hid_t rhsz_memspace = H5Screate_simple(3, rhs_mem_dims, NULL);

  hid_t E_dset_id = H5Dcreate(file_id, "E", H5T_NATIVE_DOUBLE, E_filespace,
			      H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  hid_t E_wr_p_list = H5Pcreate(H5P_DATASET_XFER);
  // H5Pset_dxpl_mpio(E_wr_p_list, H5FD_MPIO_COLLECTIVE);
  H5Sselect_hyperslab(E_filespace, H5S_SELECT_SET, start, NULL, count, NULL);
  herr_t status = H5Dwrite(E_dset_id, H5T_NATIVE_DOUBLE, E_memspace, E_filespace,
			   E_wr_p_list, E);
  H5Dclose(E_dset_id);
  H5Sclose(E_filespace);
  H5Sclose(E_memspace);
  H5Pclose(E_wr_p_list);

  hid_t B_dset_id = H5Dcreate(file_id, "B", H5T_NATIVE_DOUBLE, B_filespace,
			      H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  hid_t B_wr_p_list = H5Pcreate(H5P_DATASET_XFER);
  // H5Pset_dxpl_mpio(B_wr_p_list, H5FD_MPIO_COLLECTIVE);
  H5Sselect_hyperslab(B_filespace, H5S_SELECT_SET, start, NULL, count, NULL);
  status = H5Dwrite(B_dset_id, H5T_NATIVE_DOUBLE, B_memspace, B_filespace,
		    B_wr_p_list, B);
  H5Dclose(B_dset_id);
  H5Sclose(B_filespace);
  H5Sclose(B_memspace);
  H5Pclose(B_wr_p_list);

  hid_t rhsx_dset_id = H5Dcreate(file_id, "rhsx", H5T_NATIVE_DOUBLE, rhsx_filespace,
				 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  hid_t rhsx_wr_p_list = H5Pcreate(H5P_DATASET_XFER);
  // H5Pset_dxpl_mpio(rhsx_wr_p_list, H5FD_MPIO_COLLECTIVE);
  H5Sselect_hyperslab(rhsx_filespace, H5S_SELECT_SET, rhsx_start, NULL, rhs_count, NULL);
  status = H5Dwrite(rhsx_dset_id, H5T_NATIVE_DOUBLE, rhsx_memspace, rhsx_filespace,
		    rhsx_wr_p_list, rhsx);
  H5Dclose(rhsx_dset_id);
  H5Sclose(rhsx_filespace);
  H5Sclose(rhsx_memspace);
  H5Pclose(rhsx_wr_p_list);

  hid_t rhsy_dset_id = H5Dcreate(file_id, "rhsy", H5T_NATIVE_DOUBLE, rhsy_filespace,
				 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  hid_t rhsy_wr_p_list = H5Pcreate(H5P_DATASET_XFER);
  // H5Pset_dxpl_mpio(rhsy_wr_p_list, H5FD_MPIO_COLLECTIVE);
  H5Sselect_hyperslab(rhsy_filespace, H5S_SELECT_SET, rhsy_start, NULL, rhs_count, NULL);
  status = H5Dwrite(rhsy_dset_id, H5T_NATIVE_DOUBLE, rhsy_memspace, rhsy_filespace,
		    rhsy_wr_p_list, rhsy);
  H5Dclose(rhsy_dset_id);
  H5Sclose(rhsy_filespace);
  H5Sclose(rhsy_memspace);
  H5Pclose(rhsy_wr_p_list);

  hid_t rhsz_dset_id = H5Dcreate(file_id, "rhsz", H5T_NATIVE_DOUBLE, rhsz_filespace,
				 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  hid_t rhsz_wr_p_list = H5Pcreate(H5P_DATASET_XFER);
  // H5Pset_dxpl_mpio(rhsx_wr_p_list, H5FD_MPIO_COLLECTIVE);
  H5Sselect_hyperslab(rhsz_filespace, H5S_SELECT_SET, rhsz_start, NULL, rhs_count, NULL);
  status = H5Dwrite(rhsz_dset_id, H5T_NATIVE_DOUBLE, rhsz_memspace, rhsz_filespace,
		    rhsz_wr_p_list, rhsz);
//.........这里部分代码省略.........
开发者ID:adam-higuera,项目名称:adi-prototype,代码行数:101,代码来源:Simulation3D.cpp


示例12: main


//.........这里部分代码省略.........

    if((ret = encode_plist(dcpl1, little_endian, word_length, "testfiles/plist_files/def_dcpl_")) < 0)
        assert(ret > 0);

    if((ret = H5Pset_chunk(dcpl1, 1, &chunk_size)) < 0)
        assert(ret > 0);

    if((ret = H5Pset_alloc_time(dcpl1, H5D_ALLOC_TIME_LATE)) < 0)
        assert(ret > 0);

    ret = H5Tconvert(H5T_NATIVE_INT, H5T_STD_I32BE, (size_t)1, &fill, NULL, H5P_DEFAULT);
    assert(ret >= 0);
    if((ret = H5Pset_fill_value(dcpl1, H5T_STD_I32BE, &fill)) < 0)
        assert(ret > 0);

    max_size[0] = 100;
    if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, 
                         (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
        assert(ret > 0);
    if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, 
                         (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
        assert(ret > 0);
    if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, 
                         (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
        assert(ret > 0);
    if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, 
                         (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
        assert(ret > 0);

    if((ret = encode_plist(dcpl1, little_endian, word_length, "testfiles/plist_files/dcpl_")) < 0)
        assert(ret > 0);
        
    /* release resource */
    if((ret = H5Pclose(dcpl1)) < 0)
         assert(ret > 0);


    /******* ENCODE/DECODE DAPLS *****/
    if((dapl1 = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
        assert(dapl1 > 0);

    if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/def_dapl_")) < 0)
        assert(ret > 0);
        
    if((ret = H5Pset_chunk_cache(dapl1, nslots, nbytes, w0)) < 0)
        assert(ret > 0);

    if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/dapl_")) < 0)
        assert(ret > 0);
        
    /* release resource */
    if((ret = H5Pclose(dapl1)) < 0)
         assert(ret > 0);

    /******* ENCODE/DECODE DXPLS *****/
    if((dxpl1 = H5Pcreate(H5P_DATASET_XFER)) < 0)
        assert(dxpl1 > 0);

    if((ret = encode_plist(dxpl1, little_endian, word_length, "testfiles/plist_files/def_dxpl_")) < 0)
        assert(ret > 0);

    if((ret = H5Pset_btree_ratios(dxpl1, 0.2f, 0.6f, 0.2f)) < 0)
        assert(ret > 0);
    if((ret = H5Pset_hyper_vector_size(dxpl1, 5)) < 0)
        assert(ret > 0);
#ifdef H5_HAVE_PARALLEL
开发者ID:Starlink,项目名称:hdf5,代码行数:67,代码来源:gen_plist.c


示例13: SetDescription

bool BAGRasterBand::Initialize( hid_t hDatasetID, const char *pszName )

{
    SetDescription( pszName );

    this->hDatasetID = hDatasetID;

    hid_t datatype     = H5Dget_type( hDatasetID );
    dataspace          = H5Dget_space( hDatasetID );
    int n_dims         = H5Sget_simple_extent_ndims( dataspace );
    native             = H5Tget_native_type( datatype, H5T_DIR_ASCEND );
    hsize_t dims[3], maxdims[3];

    eDataType = GH5_GetDataType( native );

    if( n_dims == 2 )
    {
        H5Sget_simple_extent_dims( dataspace, dims, maxdims );

        nRasterXSize = (int) dims[1];
        nRasterYSize = (int) dims[0];
    }
    else
    {
        CPLError( CE_Failure, CPLE_AppDefined,
                  "Dataset not of rank 2." );
        return false;
    }

    nBlockXSize   = nRasterXSize;
    nBlockYSize   = 1;

/* -------------------------------------------------------------------- */
/*      Check for chunksize, and use it as blocksize for optimized      */
/*      reading.                                                        */
/* -------------------------------------------------------------------- */
    hid_t listid = H5Dget_create_plist( hDatasetID );
    if (listid>0)
    {
        if(H5Pget_layout(listid) == H5D_CHUNKED)
        {
            hsize_t panChunkDims[3];
            int nDimSize = H5Pget_chunk(listid, 3, panChunkDims);
            nBlockXSize  = (int) panChunkDims[nDimSize-1];
            nBlockYSize  = (int) panChunkDims[nDimSize-2];
        }

        int nfilters = H5Pget_nfilters( listid );

        H5Z_filter_t filter;
        char         name[120];
        size_t       cd_nelmts = 20;
        unsigned int cd_values[20];
        unsigned int flags;
        for (int i = 0; i < nfilters; i++) 
        {
          filter = H5Pget_filter(listid, i, &flags, (size_t *)&cd_nelmts, cd_values, 120, name);
          if (filter == H5Z_FILTER_DEFLATE)
            poDS->SetMetadataItem( "COMPRESSION", "DEFLATE", "IMAGE_STRUCTURE" );
          else if (filter == H5Z_FILTER_NBIT)
            poDS->SetMetadataItem( "COMPRESSION", "NBIT", "IMAGE_STRUCTURE" );
          else if (filter == H5Z_FILTER_SCALEOFFSET)
            poDS->SetMetadataItem( "COMPRESSION", "SCALEOFFSET", "IMAGE_STRUCTURE" );
          else if (filter == H5Z_FILTER_SZIP)
            poDS->SetMetadataItem( "COMPRESSION", "SZIP", "IMAGE_STRUCTURE" );
        }

        H5Pclose(listid);
    }

/* -------------------------------------------------------------------- */
/*      Load min/max information.                                       */
/* -------------------------------------------------------------------- */
    if( EQUAL(pszName,"elevation") 
        && GH5_FetchAttribute( hDatasetID, "Maximum Elevation Value", 
                            dfMaximum ) 
        && GH5_FetchAttribute( hDatasetID, "Minimum Elevation Value", 
                               dfMinimum ) )
        bMinMaxSet = true;
    else if( EQUAL(pszName,"uncertainty") 
             && GH5_FetchAttribute( hDatasetID, "Maximum Uncertainty Value", 
                                    dfMaximum ) 
             && GH5_FetchAttribute( hDatasetID, "Minimum Uncertainty Value", 
                                    dfMinimum ) )
        bMinMaxSet = true;
    else if( EQUAL(pszName,"nominal_elevation") 
             && GH5_FetchAttribute( hDatasetID, "max_value", 
                                    dfMaximum ) 
             && GH5_FetchAttribute( hDatasetID, "min_value", 
                                    dfMinimum ) )
        bMinMaxSet = true;

    return true;
}
开发者ID:imincik,项目名称:pkg-gdal,代码行数:94,代码来源:bagdataset.cpp


示例14: test_plist_ed


//.........这里部分代码省略.........
        recv_proc = 0;
    else
        recv_proc = 1;

    dcpl = H5Pcreate(H5P_DATASET_CREATE);
    VRFY((dcpl >= 0), "H5Pcreate succeeded");

    ret = H5Pset_chunk(dcpl, 1, &chunk_size);
    VRFY((ret >= 0), "H5Pset_chunk succeeded");

    ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
    VRFY((ret >= 0), "H5Pset_alloc_time succeeded");

    ret = H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill);
    VRFY((ret>=0), "set fill-value succeeded");

    max_size[0] = 100;
    ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, 
                          (hsize_t)(max_size[0] * sizeof(int)/4));
    VRFY((ret>=0), "set external succeeded");
    ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, 
                          (hsize_t)(max_size[0] * sizeof(int)/4));
    VRFY((ret>=0), "set external succeeded");
    ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, 
                          (hsize_t)(max_size[0] * sizeof(int)/4));
    VRFY((ret>=0), "set external succeeded");
    ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, 
                          (hsize_t)(max_size[0] * sizeof(int)/4));
    VRFY((ret>=0), "set external succeeded");

    ret = test_encode_decode(dcpl, mpi_rank, recv_proc);
    VRFY((ret >= 0), "test_encode_decode succeeded");

    ret = H5Pclose(dcpl);
    VRFY((ret >= 0), "H5Pclose succeeded");


    /******* ENCODE/DECODE DAPLS *****/
    dapl = H5Pcreate(H5P_DATASET_ACCESS);
    VRFY((dapl >= 0), "H5Pcreate succeeded");

    ret = H5Pset_chunk_cache(dapl, nslots, nbytes, w0);
    VRFY((ret >= 0), "H5Pset_chunk_cache succeeded");

    ret = test_encode_decode(dapl, mpi_rank, recv_proc);
    VRFY((ret >= 0), "test_encode_decode succeeded");

    ret = H5Pclose(dapl);
    VRFY((ret >= 0), "H5Pclose succeeded");


    /******* ENCODE/DECODE OCPLS *****/
    ocpl = H5Pcreate(H5P_OBJECT_CREATE);
    VRFY((ocpl >= 0), "H5Pcreate succeeded");

    ret = H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
    VRFY((ret >= 0), "H5Pset_attr_creation_order succeeded");

    ret = H5Pset_attr_phase_change(ocpl, 110, 105);
    VRFY((ret >= 0), "H5Pset_attr_phase_change succeeded");

    ret = H5Pset_filter(ocpl, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL);
    VRFY((ret >= 0), "H5Pset_filter succeeded");

    ret = test_encode_decode(ocpl, mpi_rank, recv_proc);
    VRFY((ret >= 0), "test_encode_decode succeeded");
开发者ID:ElaraFX,项目名称:hdf5,代码行数:67,代码来源:t_prop.c


示例15: test_family_compat

<

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ H5Pset_chunk函数代码示例发布时间:2022-05-30
下一篇:
C++ H5Lexists函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap