264
264
 
    /* setup file access template with parallel IO access. */
265
265
 
    acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS);
266
266
 
    assert(acc_tpl1 != FAIL);
267
267
 
    MESG("H5Pcreate access succeed");
268
268
 
    /* set Parallel access with communicator */
269
269
 
    ret = H5Pset_fapl_mpio(acc_tpl1, comm, info);
270
270
 
    assert(ret != FAIL);
271
271
 
    MESG("H5Pset_fapl_mpio succeed");
272
272
 
273
273
 
    /* create the file collectively */
274
 
-
    fid1=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl1);
 
274
+
    fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl1);
275
275
 
    assert(fid1 != FAIL);
276
276
 
    MESG("H5Fcreate succeed");
277
277
 
278
278
 
    /* Release file-access template */
279
 
-
    ret=H5Pclose(acc_tpl1);
 
279
+
    ret = H5Pclose(acc_tpl1);
280
280
 
    assert(ret != FAIL);
281
281
 
282
282
 
283
283
 
    /* --------------------------
284
284
 
     * Define the dimensions of the overall datasets
285
285
 
     * and the slabs local to the MPI process.
286
286
 
     * ------------------------- */
287
287
 
    /* setup dimensionality object */
288
 
-
    sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL);
 
288
+
    sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
289
289
 
    assert (sid1 != FAIL);
290
290
 
    MESG("H5Screate_simple succeed");
291
291
 
292
292
 
293
293
 
    /* create a dataset collectively */
294
 
-
    dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
295
 
-
            H5P_DEFAULT);
 
294
+
    dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
 
295
+
            H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
296
296
 
    assert(dataset1 != FAIL);
297
 
-
    MESG("H5Dcreate succeed");
 
297
+
    MESG("H5Dcreate2 succeed");
298
298
 
299
299
 
    /* create another dataset collectively */
300
 
-
    dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
301
 
-
            H5P_DEFAULT);
 
300
+
    dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
 
301
+
            H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
302
302
 
    assert(dataset2 != FAIL);
303
 
-
    MESG("H5Dcreate succeed");
 
303
+
    MESG("H5Dcreate2 succeed");
304
304
 
305
305
 
306
306
 
307
307
 
    /* set up dimensions of the slab this process accesses */
308
308
 
    start[0] = mpi_rank*SPACE1_DIM1/mpi_size;
309
309
 
    start[1] = 0;
310
310
 
    count[0] = SPACE1_DIM1/mpi_size;
311
311
 
    count[1] = SPACE1_DIM2;
312
312
 
    stride[0] = 1;
313
313
 
    stride[1] =1;
Show more
531
531
 
     * Define the dimensions of the overall datasets
532
532
 
     * and create the dataset
533
533
 
     * ------------------------- */
534
534
 
    /* setup dimensionality object */
535
535
 
    sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL);
536
536
 
    assert (sid1 != FAIL);
537
537
 
    MESG("H5Screate_simple succeed");
538
538
 
539
539
 
540
540
 
    /* create a dataset collectively */
541
 
-
    dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
 
541
+
    dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
542
542
 
    assert(dataset1 != FAIL);
543
 
-
    MESG("H5Dcreate succeed");
 
543
+
    MESG("H5Dcreate2 succeed");
544
544
 
545
545
 
    /* create another dataset collectively */
546
 
-
    dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
 
546
+
    dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
547
547
 
    assert(dataset2 != FAIL);
548
 
-
    MESG("H5Dcreate 2 succeed");
 
548
+
    MESG("H5Dcreate2 2 succeed");
549
549
 
550
550
 
    /*
551
551
 
     * Set up dimensions of the slab this process accesses.
552
552
 
     */
553
553
 
554
554
 
    /* Dataset1: each process takes a block of rows. */
555
555
 
    slab_set(start, count, stride, BYROW);
556
556
 
if (verbose)
557
557
 
    printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
558
558
 
    (unsigned long)start[0], (unsigned long)start[1],