@@ -1067,6 +1067,7 @@ static int PIOc_write_decomp_adios(file_desc_t *file, int ioid)
10671067 }
10681068
10691069 char name[PIO_MAX_NAME];
1070+ char name_varid[PIO_MAX_NAME];
10701071 adios2_variable *variableH = NULL ;
10711072 adios2_variable *num_decomp_block_writers_varid = NULL ;
10721073 if (file->adios_io_process == 1 )
@@ -1089,7 +1090,6 @@ static int PIOc_write_decomp_adios(file_desc_t *file, int ioid)
10891090 /* Variable to store the number of writer blocks, in case buffer merging doesn't happen */
10901091 if (file->block_myrank == 0 )
10911092 {
1092- char name_varid[PIO_MAX_NAME];
10931093 snprintf (name_varid, PIO_MAX_NAME, " /__pio__/track/num_decomp_block_writers/%d" , ioid);
10941094 av_count = 1 ;
10951095 num_decomp_block_writers_varid = adios2_inquire_variable (file->ioH , name_varid);
@@ -1157,6 +1157,23 @@ static int PIOc_write_decomp_adios(file_desc_t *file, int ioid)
11571157 " Setting (ADIOS) selection to variable (name=%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
11581158 name, convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
11591159 }
1160+
1161+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1162+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1163+ {
1164+ if (count_val == 1 )
1165+ {
1166+ adiosErr = adios2_remove_operations (variableH);
1167+ if (adiosErr != adios2_error_none)
1168+ {
1169+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1170+ " Removing all current operations associated with variable (name=%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1171+ name, convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1172+ }
1173+ }
1174+ }
1175+ #endif
1176+
11601177 adiosErr = adios2_put (file->engineH , variableH, file->block_array , adios2_mode_sync);
11611178 if (adiosErr != adios2_error_none)
11621179 {
@@ -1172,12 +1189,25 @@ static int PIOc_write_decomp_adios(file_desc_t *file, int ioid)
11721189 /* Write the number of block writers */
11731190 if (file->adios_io_process == 1 && file->block_myrank == 0 )
11741191 {
1192+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1193+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1194+ {
1195+ adiosErr = adios2_remove_operations (num_decomp_block_writers_varid);
1196+ if (adiosErr != adios2_error_none)
1197+ {
1198+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1199+ " Removing all current operations associated with variable (name=%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1200+ name_varid, convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1201+ }
1202+ }
1203+ #endif
1204+
11751205 adiosErr = adios2_put (file->engineH , num_decomp_block_writers_varid, &num_decomp_block_writers, adios2_mode_sync);
11761206 if (adiosErr != adios2_error_none)
11771207 {
11781208 return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
11791209 " Putting (ADIOS) variable (name=%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1180- name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1210+ name_varid , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
11811211 }
11821212 (file->num_written_blocks )++;
11831213 }
@@ -1447,6 +1477,23 @@ static int check_adios2_need_to_flush(file_desc_t *file, adios_var_desc_t *av)
14471477 " Setting (ADIOS) selection to variable (name=num_data_block_writers/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
14481478 av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
14491479 }
1480+
1481+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1482+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1483+ {
1484+ if (count_val == 1 )
1485+ {
1486+ adiosErr = adios2_remove_operations (av->num_block_writers_varid );
1487+ if (adiosErr != adios2_error_none)
1488+ {
1489+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1490+ " Removing all current operations associated with variable (name=num_data_block_writers/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1491+ av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1492+ }
1493+ }
1494+ }
1495+ #endif
1496+
14501497 adiosErr = adios2_put (file->engineH , av->num_block_writers_varid , av->num_wb_buffer , adios2_mode_sync);
14511498 if (adiosErr != adios2_error_none)
14521499 {
@@ -1471,6 +1518,23 @@ static int check_adios2_need_to_flush(file_desc_t *file, adios_var_desc_t *av)
14711518 " Setting (ADIOS) selection to variable (name=fillval_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
14721519 av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
14731520 }
1521+
1522+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1523+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1524+ {
1525+ if (count_val == 1 )
1526+ {
1527+ adiosErr = adios2_remove_operations (av->fillval_varid );
1528+ if (adiosErr != adios2_error_none)
1529+ {
1530+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1531+ " Removing all current operations associated with variable (name=fillval_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1532+ av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1533+ }
1534+ }
1535+ }
1536+ #endif
1537+
14741538 adiosErr = adios2_put (file->engineH , av->fillval_varid , av->fillval_buffer , adios2_mode_sync);
14751539 if (adiosErr != adios2_error_none)
14761540 {
@@ -1495,6 +1559,23 @@ static int check_adios2_need_to_flush(file_desc_t *file, adios_var_desc_t *av)
14951559 " Setting (ADIOS) selection to variable (name=decomp_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
14961560 av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
14971561 }
1562+
1563+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1564+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1565+ {
1566+ if (count_val == 1 )
1567+ {
1568+ adiosErr = adios2_remove_operations (av->decomp_varid );
1569+ if (adiosErr != adios2_error_none)
1570+ {
1571+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1572+ " Removing all current operations associated with variable (name=decomp_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1573+ av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1574+ }
1575+ }
1576+ }
1577+ #endif
1578+
14981579 adiosErr = adios2_put (file->engineH , av->decomp_varid , av->decomp_buffer , adios2_mode_sync);
14991580 if (adiosErr != adios2_error_none)
15001581 {
@@ -1519,6 +1600,23 @@ static int check_adios2_need_to_flush(file_desc_t *file, adios_var_desc_t *av)
15191600 " Setting (ADIOS) selection to variable (name=frame_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
15201601 av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
15211602 }
1603+
1604+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1605+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1606+ {
1607+ if (count_val == 1 )
1608+ {
1609+ adiosErr = adios2_remove_operations (av->frame_varid );
1610+ if (adiosErr != adios2_error_none)
1611+ {
1612+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1613+ " Removing all current operations associated with variable (name=frame_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1614+ av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1615+ }
1616+ }
1617+ }
1618+ #endif
1619+
15221620 adiosErr = adios2_put (file->engineH , av->frame_varid , av->frame_buffer , adios2_mode_sync);
15231621 if (adiosErr != adios2_error_none)
15241622 {
@@ -1863,6 +1961,23 @@ static int PIOc_write_darray_adios(file_desc_t *file, int varid, int ioid,
18631961 " Setting (ADIOS) selection to variable (name=decomp_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
18641962 av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
18651963 }
1964+
1965+ #if defined(_SPIO_ADIOS_USE_LOSSY_COMPRESSION) && defined(ADIOS2_HAVE_ZFP)
1966+ if (file->iosystem ->adios_lossy_compression_method == ADIOS_COMPRESSION_METHOD_ZFP)
1967+ {
1968+ if (count_val == 1 )
1969+ {
1970+ adiosErr = adios2_remove_operations (av->adios_varid );
1971+ if (adiosErr != adios2_error_none)
1972+ {
1973+ return pio_err (NULL , file, PIO_EADIOS2ERR, __FILE__, __LINE__,
1974+ " Removing all current operations associated with variable (name=decomp_id/%s) failed (adios2_error=%s) for file (%s, ncid=%d)" ,
1975+ av->name , convert_adios2_error_to_string (adiosErr), pio_get_fname_from_file (file), file->pio_ncid );
1976+ }
1977+ }
1978+ }
1979+ #endif
1980+
18661981 adiosErr = adios2_put (file->engineH , av->adios_varid , file->block_array , adios2_mode_sync);
18671982 if (adiosErr != adios2_error_none)
18681983 {
0 commit comments