Skip to content

Commit

Permalink
Updates for 1.3.0.3, handle EINTR on reads and writes, improve dw deb…
Browse files Browse the repository at this point in the history
…ug messages
  • Loading branch information
cornellwright committed Jun 30, 2016
1 parent cd11e15 commit 0e4596e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ HIO NEWS

Last updated 2016-06-18

Release hio.1.3.0.3

Some small test improvements, a fix for partial read and write handling and
improved diagnostic and debug messages related to dw_stage_directory_out calls.
Additionally, an early version of an HDF5 plugin has been added. It is untested
and is not included in the distribution tarball.

Release hio.1.3.0.2

A few minor updates, all related to testing.
Expand Down
16 changes: 12 additions & 4 deletions src/builtin-datawarp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ static int builtin_datawarp_module_dataset_close (hio_dataset_t dataset) {
hioi_err_push (HIO_ERROR, &dataset->ds_object, "builtin-datawarp/dataset_close: error starting "
"data stage on dataset %s::%lld. DWRC: %d", hioi_object_identifier (dataset), dataset->ds_id, rc);

hioi_log (context, HIO_VERBOSE_DEBUG_XLOW, "dw_stage_directory_out(%s, %s, %d) returns %d errno: %d",
dataset_path, pfs_path, stage_mode, rc, errno);
hioi_err_push (HIO_ERROR, &dataset->ds_object, "dw_stage_directory_out(%s, %s, %d) "
"rc: %d errno: %d", dataset_path, pfs_path, stage_mode, rc, errno);

rc = access(dataset_path, R_OK | W_OK | X_OK);
hioi_log (context, HIO_VERBOSE_DEBUG_XLOW, "access(%s, R_OK|W_OK|X_OK) returns %d errno: %d",
dataset_path, rc, errno);
rc = access(pfs_path, R_OK | W_OK | X_OK);
hioi_log (context, HIO_VERBOSE_DEBUG_XLOW, "access(%s, R_OK|W_OK|X_OK) returns %d errno: %d",
pfs_path, rc, errno);


free (pfs_path);
free (dataset_path);
Expand Down Expand Up @@ -213,13 +212,22 @@ static int builtin_datawarp_module_dataset_close (hio_dataset_t dataset) {

/* revoke the end of job stage for the previous dataset */
rc = dw_stage_directory_out (dataset_path, NULL, DW_REVOKE_STAGE_AT_JOB_END);
free (dataset_path);
if (0 != rc) {
hioi_err_push (HIO_ERROR, &dataset->ds_object, "builtin-datawarp/dataset_close: error revoking prior "
"end-of-job stage of dataset %s::%lld. errno: %d", hioi_object_identifier (dataset),
last_stage_id, errno);

hioi_err_push (HIO_ERROR, &dataset->ds_object, "dw_stage_directory_out(%s, NULL, %d) "
"rc: %d errno: %d", dataset_path, stage_mode, rc, errno);

rc = access(dataset_path, R_OK | W_OK | X_OK);
hioi_log (context, HIO_VERBOSE_DEBUG_XLOW, "access(%s, R_OK|W_OK|X_OK) returns %d errno: %d",
dataset_path, rc, errno);

free (dataset_path);
return HIO_ERROR;
}
free (dataset_path);

ds_data->last_scheduled_stage_id = dataset->ds_id;

Expand Down
14 changes: 5 additions & 9 deletions src/hio_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,16 +541,14 @@ ssize_t hioi_file_write (hio_file_t *file, const void *ptr, size_t count) {
total += actual;
count -= actual;
ptr = (void *) ((intptr_t) ptr + actual);
} else if (0 == total) {
total = actual;
}
} while (actual > 0 && count > 0);
}
} while (count > 0 && (actual > 0 || (-1 == actual && EINTR == errno)) );

if (total > 0) {
file->f_offset += total;
}

return total;
return (actual < 0) ? actual: total;
}

ssize_t hioi_file_read (hio_file_t *file, void *ptr, size_t count) {
Expand All @@ -567,16 +565,14 @@ ssize_t hioi_file_read (hio_file_t *file, void *ptr, size_t count) {
total += actual;
count -= actual;
ptr = (void *) ((intptr_t) ptr + actual);
} else if (0 == total) {
total = actual;
}
} while (actual > 0 && count > 0);
} while (count > 0 && (actual > 0 || (-1 == actual && EINTR == errno)) );

if (total > 0) {
file->f_offset += total;
}

return total;
return (actual < 0) ? actual: total;
}

void hioi_file_flush (hio_file_t *file) {
Expand Down

0 comments on commit 0e4596e

Please sign in to comment.