Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 22, 2024
1 parent 2b3638b commit 14cf960
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 35 deletions.
5 changes: 3 additions & 2 deletions src/api/pdc_client_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3149,7 +3149,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d
#endif
if (!(access_type == PDC_WRITE || access_type == PDC_READ)) {
ret_value = FAIL;
printf("Invalid PDC type in function %s @ %d\n", __func__, __LINE__);
printf("Invalid PDC type in function %s @ %d\n", __func__, __LINE__);
goto done;
}
in.n_objs = n_objs;
Expand Down Expand Up @@ -3181,7 +3181,8 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d
&transfer_args, &in);

/* PDC_get_time_str(cur_time); */
/* printf("%s PDC_CLIENT[%d] %s: forwarded to %d\n", cur_time, pdc_client_mpi_rank_g, __func__, data_server_id); */
/* printf("%s PDC_CLIENT[%d] %s: forwarded to %d\n", cur_time, pdc_client_mpi_rank_g, __func__,
* data_server_id); */

#ifdef PDC_TIMING
if (access_type == PDC_READ) {
Expand Down
4 changes: 2 additions & 2 deletions src/api/pdc_region/pdc_region_transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,8 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size,
transferinfo = PDC_find_id(transfer_request_id[i]);
transfer_request = (pdc_transfer_request *)(transferinfo->obj_ptr);
if (transfer_request->metadata_id != NULL) {
printf("PDC Client %d: %s attempt to start existing transfer request @ line %d\n",
pdc_client_mpi_rank_g, __func__, __LINE__);
printf("PDC Client %d: %s attempt to start existing transfer request @ line %d\n",
pdc_client_mpi_rank_g, __func__, __LINE__);
return FAIL;
}
if (transfer_request->consistency == PDC_CONSISTENCY_POSIX) {
Expand Down
4 changes: 2 additions & 2 deletions src/commons/utils/include/pdc_timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,6 @@ int PDC_timing_report(const char *prefix);
#endif

extern int pdc_timing_rank_g;
void PDC_get_time_str(char *cur_time);
int PDC_get_rank();
void PDC_get_time_str(char *cur_time);
int PDC_get_rank();
#endif
14 changes: 3 additions & 11 deletions src/commons/utils/pdc_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ PDC_get_rank()
#else
return 0;
#endif

}

inline void
Expand All @@ -560,16 +559,9 @@ PDC_get_time_str(char *cur_time)
assert(cur_time);

clock_gettime(CLOCK_REALTIME, &ts);
sprintf(cur_time, "%04d-%02d-%02d %02d:%02d:%02d.%06ld",
1900 + localtime(&ts.tv_sec)->tm_year,
localtime(&ts.tv_sec)->tm_mon + 1,
localtime(&ts.tv_sec)->tm_mday,
localtime(&ts.tv_sec)->tm_hour,
localtime(&ts.tv_sec)->tm_min,
localtime(&ts.tv_sec)->tm_sec,
ts.tv_nsec / 1000);
sprintf(cur_time, "%04d-%02d-%02d %02d:%02d:%02d.%06ld", 1900 + localtime(&ts.tv_sec)->tm_year,
localtime(&ts.tv_sec)->tm_mon + 1, localtime(&ts.tv_sec)->tm_mday, localtime(&ts.tv_sec)->tm_hour,
localtime(&ts.tv_sec)->tm_min, localtime(&ts.tv_sec)->tm_sec, ts.tv_nsec / 1000);

return;
}


2 changes: 1 addition & 1 deletion src/server/pdc_client_server_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ hg_thread_pool_t *hg_test_thread_pool_fs_g = NULL;
uint64_t pdc_id_seq_g = PDC_SERVER_ID_INTERVEL;
// actual value for each server is set by PDC_Server_init()

struct timeval last_cache_activity_timeval_g;
struct timeval last_cache_activity_timeval_g;

#include "pdc_server_region_request_handler.h"

Expand Down
22 changes: 12 additions & 10 deletions src/server/pdc_server_region/pdc_server_region_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_
pdc_obj_cache * obj_cache, *obj_cache_iter;
pdc_region_cache *region_cache_iter;
uint64_t * overlap_offset, *overlap_size;
perr_t ret_value = SUCCEED;
char cur_time[64];
perr_t ret_value = SUCCEED;
char cur_time[64];

FUNC_ENTER(NULL);
#ifdef PDC_TIMING
Expand Down Expand Up @@ -721,7 +721,7 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int
int merged_request_size = 0;
uint64_t unit;
struct pdc_region_info **obj_regions;
char cur_time[64];
char cur_time[64];
#ifdef PDC_TIMING
double start_time = MPI_Wtime();
#endif
Expand Down Expand Up @@ -799,7 +799,8 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int
region_cache_iter = obj_cache->region_cache;
while (region_cache_iter != NULL) {
/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d.%d]: %s going to write out\n", cur_time, PDC_get_rank(), flag, __func__); */
/* printf("%s ==PDC_SERVER[%d.%d]: %s going to write out\n", cur_time, PDC_get_rank(), flag,
* __func__); */

region_cache_info = region_cache_iter->region_cache_info;
PDC_Server_transfer_request_io(obj_id, obj_cache->ndim, obj_cache->dims, region_cache_info,
Expand All @@ -812,8 +813,8 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int
write_size *= region_cache_info->size[2];

PDC_get_time_str(cur_time);
printf("%s ==PDC_SERVER[%d.%d]: %s server flushed %.1f / %.1f MB to storage\n", cur_time, PDC_get_rank(),
flag, __func__, write_size / 1048576.0, total_cache_size / 1048576.0);
printf("%s ==PDC_SERVER[%d.%d]: %s server flushed %.1f / %.1f MB to storage\n", cur_time,
PDC_get_rank(), flag, __func__, write_size / 1048576.0, total_cache_size / 1048576.0);

total_cache_size -= write_size;
free(region_cache_info->offset);
Expand Down Expand Up @@ -932,7 +933,8 @@ PDC_region_cache_clock_cycle(void *ptr)
if (elapsed_time >= pdc_idle_flush_time_g) {

/* PDC_get_time_str(cur_time); */
/* fprintf(stderr, "%s ==PDC_SERVER[%d.1]: %s going to flush with idle time\n", cur_time, PDC_get_rank(), __func__); */
/* fprintf(stderr, "%s ==PDC_SERVER[%d.1]: %s going to flush with idle time\n", cur_time,
* PDC_get_rank(), __func__); */

pthread_mutex_lock(&pdc_obj_cache_list_mutex);
nflush = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache, 1);
Expand All @@ -944,16 +946,16 @@ PDC_region_cache_clock_cycle(void *ptr)

if (nflush > 0) {
PDC_get_time_str(cur_time);
fprintf(stderr, "%s ==PDC_SERVER[%d.1]: flushed %d regions to storage, took %.4fs\n", cur_time,
PDC_get_rank(), nflush, elapsed_time);
fprintf(stderr, "%s ==PDC_SERVER[%d.1]: flushed %d regions to storage, took %.4fs\n",
cur_time, PDC_get_rank(), nflush, elapsed_time);
}
}
else {
obj_cache_iter = obj_cache_iter->next;
/* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */

/* PDC_get_time_str(cur_time); */
/* fprintf(stderr, "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", */
/* fprintf(stderr, "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", */
/* cur_time,PDC_get_rank()); */

usleep(300000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info)

FUNC_ENTER(NULL);


/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); */

Expand Down Expand Up @@ -581,7 +580,8 @@ HG_TEST_RPC_CB(transfer_request_all, handle)
HG_Get_input(handle, &in);

/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d]: enter %s process CLIENT[%d]\n", cur_time, PDC_get_rank(), __func__, in.client_id); */
/* printf("%s ==PDC_SERVER[%d]: enter %s process CLIENT[%d]\n", cur_time, PDC_get_rank(), __func__,
* in.client_id); */

gettimeofday(&last_cache_activity_timeval_g, NULL);

Expand Down Expand Up @@ -659,7 +659,8 @@ HG_TEST_RPC_CB(transfer_request_all, handle)
#endif

/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d]: leaving %s responded CLIENT[%d]\n", cur_time, PDC_get_rank(), __func__, in.client_id); */
/* printf("%s ==PDC_SERVER[%d]: leaving %s responded CLIENT[%d]\n", cur_time, PDC_get_rank(), __func__,
* in.client_id); */

fflush(stdout);
FUNC_LEAVE(ret_value);
Expand Down
10 changes: 6 additions & 4 deletions src/server/pdc_server_region/pdc_server_region_transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ PDC_finish_request(uint64_t transfer_request_id)
perr_t ret_value = SUCCEED;
transfer_request_wait_out_t out;
transfer_request_wait_all_out_t out_all;
char cur_time[64];
char cur_time[64];

FUNC_ENTER(NULL);

Expand All @@ -100,15 +100,17 @@ PDC_finish_request(uint64_t transfer_request_id)
if (ptr->out_type) {

/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d]: enter %s, out_all ret\n", cur_time, PDC_get_rank(), __func__); */
/* printf("%s ==PDC_SERVER[%d]: enter %s, out_all ret\n", cur_time, PDC_get_rank(),
* __func__); */

out_all.ret = 1;
ret_value = HG_Respond(ptr->handle, NULL, NULL, &out_all);
}
else {

/* PDC_get_time_str(cur_time); */
/* printf("%s ==PDC_SERVER[%d]: enter %s, out ret\n", cur_time, PDC_get_rank(), __func__); */
/* printf("%s ==PDC_SERVER[%d]: enter %s, out ret\n", cur_time, PDC_get_rank(),
* __func__); */

out.ret = 1;
ret_value = HG_Respond(ptr->handle, NULL, NULL, &out);
Expand Down Expand Up @@ -275,7 +277,7 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob
char storage_location[ADDR_MAX];
ssize_t io_size;
uint64_t i, j;
char cur_time[64];
char cur_time[64];

FUNC_ENTER(NULL);

Expand Down

0 comments on commit 14cf960

Please sign in to comment.