Skip to content

Commit ec1aef2

Browse files
authored
Merge branch 'main' into add_rpath
2 parents ff7a19f + 05e4284 commit ec1aef2

21 files changed

Lines changed: 189 additions & 192 deletions

.github/workflows/autotools.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ jobs:
5252
cd $GITHUB_WORKSPACE
5353
make check
5454
55-
# - name: Setup tmate session
56-
# if: ${{ failure() }}
57-
# uses: mxschmitt/action-tmate@v3
55+
- name: Setup tmate session
56+
if: ${{ failure() }}
57+
uses: mxschmitt/action-tmate@v3

.github/workflows/intel.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
FC: mpiifort
1717
# Versions should match the github tag names
1818
PNETCDF_VERSION: checkpoint.1.12.3
19-
NETCDF_C_VERSION: v4.9.1
20-
NETCDF_FORTRAN_VERSION: v4.6.0
19+
NETCDF_C_VERSION: v4.9.2
20+
NETCDF_FORTRAN_VERSION: v4.6.1
2121
HDF5_VERSION: hdf5_1_12_2
2222
steps:
2323
- uses: actions/checkout@v3
@@ -27,6 +27,7 @@ jobs:
2727
sudo apt-get update
2828
sudo apt-get install libcurl4-gnutls-dev
2929
sudo apt-get install libz-dev
30+
echo "/opt/intel/oneapi/compiler/2023.2.1/linux/bin/intel64/" >> $GITHUB_PATH
3031
- name: cache intel compiler
3132
id: cache-intel
3233
uses: actions/cache@v3
@@ -74,7 +75,7 @@ jobs:
7475
export PATH=$GITHUB_WORKSPACE/hdf5/bin:$GITHUB_WORKSPACE/netcdf/bin:$PATH
7576
export LDFLAGS="$LDFLAGS -L$GITHUB_WORKSPACE/hdf5/lib -L/usr/lib/x86_64-linux-gnu/ -lcurl"
7677
export CPPFLAGS="$CPPFLAGS -I$GITHUB_WORKSPACE/hdf5/include -I$GITHUB_WORKSPACE/netcdf/include"
77-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/hdf5/lib:/usr/lib/x86_64-linux-gnu/"
78+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/hdf5/lib:/usr/lib/x86_64-linux-gnu/:/opt/intel/oneapi/compiler/2023.2.1/linux/compiler/lib/intel64_lin/"
7879
printenv >> $GITHUB_ENV
7980
- name: build-netcdf-c
8081
if: steps.cache-netcdf-c.outputs.cache-hit != 'true'
@@ -125,6 +126,6 @@ jobs:
125126
popd
126127
# the following can be used by developers to login to the github server in case of errors
127128
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
128-
# - name: Setup tmate session
129-
# if: ${{ failure() }}
130-
# uses: mxschmitt/action-tmate@v3
129+
- name: Setup tmate session
130+
if: ${{ failure() }}
131+
uses: mxschmitt/action-tmate@v3

.github/workflows/netcdf_hdf5_no_pnetcdf_ncint_mpich.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
LDFLAGS: "-L${GITHUB_WORKSPACE}/mpich/lib "
1414
# Note issue https://github.com/NCAR/ParallelIO/issues/1889 netcdf integration currently only works with netcdf 4.7.4
1515
NETCDF_C_VERSION: v4.9.2
16-
NETCDF_FORTRAN_VERSION: v4.6.0
17-
MPICH_VERSION: v4.1
16+
NETCDF_FORTRAN_VERSION: v4.6.1
17+
MPICH_VERSION: v4.1.2
1818
HDF5_VERSION: hdf5_1_12_2
1919
FFLAGS: "-fallow-argument-mismatch"
2020
FCFLAGS: "-fallow-argument-mismatch"

.github/workflows/netcdf_pnetcdf_openmpi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
env:
1515
# CPPFLAGS: "-I${GITHUB_WORKSPACE}/openmpi/include -I${GITHUB_WORKSPACE}/hdf5/include -I${GITHUB_WORKSPACE}/netcdf/include -I${GITHUB_WORKSPACE}/pnetcdf/include"
1616
# LDFLAGS: "-L${GITHUB_WORKSPACE}/openmpi/lib -L${GITHUB_WORKSPACE}/hdf5/lib -L${GITHUB_WORKSPACE}/netcdf/lib -L${GITHUB_WORKSPACE}/pnetcdf/lib"
17-
NETCDF_C_VERSION: v4.9.0
18-
NETCDF_FORTRAN_VERSION: v4.6.0
19-
OPENMPI_VERSION: v4.1.4
17+
NETCDF_C_VERSION: v4.9.2
18+
NETCDF_FORTRAN_VERSION: v4.6.1
19+
OPENMPI_VERSION: v4.1.5
2020
PNETCDF_VERSION: checkpoint.1.12.3
2121
HDF5_VERSION: hdf5_1_12_2
2222
FCFLAGS: "-fallow-argument-mismatch"

.github/workflows/withspack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ jobs:
5959
# the || true prevents a fail if parallelio is not installed
6060
# spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true
6161
# spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich
62-
spack uninstall -y parallelio@develop+pnetcdf+fortran ^mpich || true
63-
spack dev-build -d $GITHUB_WORKSPACE parallelio@develop+pnetcdf+fortran ^mpich
62+
spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true
63+
spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich
6464
6565
- name: Test parallelio
6666
run: |

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ int main() {return 0;}" HAVE_SZIP_WRITE)
357357
###
358358
# Check to see if parallel filters are supported by HDF5/netcdf-c.
359359
###
360-
check_function_exists(nc_inq_filter_avail HAVE_PAR_FILTERS)
361-
360+
if (HAVE_NETCDF_PAR)
361+
check_function_exists(nc_inq_filter_avail HAVE_PAR_FILTERS)
362+
endif()
362363
###
363364
# Check to see if this is netcdf-c-4.7.2, which won't work.
364365
###

examples/c/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (PIO_USE_MPISERIAL)
5151
else ()
5252
add_mpi_test(examplePio EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/examplePio NUMPROCS 4 TIMEOUT 60)
5353
add_mpi_test(example1 EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/example1 NUMPROCS 4 TIMEOUT 60)
54-
add_mpi_test(piorcw EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/piorcw NUMPROCS 16 TIMEOUT 600)
54+
#add_mpi_test(piorcw EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/piorcw NUMPROCS 16 TIMEOUT 600)
5555
#add_mpi_test(darray_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_async NUMPROCS 5 TIMEOUT 60)
5656
add_mpi_test(darray_no_async EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/darray_no_async NUMPROCS 4 TIMEOUT 60)
5757
endif ()

examples/c/piorcw.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ char *cvarw, *cvarr;
1313
typedef struct dimlist
1414
{
1515
char name[16];
16-
int value;
16+
PIO_Offset value;
1717
} dimlist;
1818

1919

@@ -78,7 +78,7 @@ int rcw_write_darray(int iosys, int rank)
7878
for(int i=0; i < maplen[rank]; i++)
7979
dsum += dvarw[i];
8080
if(dsum != rank)
81-
printf("%d: dvarwsum = %d\n",rank, dsum);
81+
printf("%d: dvarwsum = %g\n",rank, dsum);
8282

8383
ierr = PIOc_write_darray(ncid, varid, ioid, maplen[rank], dvarw, NULL);
8484
free(maplen);
@@ -109,7 +109,7 @@ int rcw_read_darray(int iosys,int rank)
109109
char dimname[PIO_MAX_NAME];
110110
char varname[PIO_MAX_NAME];
111111

112-
int ndims, nvars, natts, unlimdim;
112+
int i, nvars, natts, unlimdim;
113113
dimlist *dim;
114114

115115
ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
@@ -123,18 +123,15 @@ int rcw_read_darray(int iosys,int rank)
123123

124124
dim = (dimlist *) malloc(ndims*sizeof(dimlist));
125125
for(i=0; i<ndims; i++){
126-
ierr = PIOc_inq_dim(ncid, i, dim[i].name, dim[i].value);
126+
ierr = PIOc_inq_dim(ncid, i, dim[i].name, &(dim[i].value));
127127
if(ierr || debug) printf("%d %d i=%d\n",__LINE__,ierr, i);
128128
}
129129

130130

131131

132132

133133
/* TODO: support multiple variables and types*/
134-
if(myvarname != NULL)
135-
sprintf(varname,"%s",myvarname);
136-
else
137-
sprintf(varname,"var%4.4d",0);
134+
sprintf(varname,"var%4.4d",0);
138135
ierr = PIOc_inq_varid(ncid, varname, &varid);
139136
if(ierr || debug) printf("%d %d\n",__LINE__,ierr);
140137

@@ -180,7 +177,7 @@ int rcw_read_darray(int iosys,int rank)
180177
for(int i=0; i < maplen[rank]; i++)
181178
dsum += dvarr[i];
182179
if(dsum != rank)
183-
printf("%d: dsum = %d\n",rank, dsum);
180+
printf("%d: dsum = %g\n",rank, dsum);
184181
break;
185182
case PIO_INT:
186183
ivarr = malloc(sizeof(int)*maplen[rank]);
@@ -221,7 +218,6 @@ int rcw_read_darray(int iosys,int rank)
221218

222219
int main(int argc, char *argv[])
223220
{
224-
struct arguments arguments;
225221
int ierr;
226222
int rank;
227223
int comm_size;

src/clib/pio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ typedef struct var_desc_t
124124
int record;
125125

126126
/** ID of each outstanding pnetcdf request for this variable. */
127-
int *request;
127+
// int *request;
128128

129129
/** Number of requests pending with pnetcdf. */
130130
int nreqs;
@@ -784,7 +784,7 @@ enum PIO_ERROR_HANDLERS
784784
#define PIO_FILL_UINT64 NC_FILL_UINT64 /**< Default fill value for this type. */
785785

786786
#define PIO_EINDEP (-203) /**< independent access error. */
787-
787+
#define PIO_EINSUFFBUF (-219) /**< Insufficient buffer size (pnetcdf only) */
788788
#define PIO_FIRST_ERROR_CODE (-500) /**< The first error code for PIO. */
789789
#define PIO_EBADIOTYPE (-500) /**< Bad IOTYPE error. */
790790
#define PIO_EVARDIMMISMATCH (-501) /**< Variable dimensions do not match in a multivar call. */

src/clib/pio_darray_int.c

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari
427427
int rrcnt = 0; /* Number of subarray requests (pnetcdf only). */
428428
PIO_Offset *startlist[num_regions]; /* Array of start arrays for ncmpi_iput_varn(). */
429429
PIO_Offset *countlist[num_regions]; /* Array of count arrays for ncmpi_iput_varn(). */
430+
431+
ierr = ncmpi_wait_all(file->fh, NC_REQ_ALL, NULL, NULL);
430432
#endif /* _PNETCDF */
431433

432434
/* Process each region of data to be written. */
@@ -643,27 +645,10 @@ write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *vari
643645
else /* don't flush yet, accumulate the request size */
644646
vard_llen += llen;
645647
#else
646-
if (vdesc->nreqs % PIO_REQUEST_ALLOC_CHUNK == 0)
647-
{
648-
if (!(vdesc->request = realloc(vdesc->request, sizeof(int) *
649-
(vdesc->nreqs + PIO_REQUEST_ALLOC_CHUNK))))
650-
return pio_err(ios, file, PIO_ENOMEM, __FILE__, __LINE__);
651648

652-
for (int i = vdesc->nreqs; i < vdesc->nreqs + PIO_REQUEST_ALLOC_CHUNK; i++)
653-
vdesc->request[i] = NC_REQ_NULL;
654-
}
655-
656-
/* Write, in non-blocking fashion, a list of subarrays. */
657-
// PLOG((3, "about to call ncmpi_iput_varn() varids[%d] = %d rrcnt = %d, llen = %d",
658-
// nv, varids[nv], rrcnt, llen));
659-
// for(int i=0;i < llen; i++)
660-
// PLOG((3, "bufptr[%d] = %d",i,((int *)bufptr)[i]));
661649
ierr = ncmpi_iput_varn(file->fh, varids[nv], rrcnt, startlist, countlist,
662-
bufptr, llen, iodesc->mpitype, &vdesc->request[vdesc->nreqs]);
650+
bufptr, llen, iodesc->mpitype, NULL);
663651

664-
/* keeps wait calls in sync */
665-
if (vdesc->request[vdesc->nreqs] == NC_REQ_NULL)
666-
vdesc->request[vdesc->nreqs] = PIO_REQ_NULL;
667652

668653
vdesc->nreqs++;
669654
#endif
@@ -1750,58 +1735,34 @@ flush_output_buffer(file_desc_t *file, bool force, PIO_Offset addsize)
17501735
* limit, then flush to disk. */
17511736
if (force || (usage >= pio_pnetcdf_buffer_size_limit))
17521737
{
1753-
int rcnt;
17541738
int maxreq;
1755-
int reqcnt;
17561739
maxreq = 0;
1757-
reqcnt = 0;
1758-
rcnt = 0;
17591740

17601741
for (int i = 0; i < file->nvars; i++)
17611742
{
17621743
if ((ierr = get_var_desc(i, &file->varlist, &vdesc)))
17631744
return pio_err(NULL, file, ierr, __FILE__, __LINE__);
1764-
reqcnt += vdesc->nreqs;
17651745
if (vdesc->nreqs > 0)
17661746
maxreq = i;
17671747
}
1768-
int request[reqcnt];
1769-
int status[reqcnt];
1770-
17711748
if (file->varlist)
17721749
{
17731750
for (int i = 0; i <= maxreq; i++)
17741751
{
17751752
if ((ierr = get_var_desc(i, &file->varlist, &vdesc)))
17761753
return pio_err(NULL, file, ierr, __FILE__, __LINE__);
1777-
#ifdef MPIO_ONESIDED
1778-
/*onesided optimization requires that all of the requests in a wait_all call represent
1779-
a contiguous block of data in the file */
1780-
if (rcnt > 0 && (prev_record != vdesc->record || vdesc->nreqs == 0))
1781-
{
1782-
ierr = ncmpi_wait_all(file->fh, rcnt, request, status);
1783-
rcnt = 0;
1784-
}
1785-
prev_record = vdesc->record;
1786-
#endif
1787-
for (reqcnt = 0; reqcnt < vdesc->nreqs; reqcnt++)
1788-
request[rcnt++] = max(vdesc->request[reqcnt], NC_REQ_NULL);
1789-
PLOG((3,"flush_output_buffer rcnt=%d",rcnt));
17901754

1791-
if (vdesc->request != NULL)
1792-
free(vdesc->request);
1793-
vdesc->request = NULL;
17941755
vdesc->nreqs = 0;
17951756

17961757
#ifdef FLUSH_EVERY_VAR
1797-
ierr = ncmpi_wait_all(file->fh, rcnt, request, status);
1758+
ierr = ncmpi_wait_all(file->fh, NC_REQ_ALL, NULL, NULL);
1759+
//ierr = ncmpi_wait_all(file->fh, rcnt, request, status);
17981760
rcnt = 0;
17991761
#endif
18001762
}
18011763
}
1802-
1803-
if (rcnt > 0)
1804-
ierr = ncmpi_wait_all(file->fh, rcnt, request, status);
1764+
/* make sure all buffers are now clean */
1765+
ierr = ncmpi_wait_all(file->fh, NC_REQ_ALL, NULL, NULL);
18051766

18061767
/* Release resources. */
18071768
if (file->iobuf)

0 commit comments

Comments
 (0)