Skip to content

Commit 3041870

Browse files
committed
Handle ADIOS append operations only when ADIOS support is enabled
Without this fix, build errors occur when SCORPIO is configured without ADIOS support, since PIO_EADIOS2ERR is not declared in that case.
1 parent 6ca0d27 commit 3041870

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/clib/pio_darray.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,7 @@ int PIOc_write_darray_impl(int ncid, int varid, int ioid, PIO_Offset arraylen, c
21692169
"Writing variable (%s, varid=%d) to file (%s, ncid=%d) failed. The file was not opened for writing, try reopening the file in write mode (use the PIO_WRITE flag)", pio_get_vname_from_file(file, varid), varid, pio_get_fname_from_file(file), file->pio_ncid);
21702170
}
21712171

2172+
#ifdef _ADIOS2
21722173
if ((file->iotype == PIO_IOTYPE_ADIOS) || (file->iotype == PIO_IOTYPE_ADIOSC))
21732174
{
21742175
/* ADIOS type does not support open to append mode */
@@ -2189,6 +2190,7 @@ int PIOc_write_darray_impl(int ncid, int varid, int ioid, PIO_Offset arraylen, c
21892190
pio_get_fname_from_file(file), ncid);
21902191
}
21912192
}
2193+
#endif
21922194

21932195
/* Get decomposition information. */
21942196
if (!(iodesc = pio_get_iodesc_from_id(ioid)))

src/clib/pio_getput_int.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ int spio_put_att_tc(int ncid, int varid, const char *name, nc_type atttype,
6060
spio_ltimer_start(ios->io_fstats->wr_timer_name);
6161
spio_ltimer_start(ios->io_fstats->tot_timer_name);
6262

63+
#ifdef _ADIOS2
6364
if ((file->iotype == PIO_IOTYPE_ADIOS) || (file->iotype == PIO_IOTYPE_ADIOSC))
6465
{
6566
/* ADIOS type does not support open to append mode */
@@ -77,7 +78,11 @@ int spio_put_att_tc(int ncid, int varid, const char *name, nc_type atttype,
7778
pio_get_vname_from_file(file, varid), varid, PIO_IS_NULL(name),
7879
pio_get_fname_from_file(file), ncid);
7980
}
81+
}
82+
#endif
8083

84+
if ((file->iotype == PIO_IOTYPE_ADIOS) || (file->iotype == PIO_IOTYPE_ADIOSC))
85+
{
8186
GPTLstart("PIO:spio_put_att_tc_adios");
8287
GPTLstart("PIO:write_total_adios");
8388
}
@@ -2479,6 +2484,7 @@ int spio_put_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off
24792484
spio_ltimer_start(ios->io_fstats->wr_timer_name);
24802485
spio_ltimer_start(ios->io_fstats->tot_timer_name);
24812486

2487+
#ifdef _ADIOS2
24822488
if ((file->iotype == PIO_IOTYPE_ADIOS) || (file->iotype == PIO_IOTYPE_ADIOSC))
24832489
{
24842490
/* ADIOS type does not support open to append mode */
@@ -2496,7 +2502,11 @@ int spio_put_vars_tc(int ncid, int varid, const PIO_Offset *start, const PIO_Off
24962502
pio_get_vname_from_file(file, varid), varid,
24972503
pio_get_fname_from_file(file), ncid);
24982504
}
2505+
}
2506+
#endif
24992507

2508+
if ((file->iotype == PIO_IOTYPE_ADIOS) || (file->iotype == PIO_IOTYPE_ADIOSC))
2509+
{
25002510
GPTLstart("PIO:spio_put_vars_tc_adios");
25012511
GPTLstart("PIO:write_total_adios");
25022512
}

0 commit comments

Comments
 (0)