Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions benchmarks/C/aggregation.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,9 @@ int benchmark_write(char *filename,

/* set PnetCDF I/O hints */
MPI_Info_create(&info);
/* disable the header extent alignments
MPI_Info_set(info, "nc_header_align_size", "1"); size in bytes
*/
/* disable the fixed-size variable alignments */
/* disable the fixed-size variable alignments, which also
* disable the header extent alignments
*/
MPI_Info_set(info, "nc_var_align_size", "1");

nvars = 0;
Expand Down
1 change: 0 additions & 1 deletion benchmarks/C/write_block_read_column.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ int benchmark_write(char *filename,

/* set PnetCDF I/O hints */
MPI_Info_create(&info);
MPI_Info_set(info, "nc_header_align_size", "1"); /* size in bytes */
MPI_Info_set(info, "nc_var_align_size", "1"); /* size in bytes */
MPI_Info_set(info, "nc_header_read_chunk_size", "512"); /* size in bytes */
/* note that set the above values to 1 to disable the alignment */
Expand Down
25 changes: 12 additions & 13 deletions examples/C/get_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* Example standard output:

MPI File Info: nkeys = 35
MPI File Info: nkeys = 34
MPI File Info: [ 0] key = cb_buffer_size, value = 16777216
MPI File Info: [ 1] key = romio_cb_read, value = automatic
MPI File Info: [ 2] key = romio_cb_write, value = automatic
Expand All @@ -39,18 +39,17 @@
MPI File Info: [20] key = striping_unit, value = 0
MPI File Info: [21] key = striping_factor, value = 0
MPI File Info: [22] key = start_iodevice, value = 0
MPI File Info: [23] key = nc_header_align_size, value = 512
MPI File Info: [24] key = nc_var_align_size, value = 4
MPI File Info: [25] key = nc_record_align_size, value = 4
MPI File Info: [26] key = nc_header_read_chunk_size, value = 262144
MPI File Info: [27] key = nc_in_place_swap, value = auto
MPI File Info: [28] key = nc_ibuf_size, value = 16777216
MPI File Info: [29] key = pnetcdf_subfiling, value = disable
MPI File Info: [30] key = nc_num_subfiles, value = 0
MPI File Info: [31] key = nc_hash_size_dim, value = 256
MPI File Info: [32] key = nc_hash_size_var, value = 256
MPI File Info: [33] key = nc_hash_size_gattr, value = 64
MPI File Info: [34] key = nc_hash_size_vattr, value = 8
MPI File Info: [23] key = nc_var_align_size, value = 4
MPI File Info: [24] key = nc_record_align_size, value = 4
MPI File Info: [25] key = nc_header_read_chunk_size, value = 262144
MPI File Info: [26] key = nc_in_place_swap, value = auto
MPI File Info: [27] key = nc_ibuf_size, value = 16777216
MPI File Info: [28] key = pnetcdf_subfiling, value = disable
MPI File Info: [29] key = nc_num_subfiles, value = 0
MPI File Info: [30] key = nc_hash_size_dim, value = 256
MPI File Info: [31] key = nc_hash_size_var, value = 256
MPI File Info: [32] key = nc_hash_size_gattr, value = 64
MPI File Info: [33] key = nc_hash_size_vattr, value = 8
*/

#include <stdio.h>
Expand Down
20 changes: 4 additions & 16 deletions examples/C/hints.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/* $Id$ */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This example sets two PnetCDF hints:
* nc_header_align_size and nc_var_align_size
* This example sets PnetCDF hint:
* nc_var_align_size
* and prints the hint values as well as the header size, header extent, and
* two variables' starting file offsets.
*
Expand All @@ -18,7 +18,6 @@
*
* % mpiexec -l -n 4 ./hints /pvfs2/wkliao/testfile.nc
*
* nc_header_align_size set to = 1024
* nc_var_align_size set to = 512
* nc_header_read_chunk_size set to = 256
* header size = 252
Expand Down Expand Up @@ -94,7 +93,7 @@ int print_hints(int ncid,
char value[MPI_MAX_INFO_VAL];
int err, len, flag, nerrs=0;
MPI_Offset header_size, header_extent, var_zy_start, var_yx_start;
MPI_Offset h_align=-1, v_align=-1, h_chunk=-1;
MPI_Offset v_align=-1, h_chunk=-1;
MPI_Info info_used;

err = ncmpi_inq_header_size (ncid, &header_size); ERR
Expand All @@ -103,12 +102,7 @@ int print_hints(int ncid,
err = ncmpi_inq_varoffset(ncid, varid1, &var_yx_start); ERR

err = ncmpi_inq_file_info(ncid, &info_used); ERR
MPI_Info_get_valuelen(info_used, "nc_header_align_size", &len, &flag);
if (flag) {
MPI_Info_get(info_used, "nc_header_align_size", len+1, value, &flag);
h_align = strtoll(value,NULL,10);
}
MPI_Info_get_valuelen(info_used, "nc_var_align_size", &len, &flag);
MPI_Info_get_valuelen(info_used, "nc_var_align_size", &len, &flag);
if (flag) {
MPI_Info_get(info_used, "nc_var_align_size", len+1, value, &flag);
v_align = strtoll(value,NULL,10);
Expand All @@ -120,11 +114,6 @@ int print_hints(int ncid,
}
MPI_Info_free(&info_used);

if (h_align == -1)
printf("nc_header_align_size is NOT set\n");
else
printf("nc_header_align_size set to = %lld\n", h_align);

if (v_align == -1)
printf("nc_var_align_size is NOT set\n");
else
Expand Down Expand Up @@ -171,7 +160,6 @@ int main(int argc, char** argv)
else snprintf(filename, 256, "%s", argv[optind]);

MPI_Info_create(&info);
MPI_Info_set(info, "nc_header_align_size", "1024"); /* size in bytes */
MPI_Info_set(info, "nc_var_align_size", "512"); /* size in bytes */
MPI_Info_set(info, "nc_header_read_chunk_size", "256"); /* size in bytes */
/* note that set the above values to 1 to disable the alignment */
Expand Down
7 changes: 3 additions & 4 deletions examples/CXX/get_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* Example standard output:

MPI File Info: nkeys = 18
MPI File Info: nkeys = 17
MPI File Info: [ 0] key = cb_buffer_size, value = 16777216
MPI File Info: [ 1] key = romio_cb_read, value = automatic
MPI File Info: [ 2] key = romio_cb_write, value = automatic
Expand All @@ -31,9 +31,8 @@
MPI File Info: [12] key = romio_ds_read, value = automatic
MPI File Info: [13] key = romio_ds_write, value = automatic
MPI File Info: [14] key = cb_config_list, value = *:1
MPI File Info: [15] key = nc_header_align_size, value = 512
MPI File Info: [16] key = nc_var_align_size, value = 512
MPI File Info: [17] key = nc_header_read_chunk_size, value = 0
MPI File Info: [15] key = nc_var_align_size, value = 512
MPI File Info: [16] key = nc_header_read_chunk_size, value = 0
*/

#include <stdio.h>
Expand Down
20 changes: 4 additions & 16 deletions examples/CXX/hints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/* $Id$ */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This example sets two PnetCDF hints:
* nc_header_align_size and nc_var_align_size
* This example sets PnetCDF hint:
* nc_var_align_size
* and prints the hint values as well as the header size, header extent, and
* two variables' starting file offsets.
*
Expand All @@ -18,7 +18,6 @@
*
* % mpiexec -l -n 4 ./hints /pvfs2/wkliao/testfile.nc
*
* nc_header_align_size set to = 1024
* nc_var_align_size set to = 512
* nc_header_read_chunk_size set to = 256
* header size = 252
Expand Down Expand Up @@ -64,7 +63,7 @@ void print_hints(NcmpiFile &ncFile,
char value[MPI_MAX_INFO_VAL];
int len, flag;
MPI_Offset header_size, header_extent, var_zy_start, var_yx_start;
MPI_Offset h_align=-1, v_align=-1, h_chunk=-1;
MPI_Offset v_align=-1, h_chunk=-1;
MPI_Info info_used;

ncFile.Inq_header_size(&header_size);
Expand All @@ -76,12 +75,7 @@ void print_hints(NcmpiFile &ncFile,
/* get all the hints used */
ncFile.Inq_file_info(&info_used);

MPI_Info_get_valuelen(info_used, (char*)"nc_header_align_size", &len, &flag);
if (flag) {
MPI_Info_get(info_used, (char*)"nc_header_align_size", len+1, value, &flag);
h_align = strtoll(value,NULL,10);
}
MPI_Info_get_valuelen(info_used, (char*)"nc_var_align_size", &len, &flag);
MPI_Info_get_valuelen(info_used, (char*)"nc_var_align_size", &len, &flag);
if (flag) {
MPI_Info_get(info_used, (char*)"nc_var_align_size", len+1, value, &flag);
v_align = strtoll(value,NULL,10);
Expand All @@ -93,11 +87,6 @@ void print_hints(NcmpiFile &ncFile,
}
MPI_Info_free(&info_used);

if (h_align == -1)
printf("nc_header_align_size is NOT set\n");
else
printf("nc_header_align_size set to = %lld\n", h_align);

if (v_align == -1)
printf("nc_var_align_size is NOT set\n");
else
Expand Down Expand Up @@ -141,7 +130,6 @@ int main(int argc, char** argv)

try {
MPI_Info_create(&info);
MPI_Info_set(info, (char*)"nc_header_align_size", (char*)"1024");
MPI_Info_set(info, (char*)"nc_var_align_size", (char*)"512");
MPI_Info_set(info, (char*)"nc_header_read_chunk_size", (char*)"256");
/* note that set the above values to 1 to disable the alignment */
Expand Down
7 changes: 3 additions & 4 deletions examples/F77/get_info.f
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
!
! Example standard output:
!
! MPI File Info: nkeys = 18
! MPI File Info: nkeys = 17
! MPI File Info: [ 0] key = cb_buffer_size, value =16777216
! MPI File Info: [ 1] key = romio_cb_read, value =automatic
! MPI File Info: [ 2] key = romio_cb_write, value =automatic
Expand All @@ -31,9 +31,8 @@
! MPI File Info: [12] key = romio_ds_read, value =automatic
! MPI File Info: [13] key = romio_ds_write, value =automatic
! MPI File Info: [14] key = cb_config_list, value =*:1
! MPI File Info: [15] key = nc_header_align_size, value =0
! MPI File Info: [16] key = nc_var_align_size, value =0
! MPI File Info: [17] key = nc_header_read_chunk_size, value =0
! MPI File Info: [15] key = nc_var_align_size, value =0
! MPI File Info: [16] key = nc_header_read_chunk_size, value =0


program main
Expand Down
21 changes: 3 additions & 18 deletions examples/F77/hints.f
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
! $Id$

!
! This example sets two PnetCDF hints:
! nc_header_align_size and nc_var_align_size
! This example sets PnetCDF hint:
! nc_var_align_size
! and prints the hint values as well as the header size, header extent, and
! two variables' starting file offsets.
!
Expand All @@ -17,7 +17,6 @@
!
! % mpiexec -n 4 ./hints /pvfs2/wkliao/testfile.nc
!
! nc_header_align_size set to = 1024
! nc_var_align_size set to = 512
! nc_header_read_chunk_size set to = 256
! header size = 252
Expand Down Expand Up @@ -54,9 +53,8 @@ subroutine print_hints(ncid, varid0, varid1)
logical flag
integer*8 header_size, header_extent
integer*8 var_zy_start, var_yx_start
integer*8 h_align, v_align, h_chunk
integer*8 v_align, h_chunk

h_align=-1
v_align=-1
h_chunk=-1

Expand All @@ -72,13 +70,6 @@ subroutine print_hints(ncid, varid0, varid1)
err = nfmpi_inq_file_info(ncid, info_used)
call check(err, 'In nfmpi_inq_file_info : ')

call MPI_Info_get_valuelen(info_used, "nc_header_align_size",
+ len, flag, err)
if (flag) then
call MPI_Info_get(info_used, "nc_header_align_size",
+ len+1, value, flag, err)
read(value, '(i16)') h_align
endif
call MPI_Info_get_valuelen(info_used, "nc_var_align_size",
+ len, flag, err)
if (flag) then
Expand All @@ -96,11 +87,6 @@ subroutine print_hints(ncid, varid0, varid1)
endif
call MPI_Info_free(info_used, err)

if (h_align .EQ. -1) then
print*,"nc_header_align_size is NOT set"
else
print*,"nc_header_align_size set to = ", h_align
endif
if (v_align .EQ. -1) then
print*,"nc_var_align_size is NOT set"
else
Expand Down Expand Up @@ -178,7 +164,6 @@ program main
+ MPI_COMM_WORLD, err)

call MPI_Info_create(info, err)
call MPI_Info_set(info, "nc_header_align_size", "1024", err)
call MPI_Info_set(info, "nc_var_align_size", "512", err)
call MPI_Info_set(info, "nc_header_read_chunk_size", "256", err)
! note that set the above values to 1 to disable the alignment
Expand Down
7 changes: 3 additions & 4 deletions examples/F90/get_info.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
!
! Example standard output:
!
! MPI File Info: nkeys = 18
! MPI File Info: nkeys = 17
! MPI File Info: [ 0] key = cb_buffer_size, value =16777216
! MPI File Info: [ 1] key = romio_cb_read, value =automatic
! MPI File Info: [ 2] key = romio_cb_write, value =automatic
Expand All @@ -32,9 +32,8 @@
! MPI File Info: [12] key = romio_ds_read, value =automatic
! MPI File Info: [13] key = romio_ds_write, value =automatic
! MPI File Info: [14] key = cb_config_list, value =*:1
! MPI File Info: [15] key = nc_header_align_size, value =0
! MPI File Info: [16] key = nc_var_align_size, value =0
! MPI File Info: [17] key = nc_header_read_chunk_size, value =0
! MPI File Info: [15] key = nc_var_align_size, value =0
! MPI File Info: [16] key = nc_header_read_chunk_size, value =0


program main
Expand Down
21 changes: 3 additions & 18 deletions examples/F90/hints.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
! $Id$

!
! This example sets two PnetCDF hints:
! nc_header_align_size and nc_var_align_size
! This example sets PnetCDF hint:
! nc_var_align_size
! and prints the hint values as well as the header size, header extent, and
! two variables' starting file offsets.
!
Expand All @@ -18,7 +18,6 @@
!
! % mpiexec -n 4 ./hints /pvfs2/wkliao/testfile.nc
!
! nc_header_align_size set to = 1024
! nc_var_align_size set to = 512
! nc_header_read_chunk_size set to = 256
! header size = 252
Expand Down Expand Up @@ -55,9 +54,8 @@ subroutine print_hints(ncid, varid0, varid1)
logical flag
integer(kind=MPI_OFFSET_KIND) header_size, header_extent
integer(kind=MPI_OFFSET_KIND) var_zy_start, var_yx_start
integer(kind=MPI_OFFSET_KIND) h_align, v_align, h_chunk
integer(kind=MPI_OFFSET_KIND) v_align, h_chunk

h_align=-1
v_align=-1
h_chunk=-1

Expand All @@ -73,13 +71,6 @@ subroutine print_hints(ncid, varid0, varid1)
err = nf90mpi_inq_file_info(ncid, info_used)
call check(err, 'In nf90mpi_inq_file_info : ')

call MPI_Info_get_valuelen(info_used, "nc_header_align_size", &
len, flag, err)
if (flag) then
call MPI_Info_get(info_used, "nc_header_align_size", &
len+1, value, flag, err)
read(value, '(i16)') h_align
endif
call MPI_Info_get_valuelen(info_used, "nc_var_align_size", &
len, flag, err)
if (flag) then
Expand All @@ -97,11 +88,6 @@ subroutine print_hints(ncid, varid0, varid1)
endif
call MPI_Info_free(info_used, err)

if (h_align .EQ. -1) then
print*,"nc_header_align_size is NOT set"
else
print*,"nc_header_align_size set to = ", h_align
endif
if (v_align .EQ. -1) then
print*,"nc_var_align_size is NOT set"
else
Expand Down Expand Up @@ -176,7 +162,6 @@ program main
call MPI_Bcast(filename, 256, MPI_CHARACTER, 0, MPI_COMM_WORLD, err)

call MPI_Info_create(info, err)
call MPI_Info_set(info, "nc_header_align_size", "1024", err)
call MPI_Info_set(info, "nc_var_align_size", "512", err)
call MPI_Info_set(info, "nc_header_read_chunk_size", "256", err)
! note that set the above values to 1 to disable the alignment
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ with C, C++, F77, and F90 versions.
+ ./CXX/hints.cpp
+ ./F77/hints.f
+ ./F90/hints.f90
+ This example sets two PnetCDF hints: `nc_header_align_size` and
`nc_var_align_size` and prints the hint values, the header size, header
+ This example sets PnetCDF hint: `nc_var_align_size`
and prints the hint values, the header size, header
extent, and variables' starting file offsets.

* ./C/mput.c
Expand Down
Loading