Skip to content

Commit

Permalink
Add test code
Browse files Browse the repository at this point in the history
  • Loading branch information
houjun committed Aug 10, 2023
1 parent dc66f50 commit 5b3c393
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server/pdc_server_region/pdc_server_region_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache)
char ** buf, **new_buf, *buf_ptr = NULL;
uint64_t * start, *end, *new_start, *new_end;
int merged_request_size = 0;
int server_rank = 0;
uint64_t unit;
struct pdc_region_info **obj_regions;
#ifdef PDC_TIMING
Expand Down Expand Up @@ -751,6 +752,9 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache)
nflush += merged_request_size;
}

#ifdef ENABLE_MPI
MPI_Comm_rank(MPI_COMM_WORLD, &server_rank);
#endif
// Iterate through all cache regions and use POSIX I/O to write them back to file system.
region_cache_iter = obj_cache->region_cache;
while (region_cache_iter != NULL) {
Expand All @@ -764,6 +768,9 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache)
if (obj_cache->ndim >= 3)
write_size *= region_cache_info->size[2];

printf("==PDC_SERVER[%d]: server flushed %.1f / %.1f MB to storage\n", server_rank,
write_size / 1048576.0, total_cache_size / 1048576.0);

total_cache_size -= write_size;
free(region_cache_info->offset);
if (obj_cache->ndim > 1) {
Expand Down

0 comments on commit 5b3c393

Please sign in to comment.