From 246a500160610a40007c20d73274acd8f2fe168c Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Fri, 2 Aug 2024 12:23:19 -0700 Subject: [PATCH 01/23] Paritial fix for the region transfer/wait performance issue --- src/api/pdc_client_connect.c | 73 +++ src/api/pdc_region/pdc_region_transfer.c | 27 +- src/server/include/pdc_client_server_common.h | 41 ++ src/server/pdc_client_server_common.c | 33 +- src/server/pdc_server.c | 3 +- .../pdc_server_region_cache.c | 135 ++++-- .../pdc_server_region_request_handler.h | 45 +- src/tests/CMakeLists.txt | 1 + src/tests/vpicio_mts_all.c | 420 ++++++++++++++++++ 9 files changed, 734 insertions(+), 44 deletions(-) create mode 100644 src/tests/vpicio_mts_all.c diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index b89006293..e91675383 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -154,6 +154,7 @@ static hg_id_t data_server_write_check_register_id_g; static hg_id_t data_server_write_register_id_g; static hg_id_t server_checkpoint_rpc_register_id_g; static hg_id_t send_shm_register_id_g; +static hg_id_t send_rpc_register_id_g; // bulk static hg_id_t query_partial_register_id_g; @@ -904,6 +905,76 @@ PDC_Client_try_lookup_server(int server_id, int is_init) FUNC_LEAVE(ret_value); } +static hg_return_t +send_rpc_cb(const struct hg_cb_info *callback_info) +{ + FUNC_ENTER(NULL); + + hg_return_t ret_value; + + struct _pdc_client_lookup_args *client_lookup_args = (struct _pdc_client_lookup_args *)callback_info->arg; + hg_handle_t handle = callback_info->info.forward.handle; + + /* Get output from server*/ + metadata_add_tag_out_t output; + ret_value = HG_Get_output(handle, &output); + if (ret_value != HG_SUCCESS) { + client_lookup_args->ret = -1; + PGOTO_ERROR(HG_OTHER_ERROR, "==PDC_CLIENT[%d]: metadata_add_tag_rpc_cb error with HG_Get_output", + pdc_client_mpi_rank_g); + } + client_lookup_args->ret = output.ret; + +done: + fflush(stdout); + hg_atomic_decr32(&atomic_work_todo_g); + HG_Free_output(handle, &output); + + FUNC_LEAVE(ret_value); +} + +perr_t +PDC_Client_send_rpc(int server_id) +{ + perr_t ret_value = SUCCEED; + hg_return_t hg_ret = 0; + struct _pdc_client_lookup_args lookup_args; + hg_handle_t handle; + send_rpc_in_t in; + + FUNC_ENTER(NULL); + + if (server_id < 0 || server_id >= pdc_server_num_g) + PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: %s invalid server ID %d", pdc_client_mpi_rank_g, __func__, server_id); + + // Debug statistics for counting number of messages sent to each server. + debug_server_id_count[server_id]++; + + if (PDC_Client_try_lookup_server(server_id, 0) != SUCCEED) + PGOTO_ERROR(FAIL, "==CLIENT[%d]: ERROR with PDC_Client_try_lookup_server", pdc_client_mpi_rank_g); + + HG_Create(send_context_g, pdc_server_info_g[server_id].addr, send_rpc_register_id_g, &handle); + + in.value = pdc_client_mpi_rank_g; + + hg_ret = HG_Forward(handle, send_rpc_cb, &lookup_args, &in); + if (hg_ret != HG_SUCCESS) + PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: - HG_Forward Error!", pdc_client_mpi_rank_g); + + // No need to wait + // Wait for response from server + hg_atomic_set32(&atomic_work_todo_g, 1); + + PDC_Client_check_response(&send_context_g); + +done: + fflush(stdout); + HG_Destroy(handle); + + FUNC_LEAVE(ret_value); +} + + // Callback function for HG_Forward() // Gets executed after a call to HG_Trigger and the RPC has completed static hg_return_t @@ -1291,6 +1362,7 @@ PDC_Client_mercury_init(hg_class_t **hg_class, hg_context_t **hg_context, int po data_server_write_register_id_g = PDC_data_server_write_register(*hg_class); server_checkpoint_rpc_register_id_g = PDC_server_checkpoint_rpc_register(*hg_class); send_shm_register_id_g = PDC_send_shm_register(*hg_class); + send_rpc_register_id_g = PDC_send_rpc_register(*hg_class); // bulk query_partial_register_id_g = PDC_query_partial_register(*hg_class); @@ -3091,6 +3163,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d PGOTO_ERROR(FAIL, "PDC_CLIENT: transfer request failed... @ line %d\n", __LINE__); HG_Destroy(client_send_transfer_request_all_handle); + done: fflush(stdout); FUNC_LEAVE(ret_value); diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index ee4e48c8b..6bae6d286 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -1239,6 +1239,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ int * bulk_buf_ref; FUNC_ENTER(NULL); + + if (size == 0) + goto done; + metadata_id = (uint64_t *)malloc(sizeof(uint64_t) * size); read_bulk_buf = (char **)malloc(sizeof(char *) * size); index = 0; @@ -1253,6 +1257,7 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ bulk_buf_ref[0] = n_objs; // printf("checkpoint @ line %d, index = %d, dataserver_id = %d, n_objs = %d\n", __LINE__, index, // transfer_requests[index]->data_server_id, n_objs); + /* printf("==PDC_CLIENT[%d]: %s 1 send to server %d\n", pdc_client_mpi_rank_g, __func__, transfer_requests[index]->data_server_id); */ PDC_Client_transfer_request_all(n_objs, transfer_requests[index]->transfer_request->access_type, transfer_requests[index]->data_server_id, bulk_buf, bulk_buf_size, metadata_id + index); @@ -1288,9 +1293,11 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ bulk_buf_ref[0] = n_objs; // printf("checkpoint @ line %d, index = %d, dataserver_id = %d, n_objs = %d\n", __LINE__, index, // transfer_requests[index]->data_server_id, n_objs); + /* printf("==PDC_CLIENT[%d]: %s 2 send to server %d\n", pdc_client_mpi_rank_g, __func__, transfer_requests[index]->data_server_id); */ PDC_Client_transfer_request_all(n_objs, transfer_requests[index]->transfer_request->access_type, transfer_requests[index]->data_server_id, bulk_buf, bulk_buf_size, metadata_id + index); + // printf("transfer request towards data server %d\n", transfer_requests[index]->data_server_id); for (j = index; j < size; ++j) { // All requests share the same bulk buffer, reference counter is also shared among all @@ -1308,9 +1315,17 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ // transfer_requests[j]->transfer_request->obj_id, transfer_requests[j]->index, metadata_id[j]); } } + + // TODO: Tang workaround, send an RPC to the target server to trigger bulk transfer on the server + /* usleep((pdc_client_mpi_rank_g % 64) * 1000); */ + int data_server_id = transfer_requests[index]->data_server_id; + /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, data_server_id); */ + PDC_Client_send_rpc(data_server_id); + free(read_bulk_buf); free(metadata_id); +done: fflush(stdout); FUNC_LEAVE(ret_value); } @@ -1340,18 +1355,22 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) */ // Start write requests - PDC_Client_start_all_requests(write_transfer_requests, write_size); + if (write_size > 0) + PDC_Client_start_all_requests(write_transfer_requests, write_size); // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); // Start read requests - PDC_Client_start_all_requests(read_transfer_requests, read_size); + if (read_size > 0) + PDC_Client_start_all_requests(read_transfer_requests, read_size); /* fprintf(stderr, "PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); MPI_Barrier(MPI_COMM_WORLD); */ // For POSIX consistency, we block here until the data is received by the server - PDCregion_transfer_wait_all(posix_transfer_request_id, posix_size); - free(posix_transfer_request_id); + if (posix_size > 0) { + PDCregion_transfer_wait_all(posix_transfer_request_id, posix_size); + free(posix_transfer_request_id); + } // Clean up memory finish_start_all_requests(write_transfer_requests, read_transfer_requests, write_size, read_size); diff --git a/src/server/include/pdc_client_server_common.h b/src/server/include/pdc_client_server_common.h index 98edcacdc..d684434e0 100644 --- a/src/server/include/pdc_client_server_common.h +++ b/src/server/include/pdc_client_server_common.h @@ -454,6 +454,16 @@ typedef struct { pdc_metadata_transfer_t ret; } metadata_query_out_t; +/* Define send_rpc_in_t */ +typedef struct { + int value; +} send_rpc_in_t; + +/* Define send_rpc_out_t */ +typedef struct { + int value; +} send_rpc_out_t; + /* Define metadata_add_tag_in_t */ typedef struct { uint64_t obj_id; @@ -1755,6 +1765,36 @@ hg_proc_pdc_metadata_transfer_t(hg_proc_t proc, void *data) return ret; } +/* Define hg_proc_send_rpc_in_t */ +static HG_INLINE hg_return_t +hg_proc_send_rpc_in_t(hg_proc_t proc, void *data) +{ + hg_return_t ret; + send_rpc_in_t *struct_data = (send_rpc_in_t *)data; + + ret = hg_proc_int32_t(proc, &struct_data->value); + if (ret != HG_SUCCESS) { + // HG_LOG_ERROR("Proc error"); + return ret; + } + return ret; +} + +/* Define hg_proc_send_rpc_out_t */ +static HG_INLINE hg_return_t +hg_proc_send_rpc_out_t(hg_proc_t proc, void *data) +{ + hg_return_t ret; + send_rpc_out_t *struct_data = (send_rpc_out_t *)data; + + ret = hg_proc_int32_t(proc, &struct_data->value); + if (ret != HG_SUCCESS) { + // HG_LOG_ERROR("Proc error"); + return ret; + } + return ret; +} + /* Define hg_proc_metadata_add_tag_in_t */ static HG_INLINE hg_return_t hg_proc_metadata_add_tag_in_t(hg_proc_t proc, void *data) @@ -4222,6 +4262,7 @@ hg_id_t PDC_metadata_add_tag_register(hg_class_t *hg_class); hg_id_t PDC_metadata_add_kvtag_register(hg_class_t *hg_class); hg_id_t PDC_metadata_del_kvtag_register(hg_class_t *hg_class); hg_id_t PDC_metadata_get_kvtag_register(hg_class_t *hg_class); +hg_id_t PDC_send_rpc_register(hg_class_t *hg_class); hg_id_t PDC_transfer_request_register(hg_class_t *hg_class); hg_id_t PDC_transfer_request_all_register(hg_class_t *hg_class); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index d90f83bff..848830723 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -1851,6 +1851,28 @@ HG_TEST_RPC_CB(metadata_delete, handle) FUNC_LEAVE(ret_value); } +/* static hg_return_t */ +// send_rpc_cb(hg_handle_t handle) +HG_TEST_RPC_CB(send_rpc, handle) +{ + send_rpc_in_t in; + send_rpc_out_t out; + hg_return_t ret_value = HG_SUCCESS; + + FUNC_ENTER(NULL); + + HG_Get_input(handle, &in); + /* fprintf(stderr, "==PDC_Server[]: %s received value from client %d\n", __func__, in.value); */ + + out.value = 1; + HG_Respond(handle, NULL, NULL, &out); + + HG_Free_input(handle, &in); + HG_Destroy(handle); + + FUNC_LEAVE(ret_value); +} + /* static hg_return_t */ // metadata_add_tag_cb(hg_handle_t handle) HG_TEST_RPC_CB(metadata_add_tag, handle) @@ -1928,7 +1950,14 @@ HG_TEST_RPC_CB(metadata_add_kvtag, handle) FUNC_ENTER(NULL); HG_Get_input(handle, &in); - PDC_Server_add_kvtag(&in, &out); + if (strcmp(in.kvtag.name, "PDC_NOOP") != 0) { + PDC_Server_add_kvtag(&in, &out); + } + else { + printf("==PDC_SERVER[]: received NOOP\n"); + out.ret = 1; + } + ret_value = HG_Respond(handle, NULL, NULL, &out); HG_Free_input(handle, &in); @@ -6563,6 +6592,7 @@ HG_TEST_THREAD_CB(query_read_obj_name_client_rpc) HG_TEST_THREAD_CB(send_client_storage_meta_rpc) HG_TEST_THREAD_CB(send_shm_bulk_rpc) HG_TEST_THREAD_CB(send_data_query_rpc) +HG_TEST_THREAD_CB(send_rpc) HG_TEST_THREAD_CB(send_nhits) HG_TEST_THREAD_CB(send_bulk_rpc) @@ -6582,6 +6612,7 @@ PDC_FUNC_DECLARE_REGISTER(notify_region_update) PDC_FUNC_DECLARE_REGISTER(metadata_query) PDC_FUNC_DECLARE_REGISTER(container_query) PDC_FUNC_DECLARE_REGISTER(metadata_add_tag) +PDC_FUNC_DECLARE_REGISTER(send_rpc) PDC_FUNC_DECLARE_REGISTER_IN_OUT(metadata_del_kvtag, metadata_get_kvtag_in_t, metadata_add_tag_out_t) PDC_FUNC_DECLARE_REGISTER_IN_OUT(metadata_add_kvtag, metadata_add_kvtag_in_t, metadata_add_tag_out_t) PDC_FUNC_DECLARE_REGISTER(metadata_get_kvtag) diff --git a/src/server/pdc_server.c b/src/server/pdc_server.c index d73fd9b9f..a19ca0d39 100644 --- a/src/server/pdc_server.c +++ b/src/server/pdc_server.c @@ -2009,6 +2009,7 @@ PDC_Server_mercury_register() PDC_metadata_add_kvtag_register(hg_class_g); PDC_metadata_get_kvtag_register(hg_class_g); PDC_metadata_del_kvtag_register(hg_class_g); + PDC_send_rpc_register(hg_class_g); // bulk PDC_query_partial_register(hg_class_g); @@ -2384,4 +2385,4 @@ server_run(int argc, char *argv[]) MPI_Finalize(); #endif return 0; -} \ No newline at end of file +} diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index 40564e784..a5e419295 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -15,6 +15,13 @@ #define PDC_CACHE_FLUSH_TIME_INT 30 #endif +#ifdef PDC_SERVER_IDLE_CACHE_FLUSH_TIME +#define PDC_IDLE_CACHE_FLUSH_TIME_INT PDC_SERVER_IDLE_CACHE_FLUSH_TIME +#else +#define PDC_IDLE_CACHE_FLUSH_TIME_INT 2 +#endif + + typedef struct pdc_region_cache { struct pdc_region_info * region_cache_info; struct pdc_region_cache *next; @@ -38,6 +45,8 @@ static pthread_mutex_t pdc_cache_mutex; static int pdc_recycle_close_flag; static size_t total_cache_size; static size_t maximum_cache_size; +static struct timeval last_cache_activity_timeval_g; +static int pdc_idle_flush_time_g; int PDC_region_server_cache_init() @@ -47,19 +56,27 @@ PDC_region_server_cache_init() pdc_recycle_close_flag = 0; pthread_mutex_init(&pdc_obj_cache_list_mutex, NULL); pthread_mutex_init(&pdc_cache_mutex, NULL); - pthread_create(&pdc_recycle_thread, NULL, &PDC_region_cache_clock_cycle, NULL); total_cache_size = 0; p = getenv("PDC_SERVER_CACHE_MAX_SIZE"); - if (p != NULL) { + if (p != NULL) maximum_cache_size = atol(p); - } - else { + else maximum_cache_size = MAX_CACHE_SIZE; - } + + p = getenv("PDC_SERVER_IDLE_CACHE_FLUSH_TIME"); + if (p != NULL) + pdc_idle_flush_time_g = atol(p); + else + pdc_idle_flush_time_g = PDC_IDLE_CACHE_FLUSH_TIME_INT; obj_cache_list = NULL; obj_cache_list_end = NULL; + + pthread_create(&pdc_recycle_thread, NULL, &PDC_region_cache_clock_cycle, NULL); + + gettimeofday(&last_cache_activity_timeval_g, NULL); + return 0; } @@ -398,13 +415,24 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim size_t buf_size, const uint64_t *offset, const uint64_t *size, int ndim, size_t unit) { + int server_rank = 0; pdc_obj_cache * obj_cache_iter, *obj_cache = NULL; struct pdc_region_info *region_cache_info; if (obj_ndim != ndim && obj_ndim > 0) { - printf("PDC_region_cache_register reports obj_ndim != ndim, %d != %d\n", obj_ndim, ndim); + printf("%s reports obj_ndim != ndim, %d != %d\n", __func__, obj_ndim, ndim); return FAIL; } +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* char cur_time[64]; */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, server_rank, __func__, obj_id); */ + pthread_mutex_lock(&pdc_obj_cache_list_mutex); obj_cache_iter = obj_cache_list; @@ -472,13 +500,11 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim memcpy(region_cache_info->buf, buf, sizeof(char) * buf_size); total_cache_size += buf_size; + gettimeofday(&last_cache_activity_timeval_g, NULL); + pthread_mutex_unlock(&pdc_obj_cache_list_mutex); if (total_cache_size > maximum_cache_size) { - int server_rank = 0; -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif printf("==PDC_SERVER[%d]: server cache full %.1f / %.1f MB, will flush to storage\n", server_rank, total_cache_size / 1048576.0, maximum_cache_size / 1048576.0); PDC_region_cache_flush_all(); @@ -522,9 +548,7 @@ 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; - // char * buf_merged; - // uint64_t * offset_merged, size_merged; - // int merge_status; + int server_rank = 0; perr_t ret_value = SUCCEED; @@ -533,7 +557,15 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ double start = MPI_Wtime(); #endif - // Write 1GB at a time +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* char cur_time[64]; */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, server_rank, __func__, obj_id); */ uint64_t write_size = 0; if (region_info->ndim >= 1) @@ -596,6 +628,12 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ PDC_region_cache_register(obj_id, obj_ndim, obj_dims, buf, write_size, region_info->offset, region_info->size, region_info->ndim, unit); } + /* else { */ + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: %s write is fully contained with cached region\n", cur_time, server_rank, __func__); */ + /* } */ // PDC_Server_data_write_out2(obj_id, region_info, buf, unit); #ifdef PDC_TIMING @@ -852,9 +890,12 @@ PDC_region_cache_clock_cycle(void *ptr) pdc_obj_cache *obj_cache, *obj_cache_iter; struct timeval current_time; struct timeval finish_time; - int nflush = 0; + int nflush = 0, nflush_obj = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; - int server_rank = 0; + int server_rank = 0; + time_t t; + struct tm *tm; + char cur_time[64]; char *p = getenv("PDC_SERVER_CACHE_FLUSH_FREQUENCY_S"); if (p != NULL) @@ -863,44 +904,72 @@ PDC_region_cache_clock_cycle(void *ptr) if (ptr == NULL) { obj_cache_iter = NULL; } + +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: %s start \n", cur_time, server_rank); */ + while (1) { nflush = 0; pthread_mutex_lock(&pdc_cache_mutex); if (!pdc_recycle_close_flag) { - pthread_mutex_lock(&pdc_obj_cache_list_mutex); + /* pthread_mutex_lock(&pdc_obj_cache_list_mutex); */ gettimeofday(¤t_time, NULL); obj_cache_iter = obj_cache_list; - nflush = 0; + nflush = 0; while (obj_cache_iter != NULL) { + pthread_mutex_lock(&pdc_obj_cache_list_mutex); obj_cache = obj_cache_iter; - // flush every *flush_frequency_s seconds - elapsed_time = current_time.tv_sec - obj_cache->timestamp.tv_sec + - (current_time.tv_usec - obj_cache->timestamp.tv_usec) / 1000000.0; + /* // flush every *flush_frequency_s seconds */ + /* elapsed_time = current_time.tv_sec - obj_cache->timestamp.tv_sec + */ + /* (current_time.tv_usec - obj_cache->timestamp.tv_usec) / 1000000.0; */ + /* /1* if (current_time.tv_sec - obj_cache->timestamp.tv_sec > flush_frequency_s) { *1/ */ + /* if (elapsed_time >= flush_frequency_s) { */ + /* nflush += PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); */ + /* } */ + elapsed_time = current_time.tv_sec - last_cache_activity_timeval_g.tv_sec + + (current_time.tv_usec - last_cache_activity_timeval_g.tv_usec) / 1000000.0; /* if (current_time.tv_sec - obj_cache->timestamp.tv_sec > flush_frequency_s) { */ - if (elapsed_time >= flush_frequency_s) { - nflush += PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); + if (elapsed_time >= pdc_idle_flush_time_g) { + nflush_obj = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); + if (nflush_obj > 0) { + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + fprintf(stderr, + "%s ==PDC_SERVER[%d]: server without cache activity for over %ds, start flush %llu\n", + cur_time, server_rank, pdc_idle_flush_time_g, obj_cache->obj_id); + nflush += nflush_obj; + } } obj_cache_iter = obj_cache_iter->next; - } + pthread_mutex_unlock(&pdc_obj_cache_list_mutex); + usleep(10000); + } // End while obj_cache_iter if (nflush > 0) { -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif gettimeofday(&finish_time, NULL); elapsed_time = finish_time.tv_sec - current_time.tv_sec + (finish_time.tv_usec - current_time.tv_usec) / 1000000.0; + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); fprintf(stderr, - "==PDC_SERVER[%d]: flushed %d regions to storage (full/every %.0fs), took %.4fs\n", - server_rank, nflush, flush_frequency_s, elapsed_time); + "%s ==PDC_SERVER[%d]: flushed %d regions to storage (full/every %.0fs), took %.4fs\n", + cur_time, server_rank, nflush, flush_frequency_s, elapsed_time); } - pthread_mutex_unlock(&pdc_obj_cache_list_mutex); - } + /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ + } // End if pdc_recycle_close_flag else { pthread_mutex_unlock(&pdc_cache_mutex); break; } pthread_mutex_unlock(&pdc_cache_mutex); - usleep(500); + usleep(10000); } return 0; } @@ -983,4 +1052,4 @@ PDC_region_fetch(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims, struct } return 0; } -#endif \ No newline at end of file +#endif diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 04ab48481..0754f54e3 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -170,10 +170,19 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; struct pdc_region_info * remote_reg_info; - int i; + int i, server_rank; FUNC_ENTER(NULL); +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* char cur_time[64]; */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ + #ifdef PDC_TIMING double end = MPI_Wtime(), start; pdc_server_timings->PDCreg_transfer_request_start_all_write_bulk_rpc += end - local_bulk_args->start_time; @@ -182,7 +191,6 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) start = MPI_Wtime(); #endif - // printf("entering transfer_request_all_bulk_transfer_write_cb\n"); remote_reg_info = (struct pdc_region_info *)malloc(sizeof(struct pdc_region_info)); request_data.n_objs = local_bulk_args->in.n_objs; parse_bulk_data(local_bulk_args->data_buf, &request_data, PDC_WRITE); @@ -245,6 +253,11 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pdc_timestamp_register(pdc_transfer_request_inner_write_all_bulk_timestamps, start, end); #endif + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, server_rank, __func__); */ + FUNC_LEAVE(ret); } @@ -322,9 +335,19 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) hg_return_t ret = HG_SUCCESS; struct pdc_region_info * remote_reg_info; uint64_t obj_dims[3]; + int server_rank; FUNC_ENTER(NULL); +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + time_t t = time(NULL); + struct tm *tm = localtime(&t); + char cur_time[64]; + strftime(cur_time, sizeof(cur_time), "%c", tm); + printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); + #ifdef PDC_TIMING double end = MPI_Wtime(), start; pdc_server_timings->PDCreg_transfer_request_start_write_bulk_rpc += end - local_bulk_args->start_time; @@ -333,8 +356,6 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) start = MPI_Wtime(); #endif - // printf("entering transfer bulk callback\n"); - remote_reg_info = (struct pdc_region_info *)malloc(sizeof(struct pdc_region_info)); remote_reg_info->ndim = (local_bulk_args->in.remote_region).ndim; @@ -548,10 +569,19 @@ HG_TEST_RPC_CB(transfer_request_all, handle) transfer_request_all_in_t in; transfer_request_all_out_t out; hg_return_t ret_value = HG_SUCCESS; - int i; + int i, server_rank; FUNC_ENTER(NULL); +#ifdef ENABLE_MPI + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); +#endif + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* char cur_time[64]; */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ + #ifdef PDC_TIMING double start = MPI_Wtime(), end; #endif @@ -623,6 +653,11 @@ HG_TEST_RPC_CB(transfer_request_all, handle) } #endif + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, server_rank, __func__); */ + fflush(stdout); FUNC_LEAVE(ret_value); } diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 30667ddcd..ccee3687c 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -88,6 +88,7 @@ set(PROGRAMS delete_obj vpicio vpicio_mts + vpicio_mts_all bdcats vpicio_old bdcats_old diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c new file mode 100644 index 000000000..603524368 --- /dev/null +++ b/src/tests/vpicio_mts_all.c @@ -0,0 +1,420 @@ +/* + * Copyright Notice for + * Proactive Data Containers (PDC) Software Library and Utilities + * ----------------------------------------------------------------------------- + + *** Copyright Notice *** + + * Proactive Data Containers (PDC) Copyright (c) 2017, The Regents of the + * University of California, through Lawrence Berkeley National Laboratory, + * UChicago Argonne, LLC, operator of Argonne National Laboratory, and The HDF + * Group (subject to receipt of any required approvals from the U.S. Dept. of + * Energy). All rights reserved. + + * If you have questions about your rights to use or distribute this software, + * please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov. + + * NOTICE. This Software was developed under funding from the U.S. Department of + * Energy and the U.S. Government consequently retains certain rights. As such, the + * U.S. Government has been granted for itself and others acting on its behalf a + * paid-up, nonexclusive, irrevocable, worldwide license in the Software to + * reproduce, distribute copies to the public, prepare derivative works, and + * perform publicly and display publicly, and to permit other to do so. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pdc.h" + +#define NPARTICLES 8388608 + +double +uniform_random_number() +{ + return (((double)rand()) / ((double)(RAND_MAX))); +} + +void +print_usage() +{ + printf("Usage: srun -n ./vpicio #particles #steps sleep_time(s)\n"); +} + +int +main(int argc, char **argv) +{ + int rank = 0, size = 1; + pdcid_t pdc_id, cont_prop, cont_id, region_local, region_remote; + pdcid_t obj_prop_float, obj_prop_int; + pdcid_t obj_xx, obj_yy, obj_zz, obj_pxx, obj_pyy, obj_pzz, obj_id11, obj_id22; +#ifdef ENABLE_MPI + MPI_Comm comm; +#else + int comm = 1; +#endif + float *x, *y, *z, *px, *py, *pz; + int *id1, *id2; + int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; + uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; + double t0, t1; + char cur_time[64]; + time_t t; + struct tm *tm; + + pdcid_t transfer_request_x, transfer_request_y, transfer_request_z, transfer_request_px, + transfer_request_py, transfer_request_pz, transfer_request_id1, transfer_request_id2; + pdcid_t transfer_requests[8]; + +#ifdef ENABLE_MPI + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_dup(MPI_COMM_WORLD, &comm); +#endif + + numparticles = NPARTICLES; + if (argc == 4) { + numparticles = atoll(argv[1]); + steps = atoi(argv[2]); + sleeptime = atoi(argv[3]); + } + if (rank == 0) + printf("Writing %" PRIu64 " number of particles for %d steps with %d clients.\n", + numparticles, steps, size); + + dims[0] = numparticles * size; + + x = (float *)malloc(numparticles * sizeof(float)); + y = (float *)malloc(numparticles * sizeof(float)); + z = (float *)malloc(numparticles * sizeof(float)); + px = (float *)malloc(numparticles * sizeof(float)); + py = (float *)malloc(numparticles * sizeof(float)); + pz = (float *)malloc(numparticles * sizeof(float)); + + id1 = (int *)malloc(numparticles * sizeof(int)); + id2 = (int *)malloc(numparticles * sizeof(int)); + + // create a pdc + pdc_id = PDCinit("pdc"); + + // create a container property + cont_prop = PDCprop_create(PDC_CONT_CREATE, pdc_id); + if (cont_prop <= 0) { + printf("Fail to create container property @ line %d!\n", __LINE__); + return FAIL; + } + // create a container + cont_id = PDCcont_create_col("c1", cont_prop); + if (cont_id <= 0) { + printf("Fail to create container @ line %d!\n", __LINE__); + return FAIL; + } + // create an object property + obj_prop_float = PDCprop_create(PDC_OBJ_CREATE, pdc_id); + PDCprop_set_obj_dims(obj_prop_float, 1, dims); + PDCprop_set_obj_type(obj_prop_float, PDC_FLOAT); + PDCprop_set_obj_user_id(obj_prop_float, getuid()); + PDCprop_set_obj_app_name(obj_prop_float, "VPICIO"); + PDCprop_set_obj_tags(obj_prop_float, "tag0=1"); + PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_LOCAL); + + obj_prop_int = PDCprop_obj_dup(obj_prop_float); + PDCprop_set_obj_type(obj_prop_int, PDC_INT); + + for (uint64_t i = 0; i < numparticles; i++) { + id1[i] = i; + id2[i] = i * 2; + x[i] = uniform_random_number() * x_dim; + y[i] = uniform_random_number() * y_dim; + z[i] = ((float)id1[i] / numparticles) * z_dim; + px[i] = uniform_random_number() * x_dim; + py[i] = uniform_random_number() * y_dim; + pz[i] = ((float)id2[i] / numparticles) * z_dim; + } + + offset_local[0] = 0; + offset_remote[0] = rank * numparticles; + mysize[0] = numparticles; + + // create local and remote region + region_local = PDCregion_create(ndim, offset_local, mysize); + region_remote = PDCregion_create(ndim, offset_remote, mysize); + + for (int iter = 0; iter < steps; iter++) { + + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("\n%s #Step %d\n", cur_time, iter); + t0 = MPI_Wtime(); +#endif + PDCprop_set_obj_time_step(obj_prop_float, iter); + PDCprop_set_obj_time_step(obj_prop_int, iter); + + obj_xx = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop_float, 0, comm); + if (obj_xx == 0) { + printf("Error getting an object id of %s from server\n", "x"); + return FAIL; + } + + obj_yy = PDCobj_create_mpi(cont_id, "obj-var-yy", obj_prop_float, 0, comm); + if (obj_yy == 0) { + printf("Error getting an object id of %s from server\n", "y"); + return FAIL; + } + obj_zz = PDCobj_create_mpi(cont_id, "obj-var-zz", obj_prop_float, 0, comm); + if (obj_zz == 0) { + printf("Error getting an object id of %s from server\n", "z"); + return FAIL; + } + obj_pxx = PDCobj_create_mpi(cont_id, "obj-var-pxx", obj_prop_float, 0, comm); + if (obj_pxx == 0) { + printf("Error getting an object id of %s from server\n", "px"); + return FAIL; + } + obj_pyy = PDCobj_create_mpi(cont_id, "obj-var-pyy", obj_prop_float, 0, comm); + if (obj_pyy == 0) { + printf("Error getting an object id of %s from server\n", "py"); + return FAIL; + } + obj_pzz = PDCobj_create_mpi(cont_id, "obj-var-pzz", obj_prop_float, 0, comm); + if (obj_pzz == 0) { + printf("Error getting an object id of %s from server\n", "pz"); + return FAIL; + } + + obj_id11 = PDCobj_create_mpi(cont_id, "id11", obj_prop_int, 0, comm); + if (obj_id11 == 0) { + printf("Error getting an object id of %s from server\n", "id1"); + return FAIL; + } + obj_id22 = PDCobj_create_mpi(cont_id, "id22", obj_prop_int, 0, comm); + if (obj_id22 == 0) { + printf("Error getting an object id of %s from server\n", "id2"); + return FAIL; + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t1 = MPI_Wtime(); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Obj create time: %.5e\n", cur_time, t1 - t0); +#endif + + transfer_requests[0] = PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_local, region_remote); + if (transfer_requests[0] == 0) { + printf("x transfer request creation failed\n"); + return FAIL; + } + transfer_requests[1] = PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_local, region_remote); + if (transfer_requests[1] == 0) { + printf("y transfer request creation failed\n"); + return FAIL; + } + transfer_requests[2] = PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_local, region_remote); + if (transfer_requests[2] == 0) { + printf("z transfer request creation failed\n"); + return FAIL; + } + transfer_requests[3] = PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_local, region_remote); + if (transfer_requests[3] == 0) { + printf("px transfer request creation failed\n"); + return FAIL; + } + transfer_requests[4] = PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_local, region_remote); + if (transfer_requests[4] == 0) { + printf("py transfer request creation failed\n"); + return FAIL; + } + transfer_requests[5] = PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_local, region_remote); + if (transfer_requests[5] == 0) { + printf("pz transfer request creation failed\n"); + return FAIL; + } + transfer_requests[6] = PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_local, region_remote); + if (transfer_requests[6] == 0) { + printf("id1 transfer request creation failed\n"); + return FAIL; + } + transfer_requests[7] = PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_local, region_remote); + if (transfer_requests[7] == 0) { + printf("id2 transfer request creation failed\n"); + return FAIL; + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t0 = MPI_Wtime(); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Transfer create time: %.5e\n", cur_time, t0 - t1); +#endif + + if (PDCregion_transfer_start_all(transfer_requests, 8) != SUCCEED) { + printf("Failed to start transfer requests\n"); + return FAIL; + } + + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t1 = MPI_Wtime(); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Transfer start time: %.5e\n", cur_time, t1 - t0); +#endif + // Emulate compute with sleep + if (iter != steps - 1) { + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Sleep start: %llu.00\n", cur_time, sleeptime); + sleep(sleeptime); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Sleep end: %llu.00\n", cur_time, sleeptime); + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t0 = MPI_Wtime(); +#endif + + if (PDCregion_transfer_wait_all(transfer_requests, 8) != SUCCEED) { + printf("Failed to transfer wait all\n"); + return FAIL; + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t1 = MPI_Wtime(); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Transfer wait time: %.5e\n", cur_time, t1 - t0); +#endif + + for (int j = 0; j < 8; j++) { + if (PDCregion_transfer_close(transfer_requests[j]) != SUCCEED) { + printf("region transfer close failed\n"); + return FAIL; + } + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t0 = MPI_Wtime(); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); + if (rank == 0) + printf("%s Transfer close time: %.5e\n", cur_time, t0 - t1); +#endif + + if (PDCobj_close(obj_xx) != SUCCEED) { + printf("fail to close obj_xx\n"); + return FAIL; + } + if (PDCobj_close(obj_yy) != SUCCEED) { + printf("fail to close object obj_yy\n"); + return FAIL; + } + if (PDCobj_close(obj_zz) != SUCCEED) { + printf("fail to close object obj_zz\n"); + return FAIL; + } + if (PDCobj_close(obj_pxx) != SUCCEED) { + printf("fail to close object obj_pxx\n"); + return FAIL; + } + if (PDCobj_close(obj_pyy) != SUCCEED) { + printf("fail to close object obj_pyy\n"); + return FAIL; + } + if (PDCobj_close(obj_pzz) != SUCCEED) { + printf("fail to close object obj_pzz\n"); + return FAIL; + } + if (PDCobj_close(obj_id11) != SUCCEED) { + printf("fail to close object obj_id11\n"); + return FAIL; + } + if (PDCobj_close(obj_id22) != SUCCEED) { + printf("fail to close object obj_id22\n"); + return FAIL; + } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t1 = MPI_Wtime(); + if (rank == 0) + printf("Obj close time: %.5e\n", t1 - t0); +#endif + } // End for steps + + PDC_timing_report("write"); + + if (PDCprop_close(obj_prop_float) != SUCCEED) { + printf("Fail to close obj_prop_float\n"); + return FAIL; + } + if (PDCprop_close(obj_prop_int) != SUCCEED) { + printf("Fail to close obj_prop_int\n"); + return FAIL; + } + if (PDCregion_close(region_local) != SUCCEED) { + printf("fail to close local region \n"); + return FAIL; + } + if (PDCobj_close(region_remote) != SUCCEED) { + printf("fail to close remote region\n"); + return FAIL; + } + if (PDCcont_close(cont_id) != SUCCEED) { + printf("fail to close container\n"); + return FAIL; + } + if (PDCprop_close(cont_prop) != SUCCEED) { + printf("Fail to close property\n"); + return FAIL; + } + if (PDCclose(pdc_id) != SUCCEED) { + printf("fail to close PDC\n"); + return FAIL; + } + free(x); + free(y); + free(z); + free(px); + free(py); + free(pz); + free(id1); + free(id2); +#ifdef ENABLE_MPI + MPI_Finalize(); +#endif + + return 0; +} From e9b43deca9ce14a267aa7f976ed703b050a2f294 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Aug 2024 19:23:58 +0000 Subject: [PATCH 02/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 14 ++-- src/api/pdc_region/pdc_region_transfer.c | 13 ++-- src/server/include/pdc_client_server_common.h | 4 +- src/server/pdc_client_server_common.c | 2 +- .../pdc_server_region_cache.c | 29 ++++---- .../pdc_server_region_request_handler.h | 4 +- src/tests/vpicio_mts_all.c | 70 ++++++++++--------- 7 files changed, 73 insertions(+), 63 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index e91675383..55bdb294c 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -936,16 +936,17 @@ send_rpc_cb(const struct hg_cb_info *callback_info) perr_t PDC_Client_send_rpc(int server_id) { - perr_t ret_value = SUCCEED; - hg_return_t hg_ret = 0; + perr_t ret_value = SUCCEED; + hg_return_t hg_ret = 0; struct _pdc_client_lookup_args lookup_args; - hg_handle_t handle; - send_rpc_in_t in; + hg_handle_t handle; + send_rpc_in_t in; FUNC_ENTER(NULL); if (server_id < 0 || server_id >= pdc_server_num_g) - PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: %s invalid server ID %d", pdc_client_mpi_rank_g, __func__, server_id); + PGOTO_ERROR(FAIL, "==PDC_CLIENT[%d]: %s invalid server ID %d", pdc_client_mpi_rank_g, __func__, + server_id); // Debug statistics for counting number of messages sent to each server. debug_server_id_count[server_id]++; @@ -974,7 +975,6 @@ PDC_Client_send_rpc(int server_id) FUNC_LEAVE(ret_value); } - // Callback function for HG_Forward() // Gets executed after a call to HG_Trigger and the RPC has completed static hg_return_t @@ -3163,7 +3163,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d PGOTO_ERROR(FAIL, "PDC_CLIENT: transfer request failed... @ line %d\n", __LINE__); HG_Destroy(client_send_transfer_request_all_handle); - + done: fflush(stdout); FUNC_LEAVE(ret_value); diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 6bae6d286..5092e4fd8 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -1257,7 +1257,8 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ bulk_buf_ref[0] = n_objs; // printf("checkpoint @ line %d, index = %d, dataserver_id = %d, n_objs = %d\n", __LINE__, index, // transfer_requests[index]->data_server_id, n_objs); - /* printf("==PDC_CLIENT[%d]: %s 1 send to server %d\n", pdc_client_mpi_rank_g, __func__, transfer_requests[index]->data_server_id); */ + /* printf("==PDC_CLIENT[%d]: %s 1 send to server %d\n", pdc_client_mpi_rank_g, __func__, + * transfer_requests[index]->data_server_id); */ PDC_Client_transfer_request_all(n_objs, transfer_requests[index]->transfer_request->access_type, transfer_requests[index]->data_server_id, bulk_buf, bulk_buf_size, metadata_id + index); @@ -1293,11 +1294,12 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ bulk_buf_ref[0] = n_objs; // printf("checkpoint @ line %d, index = %d, dataserver_id = %d, n_objs = %d\n", __LINE__, index, // transfer_requests[index]->data_server_id, n_objs); - /* printf("==PDC_CLIENT[%d]: %s 2 send to server %d\n", pdc_client_mpi_rank_g, __func__, transfer_requests[index]->data_server_id); */ + /* printf("==PDC_CLIENT[%d]: %s 2 send to server %d\n", pdc_client_mpi_rank_g, __func__, + * transfer_requests[index]->data_server_id); */ PDC_Client_transfer_request_all(n_objs, transfer_requests[index]->transfer_request->access_type, transfer_requests[index]->data_server_id, bulk_buf, bulk_buf_size, metadata_id + index); - + // printf("transfer request towards data server %d\n", transfer_requests[index]->data_server_id); for (j = index; j < size; ++j) { // All requests share the same bulk buffer, reference counter is also shared among all @@ -1319,9 +1321,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ // TODO: Tang workaround, send an RPC to the target server to trigger bulk transfer on the server /* usleep((pdc_client_mpi_rank_g % 64) * 1000); */ int data_server_id = transfer_requests[index]->data_server_id; - /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, data_server_id); */ + /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, + * data_server_id); */ PDC_Client_send_rpc(data_server_id); - + free(read_bulk_buf); free(metadata_id); diff --git a/src/server/include/pdc_client_server_common.h b/src/server/include/pdc_client_server_common.h index d684434e0..749458430 100644 --- a/src/server/include/pdc_client_server_common.h +++ b/src/server/include/pdc_client_server_common.h @@ -1769,7 +1769,7 @@ hg_proc_pdc_metadata_transfer_t(hg_proc_t proc, void *data) static HG_INLINE hg_return_t hg_proc_send_rpc_in_t(hg_proc_t proc, void *data) { - hg_return_t ret; + hg_return_t ret; send_rpc_in_t *struct_data = (send_rpc_in_t *)data; ret = hg_proc_int32_t(proc, &struct_data->value); @@ -1784,7 +1784,7 @@ hg_proc_send_rpc_in_t(hg_proc_t proc, void *data) static HG_INLINE hg_return_t hg_proc_send_rpc_out_t(hg_proc_t proc, void *data) { - hg_return_t ret; + hg_return_t ret; send_rpc_out_t *struct_data = (send_rpc_out_t *)data; ret = hg_proc_int32_t(proc, &struct_data->value); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index 848830723..c10c3c0e3 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -1857,7 +1857,7 @@ HG_TEST_RPC_CB(send_rpc, handle) { send_rpc_in_t in; send_rpc_out_t out; - hg_return_t ret_value = HG_SUCCESS; + hg_return_t ret_value = HG_SUCCESS; FUNC_ENTER(NULL); diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index a5e419295..4d0edbaa0 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -21,7 +21,6 @@ #define PDC_IDLE_CACHE_FLUSH_TIME_INT 2 #endif - typedef struct pdc_region_cache { struct pdc_region_info * region_cache_info; struct pdc_region_cache *next; @@ -415,7 +414,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim size_t buf_size, const uint64_t *offset, const uint64_t *size, int ndim, size_t unit) { - int server_rank = 0; + int server_rank = 0; pdc_obj_cache * obj_cache_iter, *obj_cache = NULL; struct pdc_region_info *region_cache_info; if (obj_ndim != ndim && obj_ndim > 0) { @@ -424,7 +423,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim } #ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); + MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); #endif /* time_t t = time(NULL); */ @@ -632,7 +631,8 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ /* t = time(NULL); */ /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: %s write is fully contained with cached region\n", cur_time, server_rank, __func__); */ + /* printf("%s ==PDC_SERVER[%d]: %s write is fully contained with cached region\n", cur_time, + * server_rank, __func__); */ /* } */ // PDC_Server_data_write_out2(obj_id, region_info, buf, unit); @@ -892,10 +892,10 @@ PDC_region_cache_clock_cycle(void *ptr) struct timeval finish_time; int nflush = 0, nflush_obj = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; - int server_rank = 0; - time_t t; - struct tm *tm; - char cur_time[64]; + int server_rank = 0; + time_t t; + struct tm * tm; + char cur_time[64]; char *p = getenv("PDC_SERVER_CACHE_FLUSH_FREQUENCY_S"); if (p != NULL) @@ -921,7 +921,7 @@ PDC_region_cache_clock_cycle(void *ptr) /* pthread_mutex_lock(&pdc_obj_cache_list_mutex); */ gettimeofday(¤t_time, NULL); obj_cache_iter = obj_cache_list; - nflush = 0; + nflush = 0; while (obj_cache_iter != NULL) { pthread_mutex_lock(&pdc_obj_cache_list_mutex); obj_cache = obj_cache_iter; @@ -938,11 +938,12 @@ PDC_region_cache_clock_cycle(void *ptr) if (elapsed_time >= pdc_idle_flush_time_g) { nflush_obj = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); if (nflush_obj > 0) { - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); fprintf(stderr, - "%s ==PDC_SERVER[%d]: server without cache activity for over %ds, start flush %llu\n", + "%s ==PDC_SERVER[%d]: server without cache activity for over %ds, start " + "flush %llu\n", cur_time, server_rank, pdc_idle_flush_time_g, obj_cache->obj_id); nflush += nflush_obj; } @@ -955,9 +956,9 @@ PDC_region_cache_clock_cycle(void *ptr) gettimeofday(&finish_time, NULL); elapsed_time = finish_time.tv_sec - current_time.tv_sec + (finish_time.tv_usec - current_time.tv_usec) / 1000000.0; - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + t = time(NULL); + tm = localtime(&t); + strftime(cur_time, sizeof(cur_time), "%c", tm); fprintf(stderr, "%s ==PDC_SERVER[%d]: flushed %d regions to storage (full/every %.0fs), took %.4fs\n", cur_time, server_rank, nflush, flush_frequency_s, elapsed_time); diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 0754f54e3..41fac8335 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -342,9 +342,9 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) #ifdef ENABLE_MPI MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); #endif - time_t t = time(NULL); + time_t t = time(NULL); struct tm *tm = localtime(&t); - char cur_time[64]; + char cur_time[64]; strftime(cur_time, sizeof(cur_time), "%c", tm); printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c index 603524368..006718834 100644 --- a/src/tests/vpicio_mts_all.c +++ b/src/tests/vpicio_mts_all.c @@ -59,13 +59,13 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x, *y, *z, *px, *py, *pz; - int *id1, *id2; - int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; - uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; - double t0, t1; - char cur_time[64]; - time_t t; + float * x, *y, *z, *px, *py, *pz; + int * id1, *id2; + int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; + uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; + double t0, t1; + char cur_time[64]; + time_t t; struct tm *tm; pdcid_t transfer_request_x, transfer_request_y, transfer_request_z, transfer_request_px, @@ -86,14 +86,14 @@ main(int argc, char **argv) sleeptime = atoi(argv[3]); } if (rank == 0) - printf("Writing %" PRIu64 " number of particles for %d steps with %d clients.\n", - numparticles, steps, size); + printf("Writing %" PRIu64 " number of particles for %d steps with %d clients.\n", numparticles, steps, + size); dims[0] = numparticles * size; - x = (float *)malloc(numparticles * sizeof(float)); - y = (float *)malloc(numparticles * sizeof(float)); - z = (float *)malloc(numparticles * sizeof(float)); + x = (float *)malloc(numparticles * sizeof(float)); + y = (float *)malloc(numparticles * sizeof(float)); + z = (float *)malloc(numparticles * sizeof(float)); px = (float *)malloc(numparticles * sizeof(float)); py = (float *)malloc(numparticles * sizeof(float)); pz = (float *)malloc(numparticles * sizeof(float)); @@ -144,15 +144,14 @@ main(int argc, char **argv) mysize[0] = numparticles; // create local and remote region - region_local = PDCregion_create(ndim, offset_local, mysize); - region_remote = PDCregion_create(ndim, offset_remote, mysize); + region_local = PDCregion_create(ndim, offset_local, mysize); + region_remote = PDCregion_create(ndim, offset_remote, mysize); for (int iter = 0; iter < steps; iter++) { - #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) @@ -208,49 +207,57 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) printf("%s Obj create time: %.5e\n", cur_time, t1 - t0); #endif - transfer_requests[0] = PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_local, region_remote); + transfer_requests[0] = + PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_local, region_remote); if (transfer_requests[0] == 0) { printf("x transfer request creation failed\n"); return FAIL; } - transfer_requests[1] = PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_local, region_remote); + transfer_requests[1] = + PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_local, region_remote); if (transfer_requests[1] == 0) { printf("y transfer request creation failed\n"); return FAIL; } - transfer_requests[2] = PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_local, region_remote); + transfer_requests[2] = + PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_local, region_remote); if (transfer_requests[2] == 0) { printf("z transfer request creation failed\n"); return FAIL; } - transfer_requests[3] = PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_local, region_remote); + transfer_requests[3] = + PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_local, region_remote); if (transfer_requests[3] == 0) { printf("px transfer request creation failed\n"); return FAIL; } - transfer_requests[4] = PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_local, region_remote); + transfer_requests[4] = + PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_local, region_remote); if (transfer_requests[4] == 0) { printf("py transfer request creation failed\n"); return FAIL; } - transfer_requests[5] = PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_local, region_remote); + transfer_requests[5] = + PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_local, region_remote); if (transfer_requests[5] == 0) { printf("pz transfer request creation failed\n"); return FAIL; } - transfer_requests[6] = PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_local, region_remote); + transfer_requests[6] = + PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_local, region_remote); if (transfer_requests[6] == 0) { printf("id1 transfer request creation failed\n"); return FAIL; } - transfer_requests[7] = PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_local, region_remote); + transfer_requests[7] = + PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_local, region_remote); if (transfer_requests[7] == 0) { printf("id2 transfer request creation failed\n"); return FAIL; @@ -259,7 +266,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) @@ -271,11 +278,10 @@ main(int argc, char **argv) return FAIL; } - #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) @@ -283,13 +289,13 @@ main(int argc, char **argv) #endif // Emulate compute with sleep if (iter != steps - 1) { - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) printf("%s Sleep start: %llu.00\n", cur_time, sleeptime); sleep(sleeptime); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) @@ -309,7 +315,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) @@ -326,7 +332,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - t = time(NULL); + t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); if (rank == 0) From cfa12fba59e473c0675c9dd4558d8a4372f0967f Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Tue, 13 Aug 2024 15:50:19 -0700 Subject: [PATCH 03/23] Improve the async processing for vpicio_mts_all, also fix a few compile issues --- src/api/pdc_client_connect.c | 77 +++++++++++++++++-- src/api/pdc_region/pdc_region_transfer.c | 9 +-- src/server/pdc_client_server_common.c | 15 ++-- .../pdc_server_region_cache.c | 32 ++++---- .../pdc_server_region_request_handler.h | 22 ++++-- src/tests/kvtag_query_scale_col.c | 1 + 6 files changed, 116 insertions(+), 40 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 55bdb294c..47074240f 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -191,6 +191,9 @@ pdc_data_server_io_list_t *client_cache_list_head_g = NULL; static uint64_t object_selection_query_counter_g = 0; +static pthread_t hg_progress_tid_g; +static int hg_progress_shutdown_flag_g = 0; + /* * * Client Functions @@ -252,6 +255,55 @@ pdc_client_check_int_ret_cb(const struct hg_cb_info *callback_info) FUNC_LEAVE(ret_value); } +static void * +hg_progress_fn(void *foo) +{ + hg_return_t ret; + unsigned int actual_count; + hg_context_t *hg_context = (hg_context_t*) foo; + + /* char cur_time[64]; */ + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] enter %s\n", cur_time, __func__); */ + + while (!hg_progress_shutdown_flag_g) { + do { + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] before HG_Trigger\n", cur_time); */ + + ret = HG_Trigger(hg_context, 0, 1, &actual_count); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] after HG_Trigger\n", cur_time); */ + } while ((ret == HG_SUCCESS) && actual_count && !hg_progress_shutdown_flag_g); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] before HG_Progress\n", cur_time); */ + + if (!hg_progress_shutdown_flag_g) + HG_Progress(hg_context, 100); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] after HG_Progress\n", cur_time); */ + } + + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("[%s] after HG_Progress\n", cur_time); */ + + return (NULL); +} + // Check if all work has been processed // Using global variable $atomic_work_todo_g perr_t @@ -272,7 +324,7 @@ PDC_Client_check_response(hg_context_t **hg_context) if (hg_atomic_get32(&atomic_work_todo_g) <= 0) break; - hg_ret = HG_Progress(*hg_context, HG_MAX_IDLE_TIME); + hg_ret = HG_Progress(*hg_context, 100); } while (hg_ret == HG_SUCCESS || hg_ret == HG_TIMEOUT); ret_value = SUCCEED; @@ -556,14 +608,19 @@ client_send_transfer_request_all_rpc_cb(const struct hg_cb_info *callback_info) ret_value = HG_Get_output(handle, &output); if (ret_value != HG_SUCCESS) { - printf("PDC_CLIENT[%d]: client_send_transfer_request_all_rpc_cb error with HG_Get_output\n", - pdc_client_mpi_rank_g); + printf("PDC_CLIENT[%d]: %s error with HG_Get_output\n", pdc_client_mpi_rank_g, __func__); region_transfer_args->ret = -1; goto done; } region_transfer_args->ret = output.ret; region_transfer_args->metadata_id = output.metadata_id; + + /* // Tang */ + /* region_transfer_args->ret = 1; */ + /* printf("PDC_CLIENT[%d]: %s ret %d meta id %llu\n", */ + /* pdc_client_mpi_rank_g, __func__, output.ret, output.metadata_id); */ + done: fflush(stdout); hg_atomic_decr32(&atomic_work_todo_g); @@ -1200,7 +1257,7 @@ PDC_Client_check_bulk(hg_context_t *hg_context) /* Do not try to make progress anymore if we're done */ if (hg_atomic_get32(&bulk_todo_g) <= 0) break; - hg_ret = HG_Progress(hg_context, HG_MAX_IDLE_TIME); + hg_ret = HG_Progress(hg_context, 100); } while (hg_ret == HG_SUCCESS || hg_ret == HG_TIMEOUT); @@ -3119,9 +3176,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d hg_ret = HG_Bulk_create(hg_class, 1, (void **)&bulk_buf, &bulk_size, HG_BULK_READWRITE, &(in.local_bulk_handle)); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request_all(): Could not create local bulk data handle @ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_all_handle, client_send_transfer_request_all_rpc_cb, &transfer_args, &in); @@ -3163,7 +3218,9 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d PGOTO_ERROR(FAIL, "PDC_CLIENT: transfer request failed... @ line %d\n", __LINE__); HG_Destroy(client_send_transfer_request_all_handle); - + + hg_progress_shutdown_flag_g = 0; + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); done: fflush(stdout); FUNC_LEAVE(ret_value); @@ -3324,6 +3381,10 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u struct _pdc_transfer_request_wait_all_args transfer_args; FUNC_ENTER(NULL); + // Join the thread of trasfer start all + hg_progress_shutdown_flag_g = 1; + pthread_join(hg_progress_tid_g, NULL); + #ifdef PDC_TIMING double start = MPI_Wtime(), end; double function_start = start; diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 5092e4fd8..fb1dababd 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -1320,11 +1320,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ // TODO: Tang workaround, send an RPC to the target server to trigger bulk transfer on the server /* usleep((pdc_client_mpi_rank_g % 64) * 1000); */ - int data_server_id = transfer_requests[index]->data_server_id; - /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, - * data_server_id); */ - PDC_Client_send_rpc(data_server_id); - + /* int data_server_id = transfer_requests[index]->data_server_id; */ + /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, data_server_id); */ + /* PDC_Client_send_rpc(data_server_id); */ + free(read_bulk_buf); free(metadata_id); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index c10c3c0e3..ea92aaa98 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -1862,7 +1862,7 @@ HG_TEST_RPC_CB(send_rpc, handle) FUNC_ENTER(NULL); HG_Get_input(handle, &in); - /* fprintf(stderr, "==PDC_Server[]: %s received value from client %d\n", __func__, in.value); */ + fprintf(stderr, "==PDC_Server[]: %s received value from client %d\n", __func__, in.value); out.value = 1; HG_Respond(handle, NULL, NULL, &out); @@ -2142,7 +2142,8 @@ HG_TEST_RPC_CB(close_server, handle) fflush(stdout); FUNC_LEAVE(ret_value); } -/* + +#ifdef ENABLE_MULTITHREAD static HG_THREAD_RETURN_TYPE pdc_region_write_out_progress(void *arg) { @@ -2198,9 +2199,8 @@ pdc_region_write_out_progress(void *arg) FUNC_LEAVE(ret_value); } -*/ + // enter this function, transfer is done, data is pushed to buffer -/* static hg_return_t obj_map_region_release_bulk_transfer_thread_cb(const struct hg_cb_info *hg_cb_info) { @@ -2245,9 +2245,7 @@ obj_map_region_release_bulk_transfer_thread_cb(const struct hg_cb_info *hg_cb_in FUNC_LEAVE(ret_value); } -*/ -/* static HG_THREAD_RETURN_TYPE pdc_region_read_from_progress(void *arg) { @@ -2297,7 +2295,8 @@ pdc_region_read_from_progress(void *arg) FUNC_LEAVE(ret_value); } -*/ +#endif + // enter this function, transfer is done, data is in data server static hg_return_t transform_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info) @@ -6598,6 +6597,8 @@ HG_TEST_THREAD_CB(send_nhits) HG_TEST_THREAD_CB(send_bulk_rpc) HG_TEST_THREAD_CB(get_sel_data_rpc) HG_TEST_THREAD_CB(send_read_sel_obj_id_rpc) +HG_TEST_THREAD_CB(dart_get_server_info) +HG_TEST_THREAD_CB(dart_perform_one_server) PDC_FUNC_DECLARE_REGISTER(gen_obj_id) PDC_FUNC_DECLARE_REGISTER(gen_cont_id) diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index 4d0edbaa0..d25f45dfa 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -18,7 +18,7 @@ #ifdef PDC_SERVER_IDLE_CACHE_FLUSH_TIME #define PDC_IDLE_CACHE_FLUSH_TIME_INT PDC_SERVER_IDLE_CACHE_FLUSH_TIME #else -#define PDC_IDLE_CACHE_FLUSH_TIME_INT 2 +#define PDC_IDLE_CACHE_FLUSH_TIME_INT 4 #endif typedef struct pdc_region_cache { @@ -890,7 +890,7 @@ PDC_region_cache_clock_cycle(void *ptr) pdc_obj_cache *obj_cache, *obj_cache_iter; struct timeval current_time; struct timeval finish_time; - int nflush = 0, nflush_obj = 0; + int nflush = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; int server_rank = 0; time_t t; @@ -936,17 +936,19 @@ PDC_region_cache_clock_cycle(void *ptr) (current_time.tv_usec - last_cache_activity_timeval_g.tv_usec) / 1000000.0; /* if (current_time.tv_sec - obj_cache->timestamp.tv_sec > flush_frequency_s) { */ if (elapsed_time >= pdc_idle_flush_time_g) { - nflush_obj = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); - if (nflush_obj > 0) { - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); - fprintf(stderr, - "%s ==PDC_SERVER[%d]: server without cache activity for over %ds, start " - "flush %llu\n", - cur_time, server_rank, pdc_idle_flush_time_g, obj_cache->obj_id); - nflush += nflush_obj; - } + nflush = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); + } + else { + pthread_mutex_unlock(&pdc_obj_cache_list_mutex); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* fprintf(stderr, */ + /* "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", cur_time, server_rank); */ + + usleep(10000); + break; } obj_cache_iter = obj_cache_iter->next; pthread_mutex_unlock(&pdc_obj_cache_list_mutex); @@ -960,8 +962,8 @@ PDC_region_cache_clock_cycle(void *ptr) tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); fprintf(stderr, - "%s ==PDC_SERVER[%d]: flushed %d regions to storage (full/every %.0fs), took %.4fs\n", - cur_time, server_rank, nflush, flush_frequency_s, elapsed_time); + "%s ==PDC_SERVER[%d]: flushed %d regions to storage, took %.4fs\n", + cur_time, server_rank, nflush, elapsed_time); } /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ } // End if pdc_recycle_close_flag diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 41fac8335..96cf516c0 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -342,11 +342,11 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) #ifdef ENABLE_MPI MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); #endif - time_t t = time(NULL); - struct tm *tm = localtime(&t); - char cur_time[64]; - strftime(cur_time, sizeof(cur_time), "%c", tm); - printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); + /* time_t t = time(NULL); */ + /* struct tm *tm = localtime(&t); */ + /* char cur_time[64]; */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ #ifdef PDC_TIMING double end = MPI_Wtime(), start; @@ -621,10 +621,22 @@ HG_TEST_RPC_CB(transfer_request_all, handle) ret_value = HG_Bulk_create(info->hg_class, 1, &(local_bulk_args->data_buf), &(local_bulk_args->in.total_buf_size), HG_BULK_READWRITE, &(local_bulk_args->bulk_handle)); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[x]: %s start bulk \n", cur_time, __func__); */ + ret_value = HG_Bulk_transfer(info->context, transfer_request_all_bulk_transfer_write_cb, local_bulk_args, HG_BULK_PULL, info->addr, in.local_bulk_handle, 0, local_bulk_args->bulk_handle, 0, local_bulk_args->in.total_buf_size, HG_OP_ID_IGNORE); + + /* t = time(NULL); */ + /* tm = localtime(&t); */ + /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); */ + } else { // Read operation has to receive region metadata first. There will be another bulk transfer triggered diff --git a/src/tests/kvtag_query_scale_col.c b/src/tests/kvtag_query_scale_col.c index a2a4b8405..91c6d7481 100644 --- a/src/tests/kvtag_query_scale_col.c +++ b/src/tests/kvtag_query_scale_col.c @@ -31,6 +31,7 @@ #include "pdc.h" #include "pdc_client_connect.h" #include "string_utils.h" +#include "mpi.h" int assign_work_to_rank(int rank, int size, int nwork, int *my_count, int *my_start) From a92b4b9c616e72bd6cbebd88af41b4742e2a2e1f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Aug 2024 23:04:04 +0000 Subject: [PATCH 04/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 18 +++++++++--------- src/api/pdc_region/pdc_region_transfer.c | 5 +++-- src/server/pdc_client_server_common.c | 2 -- .../pdc_server_region_cache.c | 10 +++++----- .../pdc_server_region_request_handler.h | 1 - 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 47074240f..663195cb1 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -192,7 +192,7 @@ pdc_data_server_io_list_t *client_cache_list_head_g = NULL; static uint64_t object_selection_query_counter_g = 0; static pthread_t hg_progress_tid_g; -static int hg_progress_shutdown_flag_g = 0; +static int hg_progress_shutdown_flag_g = 0; /* * @@ -258,9 +258,9 @@ pdc_client_check_int_ret_cb(const struct hg_cb_info *callback_info) static void * hg_progress_fn(void *foo) { - hg_return_t ret; - unsigned int actual_count; - hg_context_t *hg_context = (hg_context_t*) foo; + hg_return_t ret; + unsigned int actual_count; + hg_context_t *hg_context = (hg_context_t *)foo; /* char cur_time[64]; */ /* time_t t = time(NULL); */ @@ -270,20 +270,20 @@ hg_progress_fn(void *foo) while (!hg_progress_shutdown_flag_g) { do { - /* t = time(NULL); */ + /* t = time(NULL); */ /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* printf("[%s] before HG_Trigger\n", cur_time); */ ret = HG_Trigger(hg_context, 0, 1, &actual_count); - /* t = time(NULL); */ + /* t = time(NULL); */ /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* printf("[%s] after HG_Trigger\n", cur_time); */ } while ((ret == HG_SUCCESS) && actual_count && !hg_progress_shutdown_flag_g); - /* t = time(NULL); */ + /* t = time(NULL); */ /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* printf("[%s] before HG_Progress\n", cur_time); */ @@ -291,7 +291,7 @@ hg_progress_fn(void *foo) if (!hg_progress_shutdown_flag_g) HG_Progress(hg_context, 100); - /* t = time(NULL); */ + /* t = time(NULL); */ /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* printf("[%s] after HG_Progress\n", cur_time); */ @@ -3218,7 +3218,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d PGOTO_ERROR(FAIL, "PDC_CLIENT: transfer request failed... @ line %d\n", __LINE__); HG_Destroy(client_send_transfer_request_all_handle); - + hg_progress_shutdown_flag_g = 0; pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); done: diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index fb1dababd..a593a7089 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -1321,9 +1321,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ // TODO: Tang workaround, send an RPC to the target server to trigger bulk transfer on the server /* usleep((pdc_client_mpi_rank_g % 64) * 1000); */ /* int data_server_id = transfer_requests[index]->data_server_id; */ - /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, data_server_id); */ + /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, + * data_server_id); */ /* PDC_Client_send_rpc(data_server_id); */ - + free(read_bulk_buf); free(metadata_id); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index ea92aaa98..32c0149ab 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -2210,8 +2210,6 @@ obj_map_region_release_bulk_transfer_thread_cb(const struct hg_cb_info *hg_cb_in FUNC_ENTER(NULL); - - bulk_args = (struct buf_map_release_bulk_args *)hg_cb_info->arg; if (hg_cb_info->ret == HG_CANCELED) { diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index d25f45dfa..f0407bd7a 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -890,7 +890,7 @@ PDC_region_cache_clock_cycle(void *ptr) pdc_obj_cache *obj_cache, *obj_cache_iter; struct timeval current_time; struct timeval finish_time; - int nflush = 0; + int nflush = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; int server_rank = 0; time_t t; @@ -945,7 +945,8 @@ PDC_region_cache_clock_cycle(void *ptr) /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* fprintf(stderr, */ - /* "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", cur_time, server_rank); */ + /* "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", cur_time, + * server_rank); */ usleep(10000); break; @@ -961,9 +962,8 @@ PDC_region_cache_clock_cycle(void *ptr) t = time(NULL); tm = localtime(&t); strftime(cur_time, sizeof(cur_time), "%c", tm); - fprintf(stderr, - "%s ==PDC_SERVER[%d]: flushed %d regions to storage, took %.4fs\n", - cur_time, server_rank, nflush, elapsed_time); + fprintf(stderr, "%s ==PDC_SERVER[%d]: flushed %d regions to storage, took %.4fs\n", cur_time, + server_rank, nflush, elapsed_time); } /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ } // End if pdc_recycle_close_flag diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 96cf516c0..36e7a6150 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -636,7 +636,6 @@ HG_TEST_RPC_CB(transfer_request_all, handle) /* tm = localtime(&t); */ /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ /* printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); */ - } else { // Read operation has to receive region metadata first. There will be another bulk transfer triggered From dd160f8bd56c312f3f754d95d679eda7013e50f6 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Tue, 13 Aug 2024 17:02:11 -0700 Subject: [PATCH 05/23] Minor change --- src/server/pdc_server_region/pdc_server_region_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index f0407bd7a..8e5f19d3d 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -939,6 +939,7 @@ PDC_region_cache_clock_cycle(void *ptr) nflush = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); } else { + obj_cache_iter = obj_cache_iter->next; pthread_mutex_unlock(&pdc_obj_cache_list_mutex); /* t = time(NULL); */ From 2b3638bc048becdc9b6835c351800eb4b71085c1 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Thu, 22 Aug 2024 11:19:37 -0700 Subject: [PATCH 06/23] Continue to optimize start_all performance for vpicio, add a few time related convinient functions --- src/api/pdc_client_connect.c | 58 +++--- src/api/pdc_region/pdc_region_transfer.c | 29 +-- src/commons/utils/include/pdc_timing.h | 3 + src/commons/utils/pdc_timing.c | 38 ++++ src/server/include/pdc_client_server_common.h | 7 + src/server/pdc_client_server_common.c | 2 + src/server/pdc_server.c | 2 +- .../pdc_server_region_cache.c | 167 +++++++++--------- .../pdc_server_region_request_handler.h | 82 ++++----- .../pdc_server_region_transfer.c | 33 ++-- src/tests/vpicio_mts_all.c | 49 ++--- 11 files changed, 263 insertions(+), 207 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 663195cb1..526a276f9 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -263,42 +263,31 @@ hg_progress_fn(void *foo) hg_context_t *hg_context = (hg_context_t *)foo; /* char cur_time[64]; */ - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] enter %s\n", cur_time, __func__); */ while (!hg_progress_shutdown_flag_g) { do { - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Trigger\n", cur_time); */ ret = HG_Trigger(hg_context, 0, 1, &actual_count); - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Trigger\n", cur_time); */ } while ((ret == HG_SUCCESS) && actual_count && !hg_progress_shutdown_flag_g); - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Progress\n", cur_time); */ if (!hg_progress_shutdown_flag_g) HG_Progress(hg_context, 100); - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Progress\n", cur_time); */ } - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Progress\n", cur_time); */ return (NULL); @@ -603,6 +592,10 @@ client_send_transfer_request_all_rpc_cb(const struct hg_cb_info *callback_info) FUNC_ENTER(NULL); + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + region_transfer_args = (struct _pdc_transfer_request_all_args *)callback_info->arg; handle = callback_info->info.forward.handle; @@ -3145,18 +3138,24 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d struct _pdc_transfer_request_all_args transfer_args; FUNC_ENTER(NULL); + + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + #ifdef PDC_TIMING double start = MPI_Wtime(), end; double function_start = start; #endif if (!(access_type == PDC_WRITE || access_type == PDC_READ)) { ret_value = FAIL; - printf("Invalid PDC type in function PDC_Client_transfer_request_all @ %d\n", __LINE__); + printf("Invalid PDC type in function %s @ %d\n", __func__, __LINE__); goto done; } in.n_objs = n_objs; in.access_type = access_type; in.total_buf_size = bulk_size; + in.client_id = pdc_client_mpi_rank_g; // Compute metadata server id // meta_server_id = PDC_get_server_by_obj_id(obj_id[0], pdc_server_num_g); @@ -3180,6 +3179,10 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d hg_ret = HG_Forward(client_send_transfer_request_all_handle, client_send_transfer_request_all_rpc_cb, &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); */ + #ifdef PDC_TIMING if (access_type == PDC_READ) { pdc_timings.PDCtransfer_request_start_all_read_rpc += MPI_Wtime() - start; @@ -3193,9 +3196,23 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_send_transfer_request_all(): Could not start HG_Forward() @ line %d\n", __LINE__); +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); +#endif + hg_atomic_set32(&atomic_work_todo_g, 1); PDC_Client_check_response(&send_context_g); + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] %s: received response\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); +#endif + + hg_progress_shutdown_flag_g = 0; + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + #ifdef PDC_TIMING end = MPI_Wtime(); if (access_type == PDC_READ) { @@ -3219,8 +3236,9 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d HG_Destroy(client_send_transfer_request_all_handle); - hg_progress_shutdown_flag_g = 0; - pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] leave %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + done: fflush(stdout); FUNC_LEAVE(ret_value); diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index a593a7089..ad6319b64 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -931,9 +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 PDCregion_transfer_start_all attempt to start existing transfer request @ " - "line %d\n", - __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) { @@ -960,7 +959,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, &(transfer_request->sub_offsets), &(transfer_request->output_offsets), &(transfer_request->output_sizes), &(transfer_request->output_buf)); if (transfer_request->n_obj_servers == 0) { - printf("PDC_Client %d, %s: error with static region partition, no server is selected!\n", + printf("PDC_Client %d: %s error with static region partition, no server is selected!\n", pdc_client_mpi_rank_g, __func__); return FAIL; } @@ -1070,6 +1069,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, else { *write_size_ptr = 0; } + if (read_size) { read_transfer_request = (pdc_transfer_request_start_all_pkg **)malloc( sizeof(pdc_transfer_request_start_all_pkg *) * read_size); @@ -1240,6 +1240,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ FUNC_ENTER(NULL); + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + if (size == 0) goto done; @@ -1318,13 +1322,6 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ } } - // TODO: Tang workaround, send an RPC to the target server to trigger bulk transfer on the server - /* usleep((pdc_client_mpi_rank_g % 64) * 1000); */ - /* int data_server_id = transfer_requests[index]->data_server_id; */ - /* printf("==PDC_CLIENT[%d]: %s send rpc to server %d\n", pdc_client_mpi_rank_g, __func__, - * data_server_id); */ - /* PDC_Client_send_rpc(data_server_id); */ - free(read_bulk_buf); free(metadata_id); @@ -1342,8 +1339,14 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) pdcid_t * posix_transfer_request_id; FUNC_ENTER(NULL); + + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + // Split write and read requests. Handle them separately. // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); + // [Tang] NOTE: prepare_start_all_requests include several metadata RPC operations ret_value = prepare_start_all_requests(transfer_request_id, size, &write_transfer_requests, &read_transfer_requests, &write_size, &read_size, &posix_transfer_request_id, &posix_size); @@ -1356,6 +1359,10 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) read_transfer_requests[i]->data_server_id, read_transfer_requests[i]->transfer_request->obj_id); } */ +#ifdef ENABLE_MPI + // [Tang] TODO: change to user provided comm + MPI_Barrier(MPI_COMM_WORLD); +#endif // Start write requests if (write_size > 0) diff --git a/src/commons/utils/include/pdc_timing.h b/src/commons/utils/include/pdc_timing.h index 22b39148f..afa5ecda0 100644 --- a/src/commons/utils/include/pdc_timing.h +++ b/src/commons/utils/include/pdc_timing.h @@ -192,4 +192,7 @@ int PDC_server_timing_report(); 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(); #endif diff --git a/src/commons/utils/pdc_timing.c b/src/commons/utils/pdc_timing.c index 95826b56b..2574b28a7 100644 --- a/src/commons/utils/pdc_timing.c +++ b/src/commons/utils/pdc_timing.c @@ -1,4 +1,5 @@ #include "pdc_timing.h" +#include "assert.h" #ifdef PDC_TIMING static double pdc_base_time; @@ -534,4 +535,41 @@ PDC_timing_report(const char *prefix __attribute__((unused))) { return 0; } +#endif // PDC_TIMING + +int pdc_timing_rank_g = -1; + +inline int +PDC_get_rank() +{ +#ifdef ENABLE_MPI + if (pdc_timing_rank_g == -1) + MPI_Comm_rank(MPI_COMM_WORLD, &pdc_timing_rank_g); + return pdc_timing_rank_g; +#else + return 0; #endif + +} + +inline void +PDC_get_time_str(char *cur_time) +{ + struct timespec ts; + + 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); + + return; +} + + diff --git a/src/server/include/pdc_client_server_common.h b/src/server/include/pdc_client_server_common.h index 749458430..ddc07249e 100644 --- a/src/server/include/pdc_client_server_common.h +++ b/src/server/include/pdc_client_server_common.h @@ -46,6 +46,7 @@ hg_thread_mutex_t lock_list_mutex_g; hg_thread_mutex_t meta_buf_map_mutex_g; hg_thread_mutex_t meta_obj_map_mutex_g; #endif +extern struct timeval last_cache_activity_timeval_g; #define PAGE_SIZE 4096 #define ADDR_MAX 1024 @@ -814,6 +815,7 @@ typedef struct transfer_request_all_in_t { uint64_t total_buf_size; int32_t n_objs; uint8_t access_type; + int client_id; } transfer_request_all_in_t; /* Define transfer_request_all_out_t */ @@ -2845,6 +2847,11 @@ hg_proc_transfer_request_all_in_t(hg_proc_t proc, void *data) // HG_LOG_ERROR("Proc error"); return ret; } + ret = hg_proc_int32_t(proc, &struct_data->client_id); + if (ret != HG_SUCCESS) { + // HG_LOG_ERROR("Proc error"); + return ret; + } return ret; } diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index 32c0149ab..5c05d6b31 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -63,6 +63,8 @@ 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; + #include "pdc_server_region_request_handler.h" hg_return_t diff --git a/src/server/pdc_server.c b/src/server/pdc_server.c index a19ca0d39..7ba1d1090 100644 --- a/src/server/pdc_server.c +++ b/src/server/pdc_server.c @@ -1880,7 +1880,7 @@ PDC_Server_loop(hg_context_t *hg_context) /* Do not try to make progress anymore if we're done */ if (hg_atomic_cas32(&close_server_g, 1, 1)) break; - hg_ret = HG_Progress(hg_context, 1000); + hg_ret = HG_Progress(hg_context, 200); } while (hg_ret == HG_SUCCESS || hg_ret == HG_TIMEOUT); diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index 8e5f19d3d..dd0a7cf60 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -1,3 +1,4 @@ +#include "pdc_client_server_common.h" #include "pdc_server_region_cache.h" #include "pdc_timing.h" @@ -18,7 +19,7 @@ #ifdef PDC_SERVER_IDLE_CACHE_FLUSH_TIME #define PDC_IDLE_CACHE_FLUSH_TIME_INT PDC_SERVER_IDLE_CACHE_FLUSH_TIME #else -#define PDC_IDLE_CACHE_FLUSH_TIME_INT 4 +#define PDC_IDLE_CACHE_FLUSH_TIME_INT 2 #endif typedef struct pdc_region_cache { @@ -44,7 +45,6 @@ static pthread_mutex_t pdc_cache_mutex; static int pdc_recycle_close_flag; static size_t total_cache_size; static size_t maximum_cache_size; -static struct timeval last_cache_activity_timeval_g; static int pdc_idle_flush_time_g; int @@ -414,7 +414,6 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim size_t buf_size, const uint64_t *offset, const uint64_t *size, int ndim, size_t unit) { - int server_rank = 0; pdc_obj_cache * obj_cache_iter, *obj_cache = NULL; struct pdc_region_info *region_cache_info; if (obj_ndim != ndim && obj_ndim > 0) { @@ -422,15 +421,9 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim return FAIL; } -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ /* char cur_time[64]; */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, server_rank, __func__, obj_id); */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); */ pthread_mutex_lock(&pdc_obj_cache_list_mutex); @@ -504,7 +497,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim pthread_mutex_unlock(&pdc_obj_cache_list_mutex); if (total_cache_size > maximum_cache_size) { - printf("==PDC_SERVER[%d]: server cache full %.1f / %.1f MB, will flush to storage\n", server_rank, + printf("==PDC_SERVER[%d]: server cache full %.1f / %.1f MB, will flush to storage\n", PDC_get_rank(), total_cache_size / 1048576.0, maximum_cache_size / 1048576.0); PDC_region_cache_flush_all(); } @@ -547,25 +540,14 @@ 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; - int server_rank = 0; - perr_t ret_value = SUCCEED; + char cur_time[64]; FUNC_ENTER(NULL); #ifdef PDC_TIMING double start = MPI_Wtime(); #endif -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ - /* char cur_time[64]; */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, server_rank, __func__, obj_id); */ - uint64_t write_size = 0; if (region_info->ndim >= 1) write_size = unit * region_info->size[0]; @@ -574,8 +556,14 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ if (region_info->ndim >= 3) write_size *= region_info->size[2]; + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); */ + pthread_mutex_lock(&pdc_obj_cache_list_mutex); + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s after lock\n", cur_time, PDC_get_rank(), __func__); */ + obj_cache = NULL; // Look up for the object in the cache list obj_cache_iter = obj_cache_list; @@ -623,16 +611,18 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ } } pthread_mutex_unlock(&pdc_obj_cache_list_mutex); + + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s after unlock\n", cur_time, PDC_get_rank(), __func__); */ + if (!flag) { PDC_region_cache_register(obj_id, obj_ndim, obj_dims, buf, write_size, region_info->offset, region_info->size, region_info->ndim, unit); } /* else { */ - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("%s ==PDC_SERVER[%d]: %s write is fully contained with cached region\n", cur_time, - * server_rank, __func__); */ + * PDC_get_rank(), __func__); */ /* } */ // PDC_Server_data_write_out2(obj_id, region_info, buf, unit); @@ -640,6 +630,9 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ pdc_server_timings->PDCcache_write += MPI_Wtime() - start; #endif + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); */ + // done: fflush(stdout); FUNC_LEAVE(ret_value); @@ -717,7 +710,7 @@ sort_by_offset(const void *elem1, const void *elem2) } int -PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache) +PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int flag) { int i, nflush = 0; pdc_region_cache * region_cache_iter, *region_cache_temp; @@ -726,15 +719,18 @@ 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; + char cur_time[64]; #ifdef PDC_TIMING double start_time = MPI_Wtime(); #endif + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d.%d]: enter %s\n", cur_time, PDC_get_rank(), flag, __func__); */ + + // For 1D case, we can merge regions to minimize the number of POSIX calls. if (obj_cache->ndim == 1 && obj_cache->region_cache_size) { - // For 1D case, we can merge regions to minimize the number of POSIX calls. start = (uint64_t *)malloc(sizeof(uint64_t) * obj_cache->region_cache_size * 2); end = start + obj_cache->region_cache_size; buf = (char **)malloc(sizeof(char *) * obj_cache->region_cache_size); @@ -797,14 +793,14 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache) free(region_cache_temp); } nflush += merged_request_size; - } + } // End for 1D -#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) { + /* 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__); */ + 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, region_cache_info->buf, region_cache_info->unit, 1); @@ -815,8 +811,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); + 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); total_cache_size -= write_size; free(region_cache_info->offset); @@ -838,6 +835,10 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache) #ifdef PDC_TIMING pdc_server_timings->PDCcache_flush += MPI_Wtime() - start_time; #endif + + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d.%d]: leave %s\n", cur_time, PDC_get_rank(), flag, __func__); */ + return nflush; } @@ -858,7 +859,12 @@ PDC_region_cache_flush(uint64_t obj_id) // printf("server error: flushing object that does not exist\n"); return 1; } - PDC_region_cache_flush_by_pointer(obj_id, obj_cache); + + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ + + PDC_region_cache_flush_by_pointer(obj_id, obj_cache, 0); return 0; } @@ -870,7 +876,12 @@ PDC_region_cache_flush_all() obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { - PDC_region_cache_flush_by_pointer(obj_cache_iter->obj_id, obj_cache_iter); + + /* char cur_time[64]; */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ + + PDC_region_cache_flush_by_pointer(obj_cache_iter->obj_id, obj_cache_iter, 0); obj_cache_temp = obj_cache_iter; obj_cache_iter = obj_cache_iter->next; if (obj_cache_temp->ndim) { @@ -892,7 +903,6 @@ PDC_region_cache_clock_cycle(void *ptr) struct timeval finish_time; int nflush = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; - int server_rank = 0; time_t t; struct tm * tm; char cur_time[64]; @@ -905,67 +915,54 @@ PDC_region_cache_clock_cycle(void *ptr) obj_cache_iter = NULL; } -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: %s start \n", cur_time, server_rank); */ - while (1) { - nflush = 0; + // pdc_cache_mutex only protect pdc_recycle_close_flag pthread_mutex_lock(&pdc_cache_mutex); if (!pdc_recycle_close_flag) { /* pthread_mutex_lock(&pdc_obj_cache_list_mutex); */ - gettimeofday(¤t_time, NULL); obj_cache_iter = obj_cache_list; - nflush = 0; while (obj_cache_iter != NULL) { - pthread_mutex_lock(&pdc_obj_cache_list_mutex); + gettimeofday(¤t_time, NULL); + /* pthread_mutex_lock(&pdc_obj_cache_list_mutex); */ obj_cache = obj_cache_iter; - /* // flush every *flush_frequency_s seconds */ - /* elapsed_time = current_time.tv_sec - obj_cache->timestamp.tv_sec + */ - /* (current_time.tv_usec - obj_cache->timestamp.tv_usec) / 1000000.0; */ - /* /1* if (current_time.tv_sec - obj_cache->timestamp.tv_sec > flush_frequency_s) { *1/ */ - /* if (elapsed_time >= flush_frequency_s) { */ - /* nflush += PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); */ - /* } */ + elapsed_time = current_time.tv_sec - last_cache_activity_timeval_g.tv_sec + (current_time.tv_usec - last_cache_activity_timeval_g.tv_usec) / 1000000.0; - /* if (current_time.tv_sec - obj_cache->timestamp.tv_sec > flush_frequency_s) { */ + if (elapsed_time >= pdc_idle_flush_time_g) { - nflush = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache); + + /* 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__); */ + + pthread_mutex_lock(&pdc_obj_cache_list_mutex); + nflush = PDC_region_cache_flush_by_pointer(obj_cache->obj_id, obj_cache, 1); + pthread_mutex_unlock(&pdc_obj_cache_list_mutex); + + gettimeofday(&finish_time, NULL); + elapsed_time = finish_time.tv_sec - current_time.tv_sec + + (finish_time.tv_usec - current_time.tv_usec) / 1000000.0; + + 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); + } } else { obj_cache_iter = obj_cache_iter->next; - pthread_mutex_unlock(&pdc_obj_cache_list_mutex); + /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* fprintf(stderr, */ - /* "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", cur_time, - * server_rank); */ + /* PDC_get_time_str(cur_time); */ + /* fprintf(stderr, "%s ==PDC_SERVER[%d]: stop flush to allow processing new RPCs\n", */ + /* cur_time,PDC_get_rank()); */ - usleep(10000); + usleep(300000); break; } obj_cache_iter = obj_cache_iter->next; - pthread_mutex_unlock(&pdc_obj_cache_list_mutex); - usleep(10000); + /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ + usleep(300000); } // End while obj_cache_iter - if (nflush > 0) { - gettimeofday(&finish_time, NULL); - elapsed_time = finish_time.tv_sec - current_time.tv_sec + - (finish_time.tv_usec - current_time.tv_usec) / 1000000.0; - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); - fprintf(stderr, "%s ==PDC_SERVER[%d]: flushed %d regions to storage, took %.4fs\n", cur_time, - server_rank, nflush, elapsed_time); - } /* pthread_mutex_unlock(&pdc_obj_cache_list_mutex); */ } // End if pdc_recycle_close_flag else { @@ -1050,7 +1047,11 @@ PDC_region_fetch(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims, struct } if (!flag) { if (obj_cache != NULL) { - PDC_region_cache_flush_by_pointer(obj_id, obj_cache); + char cur_time[64]; + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ + + PDC_region_cache_flush_by_pointer(obj_id, obj_cache, 0); } PDC_Server_transfer_request_io(obj_id, obj_ndim, obj_dims, region_info, buf, unit, 0); } diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 36e7a6150..8fa5b38bf 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -170,18 +170,16 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; struct pdc_region_info * remote_reg_info; - int i, server_rank; + int i; + char cur_time[64]; FUNC_ENTER(NULL); -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ - /* char cur_time[64]; */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ + + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); */ + + gettimeofday(&last_cache_activity_timeval_g, NULL); #ifdef PDC_TIMING double end = MPI_Wtime(), start; @@ -195,6 +193,7 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) request_data.n_objs = local_bulk_args->in.n_objs; parse_bulk_data(local_bulk_args->data_buf, &request_data, PDC_WRITE); // print_bulk_data(&request_data); + #ifndef PDC_SERVER_CACHE data_server_region_t **temp_ptrs = (data_server_region_t **)malloc(sizeof(data_server_region_t *) * request_data.n_objs); @@ -203,6 +202,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) PDC_Server_register_obj_region_by_pointer(temp_ptrs + i, request_data.obj_id[i], 1); } #endif + + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s before (cache) writing\n", cur_time, PDC_get_rank(), __func__); */ + for (i = 0; i < request_data.n_objs; ++i) { remote_reg_info->ndim = request_data.remote_ndim[i]; remote_reg_info->offset = request_data.remote_offset[i]; @@ -216,6 +219,7 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) request_data.obj_dims[i], remote_reg_info, (void *)request_data.data_buf[i], request_data.unit[i], 1); #endif + #if 0 uint64_t j; fprintf(stderr, "server write array, offset = %lu, size = %lu:", request_data.remote_offset[i][0], request_data.remote_length[i][0]); @@ -228,6 +232,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) PDC_finish_request(local_bulk_args->transfer_request_id[i]); pthread_mutex_unlock(&transfer_request_status_mutex); } + + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: %s after (cache) writing\n", cur_time, PDC_get_rank(), __func__); */ + #ifndef PDC_SERVER_CACHE for (i = 0; i < request_data.n_objs; ++i) { PDC_Server_unregister_obj_region_by_pointer(temp_ptrs[i], 1); @@ -253,10 +261,8 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pdc_timestamp_register(pdc_transfer_request_inner_write_all_bulk_timestamps, start, end); #endif - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, server_rank, __func__); */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); */ FUNC_LEAVE(ret); } @@ -335,18 +341,12 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) hg_return_t ret = HG_SUCCESS; struct pdc_region_info * remote_reg_info; uint64_t obj_dims[3]; - int server_rank; FUNC_ENTER(NULL); -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ /* char cur_time[64]; */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); */ #ifdef PDC_TIMING double end = MPI_Wtime(), start; @@ -569,25 +569,22 @@ HG_TEST_RPC_CB(transfer_request_all, handle) transfer_request_all_in_t in; transfer_request_all_out_t out; hg_return_t ret_value = HG_SUCCESS; - int i, server_rank; + int i; + char cur_time[64]; FUNC_ENTER(NULL); -#ifdef ENABLE_MPI - MPI_Comm_rank(MPI_COMM_WORLD, &server_rank); -#endif - /* time_t t = time(NULL); */ - /* struct tm *tm = localtime(&t); */ - /* char cur_time[64]; */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, server_rank, __func__); */ - #ifdef PDC_TIMING double start = MPI_Wtime(), end; #endif 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); */ + + gettimeofday(&last_cache_activity_timeval_g, NULL); + info = HG_Get_info(handle); local_bulk_args = (struct transfer_request_all_local_bulk_args *)malloc( sizeof(struct transfer_request_all_local_bulk_args)); @@ -598,11 +595,12 @@ HG_TEST_RPC_CB(transfer_request_all, handle) local_bulk_args->in = in; local_bulk_args->transfer_request_id = (uint64_t *)malloc(sizeof(uint64_t) * in.n_objs); - pthread_mutex_lock(&transfer_request_id_mutex); + // [Tang]TODO is this necessary? + /* pthread_mutex_lock(&transfer_request_id_mutex); */ for (i = 0; i < in.n_objs; ++i) { local_bulk_args->transfer_request_id[i] = PDC_transfer_request_id_register(); } - pthread_mutex_unlock(&transfer_request_id_mutex); + /* pthread_mutex_unlock(&transfer_request_id_mutex); */ pthread_mutex_lock(&transfer_request_status_mutex); // Metadata ID is in ascending order. We only need to return the first value, the client knows the size. @@ -622,9 +620,7 @@ HG_TEST_RPC_CB(transfer_request_all, handle) &(local_bulk_args->in.total_buf_size), HG_BULK_READWRITE, &(local_bulk_args->bulk_handle)); - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("%s ==PDC_SERVER[x]: %s start bulk \n", cur_time, __func__); */ ret_value = @@ -632,9 +628,7 @@ HG_TEST_RPC_CB(transfer_request_all, handle) HG_BULK_PULL, info->addr, in.local_bulk_handle, 0, local_bulk_args->bulk_handle, 0, local_bulk_args->in.total_buf_size, HG_OP_ID_IGNORE); - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ + /* PDC_get_time_str(cur_time); */ /* printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); */ } else { @@ -664,10 +658,8 @@ HG_TEST_RPC_CB(transfer_request_all, handle) } #endif - /* t = time(NULL); */ - /* tm = localtime(&t); */ - /* strftime(cur_time, sizeof(cur_time), "%c", tm); */ - /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, server_rank, __func__); */ + /* 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); */ fflush(stdout); FUNC_LEAVE(ret_value); @@ -831,9 +823,9 @@ HG_TEST_RPC_CB(transfer_request, handle) if (in.remote_region.ndim >= 3) { total_mem_size *= in.remote_region.count_2; } - pthread_mutex_lock(&transfer_request_id_mutex); + /* pthread_mutex_lock(&transfer_request_id_mutex); */ out.metadata_id = PDC_transfer_request_id_register(); - pthread_mutex_unlock(&transfer_request_id_mutex); + /* pthread_mutex_unlock(&transfer_request_id_mutex); */ pthread_mutex_lock(&transfer_request_status_mutex); PDC_commit_request(out.metadata_id); pthread_mutex_unlock(&transfer_request_status_mutex); diff --git a/src/server/pdc_server_region/pdc_server_region_transfer.c b/src/server/pdc_server_region/pdc_server_region_transfer.c index 8f7ab8886..652cb6abe 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer.c @@ -1,19 +1,8 @@ #include "pdc_client_server_common.h" #include "pdc_server_data.h" +#include "pdc_timing.h" static int io_by_region_g = 1; -int -get_server_rank() -{ -#ifdef ENABLE_MPI - int result; - MPI_Comm_rank(MPI_COMM_WORLD, &result); - return result; -#else - return 0; -#endif -} - int try_reset_dims() { @@ -92,6 +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]; FUNC_ENTER(NULL); @@ -108,10 +98,18 @@ PDC_finish_request(uint64_t transfer_request_id) printf("PDC SERVER PDC_finish_request out type unset error %d\n", __LINE__); } 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__); */ + 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__); */ + out.ret = 1; ret_value = HG_Respond(ptr->handle, NULL, NULL, &out); } @@ -277,11 +275,13 @@ 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; - - int server_rank = get_server_rank(); + char cur_time[64]; FUNC_ENTER(NULL); + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); */ + if (io_by_region_g || obj_ndim == 0) { // PDC_Server_register_obj_region(obj_id); if (is_write) { @@ -309,7 +309,7 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob } // Data path prefix will be $SCRATCH/pdc_data/$obj_id/ snprintf(storage_location, ADDR_MAX, "%.200s/pdc_data/%" PRIu64 "/server%d/s%04d.bin", data_path, obj_id, - server_rank, server_rank); + PDC_get_rank(), PDC_get_rank()); PDC_mkdir(storage_location); fd = open(storage_location, O_RDWR | O_CREAT, 0666); @@ -394,6 +394,9 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob close(fd); done: + /* PDC_get_time_str(cur_time); */ + /* printf("%s ==PDC_SERVER[%d]: leave %s\n", cur_time, PDC_get_rank(), __func__); */ + fflush(stdout); FUNC_LEAVE(ret_value); } diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c index 006718834..1993609e9 100644 --- a/src/tests/vpicio_mts_all.c +++ b/src/tests/vpicio_mts_all.c @@ -32,6 +32,7 @@ #include #include #include "pdc.h" +#include "pdc_timing.h" #define NPARTICLES 8388608 @@ -151,11 +152,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("\n%s #Step %d\n", cur_time, iter); + printf("\n[%s] #Step %d\n", cur_time, iter); t0 = MPI_Wtime(); #endif PDCprop_set_obj_time_step(obj_prop_float, iter); @@ -207,11 +206,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Obj create time: %.5e\n", cur_time, t1 - t0); + printf("[%s] Obj create time: %.5e\n", cur_time, t1 - t0); #endif transfer_requests[0] = @@ -266,11 +263,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Transfer create time: %.5e\n", cur_time, t0 - t1); + printf("[%s] Transfer create time: %.5e\n", cur_time, t0 - t1); #endif if (PDCregion_transfer_start_all(transfer_requests, 8) != SUCCEED) { @@ -281,25 +276,19 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Transfer start time: %.5e\n", cur_time, t1 - t0); + printf("[%s] Transfer start time: %.5e\n", cur_time, t1 - t0); #endif // Emulate compute with sleep if (iter != steps - 1) { - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Sleep start: %llu.00\n", cur_time, sleeptime); + printf("[%s] Sleep start: %llu.00\n", cur_time, sleeptime); sleep(sleeptime); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Sleep end: %llu.00\n", cur_time, sleeptime); + printf("[%s] Sleep end: %llu.00\n", cur_time, sleeptime); } #ifdef ENABLE_MPI @@ -315,11 +304,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Transfer wait time: %.5e\n", cur_time, t1 - t0); + printf("[%s] Transfer wait time: %.5e\n", cur_time, t1 - t0); #endif for (int j = 0; j < 8; j++) { @@ -332,11 +319,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - t = time(NULL); - tm = localtime(&t); - strftime(cur_time, sizeof(cur_time), "%c", tm); + PDC_get_time_str(cur_time); if (rank == 0) - printf("%s Transfer close time: %.5e\n", cur_time, t0 - t1); + printf("[%s] Transfer close time: %.5e\n", cur_time, t0 - t1); #endif if (PDCobj_close(obj_xx) != SUCCEED) { From 14cf96046c8ebe2553ce20f6464172d1615b7c15 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 22 Aug 2024 18:20:06 +0000 Subject: [PATCH 07/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 5 +++-- src/api/pdc_region/pdc_region_transfer.c | 4 ++-- src/commons/utils/include/pdc_timing.h | 4 ++-- src/commons/utils/pdc_timing.c | 14 +++--------- src/server/pdc_client_server_common.c | 2 +- .../pdc_server_region_cache.c | 22 ++++++++++--------- .../pdc_server_region_request_handler.h | 7 +++--- .../pdc_server_region_transfer.c | 10 +++++---- 8 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 526a276f9..9064f3c09 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -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; @@ -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) { diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index ad6319b64..f8bd5db9f 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -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) { diff --git a/src/commons/utils/include/pdc_timing.h b/src/commons/utils/include/pdc_timing.h index afa5ecda0..fd409732e 100644 --- a/src/commons/utils/include/pdc_timing.h +++ b/src/commons/utils/include/pdc_timing.h @@ -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 diff --git a/src/commons/utils/pdc_timing.c b/src/commons/utils/pdc_timing.c index 2574b28a7..cc8600b41 100644 --- a/src/commons/utils/pdc_timing.c +++ b/src/commons/utils/pdc_timing.c @@ -549,7 +549,6 @@ PDC_get_rank() #else return 0; #endif - } inline void @@ -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; } - - diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index 5c05d6b31..37df71ab0 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -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" diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index dd0a7cf60..d1f5f296b 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -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 @@ -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 @@ -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, @@ -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); @@ -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); @@ -944,8 +946,8 @@ 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 { @@ -953,7 +955,7 @@ PDC_region_cache_clock_cycle(void *ptr) /* 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); diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 8fa5b38bf..18a96e959 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -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__); */ @@ -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); @@ -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); diff --git a/src/server/pdc_server_region/pdc_server_region_transfer.c b/src/server/pdc_server_region/pdc_server_region_transfer.c index 652cb6abe..0fb4d5a67 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer.c @@ -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); @@ -100,7 +100,8 @@ 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); @@ -108,7 +109,8 @@ PDC_finish_request(uint64_t transfer_request_id) 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); @@ -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); From 4175088fb74a9ddb303648cd3fea66edffca0907 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Fri, 23 Aug 2024 15:43:24 -0700 Subject: [PATCH 08/23] Fix hanging issue in CI testing --- src/api/pdc_client_connect.c | 67 +++++++++++++------ src/api/pdc_region/pdc_region_transfer.c | 24 +++++-- .../pdc_server_region_cache.c | 63 ++++++++++------- .../pdc_server_region_request_handler.h | 42 ++++++------ src/tests/region_transfer_all.c | 2 + 5 files changed, 124 insertions(+), 74 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 9064f3c09..489daadb4 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -592,9 +592,11 @@ client_send_transfer_request_all_rpc_cb(const struct hg_cb_info *callback_info) FUNC_ENTER(NULL); - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif region_transfer_args = (struct _pdc_transfer_request_all_args *)callback_info->arg; handle = callback_info->info.forward.handle; @@ -3139,9 +3141,11 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d FUNC_ENTER(NULL); - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif #ifdef PDC_TIMING double start = MPI_Wtime(), end; @@ -3177,12 +3181,15 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); + hg_atomic_set32(&atomic_work_todo_g, 1); + hg_ret = HG_Forward(client_send_transfer_request_all_handle, client_send_transfer_request_all_rpc_cb, &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); */ +#ifdef TANG_DEBUG + 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); +#endif #ifdef PDC_TIMING if (access_type == PDC_READ) { @@ -3201,19 +3208,24 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d MPI_Barrier(MPI_COMM_WORLD); #endif - hg_atomic_set32(&atomic_work_todo_g, 1); - PDC_Client_check_response(&send_context_g); + /* PDC_Client_check_response(&send_context_g); */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] %s: received response\n", cur_time, pdc_client_mpi_rank_g, __func__); */ + hg_progress_shutdown_flag_g = 0; + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + + while (hg_atomic_get32(&atomic_work_todo_g) > 0) { + usleep(100000); + } + +#ifdef TANG_DEBUG + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] %s: received response\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); #endif - hg_progress_shutdown_flag_g = 0; - pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); - #ifdef PDC_TIMING end = MPI_Wtime(); if (access_type == PDC_READ) { @@ -3237,8 +3249,10 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d HG_Destroy(client_send_transfer_request_all_handle); - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] leave %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ +#ifdef TANG_DEBUG + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] leave %s\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif done: fflush(stdout); @@ -3533,6 +3547,8 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, PGOTO_ERROR(FAIL, "==CLIENT[%d]: ERROR with PDC_Client_try_lookup_server @ line %d", pdc_client_mpi_rank_g, __LINE__); + hg_atomic_set32(&atomic_work_todo_g, 1); + hg_ret = HG_Create(send_context_g, pdc_server_info_g[data_server_id].addr, transfer_request_register_id_g, &client_send_transfer_request_handle); @@ -3561,8 +3577,15 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_send_transfer_request(): Could not start HG_Forward() @ line %d\n", __LINE__); - hg_atomic_set32(&atomic_work_todo_g, 1); - PDC_Client_check_response(&send_context_g); + /* hg_atomic_set32(&atomic_work_todo_g, 1); */ + /* PDC_Client_check_response(&send_context_g); */ + + hg_progress_shutdown_flag_g = 0; + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + + while (hg_atomic_get32(&atomic_work_todo_g) > 0) { + usleep(100000); + } #ifdef PDC_TIMING end = MPI_Wtime(); @@ -3641,6 +3664,10 @@ PDC_Client_transfer_request_wait(pdcid_t transfer_request_id, uint32_t data_serv struct _pdc_transfer_request_wait_args transfer_args; FUNC_ENTER(NULL); + + hg_progress_shutdown_flag_g = 1; + pthread_join(hg_progress_tid_g, NULL); + #ifdef PDC_TIMING double start = MPI_Wtime(), end; double function_start = start; diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index f8bd5db9f..60c5f7f3e 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -1240,9 +1240,11 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ FUNC_ENTER(NULL); - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif if (size == 0) goto done; @@ -1340,9 +1342,11 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) FUNC_ENTER(NULL); - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); +#endif // Split write and read requests. Handle them separately. // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); @@ -1360,8 +1364,10 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) } */ #ifdef ENABLE_MPI + MPI_Comm world_comm; + MPI_Comm_dup(MPI_COMM_WORLD, &world_comm); // [Tang] TODO: change to user provided comm - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(world_comm); #endif // Start write requests @@ -1385,7 +1391,11 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) // Clean up memory finish_start_all_requests(write_transfer_requests, read_transfer_requests, write_size, read_size); // fprintf(stderr, "PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); +#ifdef ENABLE_MPI // MPI_Barrier(MPI_COMM_WORLD); + MPI_Comm_free(&world_comm); +#endif + FUNC_LEAVE(ret_value); } diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index d1f5f296b..d6b2f7e4b 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -421,9 +421,11 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim return FAIL; } - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); +#endif pthread_mutex_lock(&pdc_obj_cache_list_mutex); @@ -556,14 +558,13 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ if (region_info->ndim >= 3) write_size *= region_info->size[2]; - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: enter %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); */ +#ifdef TANG_DEBUG + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: enter %s for %llu\n", cur_time, PDC_get_rank(), __func__, obj_id); +#endif pthread_mutex_lock(&pdc_obj_cache_list_mutex); - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s after lock\n", cur_time, PDC_get_rank(), __func__); */ - obj_cache = NULL; // Look up for the object in the cache list obj_cache_iter = obj_cache_list; @@ -630,8 +631,10 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ pdc_server_timings->PDCcache_write += MPI_Wtime() - start; #endif - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); */ +#ifdef TANG_DEBUG + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); +#endif // done: fflush(stdout); @@ -799,8 +802,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, @@ -812,9 +815,11 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int if (obj_cache->ndim >= 3) 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); + if (write_size > 0) { + 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); + } total_cache_size -= write_size; free(region_cache_info->offset); @@ -861,9 +866,11 @@ PDC_region_cache_flush(uint64_t obj_id) return 1; } - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); +#endif PDC_region_cache_flush_by_pointer(obj_id, obj_cache, 0); return 0; @@ -878,9 +885,11 @@ PDC_region_cache_flush_all() obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); +#endif PDC_region_cache_flush_by_pointer(obj_cache_iter->obj_id, obj_cache_iter, 0); obj_cache_temp = obj_cache_iter; @@ -933,8 +942,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__); */ + /* printf("%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); @@ -946,7 +955,7 @@ 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", + printf("%s ==PDC_SERVER[%d.1]: flushed %d regions to storage, took %.4fs\n", cur_time, PDC_get_rank(), nflush, elapsed_time); } } @@ -1049,9 +1058,11 @@ PDC_region_fetch(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims, struct } if (!flag) { if (obj_cache != NULL) { +#ifdef TANG_DEBUG char cur_time[64]; - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s going to flush\n", cur_time, PDC_get_rank(), __func__); +#endif PDC_region_cache_flush_by_pointer(obj_id, obj_cache, 0); } diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 18a96e959..92a2e0777 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -175,8 +175,8 @@ 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__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); gettimeofday(&last_cache_activity_timeval_g, NULL); @@ -202,8 +202,8 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) } #endif - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s before (cache) writing\n", cur_time, PDC_get_rank(), __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s before (cache) writing\n", cur_time, PDC_get_rank(), __func__); for (i = 0; i < request_data.n_objs; ++i) { remote_reg_info->ndim = request_data.remote_ndim[i]; @@ -232,8 +232,8 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pthread_mutex_unlock(&transfer_request_status_mutex); } - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: %s after (cache) writing\n", cur_time, PDC_get_rank(), __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: %s after (cache) writing\n", cur_time, PDC_get_rank(), __func__); #ifndef PDC_SERVER_CACHE for (i = 0; i < request_data.n_objs; ++i) { @@ -260,8 +260,8 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pdc_timestamp_register(pdc_transfer_request_inner_write_all_bulk_timestamps, start, end); #endif - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); FUNC_LEAVE(ret); } @@ -343,9 +343,9 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) FUNC_ENTER(NULL); - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); */ + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); #ifdef PDC_TIMING double end = MPI_Wtime(), start; @@ -579,9 +579,9 @@ 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); */ + 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); gettimeofday(&last_cache_activity_timeval_g, NULL); @@ -620,16 +620,16 @@ HG_TEST_RPC_CB(transfer_request_all, handle) &(local_bulk_args->in.total_buf_size), HG_BULK_READWRITE, &(local_bulk_args->bulk_handle)); - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[x]: %s start bulk \n", cur_time, __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[x]: %s start bulk \n", cur_time, __func__); ret_value = HG_Bulk_transfer(info->context, transfer_request_all_bulk_transfer_write_cb, local_bulk_args, HG_BULK_PULL, info->addr, in.local_bulk_handle, 0, local_bulk_args->bulk_handle, 0, local_bulk_args->in.total_buf_size, HG_OP_ID_IGNORE); - /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); */ + PDC_get_time_str(cur_time); + printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); } else { // Read operation has to receive region metadata first. There will be another bulk transfer triggered @@ -658,9 +658,9 @@ 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); */ + 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); fflush(stdout); FUNC_LEAVE(ret_value); diff --git a/src/tests/region_transfer_all.c b/src/tests/region_transfer_all.c index 88f8c9bd4..4e8475e1b 100644 --- a/src/tests/region_transfer_all.c +++ b/src/tests/region_transfer_all.c @@ -329,6 +329,8 @@ main(int argc, char **argv) } } + MPI_Barrier(MPI_COMM_WORLD); + // close object for (i = 0; i < OBJ_NUM; ++i) { if (PDCobj_close(obj[i]) < 0) { From 71a9b8b7ea0fb8ac4ef140abe5ae8221cefeaebb Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 Aug 2024 22:43:53 +0000 Subject: [PATCH 09/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 3 ++- src/server/pdc_server_region/pdc_server_region_cache.c | 6 +++--- .../pdc_server_region/pdc_server_region_request_handler.h | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 489daadb4..d2910a711 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -3188,7 +3188,8 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d #ifdef TANG_DEBUG 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); #endif #ifdef PDC_TIMING diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index d6b2f7e4b..3e37de388 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -942,7 +942,7 @@ PDC_region_cache_clock_cycle(void *ptr) if (elapsed_time >= pdc_idle_flush_time_g) { /* PDC_get_time_str(cur_time); */ - /* printf("%s ==PDC_SERVER[%d.1]: %s going to flush with idle time\n", */ + /* printf("%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); @@ -955,8 +955,8 @@ PDC_region_cache_clock_cycle(void *ptr) if (nflush > 0) { PDC_get_time_str(cur_time); - printf("%s ==PDC_SERVER[%d.1]: flushed %d regions to storage, took %.4fs\n", - cur_time, PDC_get_rank(), nflush, elapsed_time); + printf("%s ==PDC_SERVER[%d.1]: flushed %d regions to storage, took %.4fs\n", cur_time, + PDC_get_rank(), nflush, elapsed_time); } } else { diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 92a2e0777..eb2fbec6b 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -580,8 +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); @@ -659,8 +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); From dc80b4d8efb767b3420804145f073ccd671e2f9f Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Fri, 23 Aug 2024 15:47:58 -0700 Subject: [PATCH 10/23] Disable debug prints --- .../pdc_server_region_request_handler.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index eb2fbec6b..4ddb6482e 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -175,8 +175,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) FUNC_ENTER(NULL); +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); +#endif gettimeofday(&last_cache_activity_timeval_g, NULL); @@ -202,8 +204,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) } #endif +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[%d]: %s before (cache) writing\n", cur_time, PDC_get_rank(), __func__); +#endif for (i = 0; i < request_data.n_objs; ++i) { remote_reg_info->ndim = request_data.remote_ndim[i]; @@ -232,8 +236,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pthread_mutex_unlock(&transfer_request_status_mutex); } +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[%d]: %s after (cache) writing\n", cur_time, PDC_get_rank(), __func__); +#endif #ifndef PDC_SERVER_CACHE for (i = 0; i < request_data.n_objs; ++i) { @@ -260,8 +266,10 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) pdc_timestamp_register(pdc_transfer_request_inner_write_all_bulk_timestamps, start, end); #endif +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[%d]: leaving %s\n", cur_time, PDC_get_rank(), __func__); +#endif FUNC_LEAVE(ret); } @@ -343,9 +351,11 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) FUNC_ENTER(NULL); +#ifdef TANG_DEBUG char cur_time[64]; PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); +#endif #ifdef PDC_TIMING double end = MPI_Wtime(), start; @@ -579,9 +589,11 @@ HG_TEST_RPC_CB(transfer_request_all, handle) HG_Get_input(handle, &in); +#ifdef TANG_DEBUG 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); +#endif gettimeofday(&last_cache_activity_timeval_g, NULL); @@ -620,16 +632,20 @@ HG_TEST_RPC_CB(transfer_request_all, handle) &(local_bulk_args->in.total_buf_size), HG_BULK_READWRITE, &(local_bulk_args->bulk_handle)); +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[x]: %s start bulk \n", cur_time, __func__); +#endif ret_value = HG_Bulk_transfer(info->context, transfer_request_all_bulk_transfer_write_cb, local_bulk_args, HG_BULK_PULL, info->addr, in.local_bulk_handle, 0, local_bulk_args->bulk_handle, 0, local_bulk_args->in.total_buf_size, HG_OP_ID_IGNORE); +#ifdef TANG_DEBUG PDC_get_time_str(cur_time); printf("%s ==PDC_SERVER[x]: %s done bulk\n", cur_time, __func__); +#endif } else { // Read operation has to receive region metadata first. There will be another bulk transfer triggered @@ -658,9 +674,11 @@ HG_TEST_RPC_CB(transfer_request_all, handle) } #endif +#ifdef TANG_DEBUG 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); +#endif fflush(stdout); FUNC_LEAVE(ret_value); From e783fa1b122eae97fdb6c422cf2ddfb74670df90 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Fri, 23 Aug 2024 16:16:28 -0700 Subject: [PATCH 11/23] Revert back for non-all ops --- src/api/pdc_client_connect.c | 12 ++++++------ src/tests/region_transfer_status.c | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index d2910a711..49a7f5b9e 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -3578,11 +3578,11 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_send_transfer_request(): Could not start HG_Forward() @ line %d\n", __LINE__); - /* hg_atomic_set32(&atomic_work_todo_g, 1); */ - /* PDC_Client_check_response(&send_context_g); */ + hg_atomic_set32(&atomic_work_todo_g, 1); + PDC_Client_check_response(&send_context_g); - hg_progress_shutdown_flag_g = 0; - pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + /* hg_progress_shutdown_flag_g = 0; */ + /* pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); */ while (hg_atomic_get32(&atomic_work_todo_g) > 0) { usleep(100000); @@ -3666,8 +3666,8 @@ PDC_Client_transfer_request_wait(pdcid_t transfer_request_id, uint32_t data_serv FUNC_ENTER(NULL); - hg_progress_shutdown_flag_g = 1; - pthread_join(hg_progress_tid_g, NULL); + /* hg_progress_shutdown_flag_g = 1; */ + /* pthread_join(hg_progress_tid_g, NULL); */ #ifdef PDC_TIMING double start = MPI_Wtime(), end; diff --git a/src/tests/region_transfer_status.c b/src/tests/region_transfer_status.c index c513c56c2..a474a5d94 100644 --- a/src/tests/region_transfer_status.c +++ b/src/tests/region_transfer_status.c @@ -174,6 +174,7 @@ main(int argc, char **argv) ret_value = 1; } + PDCregion_transfer_wait(transfer_request); PDCregion_transfer_close(transfer_request); if (PDCregion_close(reg) < 0) { @@ -218,6 +219,7 @@ main(int argc, char **argv) ret_value = 1; } + PDCregion_transfer_wait(transfer_request); PDCregion_transfer_close(transfer_request); // Check if data written previously has been correctly read. From 2d0eb24983d469cf64db3d20b510abf9ce32405a Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Sat, 24 Aug 2024 20:28:55 -0700 Subject: [PATCH 12/23] Better pthread management --- src/api/pdc_client_connect.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 49a7f5b9e..2e8b2907b 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -192,7 +192,7 @@ pdc_data_server_io_list_t *client_cache_list_head_g = NULL; static uint64_t object_selection_query_counter_g = 0; static pthread_t hg_progress_tid_g; -static int hg_progress_shutdown_flag_g = 0; +static int hg_progress_shutdown_flag_g = -1; /* * @@ -262,11 +262,13 @@ hg_progress_fn(void *foo) unsigned int actual_count; hg_context_t *hg_context = (hg_context_t *)foo; - /* char cur_time[64]; */ - /* PDC_get_time_str(cur_time); */ - /* printf("[%s] enter %s\n", cur_time, __func__); */ +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("[%s] enter %s\n", cur_time, __func__); +#endif - while (!hg_progress_shutdown_flag_g) { + while (hg_progress_shutdown_flag_g != 1) { do { /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Trigger\n", cur_time); */ @@ -275,20 +277,22 @@ hg_progress_fn(void *foo) /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Trigger\n", cur_time); */ - } while ((ret == HG_SUCCESS) && actual_count && !hg_progress_shutdown_flag_g); + } while ((ret == HG_SUCCESS) && actual_count && hg_progress_shutdown_flag_g != 1); /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Progress\n", cur_time); */ - if (!hg_progress_shutdown_flag_g) + if (hg_progress_shutdown_flag_g != 1) HG_Progress(hg_context, 100); /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Progress\n", cur_time); */ } - /* PDC_get_time_str(cur_time); */ - /* printf("[%s] after HG_Progress\n", cur_time); */ +#ifdef TANG_DEBUG + PDC_get_time_str(cur_time); + printf("[%s] leaving %s\n", cur_time, __func__); +#endif return (NULL); } @@ -3211,8 +3215,10 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d /* PDC_Client_check_response(&send_context_g); */ - hg_progress_shutdown_flag_g = 0; - pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + if (hg_progress_shutdown_flag_g == -1) { + hg_progress_shutdown_flag_g = 0; + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + } while (hg_atomic_get32(&atomic_work_todo_g) > 0) { usleep(100000); @@ -3418,6 +3424,7 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u // Join the thread of trasfer start all hg_progress_shutdown_flag_g = 1; pthread_join(hg_progress_tid_g, NULL); + hg_progress_shutdown_flag_g = -1; #ifdef PDC_TIMING double start = MPI_Wtime(), end; From 00a6b68cd55bff4cfc99e50e51c4e9d6d5279198 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Sat, 24 Aug 2024 21:13:45 -0700 Subject: [PATCH 13/23] Better pthread management --- src/api/pdc_client_connect.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 2e8b2907b..215b37d4a 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -1678,6 +1678,13 @@ PDC_Client_finalize() if (pdc_server_info_g != NULL) free(pdc_server_info_g); + // Join the thread of trasfer start all + if (hg_progress_shutdown_flag_g == 0) { + hg_progress_shutdown_flag_g = 1; + pthread_join(hg_progress_tid_g, NULL); + hg_progress_shutdown_flag_g = -1; + } + #ifndef ENABLE_MPI for (i = 0; i < pdc_server_num_g; i++) { printf(" Server%3d, %d\n", i, debug_server_id_count[i]); @@ -3422,9 +3429,11 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u FUNC_ENTER(NULL); // Join the thread of trasfer start all - hg_progress_shutdown_flag_g = 1; - pthread_join(hg_progress_tid_g, NULL); - hg_progress_shutdown_flag_g = -1; + if (hg_progress_shutdown_flag_g == 0) { + hg_progress_shutdown_flag_g = 1; + pthread_join(hg_progress_tid_g, NULL); + hg_progress_shutdown_flag_g = -1; + } #ifdef PDC_TIMING double start = MPI_Wtime(), end; From 53a04c441151e22b001e3ade6301b4ca707399b1 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Mon, 26 Aug 2024 18:20:30 -0700 Subject: [PATCH 14/23] Fix timeout issue with CI testing and clang-formatting --- src/api/include/pdc_client_connect.h | 25 +- .../pdc_analysis_and_transforms_common.h | 10 +- src/api/pdc_analysis/pdc_analysis.c | 34 +- .../pdc_analysis_and_transforms_connect.c | 12 +- src/api/pdc_analysis/pdc_analysis_common.c | 12 +- src/api/pdc_analysis/pdc_hist_pkg.c | 4 +- src/api/pdc_client_connect.c | 418 ++++++++++-------- src/api/pdc_obj/include/pdc_cont.h | 2 +- src/api/pdc_obj/include/pdc_cont_pkg.h | 2 +- src/api/pdc_obj/include/pdc_obj_pkg.h | 10 +- src/api/pdc_obj/include/pdc_prop.h | 2 +- src/api/pdc_obj/include/pdc_prop_pkg.h | 12 +- src/api/pdc_obj/pdc_cont.c | 16 +- src/api/pdc_obj/pdc_mpi.c | 6 +- src/api/pdc_obj/pdc_obj.c | 40 +- src/api/pdc_obj/pdc_prop.c | 16 +- src/api/pdc_query/include/pdc_query.h | 24 +- src/api/pdc_query/pdc_query.c | 4 +- src/api/pdc_region/include/pdc_region.h | 6 +- src/api/pdc_region/pdc_region.c | 20 +- src/api/pdc_region/pdc_region_transfer.c | 98 ++-- .../include/pdc_transforms_pkg.h | 4 +- src/api/pdc_transform/pdc_transform.c | 44 +- src/api/pdc_transform/pdc_transforms_common.c | 2 +- src/server/dablooms/pdc_dablooms.c | 2 +- src/server/dablooms/pdc_dablooms.h | 8 +- src/server/include/pdc_client_server_common.h | 72 +-- src/server/include/pdc_hash-table.h | 2 +- src/server/include/pdc_server_common.h | 8 +- src/server/include/pdc_server_metadata.h | 12 +- .../include/pdc_server_metadata_index.h | 10 +- src/server/pdc_client_server_common.c | 210 ++++----- src/server/pdc_hash-table.c | 18 +- src/server/pdc_server.c | 60 +-- .../pdc_server_analysis/pdc_server_analysis.c | 4 +- src/server/pdc_server_metadata.c | 86 ++-- src/server/pdc_server_metadata_index.c | 26 +- src/server/pdc_server_metadata_index_test.c | 2 +- .../include/pdc_server_data.h | 86 ++-- .../include/pdc_server_region_transfer.h | 12 +- .../pdc_server_region/pdc_server_data.c | 238 +++++----- .../pdc_server_region_cache.c | 38 +- .../pdc_server_region_request_handler.h | 38 +- .../pdc_server_region_transfer.c | 8 +- ...dc_server_region_transfer_metadata_query.c | 38 +- src/tests/bdcats.c | 6 +- src/tests/bdcats_old.c | 6 +- src/tests/bdcats_v2.c | 12 +- src/tests/blocked_lock.c | 2 +- src/tests/buf_map_mpi_v2.c | 2 +- src/tests/buf_obj_map_mpi.c | 4 +- src/tests/client_server.c | 2 +- src/tests/cont_add_del.c | 2 +- src/tests/create_obj_scale.c | 2 +- src/tests/dart_algo_sim.c | 4 +- src/tests/dart_func_test.c | 12 +- src/tests/data_rw_test.c | 18 +- src/tests/data_server_meta.c | 2 +- src/tests/data_server_meta_test.c | 6 +- src/tests/data_server_read.c | 4 +- src/tests/data_server_read_vpic.c | 6 +- src/tests/data_server_read_vpic_multits.c | 4 +- src/tests/data_server_read_vpic_spatial.c | 6 +- .../data_server_read_vpic_spatial_multits.c | 4 +- src/tests/data_server_write.c | 6 +- src/tests/data_server_write_vpic.c | 4 +- src/tests/data_server_write_vpic_multits.c | 4 +- src/tests/delete_obj.c | 4 +- src/tests/delete_obj_scale.c | 4 +- src/tests/gen_fastbit_idx.c | 4 +- src/tests/hash_table.c | 4 +- src/tests/helper/julia_helper_loader.c | 10 +- src/tests/import_vpic.c | 8 +- src/tests/kvtag_add_get.c | 4 +- src/tests/kvtag_add_get_benchmark.c | 6 +- src/tests/kvtag_add_get_scale.c | 4 +- src/tests/kvtag_get.c | 2 +- src/tests/kvtag_query.c | 4 +- src/tests/kvtag_query_mpi.c | 4 +- src/tests/kvtag_query_scale.c | 4 +- src/tests/kvtag_query_scale_col.c | 16 +- src/tests/list_all.c | 4 +- src/tests/obj_buf.c | 2 +- src/tests/obj_iter.c | 2 +- src/tests/obj_map.c | 4 +- src/tests/obj_transformation.c | 12 +- src/tests/pdc_transforms_lib.c | 6 +- src/tests/query_data.c | 8 +- src/tests/query_metadata_agg.c | 2 +- src/tests/query_vpic.c | 2 +- src/tests/query_vpic_bin_sds1_nopreload.c | 4 +- src/tests/query_vpic_bin_sds1_preload.c | 2 +- src/tests/query_vpic_bin_sds_nopreload.c | 2 +- src/tests/query_vpic_bin_sds_preload.c | 2 +- src/tests/query_vpic_create_data.c | 6 +- src/tests/query_vpic_exyz_nopreload.c | 4 +- src/tests/query_vpic_exyz_preload.c | 2 +- src/tests/query_vpic_multi.c | 4 +- src/tests/query_vpic_multi_nopreload.c | 4 +- src/tests/query_vpic_multi_nopreload1.c | 4 +- src/tests/query_vpic_multi_preload.c | 4 +- src/tests/read_obj.c | 4 +- src/tests/read_obj_shared.c | 4 +- src/tests/region_transfer_all.c | 8 +- src/tests/region_transfer_all_2D.c | 8 +- src/tests/region_transfer_all_3D.c | 8 +- src/tests/region_transfer_all_append.c | 23 +- src/tests/region_transfer_all_append_2D.c | 8 +- src/tests/region_transfer_all_append_3D.c | 8 +- src/tests/region_transfer_all_split_wait.c | 2 +- src/tests/region_transfer_set_dims.c | 2 +- src/tests/region_transfer_set_dims_2D.c | 2 +- src/tests/region_transfer_set_dims_3D.c | 2 +- src/tests/search_obj.c | 12 +- src/tests/search_obj_scale.c | 4 +- src/tests/stat_obj.c | 12 +- src/tests/update_obj.c | 12 +- src/tests/vpicio.c | 6 +- src/tests/vpicio_mts.c | 6 +- src/tests/vpicio_mts_all.c | 7 +- src/tests/vpicio_old.c | 6 +- src/tests/vpicio_v2.c | 12 +- src/tests/write_obj_shared.c | 2 +- 123 files changed, 1174 insertions(+), 1061 deletions(-) diff --git a/src/api/include/pdc_client_connect.h b/src/api/include/pdc_client_connect.h index acf8fa7f0..8ba5949b6 100644 --- a/src/api/include/pdc_client_connect.h +++ b/src/api/include/pdc_client_connect.h @@ -60,23 +60,23 @@ struct _pdc_client_lookup_args { uint32_t client_id; int ret; int is_init; - char * ret_string; - char * client_addr; + char *ret_string; + char *client_addr; uint32_t user_id; - const char * app_name; + const char *app_name; int time_step; uint32_t hash_value; - const char * tags; + const char *tags; hg_request_t *request; }; struct _pdc_client_transform_args { size_t size; - void * data; - void * transform_result; + void *data; + void *transform_result; struct _pdc_region_transform_ftn_info *this_transform; - struct pdc_region_info * region_info; + struct pdc_region_info *region_info; int type_extent; int transform_state; int ret; @@ -148,8 +148,8 @@ struct _pdc_query_result_list { int query_id; uint64_t nhits; uint64_t *coords; - void * data; - void ** data_arr; + void *data; + void **data_arr; uint64_t *data_arr_size; uint64_t recv_data_nhits; @@ -187,8 +187,8 @@ struct client_genetic_lookup_args { struct _dart_perform_one_thread_param { int server_id; dart_perform_one_server_in_t *dart_in; - uint64_t ** dart_out; - size_t * dart_out_size; + uint64_t **dart_out; + size_t *dart_out_size; }; #define PDC_CLIENT_DATA_SERVER() ((pdc_client_mpi_rank_g / pdc_nclient_per_server_g) % pdc_server_num_g) @@ -1102,4 +1102,7 @@ perr_t PDC_Client_insert_obj_ref_into_dart(dart_hash_algo_t hash_algo, char *att */ void report_avg_server_profiling_rst(); +perr_t PDC_Client_transfer_pthread_create(); +perr_t PDC_Client_transfer_pthread_terminate(); +perr_t PDC_Client_transfer_pthread_cnt_add(int n); #endif /* PDC_CLIENT_CONNECT_H */ diff --git a/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h b/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h index 79ccbf3db..2c6cca1e0 100644 --- a/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h +++ b/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h @@ -47,7 +47,7 @@ struct _pdc_region_analysis_ftn_info { int client_id; int ftn_lastResult; _pdc_analysis_language_t lang; - void * data; + void *data; }; /* @@ -85,9 +85,9 @@ struct _pdc_region_analysis_ftn_info { */ struct _pdc_iterator_info { - void * srcStart; /**** Constant that points to the data buffer */ - void * srcNext; /**** Updated data pointer for each iteration */ - void * copy_region; /* Normally unused (see special cases) */ + void *srcStart; /**** Constant that points to the data buffer */ + void *srcNext; /**** Updated data pointer for each iteration */ + void *copy_region; /* Normally unused (see special cases) */ size_t sliceCount; /**** Total # of slices to return */ size_t sliceNext; /* Current count that we are going to return */ size_t sliceResetCount; /* For 3d, when to recalculate 'srcNext' */ @@ -118,7 +118,7 @@ struct _pdc_iterator_info { struct _pdc_my_rpc_state { hg_int64_t value; hg_size_t size; - void * buffer; + void *buffer; hg_bulk_t bulk_handle; hg_handle_t handle; }; diff --git a/src/api/pdc_analysis/pdc_analysis.c b/src/api/pdc_analysis/pdc_analysis.c index 0add84746..086541627 100644 --- a/src/api/pdc_analysis/pdc_analysis.c +++ b/src/api/pdc_analysis/pdc_analysis.c @@ -62,7 +62,7 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator int ret_value = 0; int k, d_offset; size_t i, element_size = 0; - char * data = NULL; + char *data = NULL; size_t sliceCount = 1; size_t elementsPerSlice = 1; size_t elementsPerBlock; @@ -71,8 +71,8 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator size_t skipCount = 0; size_t totalElements; struct pdc_region_info *region_info = NULL; - struct _pdc_obj_info * object_info = PDC_obj_get_info(objectId); - struct _pdc_obj_prop * obj_prop_ptr; + struct _pdc_obj_info *object_info = PDC_obj_get_info(objectId); + struct _pdc_obj_prop *obj_prop_ptr; FUNC_ENTER(NULL); @@ -308,7 +308,7 @@ PDCobj_data_iter_create(pdcid_t obj_id, pdcid_t reg_id) char * PDC_get_argv0_() { - char * ret_value = NULL; + char *ret_value = NULL; static char *_argv0 = NULL; char fullPath[PATH_MAX] = { 0, @@ -317,9 +317,9 @@ PDC_get_argv0_() 0, }; pid_t mypid = getpid(); - char * next; - char * procpath = NULL; - FILE * shellcmd = NULL; + char *next; + char *procpath = NULL; + FILE *shellcmd = NULL; size_t cmdLength; FUNC_ENTER(NULL); @@ -415,18 +415,18 @@ perr_t PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut) { perr_t ret_value = SUCCEED; /* Return value */ - void * ftnHandle = NULL; + void *ftnHandle = NULL; int (*ftnPtr)(pdcid_t, pdcid_t) = NULL; struct _pdc_region_analysis_ftn_info *thisFtn = NULL; - struct _pdc_iterator_info * i_in = NULL, *i_out = NULL; + struct _pdc_iterator_info *i_in = NULL, *i_out = NULL; pdcid_t meta_id_in = 0, meta_id_out = 0; pdcid_t local_id_in = 0, local_id_out = 0; - char * thisApp = NULL; - char * colonsep = NULL; - char * analyislibrary = NULL; - char * applicationDir = NULL; - char * userdefinedftn = NULL; - char * loadpath = NULL; + char *thisApp = NULL; + char *colonsep = NULL; + char *analyislibrary = NULL; + char *applicationDir = NULL; + char *userdefinedftn = NULL; + char *loadpath = NULL; FUNC_ENTER(NULL); @@ -537,8 +537,8 @@ PDCobj_data_getNextBlock(pdcid_t iter, void **nextBlock, size_t *dims) size_t ret_value = 0; struct _pdc_iterator_info *thisIter = NULL; size_t current_total, remaining, offset; - struct _pdc_obj_info * object_info; - struct _pdc_obj_prop * obj_prop_ptr; + struct _pdc_obj_info *object_info; + struct _pdc_obj_prop *obj_prop_ptr; FUNC_ENTER(NULL); diff --git a/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c b/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c index 4fd664e4c..7c5713725 100644 --- a/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c +++ b/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c @@ -27,7 +27,7 @@ #include "pdc_analysis_pkg.h" #include "pdc_transforms_common.h" -static hg_context_t * send_context_g = NULL; +static hg_context_t *send_context_g = NULL; static hg_atomic_int32_t *atomic_work_todo_g = NULL; /* Forward References:: */ @@ -51,12 +51,12 @@ PDC_Client_send_iter_recv_id(pdcid_t iter_id, pdcid_t *meta_id) { uint64_t ret_value = SUCCEED; struct _pdc_iterator_info *thisIter = NULL; - struct _pdc_my_rpc_state * my_rpc_state_p; + struct _pdc_my_rpc_state *my_rpc_state_p; obj_data_iterator_in_t in; hg_return_t hg_ret; int server_id = 0; int n_retry = 0; - struct _pdc_obj_info * object_info; + struct _pdc_obj_info *object_info; FUNC_ENTER(NULL); if (atomic_work_todo_g == NULL) { @@ -172,11 +172,11 @@ PDC_Client_register_obj_analysis(struct _pdc_region_analysis_ftn_info *thisFtn, uint32_t server_id = 0; hg_return_t hg_ret; analysis_ftn_in_t in; - struct _pdc_my_rpc_state * my_rpc_state_p; + struct _pdc_my_rpc_state *my_rpc_state_p; struct _pdc_iterator_info *thisIter; int n_retry = 0; int input_server = -1, output_server = -1; - struct _pdc_obj_info * obj_prop; + struct _pdc_obj_info *obj_prop; FUNC_ENTER(NULL); if (atomic_work_todo_g == NULL) { @@ -293,7 +293,7 @@ PDC_Client_register_region_transform(const char *func, const char *loadpath, uint32_t server_id = 0; hg_return_t hg_ret; transform_ftn_in_t in; - struct _pdc_obj_info * object_info = NULL; + struct _pdc_obj_info *object_info = NULL; struct _pdc_my_rpc_state *my_rpc_state_p; FUNC_ENTER(NULL); diff --git a/src/api/pdc_analysis/pdc_analysis_common.c b/src/api/pdc_analysis/pdc_analysis_common.c index e04a8d6a7..1cc51825e 100644 --- a/src/api/pdc_analysis/pdc_analysis_common.c +++ b/src/api/pdc_analysis/pdc_analysis_common.c @@ -40,7 +40,7 @@ size_t analysis_registry_size = 0; size_t transform_registry_size = 0; hg_atomic_int32_t registered_transform_ftn_count_g; -int * i_cache_freed = NULL; +int *i_cache_freed = NULL; size_t iterator_cache_entries = CACHE_SIZE; hg_atomic_int32_t i_cache_index; hg_atomic_int32_t i_free_index; @@ -56,7 +56,7 @@ compare_gt(int *a, int b) { return (*a) > (b); } -struct _pdc_region_analysis_ftn_info ** pdc_region_analysis_registry = NULL; +struct _pdc_region_analysis_ftn_info **pdc_region_analysis_registry = NULL; struct _pdc_region_transform_ftn_info **pdc_region_transform_registry = NULL; #ifndef IS_PDC_SERVER @@ -242,7 +242,7 @@ PDCiter_get_nextId(void) { int ret_value = 0; size_t nextId = 0; - int * previous_i_cache_freed = 0; + int *previous_i_cache_freed = 0; int next_free = 0; struct _pdc_iterator_info *previous_state; @@ -422,8 +422,8 @@ PDC_get_ftnPtr_(const char *ftn, const char *loadpath, void **ftnPtr) { int ret_value = 0; static void *appHandle = NULL; - void * ftnHandle = NULL; - char * this_error = NULL; + void *ftnHandle = NULL; + char *this_error = NULL; FUNC_ENTER(NULL); @@ -456,7 +456,7 @@ HG_TEST_RPC_CB(analysis_ftn, handle) int nulliter_count = 0; pdcid_t iterIn = -1, iterOut = -1; pdcid_t registrationId = -1; - void * ftnHandle = NULL; + void *ftnHandle = NULL; int (*ftnPtr)(pdcid_t, pdcid_t) = NULL; int result; diff --git a/src/api/pdc_analysis/pdc_hist_pkg.c b/src/api/pdc_analysis/pdc_hist_pkg.c index 75343a144..4551967bf 100644 --- a/src/api/pdc_analysis/pdc_hist_pkg.c +++ b/src/api/pdc_analysis/pdc_hist_pkg.c @@ -5,7 +5,7 @@ #define MACRO_SAMPLE_MIN_MAX(TYPE, n, data, sample_pct, min, max) \ ({ \ uint64_t i, sample_n, iter = 0; \ - TYPE * ldata = (TYPE *)data; \ + TYPE *ldata = (TYPE *)data; \ (min) = ldata[0]; \ (max) = ldata[0]; \ sample_n = (n) * (sample_pct); \ @@ -161,7 +161,7 @@ PDC_create_hist(pdc_var_type_t dtype, int nbin, double min, double max) ({ \ uint64_t i; \ int lo, mid = 0, hi; \ - TYPE * ldata = (TYPE *)(_data); \ + TYPE *ldata = (TYPE *)(_data); \ if ((hist)->incr > 0) { \ for (i = 0; i < (n); i++) { \ if (ldata[i] < (hist)->range[1]) { \ diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 215b37d4a..5d1becc1b 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -66,6 +66,8 @@ #include "pdc_timing.h" +/* #define TANG_DEBUG 1 */ + int is_client_debug_g = 0; pdc_server_selection_t pdc_server_selection_g = PDC_SERVER_DEFAULT; int pdc_client_mpi_rank_g = 0; @@ -91,7 +93,7 @@ int pdc_nclient_per_server_g = 0; char pdc_client_tmp_dir_g[ADDR_MAX]; struct _pdc_server_info *pdc_server_info_g = NULL; -static int * debug_server_id_count = NULL; +static int *debug_server_id_count = NULL; int pdc_io_request_seq_id = PDC_SEQ_ID_INIT_VALUE; struct pdc_request *pdc_io_request_list_g = NULL; @@ -107,7 +109,7 @@ int nread_bb_g = 0; double read_bb_size_g = 0.0; static int mercury_has_init_g = 0; -static hg_class_t * send_class_g = NULL; +static hg_class_t *send_class_g = NULL; static hg_context_t *send_context_g = NULL; int query_id_g = 0; @@ -122,7 +124,7 @@ static hg_atomic_int32_t response_done_g; hg_atomic_int32_t bulk_transfer_done_g; // global variables for DART -static DART * dart_g; +static DART *dart_g; static dart_hash_algo_t dart_hash_algo_g = DART_HASH; static dart_object_ref_type_t dart_obj_ref_type_g = REF_PRIMARY_ID; @@ -192,7 +194,8 @@ pdc_data_server_io_list_t *client_cache_list_head_g = NULL; static uint64_t object_selection_query_counter_g = 0; static pthread_t hg_progress_tid_g; -static int hg_progress_shutdown_flag_g = -1; +static int hg_progress_flag_g = -1; // -1 thread unintialized, 0 thread created, 1 terminate thread +static int hg_progress_task_cnt_g = 0; /* * @@ -268,7 +271,7 @@ hg_progress_fn(void *foo) printf("[%s] enter %s\n", cur_time, __func__); #endif - while (hg_progress_shutdown_flag_g != 1) { + while (hg_progress_flag_g != 1) { do { /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Trigger\n", cur_time); */ @@ -277,14 +280,15 @@ hg_progress_fn(void *foo) /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Trigger\n", cur_time); */ - } while ((ret == HG_SUCCESS) && actual_count && hg_progress_shutdown_flag_g != 1); + } while ((ret == HG_SUCCESS) && actual_count && hg_progress_flag_g != 1); /* PDC_get_time_str(cur_time); */ /* printf("[%s] before HG_Progress\n", cur_time); */ - if (hg_progress_shutdown_flag_g != 1) + if (hg_progress_flag_g != 1) HG_Progress(hg_context, 100); + usleep(1000); /* PDC_get_time_str(cur_time); */ /* printf("[%s] after HG_Progress\n", cur_time); */ } @@ -297,6 +301,65 @@ hg_progress_fn(void *foo) return (NULL); } +perr_t +PDC_Client_transfer_pthread_create() +{ + perr_t ret_value = SUCCEED; + + FUNC_ENTER(NULL); + + if (hg_progress_flag_g == -1) { + pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); + hg_progress_flag_g = 0; +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s %s created pthread\n", cur_time, __func__); +#endif + } + + FUNC_LEAVE(ret_value); +} + +perr_t +PDC_Client_transfer_pthread_terminate() +{ + perr_t ret_value = SUCCEED; + + FUNC_ENTER(NULL); + + if (hg_progress_flag_g == 0 && hg_progress_task_cnt_g == 0) { + hg_progress_flag_g = 1; + pthread_join(hg_progress_tid_g, NULL); + hg_progress_flag_g = -1; +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s %s terminated pthread\n", cur_time, __func__); +#endif + } + + FUNC_LEAVE(ret_value); +} + +perr_t +PDC_Client_transfer_pthread_cnt_add(int n) +{ + perr_t ret_value = SUCCEED; + + FUNC_ENTER(NULL); + +#ifdef TANG_DEBUG + char cur_time[64]; + PDC_get_time_str(cur_time); + printf("%s %s change cnt from %d to %d\n", cur_time, __func__, hg_progress_task_cnt_g, + hg_progress_task_cnt_g + n); +#endif + hg_progress_task_cnt_g += n; + + FUNC_LEAVE(ret_value); +} + // Check if all work has been processed // Using global variable $atomic_work_todo_g perr_t @@ -325,14 +388,23 @@ PDC_Client_check_response(hg_context_t **hg_context) FUNC_LEAVE(ret_value); } +// Block and wait for all work processed by pthread +inline static void +PDC_Client_wait_pthread_progress() +{ + while (hg_atomic_get32(&atomic_work_todo_g) > 0) { + usleep(1000); + } +} + perr_t PDC_Client_read_server_addr_from_file() { perr_t ret_value = SUCCEED; int max_tries = 9, sleeptime = 1; int i = 0, is_server_ready = 0; - char * p; - FILE * na_config = NULL; + char *p; + FILE *na_config = NULL; char config_fname[PATH_MAX]; char n_server_string[PATH_MAX]; @@ -414,7 +486,7 @@ client_send_flush_obj_all_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; flush_obj_all_out_t output; - int * rpc_return; + int *rpc_return; FUNC_ENTER(NULL); @@ -471,7 +543,7 @@ client_send_flush_obj_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; flush_obj_out_t output; - int * rpc_return; + int *rpc_return; FUNC_ENTER(NULL); @@ -500,7 +572,7 @@ client_send_close_all_server_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; close_server_out_t output; - int * rpc_return; + int *rpc_return; FUNC_ENTER(NULL); @@ -672,8 +744,7 @@ client_send_transfer_request_rpc_cb(const struct hg_cb_info *callback_info) ret_value = HG_Get_output(handle, &output); if (ret_value != HG_SUCCESS) { - printf("PDC_CLIENT[%d]: client_send_transfer_request_rpc_cb error with HG_Get_output\n", - pdc_client_mpi_rank_g); + printf("PDC_CLIENT[%d]: %s error with HG_Get_output\n", __func__, pdc_client_mpi_rank_g); region_transfer_args->ret = -1; goto done; } @@ -892,7 +963,7 @@ PDC_Client_lookup_server(int server_id, int is_init) hg_return_t hg_ret; struct _pdc_client_lookup_args lookup_args; char self_addr[ADDR_MAX]; - char * target_addr_string; + char *target_addr_string; FUNC_ENTER(NULL); @@ -1168,14 +1239,14 @@ hg_test_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args; hg_bulk_t local_bulk_handle; uint32_t i; - void * buf = NULL; - void ** ids_buf; + void *buf = NULL; + void **ids_buf; uint32_t n_meta; uint64_t buf_sizes[2] = {0, 0}; - uint64_t * ids_buf_sizes; + uint64_t *ids_buf_sizes; uint32_t actual_cnt; - pdc_metadata_t * meta_ptr; - uint64_t * u64_arr_ptr; + pdc_metadata_t *meta_ptr; + uint64_t *u64_arr_ptr; uint32_t bulk_sgnum; FUNC_ENTER(NULL); @@ -1278,7 +1349,7 @@ PDC_Client_check_bulk(hg_context_t *hg_context) static const char * drc_strerror(int errnum) { - char * ret_value = NULL; + char *ret_value = NULL; const char *errstring = "UNDEFINED"; FUNC_ENTER(NULL); @@ -1316,13 +1387,13 @@ PDC_Client_mercury_init(hg_class_t **hg_class, hg_context_t **hg_context, int po * "cci+tcp" */ struct hg_init_info init_info = {0}; - char * default_hg_transport = "ofi+tcp"; - char * hg_transport; + char *default_hg_transport = "ofi+tcp"; + char *hg_transport; #ifdef PDC_HAS_CRAY_DRC uint32_t credential, cookie; drc_info_handle_t credential_info; char pdc_auth_key[256] = {'\0'}; - char * auth_key; + char *auth_key; int rc; #endif @@ -1516,7 +1587,7 @@ PDC_Client_init() { perr_t ret_value = SUCCEED; pdc_server_info_g = NULL; - char * tmp_dir; + char *tmp_dir; uint32_t port; int is_mpi_init = 0; @@ -1632,6 +1703,11 @@ PDC_Client_init() server_mem_usage_g = (int64_t *)calloc(pdc_server_num_g, sizeof(int64_t)); } + /* if (hg_progress_flag_g == -1) { */ + /* hg_progress_flag_g = 0; */ + /* pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); */ + /* } */ + done: fflush(stdout); FUNC_LEAVE(ret_value); @@ -1678,11 +1754,11 @@ PDC_Client_finalize() if (pdc_server_info_g != NULL) free(pdc_server_info_g); - // Join the thread of trasfer start all - if (hg_progress_shutdown_flag_g == 0) { - hg_progress_shutdown_flag_g = 1; + // Terminate thread + if (hg_progress_flag_g == 0) { + hg_progress_flag_g = 1; pthread_join(hg_progress_tid_g, NULL); - hg_progress_shutdown_flag_g = -1; + hg_progress_flag_g = -1; } #ifndef ENABLE_MPI @@ -1717,16 +1793,16 @@ static hg_return_t metadata_query_bulk_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t * client_lookup_args; + struct bulk_args_t *client_lookup_args; hg_handle_t handle; metadata_query_transfer_out_t output; uint32_t n_meta; hg_op_id_t hg_bulk_op_id; hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; - const struct hg_info * hg_info = NULL; - struct bulk_args_t * bulk_args; - void * recv_meta; + const struct hg_info *hg_info = NULL; + struct bulk_args_t *bulk_args; + void *recv_meta; FUNC_ENTER(NULL); @@ -2136,7 +2212,7 @@ PDC_Client_add_tag(pdcid_t obj_id, const char *tag) hg_handle_t metadata_add_tag_handle; uint64_t meta_id; uint32_t server_id; - struct _pdc_obj_info * obj_prop; + struct _pdc_obj_info *obj_prop; struct _pdc_client_lookup_args lookup_args; metadata_add_tag_in_t in; @@ -2357,7 +2433,7 @@ PDC_Client_delete_metadata(char *delete_name, pdcid_t obj_delete_prop) { perr_t ret_value = SUCCEED; hg_return_t hg_ret = 0; - struct _pdc_obj_prop * delete_prop; + struct _pdc_obj_prop *delete_prop; metadata_delete_in_t in; int hash_name_value; uint32_t server_id; @@ -2417,7 +2493,7 @@ PDC_Client_query_metadata_name_only(const char *obj_name, pdc_metadata_t **out) struct _pdc_metadata_query_args **lookup_args; uint32_t server_id; uint32_t i, count = 0; - hg_handle_t * metadata_query_handle; + hg_handle_t *metadata_query_handle; FUNC_ENTER(NULL); @@ -2759,7 +2835,7 @@ PDC_Client_send_name_recv_id(const char *obj_name, uint64_t cont_id, pdcid_t obj perr_t ret_value = SUCCEED; hg_return_t hg_ret; uint32_t server_id = 0; - struct _pdc_obj_prop * create_prop = NULL; + struct _pdc_obj_prop *create_prop = NULL; gen_obj_id_in_t in; uint32_t hash_name_value; struct _pdc_client_lookup_args lookup_args; @@ -2918,7 +2994,7 @@ PDC_Client_close_all_server() if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_close_all_server(): Could not destroy handle"); } // End pdc_client_mpi_rank_g < pdc_server_num_g - } // End pdc_client_mpi_size_g >= pdc_server_num_g + } // End pdc_client_mpi_size_g >= pdc_server_num_g else { if (pdc_client_mpi_rank_g == 0) { for (i = 0; i < (uint32_t)pdc_server_num_g; i++) { @@ -2947,7 +3023,7 @@ PDC_Client_close_all_server() PGOTO_ERROR(FAIL, "PDC_Client_close_all_server(): Could not destroy handle"); } } // End of mpi_rank == 0 - } // End pdc_client_mpi_size_g < pdc_server_num_g + } // End pdc_client_mpi_size_g < pdc_server_num_g #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); @@ -3145,15 +3221,15 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_all_in_t in; - hg_class_t * hg_class; + hg_class_t *hg_class; int i; hg_handle_t client_send_transfer_request_all_handle; struct _pdc_transfer_request_all_args transfer_args; + char cur_time[64]; FUNC_ENTER(NULL); #ifdef TANG_DEBUG - char cur_time[64]; PDC_get_time_str(cur_time); printf("%s PDC_CLIENT[%d] enter %s\n", cur_time, pdc_client_mpi_rank_g, __func__); #endif @@ -3203,6 +3279,12 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d data_server_id); #endif +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); +#endif + + PDC_Client_transfer_pthread_create(); + #ifdef PDC_TIMING if (access_type == PDC_READ) { pdc_timings.PDCtransfer_request_start_all_read_rpc += MPI_Wtime() - start; @@ -3216,20 +3298,15 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_send_transfer_request_all(): Could not start HG_Forward() @ line %d\n", __LINE__); -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - /* PDC_Client_check_response(&send_context_g); */ + /* if (hg_progress_flag_g == -1) { */ + /* pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); */ + /* hg_progress_flag_g = 0; */ + /* } */ - if (hg_progress_shutdown_flag_g == -1) { - hg_progress_shutdown_flag_g = 0; - pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); - } + /* PDC_Client_check_response(&send_context_g); */ - while (hg_atomic_get32(&atomic_work_todo_g) > 0) { - usleep(100000); - } + PDC_Client_wait_pthread_progress(); #ifdef TANG_DEBUG PDC_get_time_str(cur_time); @@ -3252,8 +3329,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d } #endif /* - printf("PDC_Client_transfer_request() checkpoint, first value is %d @ line %d\n", ((int *)buf)[0], - __LINE__); + printf("%s checkpoint, first value is %d @ line %d\n", __func__,((int *)buf)[0], __LINE__); */ for (i = 0; i < n_objs; ++i) { metadata_id[i] = transfer_args.metadata_id + i; @@ -3280,7 +3356,7 @@ PDC_Client_transfer_request_metadata_query2(char *buf, uint64_t total_buf_size, perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_metadata_query2_in_t in; - hg_class_t * hg_class; + hg_class_t *hg_class; hg_handle_t client_send_transfer_request_metadata_query2_handle; struct _pdc_transfer_request_metadata_query2_args transfer_args; @@ -3293,8 +3369,8 @@ PDC_Client_transfer_request_metadata_query2(char *buf, uint64_t total_buf_size, in.total_buf_size = total_buf_size; // Compute metadata server id - // fprintf(stderr, "PDC_Client_transfer_request_metadata_query2[%d]: metdata_id = %u, total_buf_size = - // %lu\n", pdc_client_mpi_rank_g, metadata_server_id, total_buf_size); + // fprintf(stderr, "%s [%d]: metdata_id = %u, total_buf_size = + // %lu\n", __func__, pdc_client_mpi_rank_g, metadata_server_id, total_buf_size); debug_server_id_count[metadata_server_id]++; hg_class = HG_Context_get_class(send_context_g); @@ -3311,10 +3387,7 @@ PDC_Client_transfer_request_metadata_query2(char *buf, uint64_t total_buf_size, hg_ret = HG_Bulk_create(hg_class, 1, (void **)&buf, (hg_size_t *)&(in.total_buf_size), HG_BULK_READWRITE, &(in.local_bulk_handle)); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request_metadata_query2(): Could not create local bulk data handle " - "@ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_metadata_query2_handle, client_send_transfer_request_metadata_query2_rpc_cb, &transfer_args, &in); @@ -3351,7 +3424,7 @@ PDC_Client_transfer_request_metadata_query(char *buf, uint64_t total_buf_size, i perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_metadata_query_in_t in; - hg_class_t * hg_class; + hg_class_t *hg_class; hg_handle_t client_send_transfer_request_metadata_query_handle; struct _pdc_transfer_request_metadata_query_args transfer_args; @@ -3382,10 +3455,7 @@ PDC_Client_transfer_request_metadata_query(char *buf, uint64_t total_buf_size, i hg_ret = HG_Bulk_create(hg_class, 1, (void **)&buf, (hg_size_t *)&(in.total_buf_size), HG_BULK_READWRITE, &(in.local_bulk_handle)); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request_metadata_query(): Could not create local bulk data handle @ " - "line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_metadata_query_handle, client_send_transfer_request_metadata_query_rpc_cb, &transfer_args, &in); @@ -3410,7 +3480,7 @@ PDC_Client_transfer_request_metadata_query(char *buf, uint64_t total_buf_size, i pdc_timings.PDCtransfer_request_metadata_query_rpc += end - start; pdc_timestamp_register(pdc_client_transfer_request_metadata_query_timestamps, function_start, end); #endif - // fprintf(stderr, "PDC_Client_transfer_request_metadata_query: checkpoint %d\n", __LINE__); + // fprintf(stderr, "%s: checkpoint %d\n", __func__, __LINE__); done: fflush(stdout); @@ -3423,17 +3493,18 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_wait_all_in_t in; - hg_class_t * hg_class; + hg_class_t *hg_class; hg_handle_t client_send_transfer_request_wait_all_handle; struct _pdc_transfer_request_wait_all_args transfer_args; + char cur_time[64]; FUNC_ENTER(NULL); - // Join the thread of trasfer start all - if (hg_progress_shutdown_flag_g == 0) { - hg_progress_shutdown_flag_g = 1; - pthread_join(hg_progress_tid_g, NULL); - hg_progress_shutdown_flag_g = -1; - } + + /* if (hg_progress_flag_g == 0) { */ + /* hg_progress_flag_g = 1; */ + /* pthread_join(hg_progress_tid_g, NULL); */ + /* hg_progress_flag_g = -1; */ + /* } */ #ifdef PDC_TIMING double start = MPI_Wtime(), end; @@ -3460,10 +3531,7 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u hg_ret = HG_Bulk_create(hg_class, 1, (void **)&transfer_request_id, (hg_size_t *)&(in.total_buf_size), HG_BULK_READWRITE, &(in.local_bulk_handle)); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR( - FAIL, - "PDC_Client_transfer_request_wait_all(): Could not create local bulk data handle @ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_wait_all_handle, client_send_transfer_request_wait_all_rpc_cb, &transfer_args, &in); @@ -3481,9 +3549,7 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u /* - printf("PDC_Client_transfer_request() checkpoint, first value is %d @ line %d\n", ((int *)buf)[0], - - __LINE__); + printf("%s checkpoint, first value is %d @ line %d\n", ((int *)buf)[0], __func__, __LINE__); */ if (transfer_args.ret != 1) PGOTO_ERROR(FAIL, "PDC_CLIENT: transfer request wait all failed... @ line %d\n", __LINE__); @@ -3510,12 +3576,13 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_in_t in; - hg_class_t * hg_class; + hg_class_t *hg_class; uint32_t meta_server_id; hg_size_t total_data_size; int i; hg_handle_t client_send_transfer_request_handle; struct _pdc_transfer_request_args transfer_args; + char cur_time[64]; FUNC_ENTER(NULL); #ifdef PDC_TIMING @@ -3524,11 +3591,11 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, #endif if (!(access_type == PDC_WRITE || access_type == PDC_READ)) { ret_value = FAIL; - printf("Invalid PDC type in function PDC_Client_transfer_request @ %d\n", __LINE__); + printf("Invalid PDC type in function %s @ %d\n", __func__, __LINE__); goto done; } - // printf("rank = %d, PDC_Client_transfer_request_start data_server_id = %u\n", pdc_client_mpi_rank_g, + // printf("rank = %d, %s data_server_id = %u\n", pdc_client_mpi_rank_g, __func__, // data_server_id); in.access_type = access_type; in.remote_unit = unit; @@ -3564,8 +3631,6 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, PGOTO_ERROR(FAIL, "==CLIENT[%d]: ERROR with PDC_Client_try_lookup_server @ line %d", pdc_client_mpi_rank_g, __LINE__); - hg_atomic_set32(&atomic_work_todo_g, 1); - hg_ret = HG_Create(send_context_g, pdc_server_info_g[data_server_id].addr, transfer_request_register_id_g, &client_send_transfer_request_handle); @@ -3574,9 +3639,9 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, &(in.local_bulk_handle)); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request(): Could not create local bulk data handle @ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); + + hg_atomic_set32(&atomic_work_todo_g, 1); hg_ret = HG_Forward(client_send_transfer_request_handle, client_send_transfer_request_rpc_cb, &transfer_args, &in); @@ -3591,18 +3656,20 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, start = MPI_Wtime(); #endif + PDC_Client_transfer_pthread_create(); + if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_send_transfer_request(): Could not start HG_Forward() @ line %d\n", __LINE__); - hg_atomic_set32(&atomic_work_todo_g, 1); - PDC_Client_check_response(&send_context_g); + /* hg_atomic_set32(&atomic_work_todo_g, 1); */ + /* PDC_Client_check_response(&send_context_g); */ - /* hg_progress_shutdown_flag_g = 0; */ - /* pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); */ + /* if (hg_progress_flag_g == -1) { */ + /* pthread_create(&hg_progress_tid_g, NULL, hg_progress_fn, send_context_g); */ + /* hg_progress_flag_g = 0; */ + /* } */ - while (hg_atomic_get32(&atomic_work_todo_g) > 0) { - usleep(100000); - } + PDC_Client_wait_pthread_progress(); #ifdef PDC_TIMING end = MPI_Wtime(); @@ -3647,9 +3714,7 @@ PDC_Client_transfer_request_status(pdcid_t transfer_request_id, uint32_t data_se transfer_request_status_register_id_g, &client_send_transfer_request_status_handle); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request(): Could not create local bulk data handle @ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_status_handle, client_send_transfer_request_status_rpc_cb, &transfer_args, &in); @@ -3679,11 +3744,16 @@ PDC_Client_transfer_request_wait(pdcid_t transfer_request_id, uint32_t data_serv transfer_request_wait_in_t in; hg_handle_t client_send_transfer_request_wait_handle; struct _pdc_transfer_request_wait_args transfer_args; + char cur_time[64]; FUNC_ENTER(NULL); - /* hg_progress_shutdown_flag_g = 1; */ - /* pthread_join(hg_progress_tid_g, NULL); */ + // Join the thread of trasfer start + /* if (hg_progress_flag_g == 0) { */ + /* hg_progress_flag_g = 1; */ + /* pthread_join(hg_progress_tid_g, NULL); */ + /* hg_progress_flag_g = -1; */ + /* } */ #ifdef PDC_TIMING double start = MPI_Wtime(), end; @@ -3703,9 +3773,7 @@ PDC_Client_transfer_request_wait(pdcid_t transfer_request_id, uint32_t data_serv transfer_request_wait_register_id_g, &client_send_transfer_request_wait_handle); if (hg_ret != HG_SUCCESS) - PGOTO_ERROR(FAIL, - "PDC_Client_transfer_request(): Could not create local bulk data handle @ line %d\n", - __LINE__); + PGOTO_ERROR(FAIL, "%s: Could not create local bulk data handle @ line %d\n", __func__, __LINE__); hg_ret = HG_Forward(client_send_transfer_request_wait_handle, client_send_transfer_request_wait_rpc_cb, &transfer_args, &in); @@ -3758,12 +3826,12 @@ PDC_Client_buf_map(pdcid_t local_region_id, pdcid_t remote_obj_id, size_t ndim, hg_return_t hg_ret = HG_SUCCESS; buf_map_in_t in; uint32_t data_server_id, meta_server_id; - hg_class_t * hg_class; + hg_class_t *hg_class; hg_uint32_t i, j; hg_uint32_t local_count; - void ** data_ptrs = NULL; - size_t * data_size = NULL; + void **data_ptrs = NULL; + size_t *data_size = NULL; size_t unit, unit_to; struct _pdc_buf_map_args map_args; hg_handle_t client_send_buf_map_handle; @@ -4713,11 +4781,11 @@ PDC_Client_get_data_from_server_shm_cb(const struct hg_cb_info *callback_info) int shm_fd = -1; // file descriptor, from shm_open() uint32_t i = 0; - char * shm_base = NULL; // base address, from mmap() - char * shm_addr = NULL; + char *shm_base = NULL; // base address, from mmap() + char *shm_addr = NULL; uint64_t data_size = 1; - client_read_info_t * read_info = NULL; - struct pdc_request * elt = NULL; + client_read_info_t *read_info = NULL; + struct pdc_request *elt = NULL; struct pdc_region_info *target_region = NULL; #ifdef ENABLE_TIMING struct timeval pdc_timer_start; @@ -4809,8 +4877,8 @@ PDC_Client_data_server_read_check(int server_id, uint32_t client_id, pdc_metadat uint64_t read_size = 1; hg_handle_t data_server_read_check_handle; int shm_fd; // file descriptor, from shm_open() - char * shm_base; // base address, from mmap() - char * shm_addr; + char *shm_base; // base address, from mmap() + char *shm_addr; #ifdef ENABLE_TIMING struct timeval pdc_timer_start; struct timeval pdc_timer_end; @@ -4945,8 +5013,8 @@ PDC_Client_data_server_read(struct pdc_request *request) data_server_read_in_t in; hg_handle_t data_server_read_handle; int server_id, n_client, n_update; - pdc_metadata_t * meta; - struct pdc_region_info * region; + pdc_metadata_t *meta; + struct pdc_region_info *region; FUNC_ENTER(NULL); @@ -5078,8 +5146,8 @@ PDC_Client_data_server_write_check(struct pdc_request *request, int *status) data_server_write_check_in_t in; hg_handle_t data_server_write_check_handle; int server_id; - pdc_metadata_t * meta; - struct pdc_region_info * region; + pdc_metadata_t *meta; + struct pdc_region_info *region; uint64_t write_size = 1; uint32_t i; @@ -5180,9 +5248,9 @@ PDC_Client_data_server_write(struct pdc_request *request) int server_ret; hg_handle_t data_server_write_handle; int server_id, n_client, n_update; - pdc_metadata_t * meta; - struct pdc_region_info * region; - void * buf; + pdc_metadata_t *meta; + struct pdc_region_info *region; + void *buf; int rnd; #ifdef ENABLE_TIMING @@ -5451,7 +5519,7 @@ PDC_Client_write_id(pdcid_t local_obj_id, struct pdc_region_info *region, void * struct _pdc_id_info *info; struct _pdc_obj_info *object; - pdc_metadata_t * meta; + pdc_metadata_t *meta; perr_t ret_value = SUCCEED; FUNC_ENTER(NULL); @@ -5682,7 +5750,7 @@ PDC_Client_add_objects_to_container(int nobj, pdcid_t *local_obj_ids, pdcid_t lo { perr_t ret_value = SUCCEED; int i; - uint64_t * obj_ids; + uint64_t *obj_ids; uint64_t cont_meta_id; struct _pdc_id_info *id_info = NULL; @@ -5708,7 +5776,7 @@ PDC_Client_del_objects_to_container(int nobj, pdcid_t *local_obj_ids, pdcid_t lo { perr_t ret_value = SUCCEED; int i; - uint64_t * obj_ids; + uint64_t *obj_ids; uint64_t cont_meta_id; struct _pdc_id_info *id_info = NULL; @@ -5736,7 +5804,7 @@ PDC_Client_add_tags_to_container(pdcid_t cont_id, char *tags) hg_return_t hg_ret = HG_SUCCESS; hg_handle_t rpc_handle; uint32_t server_id; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_cont_info *object; uint64_t cont_meta_id; cont_add_tags_rpc_in_t add_tag_rpc_in; @@ -5991,12 +6059,12 @@ PDC_Client_query_name_read_entire_obj(int nobj, char **obj_names, void ***out_bu hg_handle_t rpc_handle; hg_bulk_t bulk_handle; uint32_t server_id; - uint64_t * buf_sizes, total_size; + uint64_t *buf_sizes, total_size; int i; query_read_obj_name_in_t bulk_rpc_in; // Reuse the existing args structure update_region_storage_meta_bulk_args_t cb_args; - struct pdc_request * request; + struct pdc_request *request; FUNC_ENTER(NULL); @@ -6314,7 +6382,7 @@ static region_list_t * PDC_get_storage_meta_from_io_list(pdc_data_server_io_list_t **list, region_storage_meta_t *storage_meta) { pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; - region_list_t * ret_value = NULL; + region_list_t *ret_value = NULL; FUNC_ENTER(NULL); @@ -6340,7 +6408,7 @@ PDC_add_storage_meta_to_io_list(pdc_data_server_io_list_t **list, region_storage { pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; - region_list_t * new_region; + region_list_t *new_region; int j; perr_t ret_value = SUCCEED; @@ -6407,7 +6475,7 @@ PDC_send_region_storage_meta_shm(uint32_t server_id, int n, region_storage_meta_ buf_sizes = n * sizeof(region_storage_meta_t); hg_ret = HG_Bulk_create(send_class_g, 1, (void **)&storage_meta, (const hg_size_t *)&buf_sizes, - HG_BULK_READ_ONLY, &bulk_handle); + HG_BULK_READ_ONLY, &bulk_handle); if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "Could not create bulk data handle"); @@ -6440,7 +6508,7 @@ PDC_Client_cp_data_to_local_server(int nobj, region_storage_meta_t **all_storage perr_t ret_value = SUCCEED; uint32_t ndim, server_id; uint64_t total_size = 0, cp_loc = 0; - void * buf = NULL; + void *buf = NULL; char shm_addr[ADDR_MAX]; int i, *total_obj = NULL, ntotal_obj = nobj, *recvcounts = NULL, *displs = NULL; region_storage_meta_t *all_region_storage_meta_1d = NULL, *my_region_storage_meta_1d = NULL; @@ -6552,8 +6620,8 @@ PDC_Client_read_with_storage_meta(int nobj, region_storage_meta_t **all_storage_ { perr_t ret_value = SUCCEED; int i; - char * fname, *prev_fname; - FILE * fp_read = NULL; + char *fname, *prev_fname; + FILE *fp_read = NULL; uint32_t ndim; uint64_t req_start, req_count, storage_start, storage_count, file_offset, buf_size; size_t read_bytes; @@ -6657,15 +6725,15 @@ PDC_Client_query_multi_storage_info(int nobj, char **obj_names, region_storage_m hg_bulk_t bulk_handle; uint32_t server_id; - uint64_t * buf_sizes = NULL, total_size; + uint64_t *buf_sizes = NULL, total_size; int i, j, loc, iter, *n_obj_name_by_server = NULL; - int ** obj_names_server_seq_mapping = NULL, *obj_names_server_seq_mapping_1d; + int **obj_names_server_seq_mapping = NULL, *obj_names_server_seq_mapping_1d; int send_n_request = 0; - char *** obj_names_by_server = NULL; - char ** obj_names_by_server_2d = NULL; + char ***obj_names_by_server = NULL; + char **obj_names_by_server_2d = NULL; query_read_obj_name_in_t bulk_rpc_in; update_region_storage_meta_bulk_args_t cb_args; - struct pdc_request ** requests, *request; + struct pdc_request **requests, *request; FUNC_ENTER(NULL); @@ -6889,12 +6957,12 @@ PDC_Client_query_name_read_entire_obj_client_agg(int my_nobj, char **my_obj_name size_t *out_buf_sizes) { perr_t ret_value = SUCCEED; - char ** all_names = my_obj_names; - char * local_names_1d, *all_names_1d = NULL; - int * total_obj = NULL, i, ntotal_obj = my_nobj, *recvcounts = NULL, *displs = NULL; + char **all_names = my_obj_names; + char *local_names_1d, *all_names_1d = NULL; + int *total_obj = NULL, i, ntotal_obj = my_nobj, *recvcounts = NULL, *displs = NULL; size_t max_name_len = 64; region_storage_meta_t **all_storage_meta = NULL, **my_storage_meta = NULL; - region_storage_meta_t * my_storage_meta_1d = NULL, *res_storage_meta_1d = NULL; + region_storage_meta_t *my_storage_meta_1d = NULL, *res_storage_meta_1d = NULL; #ifdef ENABLE_TIMING struct timeval pdc_timer1; @@ -7184,7 +7252,7 @@ PDC_Client_read_overlap_regions(uint32_t ndim, uint64_t *req_start, uint64_t *re *total_read_bytes += read_bytes; } // for each row - } // ndim=2 + } // ndim=2 else if (ndim == 3) { if (is_client_debug_g == 1) { @@ -7255,8 +7323,8 @@ PDC_add_kvtag(pdcid_t obj_id, pdc_kvtag_t *kvtag, int is_cont) uint32_t server_id; hg_handle_t metadata_add_kvtag_handle; metadata_add_kvtag_in_t in; - struct _pdc_obj_info * obj_prop; - struct _pdc_cont_info * cont_prop; + struct _pdc_obj_info *obj_prop; + struct _pdc_cont_info *cont_prop; struct _pdc_client_lookup_args lookup_args; FUNC_ENTER(NULL); @@ -7364,8 +7432,8 @@ PDC_get_kvtag(pdcid_t obj_id, char *tag_name, pdc_kvtag_t **kvtag, int is_cont) hg_handle_t metadata_get_kvtag_handle; metadata_get_kvtag_in_t in; struct _pdc_get_kvtag_args lookup_args; - struct _pdc_obj_info * obj_prop; - struct _pdc_cont_info * cont_prop; + struct _pdc_obj_info *obj_prop; + struct _pdc_cont_info *cont_prop; FUNC_ENTER(NULL); @@ -7425,12 +7493,12 @@ kvtag_query_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_bulk_t origin_bulk_handle = hg_cb_info->info.bulk.origin_handle; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; uint32_t n_meta, actual_cnt; - void * buf = NULL; + void *buf = NULL; uint64_t buf_sizes[1]; uint32_t bulk_sgnum; - uint64_t * ids_buf_sizes; - void ** ids_buf; - uint64_t * u64_arr_ptr; + uint64_t *ids_buf_sizes; + void **ids_buf; + uint64_t *u64_arr_ptr; FUNC_ENTER(NULL); @@ -7483,14 +7551,14 @@ static hg_return_t kvtag_query_forward_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t * bulk_arg; + struct bulk_args_t *bulk_arg; hg_handle_t handle; metadata_query_transfer_out_t output; uint32_t n_meta; hg_op_id_t hg_bulk_op_id; hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; - const struct hg_info * hg_info = NULL; + const struct hg_info *hg_info = NULL; FUNC_ENTER(NULL); @@ -7668,8 +7736,8 @@ PDCtag_delete(pdcid_t obj_id, char *tag_name, int is_cont) uint32_t server_id; hg_handle_t metadata_del_kvtag_handle; metadata_get_kvtag_in_t in; - struct _pdc_obj_info * obj_prop; - struct _pdc_cont_info * cont_prop; + struct _pdc_obj_info *obj_prop; + struct _pdc_cont_info *cont_prop; struct _pdc_client_lookup_args lookup_args; FUNC_ENTER(NULL); @@ -7916,7 +7984,7 @@ PDCobj_put_data(const char *obj_name, void *data, uint64_t size, pdcid_t cont_id perr_t ret; // pdc_metadata_t *meta; struct _pdc_cont_info *info = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; pdcid_t transfer_request; FUNC_ENTER(NULL); @@ -8022,7 +8090,7 @@ PDC_Client_del_metadata(pdcid_t obj_id, int is_cont) { perr_t ret_value = SUCCEED; uint64_t meta_id; - struct _pdc_obj_info * obj_prop; + struct _pdc_obj_info *obj_prop; struct _pdc_cont_info *cont_prop; FUNC_ENTER(NULL); @@ -8155,7 +8223,7 @@ hg_return_t PDC_recv_nhits(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; - send_nhits_t * in = (send_nhits_t *)callback_info->arg; + send_nhits_t *in = (send_nhits_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; FUNC_ENTER(NULL); @@ -8184,10 +8252,10 @@ PDC_send_data_query(pdc_query_t *query, pdc_query_get_op_t get_op, uint64_t *nhi { perr_t ret_value = SUCCEED; hg_return_t hg_ret = 0; - uint32_t * target_servers = NULL; + uint32_t *target_servers = NULL; int i, server_id, next_server = 0, prev_server = 0, ntarget = 0; hg_handle_t handle; - pdc_query_xfer_t * query_xfer; + pdc_query_xfer_t *query_xfer; struct _pdc_client_lookup_args lookup_args; struct _pdc_query_result_list *result; @@ -8275,12 +8343,12 @@ PDC_recv_coords(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; uint64_t nhits = 0; uint32_t ndim; int query_id, origin; - void * buf; + void *buf; pdc_int_ret_t out; FUNC_ENTER(NULL); @@ -8361,7 +8429,7 @@ PDC_Client_get_sel_data(pdcid_t obj_id, pdc_selection_t *sel, void *data) uint64_t meta_id, off; get_sel_data_rpc_in_t in; struct _pdc_client_lookup_args lookup_args; - struct _pdc_obj_info * obj_prop; + struct _pdc_obj_info *obj_prop; struct _pdc_query_result_list *result_elt; FUNC_ENTER(NULL); @@ -8434,11 +8502,11 @@ PDC_recv_read_coords_data(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; uint64_t nhits = 0; int query_id, seq_id; - void * buf; + void *buf; pdc_int_ret_t out; FUNC_ENTER(NULL); @@ -8510,9 +8578,9 @@ report_avg_server_profiling_rst() { for (int i = 0; i < pdc_server_num_g; i++) { - double avg_srv_time = server_call_count_g[i] > 0 - ? (double)(server_time_total_g[i]) / (double)(server_call_count_g[i]) - : 0.0; + double avg_srv_time = server_call_count_g[i] > 0 + ? (double)(server_time_total_g[i]) / (double)(server_call_count_g[i]) + : 0.0; double srv_mem_usage = server_mem_usage_g[i] / 1024.0 / 1024.0; printf("==PDC_CLIENT[%d]: server %d, avg profiling time: %.4f ms, memory usage: %.4f MB\n", pdc_client_mpi_rank_g, i, avg_srv_time / 1000.0, srv_mem_usage); @@ -8657,7 +8725,7 @@ static hg_return_t dart_perform_one_server_on_receive_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t * client_lookup_args; + struct bulk_args_t *client_lookup_args; hg_handle_t handle; dart_perform_one_server_out_t output; uint32_t n_meta; @@ -8666,8 +8734,8 @@ dart_perform_one_server_on_receive_cb(const struct hg_cb_info *callback_info) hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; const struct hg_info *hg_info = NULL; - struct bulk_args_t * bulk_args; - void * recv_meta; + struct bulk_args_t *bulk_args; + void *recv_meta; FUNC_ENTER(NULL); @@ -8833,7 +8901,7 @@ dart_perform_on_servers(index_hash_result_t **hash_result, int num_servers, { struct bulk_args_t *lookup_args = (struct bulk_args_t *)calloc(num_servers, sizeof(struct bulk_args_t)); uint64_t ret_value = 0; - hg_handle_t * dart_request_handles = (hg_handle_t *)calloc(num_servers, sizeof(hg_handle_t)); + hg_handle_t *dart_request_handles = (hg_handle_t *)calloc(num_servers, sizeof(hg_handle_t)); int num_requests = 0; uint32_t total_n_meta = 0; dart_op_type_t op_type = dart_in->op_type; @@ -8903,10 +8971,10 @@ PDC_Client_search_obj_ref_through_dart(dart_hash_algo_t hash_algo, char *query_s stopwatch_t timer; timer_start(&timer); - char * k_query = get_key(query_string, '='); - char * v_query = get_value(query_string, '='); - char * tok = NULL; - char * affix = NULL; + char *k_query = get_key(query_string, '='); + char *v_query = get_value(query_string, '='); + char *tok = NULL; + char *affix = NULL; dart_op_type_t dart_op; pattern_type_t dart_query_type = determine_pattern_type(k_query); diff --git a/src/api/pdc_obj/include/pdc_cont.h b/src/api/pdc_obj/include/pdc_cont.h index 33e924c14..5132e6184 100644 --- a/src/api/pdc_obj/include/pdc_cont.h +++ b/src/api/pdc_obj/include/pdc_cont.h @@ -33,7 +33,7 @@ typedef struct _pdc_id_info cont_handle; /* Library Public Struct */ /**************************/ struct pdc_cont_info { - char * name; + char *name; pdcid_t local_id; uint64_t meta_id; }; diff --git a/src/api/pdc_obj/include/pdc_cont_pkg.h b/src/api/pdc_obj/include/pdc_cont_pkg.h index 262192048..f8d0a15d6 100644 --- a/src/api/pdc_obj/include/pdc_cont_pkg.h +++ b/src/api/pdc_obj/include/pdc_cont_pkg.h @@ -31,7 +31,7 @@ /* Library Private Struct */ /**************************/ struct _pdc_cont_info { - struct pdc_cont_info * cont_info_pub; + struct pdc_cont_info *cont_info_pub; struct _pdc_cont_prop *cont_pt; }; diff --git a/src/api/pdc_obj/include/pdc_obj_pkg.h b/src/api/pdc_obj/include/pdc_obj_pkg.h index 11effda8e..adf0bc329 100644 --- a/src/api/pdc_obj/include/pdc_obj_pkg.h +++ b/src/api/pdc_obj/include/pdc_obj_pkg.h @@ -42,12 +42,12 @@ typedef struct pdc_local_transfer_request { } pdc_local_transfer_request; struct _pdc_obj_info { - struct pdc_obj_info * obj_info_pub; + struct pdc_obj_info *obj_info_pub; _pdc_obj_location_t location; - void * metadata; - struct _pdc_cont_info * cont; - struct _pdc_obj_prop * obj_pt; - struct region_map_list * region_list_head; + void *metadata; + struct _pdc_cont_info *cont; + struct _pdc_obj_prop *obj_pt; + struct region_map_list *region_list_head; pdc_local_transfer_request *local_transfer_request_head; pdc_local_transfer_request *local_transfer_request_end; int local_transfer_request_size; diff --git a/src/api/pdc_obj/include/pdc_prop.h b/src/api/pdc_obj/include/pdc_prop.h index 0459e0283..fd714d1e5 100644 --- a/src/api/pdc_obj/include/pdc_prop.h +++ b/src/api/pdc_obj/include/pdc_prop.h @@ -34,7 +34,7 @@ struct pdc_obj_prop { pdcid_t obj_prop_id; size_t ndim; - uint64_t * dims; + uint64_t *dims; pdc_var_type_t type; pdc_region_partition_t region_partition; pdc_consistency_t consistency; diff --git a/src/api/pdc_obj/include/pdc_prop_pkg.h b/src/api/pdc_obj/include/pdc_prop_pkg.h index 16524314b..823ce634b 100644 --- a/src/api/pdc_obj/include/pdc_prop_pkg.h +++ b/src/api/pdc_obj/include/pdc_prop_pkg.h @@ -47,14 +47,14 @@ struct _pdc_transform_state { struct _pdc_obj_prop { struct pdc_obj_prop *obj_prop_pub; - struct _pdc_class * pdc; + struct _pdc_class *pdc; uint32_t user_id; - char * app_name; + char *app_name; uint32_t time_step; - char * data_loc; - char * tags; - void * buf; - pdc_kvtag_t * kvtag; + char *data_loc; + char *tags; + void *buf; + pdc_kvtag_t *kvtag; /* The following have been added to support of PDC analysis and transforms */ size_t type_extent; diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index 4366c4156..8370d5d54 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -57,7 +57,7 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id) perr_t ret = SUCCEED; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; FUNC_ENTER(NULL); @@ -106,7 +106,7 @@ PDCcont_create_col(const char *cont_name, pdcid_t cont_prop_id) perr_t ret = SUCCEED; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; FUNC_ENTER(NULL); @@ -152,7 +152,7 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id) pdcid_t ret_value = 0; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; pdcid_t cont_prop_id; FUNC_ENTER(NULL); @@ -312,7 +312,7 @@ PDC_cont_get_info(pdcid_t cont_id) { struct _pdc_cont_info *ret_value = NULL; struct _pdc_cont_info *info = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; FUNC_ENTER(NULL); @@ -356,7 +356,7 @@ PDC_cont_get_info(pdcid_t cont_id) struct pdc_cont_info * PDCcont_get_info(const char *cont_name) { - struct pdc_cont_info * ret_value = NULL; + struct pdc_cont_info *ret_value = NULL; struct _pdc_cont_info *tmp = NULL; pdcid_t cont_id; @@ -380,8 +380,8 @@ PDCcont_get_info(const char *cont_name) cont_handle * PDCcont_iter_start() { - cont_handle * ret_value = NULL; - cont_handle * conthl = NULL; + cont_handle *ret_value = NULL; + cont_handle *conthl = NULL; struct PDC_id_type *type_ptr; FUNC_ENTER(NULL); @@ -431,7 +431,7 @@ PDCcont_iter_next(cont_handle *chandle) struct pdc_cont_info * PDCcont_iter_get_info(cont_handle *chandle) { - struct pdc_cont_info * ret_value = NULL; + struct pdc_cont_info *ret_value = NULL; struct _pdc_cont_info *info = NULL; FUNC_ENTER(NULL); diff --git a/src/api/pdc_obj/pdc_mpi.c b/src/api/pdc_obj/pdc_mpi.c index 4db4d0479..063fd27ab 100644 --- a/src/api/pdc_obj/pdc_mpi.c +++ b/src/api/pdc_obj/pdc_mpi.c @@ -34,7 +34,7 @@ PDCobj_create_mpi(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, in { pdcid_t ret_value = SUCCEED; struct _pdc_obj_info *p = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_id_info *id_info = NULL; int rank; FUNC_ENTER(NULL); @@ -63,7 +63,7 @@ perr_t PDCobj_encode(pdcid_t obj_id, pdcid_t *meta_id) { perr_t ret_value = FAIL; - struct _pdc_id_info * objinfo; + struct _pdc_id_info *objinfo; struct _pdc_obj_info *obj; int client_rank, client_size; @@ -93,7 +93,7 @@ pdcid_t PDCobj_decode(pdcid_t obj_id, pdcid_t meta_id) { pdcid_t ret_value = 0; - struct _pdc_id_info * objinfo; + struct _pdc_id_info *objinfo; struct _pdc_obj_info *obj; int client_rank, client_size; diff --git a/src/api/pdc_obj/pdc_obj.c b/src/api/pdc_obj/pdc_obj.c index 9b307e5fa..43e2a11c7 100644 --- a/src/api/pdc_obj/pdc_obj.c +++ b/src/api/pdc_obj/pdc_obj.c @@ -228,10 +228,10 @@ pdcid_t PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_obj_location_t location) { pdcid_t ret_value = 0; - struct _pdc_obj_info * p = NULL; - struct _pdc_id_info * id_info = NULL; + struct _pdc_obj_info *p = NULL; + struct _pdc_id_info *id_info = NULL; struct _pdc_cont_info *cont_info = NULL; - struct _pdc_obj_prop * obj_prop; + struct _pdc_obj_prop *obj_prop; uint64_t meta_id; uint32_t data_server_id, metadata_server_id; size_t i; @@ -391,7 +391,7 @@ perr_t PDC_obj_close(struct _pdc_obj_info *op) { perr_t ret_value = SUCCEED; - pdcid_t * transfer_request_id; + pdcid_t *transfer_request_id; pdc_local_transfer_request *temp, *previous; int i; @@ -530,7 +530,7 @@ PDCobj_open_common(const char *obj_name, pdcid_t pdc, int is_col) pdcid_t ret_value = 0; perr_t ret = SUCCEED; struct _pdc_obj_info *p = NULL; - pdc_metadata_t * out = NULL; + pdc_metadata_t *out = NULL; pdcid_t obj_prop; size_t i; uint32_t metadata_server_id; @@ -665,8 +665,8 @@ PDCobj_open_col(const char *obj_name, pdcid_t pdc) obj_handle * PDCobj_iter_start(pdcid_t cont_id) { - obj_handle * ret_value = NULL; - obj_handle * objhl = NULL; + obj_handle *ret_value = NULL; + obj_handle *objhl = NULL; struct PDC_id_type *type_ptr; FUNC_ENTER(NULL); @@ -728,7 +728,7 @@ PDCobj_iter_next(obj_handle *ohandle, pdcid_t cont_id) struct pdc_obj_info * PDCobj_iter_get_info(obj_handle *ohandle) { - struct pdc_obj_info * ret_value = NULL; + struct pdc_obj_info *ret_value = NULL; struct _pdc_obj_info *info = NULL; unsigned i; @@ -861,7 +861,7 @@ perr_t PDCprop_set_obj_dims(pdcid_t obj_prop, PDC_int_t ndim, uint64_t *dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -888,7 +888,7 @@ perr_t PDCprop_set_obj_type(pdcid_t obj_prop, pdc_var_type_t type) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -908,7 +908,7 @@ perr_t PDCprop_set_obj_transfer_region_type(pdcid_t obj_prop, pdc_region_partition_t region_partition) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -928,7 +928,7 @@ perr_t PDCprop_set_obj_consistency_semantics(pdcid_t obj_prop, pdc_consistency_t consistency) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -948,7 +948,7 @@ perr_t PDCprop_set_obj_buf(pdcid_t obj_prop, void *buf) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -968,7 +968,7 @@ perr_t PDCobj_set_dims(pdcid_t obj_id, int ndim, uint64_t *dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_info *object; int reset; @@ -1006,7 +1006,7 @@ perr_t PDCobj_get_dims(pdcid_t obj_id, int *ndim, uint64_t **dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info; + struct _pdc_id_info *info; struct _pdc_obj_info *object; FUNC_ENTER(NULL); @@ -1025,10 +1025,10 @@ PDCobj_get_dims(pdcid_t obj_id, int *ndim, uint64_t **dims) void ** PDCobj_buf_retrieve(pdcid_t obj_id) { - void ** ret_value = NULL; - struct _pdc_id_info * info; + void **ret_value = NULL; + struct _pdc_id_info *info; struct _pdc_obj_info *object; - void ** buffer; + void **buffer; FUNC_ENTER(NULL); info = PDC_find_id(obj_id); @@ -1048,7 +1048,7 @@ PDC_obj_get_info(pdcid_t obj_id) { struct _pdc_obj_info *ret_value = NULL; struct _pdc_obj_info *info = NULL; - struct _pdc_id_info * obj; + struct _pdc_id_info *obj; size_t i; FUNC_ENTER(NULL); @@ -1227,7 +1227,7 @@ PDC_free_obj_info(struct _pdc_obj_info *obj) struct pdc_obj_info * PDCobj_get_info(pdcid_t obj_id) { - struct pdc_obj_info * ret_value = NULL; + struct pdc_obj_info *ret_value = NULL; struct _pdc_obj_info *tmp = NULL; /* pdcid_t obj_id; */ diff --git a/src/api/pdc_obj/pdc_prop.c b/src/api/pdc_obj/pdc_prop.c index 65f1985ec..5d66b91a4 100644 --- a/src/api/pdc_obj/pdc_prop.c +++ b/src/api/pdc_obj/pdc_prop.c @@ -58,9 +58,9 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) { pdcid_t ret_value = 0; struct _pdc_cont_prop *p = NULL; - struct _pdc_obj_prop * q = NULL; - struct _pdc_id_info * id_info = NULL; - struct _pdc_class * pdc_class; + struct _pdc_obj_prop *q = NULL; + struct _pdc_id_info *id_info = NULL; + struct _pdc_class *pdc_class; pdcid_t new_id_c; pdcid_t new_id_o; @@ -130,7 +130,7 @@ PDCprop_obj_dup(pdcid_t prop_id) pdcid_t ret_value = 0; struct _pdc_obj_prop *q = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info * prop = NULL; + struct _pdc_id_info *prop = NULL; pdcid_t new_id; size_t i; @@ -294,7 +294,7 @@ PDCcont_prop_get_info(pdcid_t cont_prop) { struct _pdc_cont_prop *ret_value = NULL; struct _pdc_cont_prop *info = NULL; - struct _pdc_id_info * prop; + struct _pdc_id_info *prop; FUNC_ENTER(NULL); @@ -324,9 +324,9 @@ PDCcont_prop_get_info(pdcid_t cont_prop) struct pdc_obj_prop * PDCobj_prop_get_info(pdcid_t obj_prop) { - struct pdc_obj_prop * ret_value = NULL; + struct pdc_obj_prop *ret_value = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info * prop; + struct _pdc_id_info *prop; size_t i; FUNC_ENTER(NULL); @@ -357,7 +357,7 @@ PDC_obj_prop_get_info(pdcid_t obj_prop) { struct _pdc_obj_prop *ret_value = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info * prop; + struct _pdc_id_info *prop; size_t i; FUNC_ENTER(NULL); diff --git a/src/api/pdc_query/include/pdc_query.h b/src/api/pdc_query/include/pdc_query.h index d71abb286..4fb838876 100644 --- a/src/api/pdc_query/include/pdc_query.h +++ b/src/api/pdc_query/include/pdc_query.h @@ -39,7 +39,7 @@ typedef struct pdc_query_constraint_t { pdc_query_op_t op2; double value2; - void * storage_region_list_head; + void *storage_region_list_head; pdcid_t origin_server; int n_sent; int n_recv; @@ -47,12 +47,12 @@ typedef struct pdc_query_constraint_t { typedef struct pdc_query_t { pdc_query_constraint_t *constraint; - struct pdc_query_t * left; - struct pdc_query_t * right; + struct pdc_query_t *left; + struct pdc_query_t *right; pdc_query_combine_op_t combine_op; struct pdc_region_info *region; // used only on client - void * region_constraint; // used only on server - pdc_selection_t * sel; + void *region_constraint; // used only on server + pdc_selection_t *sel; } pdc_query_t; // Request structure for async read/write @@ -62,9 +62,9 @@ struct pdc_request { int n_client; int n_update; pdc_access_t access_type; - void * metadata; + void *metadata; struct pdc_region_info *region; - void * buf; + void *buf; char *shm_base; char shm_addr[128]; @@ -72,11 +72,11 @@ struct pdc_request { int shm_size; int n_buf_arr; - void *** buf_arr; - int * buf_arr_idx; - char ** shm_base_arr; - char ** shm_addr_arr; - int * shm_fd_arr; + void ***buf_arr; + int *buf_arr_idx; + char **shm_base_arr; + char **shm_addr_arr; + int *shm_fd_arr; uint64_t *shm_size_arr; void *storage_meta; diff --git a/src/api/pdc_query/pdc_query.c b/src/api/pdc_query/pdc_query.c index 25df43ea7..d90d69933 100644 --- a/src/api/pdc_query/pdc_query.c +++ b/src/api/pdc_query/pdc_query.c @@ -22,8 +22,8 @@ pdc_query_t * PDCquery_create(pdcid_t obj_id, pdc_query_op_t op, pdc_var_type_t type, void *value) { - pdc_query_t * ret_value = NULL; - pdc_query_t * query; + pdc_query_t *ret_value = NULL; + pdc_query_t *query; int type_size; struct _pdc_obj_info *obj_prop; uint64_t meta_id; diff --git a/src/api/pdc_region/include/pdc_region.h b/src/api/pdc_region/include/pdc_region.h index f30c2e595..ff989900a 100644 --- a/src/api/pdc_region/include/pdc_region.h +++ b/src/api/pdc_region/include/pdc_region.h @@ -35,11 +35,11 @@ struct pdc_region_info { pdcid_t local_id; struct _pdc_obj_info *obj; size_t ndim; - uint64_t * offset; - uint64_t * size; + uint64_t *offset; + uint64_t *size; bool mapping; int registered_op; - void * buf; + void *buf; size_t unit; }; diff --git a/src/api/pdc_region/pdc_region.c b/src/api/pdc_region/pdc_region.c index 5b5aa1fe3..9156133c8 100644 --- a/src/api/pdc_region/pdc_region.c +++ b/src/api/pdc_region/pdc_region.c @@ -212,12 +212,12 @@ PDCbuf_obj_map(void *buf, pdc_var_type_t local_type, pdcid_t local_reg, pdcid_t { pdcid_t ret_value = SUCCEED; size_t i; - struct _pdc_id_info * objinfo2; + struct _pdc_id_info *objinfo2; struct _pdc_obj_info *obj2; pdcid_t remote_meta_id; pdc_var_type_t remote_type; - struct _pdc_id_info * reginfo1, *reginfo2; + struct _pdc_id_info *reginfo1, *reginfo2; struct pdc_region_info *reg1, *reg2; FUNC_ENTER(NULL); @@ -265,7 +265,7 @@ PDCregion_get_info(pdcid_t reg_id) { struct pdc_region_info *ret_value = NULL; struct pdc_region_info *info = NULL; - struct _pdc_id_info * region; + struct _pdc_id_info *region; FUNC_ENTER(NULL); @@ -285,8 +285,8 @@ perr_t PDCbuf_obj_unmap(pdcid_t remote_obj_id, pdcid_t remote_reg_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * info1; - struct _pdc_obj_info * object1; + struct _pdc_id_info *info1; + struct _pdc_obj_info *object1; struct pdc_region_info *reginfo; pdc_var_type_t data_type; @@ -320,11 +320,11 @@ perr_t PDCreg_obtain_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type, pdc_lock_mode_t lock_mode) { perr_t ret_value = SUCCEED; - struct _pdc_obj_info * object_info; + struct _pdc_obj_info *object_info; struct pdc_region_info *region_info; pdc_var_type_t data_type; pbool_t obtained; - struct _pdc_id_info * info1; + struct _pdc_id_info *info1; FUNC_ENTER(NULL); @@ -336,7 +336,7 @@ PDCreg_obtain_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type, pdc data_type = object_info->obj_pt->obj_prop_pub->type; region_info = PDCregion_get_info(reg_id); ret_value = PDC_Client_region_lock(object_info->obj_info_pub->meta_id, object_info, region_info, - access_type, lock_mode, data_type, &obtained); + access_type, lock_mode, data_type, &obtained); // PDC_free_obj_info(object_info); done: @@ -348,10 +348,10 @@ PDCreg_release_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type) { perr_t ret_value = SUCCEED; pbool_t released; - struct _pdc_obj_info * object_info; + struct _pdc_obj_info *object_info; struct pdc_region_info *region_info; pdc_var_type_t data_type; - struct _pdc_id_info * info1; + struct _pdc_id_info *info1; FUNC_ENTER(NULL); diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 60c5f7f3e..1c04e0666 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -44,6 +44,8 @@ #include "pdc_analysis_pkg.h" #include +/* #define TANG_DEBUG 1 */ + // pdc region transfer class. Contains essential information for performing non-blocking PDC client I/O // perations. typedef struct pdc_transfer_request { @@ -71,7 +73,7 @@ typedef struct pdc_transfer_request { // For each of the contig buffer sent to a server, we have a bulk buffer. char **bulk_buf; // Reference counter for bulk_buf, if 0, we free it. - int ** bulk_buf_ref; + int **bulk_buf_ref; pdc_region_partition_t region_partition; // Consistency semantics required by user @@ -120,7 +122,7 @@ typedef struct pdc_transfer_request_start_all_pkg { int index; // Data buffer. This data buffer is contiguous according to the remote region. We assume this is after // transformation of local regions - char * buf; + char *buf; struct pdc_transfer_request_start_all_pkg *next; } pdc_transfer_request_start_all_pkg; @@ -134,7 +136,7 @@ typedef struct pdc_transfer_request_wait_all_pkg { // Record the index of the metadata_id in the current transfer_request int index; // Pointer to the transfer request - pdc_transfer_request * transfer_request; + pdc_transfer_request *transfer_request; struct pdc_transfer_request_wait_all_pkg *next; } pdc_transfer_request_wait_all_pkg; @@ -188,12 +190,12 @@ PDCregion_transfer_create(void *buf, pdc_access_t access_type, pdcid_t obj_id, p pdcid_t remote_reg) { pdcid_t ret_value = SUCCEED; - struct _pdc_id_info * objinfo2; - struct _pdc_obj_info * obj2; - pdc_transfer_request * p; - struct _pdc_id_info * reginfo1, *reginfo2; + struct _pdc_id_info *objinfo2; + struct _pdc_obj_info *obj2; + pdc_transfer_request *p; + struct _pdc_id_info *reginfo1, *reginfo2; struct pdc_region_info *reg1, *reg2; - uint64_t * ptr; + uint64_t *ptr; uint64_t unit; int j; @@ -277,7 +279,7 @@ PDCregion_transfer_create(void *buf, pdc_access_t access_type, pdcid_t obj_id, p perr_t PDCregion_transfer_close(pdcid_t transfer_request_id) { - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; perr_t ret_value = SUCCEED; FUNC_ENTER(NULL); @@ -306,7 +308,11 @@ PDCregion_transfer_close(pdcid_t transfer_request_id) /* When the reference count reaches zero the resources are freed */ if (PDC_dec_ref(transfer_request_id) < 0) PGOTO_ERROR(FAIL, "PDC transfer request: problem of freeing id"); + done: + PDC_Client_transfer_pthread_cnt_add(-1); + PDC_Client_transfer_pthread_terminate(); + fflush(stdout); FUNC_LEAVE(ret_value); } @@ -521,7 +527,7 @@ pack_region_buffer(char *buf, uint64_t *obj_dims, size_t total_data_size, int lo { uint64_t i, j; perr_t ret_value = SUCCEED; - char * ptr; + char *ptr; FUNC_ENTER(NULL); @@ -590,7 +596,7 @@ pack_region_metadata_query(pdc_transfer_request_start_all_pkg **transfer_request { perr_t ret_value = SUCCEED; int i; - char * ptr; + char *ptr; uint64_t total_buf_size; uint8_t region_partition; @@ -638,13 +644,13 @@ unpack_region_metadata_query(char *buf, pdc_transfer_request_start_all_pkg **tra { perr_t ret_value = SUCCEED; pdc_transfer_request_start_all_pkg *transfer_request_head, *transfer_request_end; - pdc_transfer_request * local_request; + pdc_transfer_request *local_request; int size; int i, j, index; int counter; - char * ptr; + char *ptr; uint64_t region_size; - uint64_t * sub_offset; + uint64_t *sub_offset; FUNC_ENTER(NULL); local_request = NULL; @@ -756,10 +762,10 @@ register_metadata(pdc_transfer_request_start_all_pkg **transfer_request_input, i perr_t ret_value = SUCCEED; int i, j, index, size, output_size, remain_size, n_objs; pdc_transfer_request_start_all_pkg **transfer_requests; - pdc_transfer_request_start_all_pkg * transfer_request_head, *transfer_request_front_head, + pdc_transfer_request_start_all_pkg *transfer_request_head, *transfer_request_front_head, *transfer_request_end, **transfer_request_output, *previous = NULL; uint64_t total_buf_size, output_buf_size, query_id; - char * buf, *output_buf; + char *buf, *output_buf; FUNC_ENTER(NULL); transfer_request_output = NULL; @@ -916,7 +922,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, *read_request_pkgs, *write_request_pkgs_end, *read_request_pkgs_end, *request_pkgs, **transfer_request_output; int write_size, read_size, output_size; - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; int set_output_buf = 0; @@ -1119,7 +1125,7 @@ PDC_Client_pack_all_requests(int n_objs, pdc_transfer_request_start_all_pkg **tr char **read_bulk_buf) { perr_t ret_value = SUCCEED; - char * bulk_buf, *ptr, *ptr2; + char *bulk_buf, *ptr, *ptr2; size_t total_buf_size, obj_data_size, total_obj_data_size, unit, data_size, metadata_size; int i, j; @@ -1233,10 +1239,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ int index, i, j; int n_objs; uint64_t *metadata_id; - char ** read_bulk_buf; - char * bulk_buf; + char **read_bulk_buf; + char *bulk_buf; size_t bulk_buf_size; - int * bulk_buf_ref; + int *bulk_buf_ref; FUNC_ENTER(NULL); @@ -1338,7 +1344,7 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) perr_t ret_value = SUCCEED; int write_size = 0, read_size = 0, posix_size = 0; pdc_transfer_request_start_all_pkg **write_transfer_requests = NULL, **read_transfer_requests = NULL; - pdcid_t * posix_transfer_request_id; + pdcid_t *posix_transfer_request_id; FUNC_ENTER(NULL); @@ -1349,13 +1355,13 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) #endif // Split write and read requests. Handle them separately. - // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); + // printf("%s: checkpoint %d\n", __func__, __LINE__); // [Tang] NOTE: prepare_start_all_requests include several metadata RPC operations ret_value = prepare_start_all_requests(transfer_request_id, size, &write_transfer_requests, &read_transfer_requests, &write_size, &read_size, &posix_transfer_request_id, &posix_size); /* - printf("PDCregion_transfer_start_all: checkpoint %d, write_size = %d, read_size = %d\n", __LINE__, + printf("%s: checkpoint %d, write_size = %d, read_size = %d\n", __func__, __LINE__, write_size, read_size); int i; for ( i = 0; i < read_size; ++i ) { @@ -1363,37 +1369,44 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) read_transfer_requests[i]->data_server_id, read_transfer_requests[i]->transfer_request->obj_id); } */ + PDC_Client_transfer_pthread_cnt_add(size); + /* PDC_Client_transfer_pthread_create(); */ + #ifdef ENABLE_MPI - MPI_Comm world_comm; - MPI_Comm_dup(MPI_COMM_WORLD, &world_comm); // [Tang] TODO: change to user provided comm - MPI_Barrier(world_comm); + /* MPI_Comm world_comm; */ + /* MPI_Comm_dup(MPI_COMM_WORLD, &world_comm); */ + /* MPI_Barrier(world_comm); */ + MPI_Barrier(MPI_COMM_WORLD); #endif // Start write requests if (write_size > 0) PDC_Client_start_all_requests(write_transfer_requests, write_size); - // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); + // printf("%s: checkpoint %d\n", __func__, __LINE__); // Start read requests if (read_size > 0) PDC_Client_start_all_requests(read_transfer_requests, read_size); /* - fprintf(stderr, "PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); + fprintf(stderr, "%s: checkpoint %d\n", __func__, __LINE__); MPI_Barrier(MPI_COMM_WORLD); */ // For POSIX consistency, we block here until the data is received by the server if (posix_size > 0) { + fprintf(stderr, "==PDC_CLIENT[%d]: %s wait for posix requests\n", pdc_client_mpi_rank_g, __func__); PDCregion_transfer_wait_all(posix_transfer_request_id, posix_size); free(posix_transfer_request_id); } // Clean up memory finish_start_all_requests(write_transfer_requests, read_transfer_requests, write_size, read_size); - // fprintf(stderr, "PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); + // fprintf(stderr, "%s: checkpoint %d\n", __func__, __LINE__); + #ifdef ENABLE_MPI - // MPI_Barrier(MPI_COMM_WORLD); - MPI_Comm_free(&world_comm); + MPI_Barrier(MPI_COMM_WORLD); + /* MPI_Barrier(world_comm); */ + /* MPI_Comm_free(&world_comm); */ #endif FUNC_LEAVE(ret_value); @@ -1460,7 +1473,7 @@ perr_t PDCregion_transfer_start(pdcid_t transfer_request_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; @@ -1486,6 +1499,9 @@ PDCregion_transfer_start(pdcid_t transfer_request_id) goto done; } + PDC_Client_transfer_pthread_cnt_add(1); + /* PDC_Client_transfer_pthread_create(); */ + attach_local_transfer_request(transfer_request->obj_pointer, transfer_request_id); // Pack local region to a contiguous memory buffer @@ -1575,7 +1591,7 @@ release_region_buffer(char *buf, uint64_t *obj_dims, int local_ndim, uint64_t *l int k; perr_t ret_value = SUCCEED; - char * ptr; + char *ptr; FUNC_ENTER(NULL); if (local_ndim == 2) { if (access_type == PDC_READ) { @@ -1629,7 +1645,7 @@ perr_t PDCregion_transfer_status(pdcid_t transfer_request_id, pdc_transfer_status_t *completed) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; @@ -1734,11 +1750,11 @@ PDCregion_transfer_wait_all(pdcid_t *transfer_request_id, int size) int index, i, j; size_t unit; int total_requests, n_objs; - uint64_t * metadata_ids; + uint64_t *metadata_ids; pdc_transfer_request_wait_all_pkg **transfer_requests, *transfer_request_head, *transfer_request_end, *temp; - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; FUNC_ENTER(NULL); @@ -1746,7 +1762,7 @@ PDCregion_transfer_wait_all(pdcid_t *transfer_request_id, int size) goto done; } - // printf("entered PDCregion_transfer_wait_all @ line %d\n", __LINE__); + // printf("entered %s @ line %d\n", __func__, __LINE__); total_requests = 0; transfer_request_head = NULL; for (i = 0; i < size; ++i) { @@ -1754,9 +1770,9 @@ PDCregion_transfer_wait_all(pdcid_t *transfer_request_id, int size) transfer_request = (pdc_transfer_request *)(transferinfo->obj_ptr); if (!transfer_request->metadata_id) { fprintf(stderr, - "PDCregion_transfer_wait_all [rank %d] @ line %d: Attempt to wait for a transfer request " + "%s [rank %d] @ line %d: Attempt to wait for a transfer request " "that has not been started.\n", - pdc_client_mpi_rank_g, __LINE__); + __func__, pdc_client_mpi_rank_g, __LINE__); ret_value = FAIL; goto done; } @@ -1942,7 +1958,7 @@ perr_t PDCregion_transfer_wait(pdcid_t transfer_request_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info * transferinfo; + struct _pdc_id_info *transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; diff --git a/src/api/pdc_transform/include/pdc_transforms_pkg.h b/src/api/pdc_transform/include/pdc_transforms_pkg.h index 4929f1f12..c753dd4e8 100644 --- a/src/api/pdc_transform/include/pdc_transforms_pkg.h +++ b/src/api/pdc_transform/include/pdc_transforms_pkg.h @@ -53,8 +53,8 @@ struct _pdc_region_transform_ftn_info { pdc_obj_transform_t op_type; pdc_data_movement_t when; _pdc_analysis_language_t lang; - void * data; - void * result; + void *data; + void *result; }; /***************************************/ diff --git a/src/api/pdc_transform/pdc_transform.c b/src/api/pdc_transform/pdc_transform.c index 884cbf434..7327c2e96 100644 --- a/src/api/pdc_transform/pdc_transform.c +++ b/src/api/pdc_transform/pdc_transform.c @@ -50,23 +50,23 @@ PDCobj_transform_register(char *func, pdcid_t obj_id, int current_state, int nex pdc_obj_transform_t op_type, pdc_data_movement_t when) { perr_t ret_value = SUCCEED; - void * ftnHandle = NULL; + void *ftnHandle = NULL; size_t (*ftnPtr)() = NULL; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - struct _pdc_obj_info * obj1, *obj2; - struct _pdc_id_info * objinfo1; - struct _pdc_obj_prop * prop; - struct pdc_region_info * reg1 = NULL, *reg2 = NULL; + struct _pdc_obj_info *obj1, *obj2; + struct _pdc_id_info *objinfo1; + struct _pdc_obj_prop *prop; + struct pdc_region_info *reg1 = NULL, *reg2 = NULL; pdcid_t src_region_id = 0, dest_region_id = 0; pdcid_t dest_object_id = 0; - char * thisApp = NULL; - char * colonsep = NULL; - char * transformslibrary = NULL; - char * applicationDir = NULL; - char * userdefinedftn = NULL; - char * loadpath = NULL; + char *thisApp = NULL; + char *colonsep = NULL; + char *transformslibrary = NULL; + char *applicationDir = NULL; + char *userdefinedftn = NULL; + char *loadpath = NULL; int local_regIndex; - struct _pdc_id_info * id_info; + struct _pdc_id_info *id_info; FUNC_ENTER(NULL); @@ -168,18 +168,18 @@ PDCbuf_map_transform_register(char *func, void *buf, pdcid_t src_region_id, pdci pdc_data_movement_t when) { perr_t ret_value = SUCCEED; /* Return value */ - void * ftnHandle = NULL; + void *ftnHandle = NULL; size_t (*ftnPtr)() = NULL; - struct _pdc_obj_info * object1 = NULL; + struct _pdc_obj_info *object1 = NULL; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - struct pdc_region_info * region_info = NULL; - struct _pdc_id_info * id_info; - char * thisApp = NULL; - char * colonsep = NULL; - char * transformslibrary = NULL; - char * applicationDir = NULL; - char * userdefinedftn = NULL; - char * loadpath = NULL; + struct pdc_region_info *region_info = NULL; + struct _pdc_id_info *id_info; + char *thisApp = NULL; + char *colonsep = NULL; + char *transformslibrary = NULL; + char *applicationDir = NULL; + char *userdefinedftn = NULL; + char *loadpath = NULL; int local_regIndex; FUNC_ENTER(NULL); diff --git a/src/api/pdc_transform/pdc_transforms_common.c b/src/api/pdc_transform/pdc_transforms_common.c index 34ecd7b07..fed48090f 100644 --- a/src/api/pdc_transform/pdc_transforms_common.c +++ b/src/api/pdc_transform/pdc_transforms_common.c @@ -41,7 +41,7 @@ HG_TEST_RPC_CB(transform_ftn, handle) transform_ftn_in_t in; transform_ftn_out_t out = {0, 0, 0, -1}; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - void * ftnHandle = NULL; + void *ftnHandle = NULL; FUNC_ENTER(NULL); diff --git a/src/server/dablooms/pdc_dablooms.c b/src/server/dablooms/pdc_dablooms.c index 2be56c884..f78557cf3 100644 --- a/src/server/dablooms/pdc_dablooms.c +++ b/src/server/dablooms/pdc_dablooms.c @@ -403,7 +403,7 @@ scaling_bloom_t * new_scaling_bloom(unsigned int capacity, double error_rate) { - scaling_bloom_t * bloom; + scaling_bloom_t *bloom; counting_bloom_t *cur_bloom; bloom = scaling_bloom_init(capacity, error_rate); diff --git a/src/server/dablooms/pdc_dablooms.h b/src/server/dablooms/pdc_dablooms.h index 0e4b79bf5..4de824daa 100644 --- a/src/server/dablooms/pdc_dablooms.h +++ b/src/server/dablooms/pdc_dablooms.h @@ -10,7 +10,7 @@ const char *dablooms_version(void); typedef struct { size_t bytes; - char * array; + char *array; } bitmap_t; bitmap_t *bitmap_resize(bitmap_t *bitmap, size_t new_size); @@ -33,12 +33,12 @@ typedef struct { unsigned int capacity; long offset; unsigned int counts_per_func; - uint32_t * hashes; + uint32_t *hashes; size_t nfuncs; size_t size; size_t num_bytes; double error_rate; - bitmap_t * bitmap; + bitmap_t *bitmap; } counting_bloom_t; int free_counting_bloom(counting_bloom_t *bloom); @@ -65,7 +65,7 @@ typedef struct { double error_rate; /* int fd; */ counting_bloom_t **blooms; - bitmap_t * bitmap; + bitmap_t *bitmap; } scaling_bloom_t; /* scaling_bloom_t *new_scaling_bloom(unsigned int capacity, double error_rate, const char *filename); */ diff --git a/src/server/include/pdc_client_server_common.h b/src/server/include/pdc_client_server_common.h index ddc07249e..0ba950a48 100644 --- a/src/server/include/pdc_client_server_common.h +++ b/src/server/include/pdc_client_server_common.h @@ -133,17 +133,17 @@ typedef struct pdc_kvtag_list_t { typedef struct get_storage_loc_args_t { perr_t (*cb)(); - void * cb_args; + void *cb_args; region_list_t **region_lists; hg_handle_t rpc_handle; - uint32_t * n_loc; - void * void_buf; + uint32_t *n_loc; + void *void_buf; } get_storage_loc_args_t; typedef struct update_region_storage_meta_bulk_args_t { perr_t (*cb)(); - void * meta_list_target; - int * n_updated; + void *meta_list_target; + int *n_updated; int server_id; hg_bulk_t bulk_handle; hg_handle_t rpc_handle; @@ -166,8 +166,8 @@ typedef struct region_list_t { int is_data_ready; char shm_addr[ADDR_MAX]; int shm_fd; - pdc_histogram_t * region_hist; - char * buf; + pdc_histogram_t *region_hist; + char *buf; _pdc_data_loc_t data_loc_type; char storage_location[ADDR_MAX]; uint64_t offset; @@ -268,7 +268,7 @@ typedef struct region_map_t { pdcid_t local_reg_id; /* origin of region id */ region_info_transfer_t local_region; size_t local_ndim; - uint64_t * local_reg_size; + uint64_t *local_reg_size; hg_addr_t local_addr; hg_bulk_t local_bulk_handle; pdc_var_type_t local_data_type; @@ -279,7 +279,7 @@ typedef struct region_map_t { } region_map_t; typedef struct region_buf_map_t { - void * remote_data_ptr; + void *remote_data_ptr; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -293,7 +293,7 @@ typedef struct region_buf_map_t { pdcid_t local_reg_id; /* origin of region id */ region_info_transfer_t local_region; size_t local_ndim; - uint64_t * local_reg_size; + uint64_t *local_reg_size; hg_addr_t local_addr; hg_bulk_t local_bulk_handle; pdc_var_type_t local_data_type; @@ -335,8 +335,8 @@ typedef struct data_server_region_t { region_list_t *region_storage_head; // For non-mapped object analysis // Used primarily as a local_temp - void * obj_data_ptr; - char * storage_location; // save the file location to enable reopening + void *obj_data_ptr; + char *storage_location; // save the file location to enable reopening struct data_server_region_t *prev; struct data_server_region_t *next; } data_server_region_t; @@ -345,7 +345,7 @@ typedef struct data_server_region_unmap_t { uint64_t obj_id; region_info_transfer_t unmap_region; - const struct hg_info * info; + const struct hg_info *info; struct data_server_region_unmap_t *prev; struct data_server_region_unmap_t *next; @@ -397,7 +397,7 @@ typedef struct pdc_metadata_t { // For hash table list struct pdc_metadata_t *prev; struct pdc_metadata_t *next; - void * bloom; + void *bloom; } pdc_metadata_t; @@ -418,7 +418,7 @@ typedef struct query_read_names_args_t { int cnt; int is_select_all; char **obj_names; - char * obj_names_1d; + char *obj_names_1d; } query_read_names_args_t; /********************************************************/ @@ -1112,7 +1112,7 @@ typedef struct pdc_query_xfer_t { int n_unique_obj; int query_op; int n_combine_ops; - int * combine_ops; + int *combine_ops; int n_constraints; int get_op; int next_server_id; @@ -1143,7 +1143,7 @@ typedef struct query_storage_region_transfer_t { int manager; uint64_t obj_id; region_info_transfer_t region_transfer; - char * storage_location; + char *storage_location; uint64_t offset; uint64_t size; int has_hist; @@ -4007,10 +4007,10 @@ struct bulk_args_t { size_t nbytes; int origin; size_t ret; - pdc_metadata_t ** meta_arr; + pdc_metadata_t **meta_arr; uint32_t n_meta; uint64_t obj_id; - uint64_t * obj_ids; + uint64_t *obj_ids; int client_seq_id; int is_id; // if is_id == true, then use uint64_t; otherwise, pdc_metadata_t int8_t op_type; @@ -4034,7 +4034,7 @@ struct buf_map_release_bulk_args { double start_time; #endif hg_handle_t handle; - void * data_buf; + void *data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -4062,11 +4062,11 @@ struct buf_map_release_bulk_args { struct buf_map_transform_and_release_bulk_args { hg_handle_t handle; - void * data_buf; + void *data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; - struct pdc_region_info * remote_reg_info; + struct pdc_region_info *remote_reg_info; region_info_transfer_t remote_region; hg_bulk_t remote_bulk_handle; hg_bulk_t local_bulk_handle; @@ -4080,7 +4080,7 @@ struct buf_map_transform_and_release_bulk_args { struct buf_map_analysis_and_release_bulk_args { hg_handle_t handle; - void * data_buf; + void *data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -4101,8 +4101,8 @@ struct lock_bulk_args { hg_handle_t handle; region_lock_in_t in; struct pdc_region_info *server_region; - void * data_buf; - region_map_t * mapping_list; + void *data_buf; + region_map_t *mapping_list; hg_addr_t addr; }; @@ -4112,14 +4112,14 @@ struct region_lock_update_bulk_args { pdcid_t remote_obj_id; pdcid_t remote_reg_id; int32_t remote_client_id; - void * data_buf; + void *data_buf; struct pdc_region_info *server_region; }; struct transfer_request_wait_all_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; - void * data_buf; + void *data_buf; transfer_request_wait_all_in_t in; #ifdef PDC_TIMING double start_time; @@ -4130,8 +4130,8 @@ struct transfer_request_all_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; transfer_request_all_in_t in; - uint64_t * transfer_request_id; - void * data_buf; + uint64_t *transfer_request_id; + void *data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4141,8 +4141,8 @@ struct transfer_request_all_local_bulk_args2 { hg_handle_t handle; transfer_request_all_data request_data; hg_bulk_t bulk_handle; - uint64_t * transfer_request_id; - void * data_buf; + uint64_t *transfer_request_id; + void *data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4152,7 +4152,7 @@ struct transfer_request_metadata_query_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; transfer_request_metadata_query_in_t in; - void * data_buf; + void *data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4161,7 +4161,7 @@ struct transfer_request_metadata_query_local_bulk_args { struct transfer_request_metadata_query2_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; - void * data_buf; + void *data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4172,7 +4172,7 @@ struct transfer_request_local_bulk_args { hg_bulk_t bulk_handle; transfer_request_in_t in; uint64_t transfer_request_id; - void * data_buf; + void *data_buf; size_t total_mem_size; #ifdef PDC_TIMING @@ -4221,12 +4221,12 @@ typedef struct process_bulk_storage_meta_args_t { typedef struct region_meta_transfer_t { int loc_len; - char * storage_location; + char *storage_location; region_info_transfer_t region_info; uint64_t offset; uint64_t size; int has_hist; - pdc_histogram_t * histogram; + pdc_histogram_t *histogram; } region_meta_transfer_t; typedef struct storage_region_bulk_header_t { diff --git a/src/server/include/pdc_hash-table.h b/src/server/include/pdc_hash-table.h index 76474d33d..207c4e578 100644 --- a/src/server/include/pdc_hash-table.h +++ b/src/server/include/pdc_hash-table.h @@ -94,7 +94,7 @@ typedef struct _HashTablePair { */ struct _HashTableIterator { - HashTable * hash_table; + HashTable *hash_table; HashTableEntry *next_entry; unsigned int next_chain; }; diff --git a/src/server/include/pdc_server_common.h b/src/server/include/pdc_server_common.h index 628bbdc1b..c42223e57 100644 --- a/src/server/include/pdc_server_common.h +++ b/src/server/include/pdc_server_common.h @@ -34,9 +34,9 @@ typedef struct server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char * ret_string; - void * void_buf; - char * server_addr; + char *ret_string; + void *void_buf; + char *server_addr; pdc_metadata_t *meta; region_list_t **region_lists; uint32_t n_loc; @@ -49,7 +49,7 @@ struct transfer_buf_map { }; typedef struct pdc_remote_server_info_t { - char * addr_string; + char *addr_string; int addr_valid; hg_addr_t addr; } pdc_remote_server_info_t; diff --git a/src/server/include/pdc_server_metadata.h b/src/server/include/pdc_server_metadata.h index de3c15c80..1dca89f15 100644 --- a/src/server/include/pdc_server_metadata.h +++ b/src/server/include/pdc_server_metadata.h @@ -49,15 +49,15 @@ extern int pdc_server_rank_g; extern int pdc_server_size_g; extern char pdc_server_tmp_dir_g[TMP_DIR_STRING_LEN]; extern uint32_t n_metadata_g; -extern HashTable * metadata_hash_table_g; -extern HashTable * container_hash_table_g; -extern hg_class_t * hg_class_g; +extern HashTable *metadata_hash_table_g; +extern HashTable *container_hash_table_g; +extern hg_class_t *hg_class_g; extern hg_context_t *hg_context_g; extern int is_debug_g; extern hg_id_t get_metadata_by_id_register_id_g; extern hg_id_t send_client_storage_meta_rpc_register_id_g; -extern pdc_client_info_t * pdc_client_info_g; +extern pdc_client_info_t *pdc_client_info_g; extern pdc_remote_server_info_t *pdc_remote_server_info_g; extern double total_mem_usage_g; extern int is_hash_table_init_g; @@ -70,7 +70,7 @@ extern int use_sqlite3_g; /****************************/ typedef struct pdc_hash_table_entry_head { int n_obj; - void * bloom; + void *bloom; pdc_metadata_t *metadata; } pdc_hash_table_entry_head; @@ -80,7 +80,7 @@ typedef struct pdc_cont_hash_table_entry_t { int n_obj; int n_deleted; int n_allocated; - uint64_t * obj_ids; + uint64_t *obj_ids; char tags[TAG_LEN_MAX]; pdc_kvtag_list_t *kvtag_list_head; } pdc_cont_hash_table_entry_t; diff --git a/src/server/include/pdc_server_metadata_index.h b/src/server/include/pdc_server_metadata_index.h index d5360539c..64e1aa436 100644 --- a/src/server/include/pdc_server_metadata_index.h +++ b/src/server/include/pdc_server_metadata_index.h @@ -26,11 +26,11 @@ typedef struct { } key_index_leaf_content; typedef struct pdc_art_iterator_param { - char * query_str; - char * level_one_infix; - char * level_two_infix; + char *query_str; + char *level_one_infix; + char *level_two_infix; uint32_t total_count; - Set * out; + Set *out; } pdc_art_iterator_param_t; /** @@ -77,7 +77,7 @@ perr_t PDC_Server_dart_get_server_info(dart_get_server_info_in_t *in, dart_get_s * @param out [OUT] Output parameters for the DART operation * @return perr_t SUCCESS on success, FAIL on failure */ -perr_t PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t * in, +perr_t PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t *in, dart_perform_one_server_out_t *out, uint64_t *n_obj_ids_ptr, uint64_t **buf_ptrs); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index 37df71ab0..fb9062d79 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -1722,7 +1722,7 @@ HG_TEST_RPC_CB(metadata_query, handle) hg_return_t ret_value = HG_SUCCESS; metadata_query_in_t in; metadata_query_out_t out; - pdc_metadata_t * query_result = NULL; + pdc_metadata_t *query_result = NULL; FUNC_ENTER(NULL); @@ -1763,7 +1763,7 @@ HG_TEST_RPC_CB(obj_reset_dims, handle) hg_return_t ret_value = HG_SUCCESS; obj_reset_dims_in_t in; obj_reset_dims_out_t out; - pdc_metadata_t * query_result = NULL; + pdc_metadata_t *query_result = NULL; FUNC_ENTER(NULL); @@ -2151,7 +2151,7 @@ pdc_region_write_out_progress(void *arg) { HG_THREAD_RETURN_TYPE ret_value = (HG_THREAD_RETURN_TYPE)0; struct buf_map_release_bulk_args *bulk_args = (struct buf_map_release_bulk_args *)arg; - struct pdc_region_info * remote_reg_info = NULL; + struct pdc_region_info *remote_reg_info = NULL; region_lock_out_t out; FUNC_ENTER(NULL); @@ -2251,7 +2251,7 @@ pdc_region_read_from_progress(void *arg) { HG_THREAD_RETURN_TYPE ret_value = (HG_THREAD_RETURN_TYPE)0; struct buf_map_release_bulk_args *bulk_args = (struct buf_map_release_bulk_args *)arg; - const struct hg_info * hg_info = NULL; + const struct hg_info *hg_info = NULL; hg_return_t hg_ret; size_t size; int error = 0; @@ -2304,21 +2304,21 @@ transform_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_inf hg_return_t ret_value = HG_SUCCESS; region_lock_out_t out; struct buf_map_transform_and_release_bulk_args *bulk_args = NULL; - void * data_buf; - char * buf; + void *data_buf; + char *buf; int ndim; int transform_id; int type_extent = 0; int use_transform_size = 0; size_t unit = 1; int64_t transform_size, expected_size; - uint64_t * dims = NULL; + uint64_t *dims = NULL; pdc_var_type_t destType; - struct _pdc_region_transform_ftn_info ** registry = NULL; + struct _pdc_region_transform_ftn_info **registry = NULL; int registered_count; #ifdef ENABLE_MULTITHREAD data_server_region_t *target_reg = NULL; - region_buf_map_t * elt; + region_buf_map_t *elt; #else struct pdc_region_info *remote_reg_info = NULL; #endif @@ -2495,12 +2495,12 @@ analysis_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info hg_return_t ret_value = HG_SUCCESS; region_lock_out_t out; struct buf_map_analysis_and_release_bulk_args *bulk_args = NULL; - void * data_buf; + void *data_buf; int ndim; uint64_t type_extent; - uint64_t * dims = NULL; - struct pdc_region_info * remote_reg_info = NULL; - struct pdc_region_info * local_reg_info = NULL; + uint64_t *dims = NULL; + struct pdc_region_info *remote_reg_info = NULL; + struct pdc_region_info *local_reg_info = NULL; double start_t, end_t, analysis_t, io_t; double averages[4]; @@ -2553,7 +2553,7 @@ analysis_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info int registered_count = PDC_get_analysis_registry(®istry); if ((registered_count >= analysis_meta_index) && (registry != NULL)) { - int (*analysis_ftn)(pdcid_t iterIn, pdcid_t iterOut, struct _pdc_iterator_cbs_t * _cbs) = + int (*analysis_ftn)(pdcid_t iterIn, pdcid_t iterOut, struct _pdc_iterator_cbs_t *_cbs) = registry[analysis_meta_index]->ftnPtr; int result = analysis_ftn(bulk_args->in.input_iter, bulk_args->in.output_iter, &iter_cbs); printf("==PDC_SERVER: Analysis returned %d\n", result); @@ -2670,7 +2670,7 @@ buf_map_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info) struct buf_map_release_bulk_args *bulk_args = NULL; #ifdef ENABLE_MULTITHREAD data_server_region_t *target_reg = NULL; - region_buf_map_t * elt; + region_buf_map_t *elt; #else struct pdc_region_info *remote_reg_info = NULL; #endif @@ -2883,23 +2883,23 @@ HG_TEST_RPC_CB(region_release, handle) hg_return_t hg_ret; region_lock_in_t in; region_lock_out_t out; - const struct hg_info * hg_info = NULL; - data_server_region_t * target_obj; + const struct hg_info *hg_info = NULL; + data_server_region_t *target_obj; int error = 0; int dirty_reg = 0; hg_size_t size, size2; - void * data_buf; - struct pdc_region_info * server_region; - region_list_t * elt, *request_region, *tmp, *elt_tmp; + void *data_buf; + struct pdc_region_info *server_region; + region_list_t *elt, *request_region, *tmp, *elt_tmp; struct region_lock_update_bulk_args *lock_update_bulk_args = NULL; - struct buf_map_release_bulk_args * buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; + struct buf_map_release_bulk_args *buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; hg_bulk_t lock_local_bulk_handle = HG_BULK_NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - struct pdc_region_info * remote_reg_info; - region_buf_map_t * eltt, *eltt2, *eltt_tmp; + struct pdc_region_info *remote_reg_info; + region_buf_map_t *eltt, *eltt2, *eltt_tmp; hg_uint32_t /*k, m, */ remote_count; - void ** data_ptrs_to = NULL; - size_t * data_size_to = NULL; + void **data_ptrs_to = NULL; + size_t *data_size_to = NULL; // size_t type_size = 0; // size_t dims[4] = {0, 0, 0, 0}; #ifdef PDC_TIMING @@ -3397,10 +3397,10 @@ region_read_transform_release(region_transform_and_lock_in_t *in, hg_handle_t ha const struct hg_info *hg_info = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; hg_uint32_t remote_count; - void * data_buf = NULL; + void *data_buf = NULL; ; - void ** data_ptrs_to = NULL; - size_t * data_size_to = NULL; + void **data_ptrs_to = NULL; + size_t *data_size_to = NULL; region_buf_map_t *eltt2; region_lock_out_t out; @@ -3409,8 +3409,8 @@ region_read_transform_release(region_transform_and_lock_in_t *in, hg_handle_t ha int dirty_reg = 0; struct buf_map_transform_and_release_bulk_args *transform_release_bulk_args = NULL; - struct pdc_region_info * remote_reg_info = NULL; - data_server_region_t * target_obj = NULL; + struct pdc_region_info *remote_reg_info = NULL; + data_server_region_t *target_obj = NULL; region_list_t *tmp, *elt, *request_region = (region_list_t *)malloc(sizeof(region_list_t)); FUNC_ENTER(NULL); @@ -3563,19 +3563,19 @@ HG_TEST_RPC_CB(transform_region_release, handle) region_transform_and_lock_in_t in; region_lock_in_t reg_lock_in; region_lock_out_t out; - const struct hg_info * hg_info = NULL; - data_server_region_t * target_obj; + const struct hg_info *hg_info = NULL; + data_server_region_t *target_obj; int error = 0; int dirty_reg = 0; hg_size_t size; - void * data_buf; - region_list_t * elt, *request_region, *tmp; + void *data_buf; + region_list_t *elt, *request_region, *tmp; struct buf_map_transform_and_release_bulk_args *buf_map_bulk_args = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - region_buf_map_t * eltt; + region_buf_map_t *eltt; hg_uint32_t remote_count; - void ** data_ptrs_to = NULL; - size_t * data_size_to = NULL; + void **data_ptrs_to = NULL; + size_t *data_size_to = NULL; FUNC_ENTER(NULL); @@ -3711,14 +3711,14 @@ HG_TEST_RPC_CB(region_transform_release, handle) int dirty_reg = 0; hg_size_t size, remote_size; ; - void * data_buf; - region_list_t * elt, *request_region, *tmp; + void *data_buf; + region_list_t *elt, *request_region, *tmp; struct buf_map_release_bulk_args *buf_map_bulk_args = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - region_buf_map_t * eltt; + region_buf_map_t *eltt; hg_uint32_t k, remote_count = 0; - void ** data_ptrs_to = NULL; - size_t * data_size_to = NULL; + void **data_ptrs_to = NULL; + size_t *data_size_to = NULL; size_t type_size = 0; ; size_t dims[4] = {0, 0, 0, 0}; @@ -3870,26 +3870,26 @@ HG_TEST_RPC_CB(region_analysis_release, handle) } in; region_lock_out_t out; - const struct hg_info * hg_info = NULL; - data_server_region_t * target_obj; - data_server_region_t * lock_obj; + const struct hg_info *hg_info = NULL; + data_server_region_t *target_obj; + data_server_region_t *lock_obj; int error = 0; int dirty_reg = 0; hg_size_t size; hg_return_t hg_ret; - void * data_buf; - struct pdc_region_info * server_region; - region_list_t * elt, *request_region, *tmp; - struct region_lock_update_bulk_args * lock_update_bulk_args = NULL; + void *data_buf; + struct pdc_region_info *server_region; + region_list_t *elt, *request_region, *tmp; + struct region_lock_update_bulk_args *lock_update_bulk_args = NULL; struct buf_map_analysis_and_release_bulk_args *buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; hg_bulk_t lock_local_bulk_handle = HG_BULK_NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - struct pdc_region_info * remote_reg_info; - region_buf_map_t * eltt, *eltt2; + struct pdc_region_info *remote_reg_info; + region_buf_map_t *eltt, *eltt2; hg_uint32_t k, remote_count = 0; - void ** data_ptrs_to = NULL; - size_t * data_size_to = NULL; + void **data_ptrs_to = NULL; + size_t *data_size_to = NULL; size_t type_size = 0; size_t dims[4] = {0, 0, 0, 0}; @@ -4329,7 +4329,7 @@ HG_TEST_RPC_CB(get_remote_metadata, handle) hg_return_t ret_value = HG_SUCCESS; get_remote_metadata_in_t in; get_remote_metadata_out_t out; - pdc_metadata_t * meta; + pdc_metadata_t *meta; FUNC_ENTER(NULL); @@ -4364,7 +4364,7 @@ HG_TEST_RPC_CB(buf_unmap_server, handle) hg_return_t ret_value = HG_SUCCESS; buf_unmap_in_t in; buf_unmap_out_t out; - pdc_metadata_t * target_obj; + pdc_metadata_t *target_obj; region_buf_map_t *tmp, *elt; FUNC_ENTER(NULL); @@ -4413,8 +4413,8 @@ HG_TEST_RPC_CB(buf_map_server, handle) hg_return_t ret_value = HG_SUCCESS; buf_map_in_t in; buf_map_out_t out; - pdc_metadata_t * target_obj; - region_list_t * elt, *request_region; + pdc_metadata_t *target_obj; + region_list_t *elt, *request_region; region_buf_map_t *buf_map_ptr; FUNC_ENTER(NULL); @@ -4478,9 +4478,9 @@ HG_TEST_RPC_CB(buf_map, handle) buf_map_in_t in; buf_map_out_t out; const struct hg_info *info; - region_list_t * request_region; - region_buf_map_t * new_buf_map_ptr = NULL; - void * data_ptr; + region_list_t *request_region; + region_buf_map_t *new_buf_map_ptr = NULL; + void *data_ptr; size_t ndim; #ifdef PDC_TIMING double start, end; @@ -4559,9 +4559,9 @@ HG_TEST_RPC_CB(query_partial, handle) hg_return_t hg_ret; hg_bulk_t bulk_handle = HG_BULK_NULL; uint32_t i; - void ** buf_ptrs; - size_t * buf_sizes; - uint32_t * n_meta_ptr, n_buf; + void **buf_ptrs; + size_t *buf_sizes; + uint32_t *n_meta_ptr, n_buf; metadata_query_transfer_in_t in; metadata_query_transfer_out_t out; @@ -4654,7 +4654,7 @@ HG_TEST_RPC_CB(query_kvtag, handle) hg_return_t ret_value; hg_return_t hg_ret; hg_bulk_t bulk_handle = HG_BULK_NULL; - uint64_t * buf_ptr; + uint64_t *buf_ptr; size_t buf_size[1]; uint32_t nmeta; pdc_kvtag_t in; @@ -4715,10 +4715,10 @@ update_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int cnt, i; - uint64_t * obj_id_ptr; + uint64_t *obj_id_ptr; pdc_int_ret_t out_struct; - void ** buf; - void * buf_1d; + void **buf; + void *buf_1d; FUNC_ENTER(NULL); @@ -4774,7 +4774,7 @@ HG_TEST_RPC_CB(bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t * bulk_args = NULL; + struct bulk_args_t *bulk_args = NULL; bulk_rpc_in_t in_struct; int cnt; @@ -4922,7 +4922,7 @@ HG_TEST_RPC_CB(data_server_read_check, handle) // Decode input data_server_read_check_in_t in; data_server_read_check_out_t out; - server_read_check_out_t * read_out = calloc(1, sizeof(server_read_check_out_t)); + server_read_check_out_t *read_out = calloc(1, sizeof(server_read_check_out_t)); FUNC_ENTER(NULL); @@ -5024,7 +5024,7 @@ HG_TEST_RPC_CB(get_metadata_by_id, handle) hg_return_t ret_value = HG_SUCCESS; get_metadata_by_id_in_t in; get_metadata_by_id_out_t out; - pdc_metadata_t * target = NULL; + pdc_metadata_t *target = NULL; FUNC_ENTER(NULL); @@ -5130,8 +5130,8 @@ char * PDC_find_in_path(char *workingDir, char *application) { struct stat fileStat; - char * ret_value = NULL; - char * pathVar = getenv("PATH"); + char *ret_value = NULL; + char *pathVar = getenv("PATH"); char colon = ':'; char checkPath[PATH_MAX]; @@ -5186,11 +5186,11 @@ cont_add_del_objs_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int cnt, op; cont_add_del_objs_rpc_out_t out_struct; - uint64_t * obj_ids, cont_id; + uint64_t *obj_ids, cont_id; FUNC_ENTER(NULL); @@ -5241,8 +5241,8 @@ cont_add_del_objs_bulk_cb(const struct hg_cb_info *hg_cb_info) HG_TEST_RPC_CB(cont_add_del_objs_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; - const struct hg_info * hg_info = NULL; - struct bulk_args_t * bulk_args = NULL; + const struct hg_info *hg_info = NULL; + struct bulk_args_t *bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; cont_add_del_objs_rpc_in_t in_struct; @@ -5322,13 +5322,13 @@ query_read_obj_name_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_return_t ret_value = HG_SUCCESS; hg_return_t ret = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int iter; size_t i; - char * tmp_buf; + char *tmp_buf; query_read_obj_name_out_t out_struct; - query_read_names_args_t * query_read_names_args; + query_read_names_args_t *query_read_names_args; FUNC_ENTER(NULL); @@ -5384,8 +5384,8 @@ HG_TEST_RPC_CB(query_read_obj_name_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; hg_return_t ret = HG_SUCCESS; - const struct hg_info * hg_info = NULL; - struct bulk_args_t * bulk_args = NULL; + const struct hg_info *hg_info = NULL; + struct bulk_args_t *bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; query_read_obj_name_in_t in_struct; @@ -5493,13 +5493,13 @@ get_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int i, task_id, n_regions; - int * int_ptr; - char * char_ptr, *file_path; - uint64_t * uint64_ptr, offset; + int *int_ptr; + char *char_ptr, *file_path; + uint64_t *uint64_ptr, offset; - void * buf; + void *buf; region_info_transfer_t *region_info_ptr; - region_list_t * region_list, *region_list_head = NULL; + region_list_t *region_list, *region_list_head = NULL; pdc_int_ret_t out_struct; FUNC_ENTER(NULL); @@ -5569,7 +5569,7 @@ HG_TEST_RPC_CB(get_storage_meta_name_query_bulk_result_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; const struct hg_info *hg_info = NULL; - struct bulk_args_t * bulk_args = NULL; + struct bulk_args_t *bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; bulk_rpc_in_t in_struct; @@ -5622,8 +5622,8 @@ notify_client_multi_io_complete_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int n_shm; - void * buf; - char * buf_cp; + void *buf; + char *buf_cp; pdc_int_ret_t out_struct; FUNC_ENTER(NULL); @@ -5666,7 +5666,7 @@ HG_TEST_RPC_CB(notify_client_multi_io_complete_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; const struct hg_info *hg_info = NULL; - struct bulk_args_t * bulk_args = NULL; + struct bulk_args_t *bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; bulk_rpc_in_t in_struct; @@ -5709,7 +5709,7 @@ PDC_add_task_to_list(pdc_task_list_t **target_list, perr_t (*cb)(), void *cb_arg #ifdef ENABLE_MULTITHREAD void *_mutex) #else - void *_mutex ATTRIBUTE(unused)) + void *_mutex ATTRIBUTE(unused)) #endif { int ret_value = 0; @@ -5753,7 +5753,7 @@ PDC_del_task_from_list(pdc_task_list_t **target_list, pdc_task_list_t *del, #ifdef ENABLE_MULTITHREAD void *_mutex) #else - void *_mutex ATTRIBUTE(unused)) + void *_mutex ATTRIBUTE(unused)) #endif { perr_t ret_value = SUCCEED; @@ -5937,13 +5937,13 @@ query_read_obj_name_client_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int iter; size_t i; - char * tmp_buf; + char *tmp_buf; query_read_obj_name_out_t out_struct; - query_read_names_args_t * query_read_names_args; + query_read_names_args_t *query_read_names_args; FUNC_ENTER(NULL); @@ -5999,8 +5999,8 @@ query_read_obj_name_client_bulk_cb(const struct hg_cb_info *hg_cb_info) HG_TEST_RPC_CB(query_read_obj_name_client_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; - const struct hg_info * hg_info = NULL; - struct bulk_args_t * bulk_args = NULL; + const struct hg_info *hg_info = NULL; + struct bulk_args_t *bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; query_read_obj_name_in_t in_struct; @@ -6050,9 +6050,9 @@ static hg_return_t send_client_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; - struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; - void * buf = NULL, *buf_cp = NULL; + void *buf = NULL, *buf_cp = NULL; process_bulk_storage_meta_args_t *process_args = NULL; FUNC_ENTER(NULL); @@ -6097,7 +6097,7 @@ HG_TEST_RPC_CB(send_client_storage_meta_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t * bulk_args = NULL; + struct bulk_args_t *bulk_args = NULL; bulk_rpc_in_t in_struct; pdc_int_ret_t out_struct; int cnt; @@ -6157,7 +6157,7 @@ server_recv_shm_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_return_t ret_value = HG_SUCCESS; struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; - void * buf = NULL, *buf_cp = NULL; + void *buf = NULL, *buf_cp = NULL; FUNC_ENTER(NULL); @@ -6194,7 +6194,7 @@ HG_TEST_RPC_CB(send_shm_bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t * bulk_args = NULL; + struct bulk_args_t *bulk_args = NULL; bulk_rpc_in_t in_struct; pdc_int_ret_t out_struct; int cnt; @@ -6362,7 +6362,7 @@ HG_TEST_RPC_CB(send_bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t * bulk_arg = NULL; + struct bulk_args_t *bulk_arg = NULL; bulk_rpc_in_t in_struct; hg_return_t (*func_ptr)(const struct hg_cb_info *hg_cb_info); struct hg_cb_info callback_info; @@ -6462,10 +6462,10 @@ HG_TEST_RPC_CB(dart_perform_one_server, handle) dart_perform_one_server_out_t out; hg_bulk_t bulk_handle = HG_BULK_NULL; - uint64_t * n_obj_ids_ptr; + uint64_t *n_obj_ids_ptr; uint64_t n_buf; uint64_t **buf_ptrs; - size_t * buf_sizes; + size_t *buf_sizes; uint32_t i; FUNC_ENTER(NULL); diff --git a/src/server/pdc_hash-table.c b/src/server/pdc_hash-table.c index f4804a24a..27003a93e 100644 --- a/src/server/pdc_hash-table.c +++ b/src/server/pdc_hash-table.c @@ -34,7 +34,7 @@ struct _HashTableEntry { }; struct _HashTable { - HashTableEntry ** table; + HashTableEntry **table; unsigned int table_size; HashTableHashFunc hash_func; HashTableEqualFunc equal_func; @@ -175,9 +175,9 @@ hash_table_enlarge(HashTable *hash_table) HashTableEntry **old_table; unsigned int old_table_size; unsigned int old_prime_index; - HashTableEntry * rover; - HashTablePair * pair; - HashTableEntry * next; + HashTableEntry *rover; + HashTablePair *pair; + HashTableEntry *next; unsigned int index; unsigned int i; @@ -232,7 +232,7 @@ int hash_table_insert(HashTable *hash_table, HashTableKey key, HashTableValue value) { HashTableEntry *rover; - HashTablePair * pair; + HashTablePair *pair; HashTableEntry *newentry; unsigned int index; @@ -316,7 +316,7 @@ HashTableValue hash_table_lookup(HashTable *hash_table, HashTableKey key) { HashTableEntry *rover; - HashTablePair * pair; + HashTablePair *pair; unsigned int index; /* Generate the hash of the key and hence the index into the table */ @@ -346,8 +346,8 @@ int hash_table_remove(HashTable *hash_table, HashTableKey key) { HashTableEntry **rover; - HashTableEntry * entry; - HashTablePair * pair; + HashTableEntry *entry; + HashTablePair *pair; unsigned int index; int result; @@ -430,7 +430,7 @@ HashTablePair hash_table_iter_next(HashTableIterator *iterator) { HashTableEntry *current_entry; - HashTable * hash_table; + HashTable *hash_table; HashTablePair pair = {NULL, NULL}; unsigned int chain; diff --git a/src/server/pdc_server.c b/src/server/pdc_server.c index 7ba1d1090..0022ceb63 100644 --- a/src/server/pdc_server.c +++ b/src/server/pdc_server.c @@ -81,7 +81,7 @@ sqlite3 *sqlite3_db_g; int is_debug_g = 0; int pdc_client_num_g = 0; -hg_class_t * hg_class_g = NULL; +hg_class_t *hg_class_g = NULL; hg_context_t *hg_context_g = NULL; // Below three are guarded by pdc_server_task_mutex_g for multi-thread @@ -89,10 +89,10 @@ pdc_task_list_t *pdc_server_agg_task_head_g = NULL; pdc_task_list_t *pdc_server_s2s_task_head_g = NULL; int pdc_server_task_id_g = PDC_SERVER_TASK_INIT_VALUE; -pdc_client_info_t * pdc_client_info_g = NULL; +pdc_client_info_t *pdc_client_info_g = NULL; pdc_remote_server_info_t *pdc_remote_server_info_g = NULL; -char * all_addr_strings_1d_g = NULL; -char ** all_addr_strings_g = NULL; +char *all_addr_strings_1d_g = NULL; +char **all_addr_strings_g = NULL; int is_hash_table_init_g = 0; int lustre_stripe_size_mb_g = 16; int lustre_total_ost_g = 0; @@ -144,7 +144,7 @@ int gen_fastbit_idx_g = 0; int use_fastbit_idx_g = 0; int use_rocksdb_g = 0; int use_sqlite3_g = 0; -char * gBinningOption = NULL; +char *gBinningOption = NULL; double server_write_time_g = 0.0; double server_read_time_g = 0.0; @@ -162,9 +162,9 @@ volatile int dbg_sleep_g = 1; double total_mem_usage_g = 0.0; // Data server related -pdc_data_server_io_list_t * pdc_data_server_read_list_head_g = NULL; -pdc_data_server_io_list_t * pdc_data_server_write_list_head_g = NULL; -update_storage_meta_list_t * pdc_update_storage_meta_list_head_g = NULL; +pdc_data_server_io_list_t *pdc_data_server_read_list_head_g = NULL; +pdc_data_server_io_list_t *pdc_data_server_write_list_head_g = NULL; +update_storage_meta_list_t *pdc_update_storage_meta_list_head_g = NULL; extern data_server_region_t *dataserver_region_g; /* @@ -376,7 +376,7 @@ static int remove_directory(const char *dir) { int ret = 0; - FTS * ftsp = NULL; + FTS *ftsp = NULL; FTSENT *curr; // Cast needed (in C) because fts_open() takes a "char * const *", instead @@ -540,7 +540,7 @@ PDC_Server_lookup_server_id(int remote_server_id) lookup_args->server_id = remote_server_id; hg_ret = HG_Addr_lookup(hg_context_g, lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { printf("==PDC_SERVER: Connection to remote server FAILED!\n"); ret_value = FAIL; @@ -659,7 +659,7 @@ PDC_Server_lookup_client(uint32_t client_id) // Lookup and fill the client info server_lookup_args_t lookup_args; - char * target_addr_string; + char *target_addr_string; lookup_args.server_id = pdc_server_rank_g; lookup_args.client_id = client_id; @@ -801,7 +801,7 @@ PDC_Server_init(int port, hg_class_t **hg_class, hg_context_t **hg_context) uint32_t credential = 0, cookie; drc_info_handle_t credential_info; char pdc_auth_key[256] = {'\0'}; - char * auth_key; + char *auth_key; int rc; #endif @@ -1052,7 +1052,7 @@ perr_t PDC_Server_finalize() { pdc_data_server_io_list_t *io_elt = NULL; - region_list_t * region_elt = NULL, *region_tmp = NULL; + region_list_t *region_elt = NULL, *region_tmp = NULL; perr_t ret_value = SUCCEED; hg_return_t hg_ret; @@ -1219,21 +1219,21 @@ perr_t PDC_Server_checkpoint() { perr_t ret_value = SUCCEED; - pdc_metadata_t * elt; - region_list_t * region_elt; - pdc_kvtag_list_t * kvlist_elt; - pdc_hash_table_entry_head * head; + pdc_metadata_t *elt; + region_list_t *region_elt; + pdc_kvtag_list_t *kvlist_elt; + pdc_hash_table_entry_head *head; pdc_cont_hash_table_entry_t *cont_head; int n_entry, metadata_size = 0, region_count = 0, n_region, n_objs, n_write_region = 0, n_kvtag, key_len; uint32_t hash_key; HashTablePair pair; char checkpoint_file[ADDR_MAX], checkpoint_file_local[ADDR_MAX], cmd[4096]; HashTableIterator hash_table_iter; - char * checkpoint; - char * env_char; + char *checkpoint; + char *env_char; uint64_t checkpoint_size; bool use_tmpfs = false; - FILE * file; + FILE *file; FUNC_ENTER(NULL); @@ -1371,7 +1371,7 @@ PDC_Server_checkpoint() metadata_size++; region_count += n_region; } // End for metadata entry linked list - } // End for hash table metadata entry + } // End for hash table metadata entry // Note data server region are managed by data server instead of metadata server data_server_region_t *region = NULL; @@ -1463,14 +1463,14 @@ PDC_Server_restart(char *filename) int n_entry, count, i, j, nobj = 0, all_nobj = 0, all_n_region, n_region, n_objs, total_region = 0, n_kvtag, key_len; int n_cont, all_cont; - pdc_metadata_t * metadata, *elt; - region_list_t * region_list; - pdc_hash_table_entry_head * entry; + pdc_metadata_t *metadata, *elt; + region_list_t *region_list; + pdc_hash_table_entry_head *entry; pdc_cont_hash_table_entry_t *cont_entry; - uint32_t * hash_key; + uint32_t *hash_key; unsigned idx; uint64_t checkpoint_size; - char * checkpoint_buf; + char *checkpoint_buf; #ifdef PDC_TIMING double start = MPI_Wtime(); #endif @@ -1754,8 +1754,8 @@ PDC_Server_restart(char *filename) MPI_Reduce(&nobj, &all_nobj, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); MPI_Reduce(&total_region, &all_n_region, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); #else - all_nobj = nobj; - all_n_region = total_region; + all_nobj = nobj; + all_n_region = total_region; #endif if (pdc_server_rank_g == 0) { @@ -1783,7 +1783,7 @@ PDC_Server_restart(char *filename) static HG_THREAD_RETURN_TYPE hg_progress_thread(void *arg) { - hg_context_t * context = (hg_context_t *)arg; + hg_context_t *context = (hg_context_t *)arg; HG_THREAD_RETURN_TYPE tret = (HG_THREAD_RETURN_TYPE)0; hg_return_t ret = HG_SUCCESS; @@ -2261,7 +2261,7 @@ server_run(int argc, char *argv[]) rocksdb_options_set_create_if_missing(options, 1); rocksdb_block_based_table_options_t *table_options = rocksdb_block_based_options_create(); - rocksdb_filterpolicy_t * filter_policy = rocksdb_filterpolicy_create_bloom(10); + rocksdb_filterpolicy_t *filter_policy = rocksdb_filterpolicy_create_bloom(10); rocksdb_block_based_options_set_filter_policy(table_options, filter_policy); rocksdb_options_set_block_based_table_factory(options, table_options); diff --git a/src/server/pdc_server_analysis/pdc_server_analysis.c b/src/server/pdc_server_analysis/pdc_server_analysis.c index 8e2609bac..b1218be66 100644 --- a/src/server/pdc_server_analysis/pdc_server_analysis.c +++ b/src/server/pdc_server_analysis/pdc_server_analysis.c @@ -87,7 +87,7 @@ perr_t PDC_Server_instantiate_data_iterator(obj_data_iterator_in_t *in, obj_data_iterator_out_t *out) { perr_t ret_value = SUCCEED; - data_server_region_t * region_reference = NULL; + data_server_region_t *region_reference = NULL; struct _pdc_iterator_info *thisIter; FUNC_ENTER(NULL); @@ -204,7 +204,7 @@ void * PDC_Server_get_ftn_reference(char *ftn) { static void *appHandle = NULL; - void * ftnHandle = NULL; + void *ftnHandle = NULL; if (appHandle == NULL) { /* We need the in_process address of the function */ if ((appHandle = dlopen(0, RTLD_NOW)) == NULL) { diff --git a/src/server/pdc_server_metadata.c b/src/server/pdc_server_metadata.c index 02380fcc8..03bab1f2d 100644 --- a/src/server/pdc_server_metadata.c +++ b/src/server/pdc_server_metadata.c @@ -155,7 +155,7 @@ PDC_Server_metadata_int_hash_key_free(void *key) static void PDC_Server_metadata_hash_value_free(void *value) { - pdc_metadata_t * elt, *tmp; + pdc_metadata_t *elt, *tmp; pdc_hash_table_entry_head *head; FUNC_ENTER(NULL); @@ -282,9 +282,9 @@ find_metadata_by_id_from_list(pdc_metadata_t *mlist, uint64_t obj_id) pdc_metadata_t * find_metadata_by_id(uint64_t obj_id) { - pdc_metadata_t * ret_value = NULL; + pdc_metadata_t *ret_value = NULL; pdc_hash_table_entry_head *head; - pdc_metadata_t * elt; + pdc_metadata_t *elt; HashTableIterator hash_table_iter; HashTablePair pair; int n_entry; @@ -350,7 +350,7 @@ static pdc_metadata_t * find_identical_metadata(pdc_hash_table_entry_head *entry, pdc_metadata_t *a) { pdc_metadata_t *ret_value = NULL; - BLOOM_TYPE_T * bloom; + BLOOM_TYPE_T *bloom; int bloom_check; char combined_string[TAG_LEN_MAX]; pdc_metadata_t *elt; @@ -803,8 +803,8 @@ PDC_Server_update_metadata(metadata_update_in_t *in, metadata_update_out_t *out) perr_t ret_value = SUCCEED; uint64_t obj_id; pdc_hash_table_entry_head *lookup_value; - uint32_t * hash_key = NULL; - pdc_metadata_t * target; + uint32_t *hash_key = NULL; + pdc_metadata_t *target; FUNC_ENTER(NULL); @@ -928,7 +928,7 @@ perr_t PDC_Server_delete_metadata_by_id(metadata_delete_by_id_in_t *in, metadata_delete_by_id_out_t *out) { perr_t ret_value = FAIL; - pdc_metadata_t * elt; + pdc_metadata_t *elt; HashTableIterator hash_table_iter; HashTablePair pair; uint64_t target_obj_id; @@ -1014,8 +1014,8 @@ PDC_Server_delete_metadata_by_id(metadata_delete_by_id_in_t *in, metadata_delete ret_value = SUCCEED; } } // DL_FOREACH - } // while - } // if (metadata_hash_table_g != NULL) + } // while + } // if (metadata_hash_table_g != NULL) else { printf("==PDC_SERVER: metadata_hash_table_g not initialized!\n"); ret_value = FAIL; @@ -1069,7 +1069,7 @@ perr_t PDC_delete_metadata_from_hash_table(metadata_delete_in_t *in, metadata_delete_out_t *out) { perr_t ret_value = SUCCEED; - uint32_t * hash_key = NULL; + uint32_t *hash_key = NULL; pdc_metadata_t *target; FUNC_ENTER(NULL); @@ -1199,7 +1199,7 @@ PDC_insert_metadata_to_hash_table(gen_obj_id_in_t *in, gen_obj_id_out_t *out) { perr_t ret_value = SUCCEED; pdc_metadata_t *metadata; - uint32_t * hash_key, i; + uint32_t *hash_key, i; #ifdef ENABLE_MULTITHREAD // Obtain lock for hash table int unlocked = 0; @@ -1263,7 +1263,7 @@ PDC_insert_metadata_to_hash_table(gen_obj_id_in_t *in, gen_obj_id_out_t *out) *hash_key = in->hash_value; pdc_hash_table_entry_head *lookup_value; - pdc_metadata_t * found_identical; + pdc_metadata_t *found_identical; #ifdef ENABLE_MULTITHREAD // Obtain lock for hash table @@ -1370,7 +1370,7 @@ PDC_Server_print_all_metadata() { perr_t ret_value = SUCCEED; HashTableIterator hash_table_iter; - pdc_metadata_t * elt; + pdc_metadata_t *elt; pdc_hash_table_entry_head *head; HashTablePair pair; @@ -1425,7 +1425,7 @@ PDC_Server_metadata_duplicate_check() int all_maybe, all_total, all_entry; int has_dup_obj = 0; int all_dup_obj = 0; - pdc_metadata_t * elt, *elt_next; + pdc_metadata_t *elt, *elt_next; pdc_hash_table_entry_head *head; FUNC_ENTER(NULL); @@ -1437,9 +1437,9 @@ PDC_Server_metadata_duplicate_check() MPI_Reduce(&n_bloom_total_g, &all_total, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); MPI_Reduce(&n_entry, &all_entry, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); #else - all_maybe = n_bloom_maybe_g; - all_total = n_bloom_total_g; - all_entry = n_entry; + all_maybe = n_bloom_maybe_g; + all_total = n_bloom_total_g; + all_entry = n_entry; #endif if (pdc_server_rank_g == 0) { @@ -1545,7 +1545,7 @@ PDC_Server_get_partial_query_result(metadata_query_transfer_in_t *in, uint32_t * uint32_t i; uint32_t n_buf, iter = 0; pdc_hash_table_entry_head *head; - pdc_metadata_t * elt; + pdc_metadata_t *elt; HashTableIterator hash_table_iter; int n_entry; HashTablePair pair; @@ -1661,7 +1661,7 @@ PDC_Server_query_kvtag_rocksdb(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj uint32_t iter = 0; rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); - rocksdb_iterator_t * rocksdb_iter = rocksdb_create_iterator(rocksdb_g, readoptions); + rocksdb_iterator_t *rocksdb_iter = rocksdb_create_iterator(rocksdb_g, readoptions); rocksdb_iter_seek_to_first(rocksdb_iter); // Iterate over all rocksdb kv @@ -1707,8 +1707,8 @@ PDC_Server_query_kvtag_sqlite(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ perr_t ret_value = SUCCEED; #ifdef ENABLE_SQLITE3 char sql[TAG_LEN_MAX]; - char * errMessage = NULL; - char * tmp_value, *tmp_name, *current_pos; + char *errMessage = NULL; + char *tmp_value, *tmp_name, *current_pos; pdc_sqlite3_query_t query_data; // Check if there is * in tag name @@ -1812,8 +1812,8 @@ PDC_Server_query_kvtag_someta(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ perr_t ret_value = SUCCEED; uint32_t iter = 0; pdc_hash_table_entry_head *head; - pdc_metadata_t * elt; - pdc_kvtag_list_t * kvtag_list_elt; + pdc_metadata_t *elt; + pdc_kvtag_list_t *kvtag_list_elt; HashTableIterator hash_table_iter; int n_entry, is_name_match, is_value_match; HashTablePair pair; @@ -1853,8 +1853,8 @@ PDC_Server_query_kvtag_someta(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ #endif } } // End for each kvtag in list - } // End for each metadata from hash table entry - } // End looping metadata hash table + } // End for each metadata from hash table entry + } // End looping metadata hash table *n_meta = iter; #ifdef PDC_DEBUG_OUTPUT printf("==PDC_SERVER[%d]: found %d objids \n", pdc_server_rank_g, iter); @@ -1917,7 +1917,7 @@ PDC_Server_search_with_name_timestep(const char *obj_name, uint32_t hash_key, ui perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *lookup_value; pdc_metadata_t metadata; - const char * name; + const char *name; FUNC_ENTER(NULL); @@ -1968,7 +1968,7 @@ PDC_Server_search_with_name_hash(const char *obj_name, uint32_t hash_key, pdc_me perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *lookup_value; pdc_metadata_t metadata; - const char * name; + const char *name; FUNC_ENTER(NULL); @@ -2020,7 +2020,7 @@ PDC_Server_get_local_metadata_by_id(uint64_t obj_id, pdc_metadata_t **res_meta_p perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *head; - pdc_metadata_t * elt; + pdc_metadata_t *elt; HashTableIterator hash_table_iter; int n_entry; HashTablePair pair; @@ -2070,7 +2070,7 @@ PDC_Server_get_metadata_by_id_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; hg_handle_t handle; - pdc_metadata_t * meta = NULL; + pdc_metadata_t *meta = NULL; get_metadata_by_id_args_t *cb_args; get_metadata_by_id_out_t output; @@ -2117,7 +2117,7 @@ PDC_Server_get_metadata_by_id_cb(const struct hg_cb_info *callback_info) perr_t PDC_Server_get_metadata_by_id_with_cb(uint64_t obj_id, perr_t (*cb)(), void *args) { - pdc_metadata_t * res_meta_ptr = NULL; + pdc_metadata_t *res_meta_ptr = NULL; hg_return_t hg_ret; perr_t ret_value = SUCCEED; uint32_t server_id = 0; @@ -2614,14 +2614,14 @@ PDC_Server_get_storage_meta_by_names(query_read_names_args_t *args) hg_handle_t rpc_handle; hg_bulk_t bulk_handle; bulk_rpc_in_t bulk_rpc_in; - void ** buf_ptrs; - hg_size_t * buf_sizes; + void **buf_ptrs; + hg_size_t *buf_sizes; uint32_t client_id; - char * obj_name; - pdc_metadata_t * meta = NULL; + char *obj_name; + pdc_metadata_t *meta = NULL; int i = 0, j = 0; region_storage_meta_t **all_storage_meta; - int * all_nregion, total_region; + int *all_nregion, total_region; FUNC_ENTER(NULL); // Get the storage meta for each queried object name @@ -2762,7 +2762,7 @@ PDC_add_kvtag_to_list(pdc_kvtag_list_t **list_head, pdc_kvtag_t *tag) { perr_t ret_value = SUCCEED; pdc_kvtag_list_t *new_list_item; - pdc_kvtag_t * newtag; + pdc_kvtag_t *newtag; FUNC_ENTER(NULL); PDC_kvtag_dup(tag, &newtag); @@ -2853,7 +2853,7 @@ static perr_t PDC_Server_add_kvtag_someta(metadata_add_kvtag_in_t *in, metadata_add_tag_out_t *out) { perr_t ret_value = SUCCEED; - pdc_hash_table_entry_head * lookup_value; + pdc_hash_table_entry_head *lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; uint32_t hash_key; @@ -2872,7 +2872,7 @@ PDC_Server_add_kvtag_someta(metadata_add_kvtag_in_t *in, metadata_add_tag_out_t ret_value = FAIL; out->ret = -1; } - } // if lookup_value != NULL + } // if lookup_value != NULL else { // look for containers cont_lookup_value = hash_table_lookup(container_hash_table_g, &hash_key); if (cont_lookup_value != NULL) { @@ -3053,9 +3053,9 @@ PDC_Server_get_kvtag_rocksdb(metadata_get_kvtag_in_t *in, metadata_get_kvtag_out rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); char rocksdb_key[TAG_LEN_MAX] = {0}; sprintf(rocksdb_key, "%lu`%s", in->obj_id, in->key); - char * err = NULL; + char *err = NULL; size_t len; - char * value = rocksdb_get(rocksdb_g, readoptions, rocksdb_key, strlen(rocksdb_key) + 1, &len, &err); + char *value = rocksdb_get(rocksdb_g, readoptions, rocksdb_key, strlen(rocksdb_key) + 1, &len, &err); if (value == NULL) { printf("==PDC_SERVER[%d]: error with rocksdb_get %s, [%s]!\n", pdc_server_rank_g, in->key, err); ret_value = FAIL; @@ -3108,7 +3108,7 @@ PDC_Server_get_kvtag_someta(metadata_get_kvtag_in_t *in, metadata_get_kvtag_out_ perr_t ret_value = SUCCEED; uint32_t hash_key; uint64_t obj_id; - pdc_hash_table_entry_head * lookup_value; + pdc_hash_table_entry_head *lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; hash_key = in->hash_value; @@ -3255,7 +3255,7 @@ PDC_Server_del_kvtag_rocksdb(metadata_get_kvtag_in_t *in, metadata_add_tag_out_t { perr_t ret_value = SUCCEED; #ifdef ENABLE_ROCKSDB - char * err = NULL; + char *err = NULL; char rocksdb_key[TAG_LEN_MAX] = {0}; rocksdb_writeoptions_t *writeoptions = rocksdb_writeoptions_create(); @@ -3306,7 +3306,7 @@ PDC_Server_del_kvtag_someta(metadata_get_kvtag_in_t *in, metadata_add_tag_out_t perr_t ret_value = SUCCEED; uint32_t hash_key; uint64_t obj_id; - pdc_hash_table_entry_head * lookup_value; + pdc_hash_table_entry_head *lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; hash_key = in->hash_value; diff --git a/src/server/pdc_server_metadata_index.c b/src/server/pdc_server_metadata_index.c index 1e91c42f7..4e72ccfe4 100644 --- a/src/server/pdc_server_metadata_index.c +++ b/src/server/pdc_server_metadata_index.c @@ -240,8 +240,8 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) int len = strlen(attr_name); key_index_leaf_content *leaf_content = NULL; - art_tree * nm_trie = NULL; - unsigned char * nm_key = NULL; + art_tree *nm_trie = NULL; + unsigned char *nm_key = NULL; #ifndef PDC_DART_SFX_TREE int rr = 0; @@ -252,7 +252,7 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) int sub_loop_count = len; // should be 'len', but we already iterate all suffixes at client side nm_trie = art_key_prefix_tree_g; for (int j = 0; j < sub_loop_count; j++) { - nm_key = (unsigned char *)substring(attr_name, j, len); + nm_key = (unsigned char *)substring(attr_name, j, len); #endif key_index_leaf_content *leafcnt = (key_index_leaf_content *)art_search(nm_trie, nm_key, strlen((const char *)nm_key)); @@ -290,7 +290,7 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) #endif create_prefix_index_for_attr_value((void **)&secondary_trie, val_key, data); } // this matches with the 'r' loop or 'jj' loop - } // this matches with the 'rr' loop or 'j' loop + } // this matches with the 'rr' loop or 'j' loop return nm_trie; } @@ -366,8 +366,8 @@ delete_index_for_attr_name(char *attr_name, char *attr_value, void *data) { int len = strlen(attr_name); key_index_leaf_content *leaf_content = NULL; - art_tree * nm_trie = NULL; - unsigned char * nm_key = NULL; + art_tree *nm_trie = NULL; + unsigned char *nm_key = NULL; #ifndef PDC_DART_SFX_TREE int rr = 0; @@ -407,7 +407,7 @@ delete_index_for_attr_name(char *attr_name, char *attr_value, void *data) } // TODO: deal with index for range query. } // this matches with the 'r' loop or 'jj' loop - } // this matches with the 'rr' loop or 'j' loop + } // this matches with the 'rr' loop or 'j' loop } perr_t @@ -471,7 +471,7 @@ level_two_art_callback(void *data, const unsigned char *key, uint32_t key_len, v } } if (value != NULL) { - Set * obj_id_set = (Set *)value; + Set *obj_id_set = (Set *)value; SetIterator value_set_iter; set_iterate(obj_id_set, &value_set_iter); @@ -493,7 +493,7 @@ level_two_art_callback(void *data, const unsigned char *key, uint32_t key_len, v int level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, void *value) { - key_index_leaf_content * leafcnt = (key_index_leaf_content *)value; + key_index_leaf_content *leafcnt = (key_index_leaf_content *)value; pdc_art_iterator_param_t *param = (pdc_art_iterator_param_t *)(data); if (param->level_one_infix != NULL) { @@ -512,7 +512,7 @@ level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, v else { // DO TEXT QUERY HERE. pattern_type_t level_two_ptn_type = determine_pattern_type(secondary_query); - char * tok = NULL; + char *tok = NULL; switch (level_two_ptn_type) { case PATTERN_EXACT: tok = secondary_query; @@ -539,7 +539,7 @@ level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, v tok = reverse_str(tok); secondary_trie = (art_tree *)leafcnt->extra_suffix_index; #else - secondary_trie = (art_tree *)leafcnt->extra_prefix_index; + secondary_trie = (art_tree *)leafcnt->extra_prefix_index; #endif if (secondary_trie != NULL) { #ifndef PDC_DART_SFX_TREE @@ -696,8 +696,8 @@ PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t *in, dart_perfor perr_t result = SUCCEED; dart_op_type_t op_type = in->op_type; dart_hash_algo_t hash_algo = in->hash_algo; - char * attr_key = (char *)in->attr_key; - char * attr_val = (char *)in->attr_val; + char *attr_key = (char *)in->attr_key; + char *attr_val = (char *)in->attr_val; dart_object_ref_type_t ref_type = in->obj_ref_type; uint64_t obj_locator = in->obj_primary_ref; diff --git a/src/server/pdc_server_metadata_index_test.c b/src/server/pdc_server_metadata_index_test.c index d385c717f..63e6def99 100644 --- a/src/server/pdc_server_metadata_index_test.c +++ b/src/server/pdc_server_metadata_index_test.c @@ -29,7 +29,7 @@ query_result_from_kvtag(char *key_value_query, int8_t op_type) dart_perform_one_server_in_t input; dart_perform_one_server_out_t output; uint64_t n_obj_ids = 0; - uint64_t * buf_ptr = NULL; + uint64_t *buf_ptr = NULL; input.op_type = op_type; input.attr_key = key_value_query; assert(PDC_Server_dart_perform_one_server(&input, &output, &n_obj_ids, &buf_ptr) == SUCCEED); diff --git a/src/server/pdc_server_region/include/pdc_server_data.h b/src/server/pdc_server_region/include/pdc_server_data.h index a204aa437..c33f60be1 100644 --- a/src/server/pdc_server_region/include/pdc_server_data.h +++ b/src/server/pdc_server_region/include/pdc_server_data.h @@ -47,11 +47,11 @@ struct buf_map_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char * ret_string; - void * void_buf; - char * server_addr; - pdc_metadata_t * meta; - region_list_t ** region_lists; + char *ret_string; + void *void_buf; + char *server_addr; + pdc_metadata_t *meta; + region_list_t **region_lists; uint32_t n_loc; struct transfer_buf_map *buf_map_args; } buf_map_server_lookup_args_t; @@ -60,11 +60,11 @@ struct obj_map_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char * ret_string; - void * void_buf; - char * server_addr; - pdc_metadata_t * meta; - region_list_t ** region_lists; + char *ret_string; + void *void_buf; + char *server_addr; + pdc_metadata_t *meta; + region_list_t **region_lists; uint32_t n_loc; struct transfer_obj_map *obj_map_args; } obj_map_server_lookup_args_t; @@ -78,11 +78,11 @@ struct buf_unmap_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char * ret_string; - void * void_buf; - char * server_addr; - pdc_metadata_t * meta; - region_list_t ** region_lists; + char *ret_string; + void *void_buf; + char *server_addr; + pdc_metadata_t *meta; + region_list_t **region_lists; uint32_t n_loc; struct transfer_buf_unmap *buf_unmap_args; } buf_unmap_server_lookup_args_t; @@ -91,11 +91,11 @@ struct obj_unmap_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char * ret_string; - void * void_buf; - char * server_addr; - pdc_metadata_t * meta; - region_list_t ** region_lists; + char *ret_string; + void *void_buf; + char *server_addr; + pdc_metadata_t *meta; + region_list_t **region_lists; uint32_t n_loc; struct transfer_obj_unmap *obj_unmap_args; } obj_unmap_server_lookup_args_t; @@ -138,13 +138,13 @@ struct transfer_buf_unmap_args { /****************************/ typedef struct notify_multi_io_args_t { hg_bulk_t bulk_handle; - void * buf_sizes; - void * buf_ptrs; + void *buf_sizes; + void *buf_ptrs; region_list_t *region_list; } notify_multi_io_args_t; typedef struct bulk_xfer_data_t { - void ** buf_ptrs; + void **buf_ptrs; hg_size_t *buf_sizes; int n_alloc; int idx; @@ -173,13 +173,13 @@ typedef struct accumulate_storage_meta_t { } accumulate_storage_meta_t; typedef struct storage_meta_query_one_name_args_t { - char * name; + char *name; int n_res; int seq_id; region_list_t *req_region; region_list_t *overlap_storage_region_list; perr_t (*cb)(); - void * cb_args; + void *cb_args; accumulate_storage_meta_t *accu_meta; } storage_meta_query_one_name_args_t; @@ -187,24 +187,24 @@ typedef struct server_read_check_out_t { int ret; int is_cache_to_bb; region_list_t *region; - char * shm_addr; + char *shm_addr; } server_read_check_out_t; // Data query typedef struct query_task_t { - pdc_query_t * query; + pdc_query_t *query; int query_id; int manager; int client_id; int n_sent_server; int n_unique_obj; - uint64_t * obj_ids; + uint64_t *obj_ids; int n_recv_obj; int ndim; pdc_query_get_op_t get_op; - region_list_t * region_constraint; + region_list_t *region_constraint; uint64_t total_elem; - int * invalid_region_ids; + int *invalid_region_ids; int ninvalid_region; int prev_server_id; int next_server_id; @@ -213,17 +213,17 @@ typedef struct query_task_t { int is_done; int n_recv; uint64_t nhits; - uint64_t * coords; + uint64_t *coords; uint64_t **coords_arr; - uint64_t * n_hits_from_server; + uint64_t *n_hits_from_server; // Data read int n_read_data_region; - void ** data_arr; + void **data_arr; uint64_t *my_read_coords; uint64_t my_nread_coords; uint64_t my_read_obj_id; - void * my_data; + void *my_data; int client_seq_id; struct query_task_t *prev; @@ -272,21 +272,21 @@ extern int buffer_write_request_total_g; extern int buffer_write_request_num_g; extern int buffer_read_request_num_g; extern int is_server_direct_io_g; -extern pdc_task_list_t * pdc_server_agg_task_head_g; -extern pdc_task_list_t * pdc_server_s2s_task_head_g; +extern pdc_task_list_t *pdc_server_agg_task_head_g; +extern pdc_task_list_t *pdc_server_s2s_task_head_g; extern int pdc_server_task_id_g; -extern hg_class_t * hg_class_g; -extern hg_context_t * hg_context_g; +extern hg_class_t *hg_class_g; +extern hg_context_t *hg_context_g; extern pdc_remote_server_info_t *pdc_remote_server_info_g; extern int is_debug_g; extern int n_read_from_bb_g; extern int read_from_bb_size_g; extern int gen_hist_g; -extern pdc_data_server_io_list_t * pdc_data_server_read_list_head_g; -extern pdc_data_server_io_list_t * pdc_data_server_write_list_head_g; +extern pdc_data_server_io_list_t *pdc_data_server_read_list_head_g; +extern pdc_data_server_io_list_t *pdc_data_server_write_list_head_g; extern update_storage_meta_list_t *pdc_update_storage_meta_list_head_g; -extern pdc_client_info_t * pdc_client_info_g; +extern pdc_client_info_t *pdc_client_info_g; extern int pdc_client_num_g; extern double total_mem_usage_g; extern int lustre_stripe_size_mb_g; @@ -309,7 +309,7 @@ extern hg_id_t send_data_query_region_register_id_g; extern hg_id_t send_read_sel_obj_id_rpc_register_id_g; extern hg_id_t send_nhits_register_id_g; extern hg_id_t send_bulk_rpc_register_id_g; -extern char * gBinningOption; +extern char *gBinningOption; extern int gen_fastbit_idx_g; extern int use_fastbit_idx_g; @@ -663,7 +663,7 @@ perr_t PDC_Server_close_shm(region_list_t *region, int is_remove); */ perr_t PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t *bulk_data, perr_t (*cb)(), update_storage_meta_list_t *meta_list_target, - int * n_updated); + int *n_updated); /** * ********** diff --git a/src/server/pdc_server_region/include/pdc_server_region_transfer.h b/src/server/pdc_server_region/include/pdc_server_region_transfer.h index 7b210e8e3..9f1f4a252 100644 --- a/src/server/pdc_server_region/include/pdc_server_region_transfer.h +++ b/src/server/pdc_server_region/include/pdc_server_region_transfer.h @@ -4,11 +4,11 @@ typedef struct transfer_request_all_data { uint64_t **obj_dims; uint64_t **remote_offset; uint64_t **remote_length; - pdcid_t * obj_id; - int * obj_ndim; - size_t * unit; - int * remote_ndim; - char ** data_buf; + pdcid_t *obj_id; + int *obj_ndim; + size_t *unit; + int *remote_ndim; + char **data_buf; int n_objs; } transfer_request_all_data; @@ -16,7 +16,7 @@ typedef struct pdc_transfer_request_status { hg_handle_t handle; uint64_t transfer_request_id; uint32_t status; - int * handle_ref; + int *handle_ref; int out_type; struct pdc_transfer_request_status *next; } pdc_transfer_request_status; diff --git a/src/server/pdc_server_region/pdc_server_data.c b/src/server/pdc_server_region/pdc_server_data.c index 9b3ae5b6f..9e09e9d41 100644 --- a/src/server/pdc_server_region/pdc_server_data.c +++ b/src/server/pdc_server_region/pdc_server_data.c @@ -57,7 +57,7 @@ #include "pdc_region.h" // Global object region info list in local data server -data_server_region_t * dataserver_region_g = NULL; +data_server_region_t *dataserver_region_g = NULL; data_server_region_unmap_t *dataserver_region_unmap = NULL; int pdc_buffered_bulk_update_total_g = 0; @@ -74,10 +74,10 @@ uint64_t max_mem_cache_size_mb_g = 0; int cache_percentage_g = 0; int current_read_from_cache_cnt_g = 0; int total_read_from_cache_cnt_g = 0; -FILE * pdc_cache_file_ptr_g = NULL; +FILE *pdc_cache_file_ptr_g = NULL; char pdc_cache_file_path_g[ADDR_MAX]; -query_task_t * query_task_list_head_g = NULL; +query_task_t *query_task_list_head_g = NULL; cache_storage_region_t *cache_storage_region_head_g = NULL; static int @@ -218,7 +218,7 @@ PDC_Server_local_region_lock_status(PDC_mapping_info_t *mapped_region, int *lock { perr_t ret_value = SUCCEED; pdc_metadata_t *res_meta; - region_list_t * elt, *request_region; + region_list_t *elt, *request_region; FUNC_ENTER(NULL); @@ -303,7 +303,7 @@ PDC_Server_clear_obj_region() { perr_t ret_value = SUCCEED; data_server_region_t *elt, *tmp; - region_list_t * elt2, *tmp2; + region_list_t *elt2, *tmp2; FUNC_ENTER(NULL); if (dataserver_region_g != NULL) { @@ -412,10 +412,10 @@ PDC_Data_Server_region_lock(region_lock_in_t *in, region_lock_out_t *out, hg_han { perr_t ret_value = SUCCEED; int ndim; - region_list_t * request_region; + region_list_t *request_region; data_server_region_t *new_obj_reg; - region_list_t * elt1, *tmp; - region_buf_map_t * eltt; + region_list_t *elt1, *tmp; + region_buf_map_t *eltt; int error = 0; int found_lock = 0; // time_t t; @@ -540,8 +540,8 @@ perr_t PDC_Server_release_lock_request(uint64_t obj_id, struct pdc_region_info *region) { perr_t ret_value = SUCCEED; - region_list_t * request_region; - region_list_t * elt, *tmp; + region_list_t *request_region; + region_list_t *elt, *tmp; data_server_region_t *new_obj_reg; region_lock_out_t out; @@ -583,7 +583,7 @@ PDC_Data_Server_region_release(region_lock_in_t *in, region_lock_out_t *out) { perr_t ret_value = SUCCEED; int ndim; - region_list_t * tmp1, *tmp2; + region_list_t *tmp1, *tmp2; region_list_t request_region; int found = 0; data_server_region_t *obj_reg = NULL; @@ -742,7 +742,7 @@ PDC_Data_Server_buf_unmap(const struct hg_info *info, buf_unmap_in_t *in) { perr_t ret_value = SUCCEED; int ret = HG_UTIL_SUCCESS; - region_buf_map_t * tmp, *elt; + region_buf_map_t *tmp, *elt; data_server_region_t *target_obj; FUNC_ENTER(NULL); @@ -836,9 +836,9 @@ PDC_Data_Server_check_unmap() perr_t ret_value = SUCCEED; int ret = HG_UTIL_SUCCESS; pdcid_t remote_obj_id; - region_buf_map_t * tmp, *elt; + region_buf_map_t *tmp, *elt; data_server_region_unmap_t *tmp1, *elt1; - data_server_region_t * target_obj; + data_server_region_t *target_obj; int completed = 0; FUNC_ENTER(NULL); @@ -937,7 +937,7 @@ buf_unmap_lookup_remote_server_cb(const struct hg_cb_info *callback_info) struct buf_unmap_server_lookup_args_t *lookup_args; hg_handle_t server_send_buf_unmap_handle; hg_handle_t handle; - struct transfer_buf_unmap * tranx_args; + struct transfer_buf_unmap *tranx_args; int error = 0; FUNC_ENTER(NULL); @@ -1001,7 +1001,7 @@ PDC_Server_buf_unmap_lookup_server_id(int remote_server_id, struct transfer_buf_ lookup_args->server_id = remote_server_id; lookup_args->buf_unmap_args = transfer_args; hg_ret = HG_Addr_lookup(hg_context_g, buf_unmap_lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { error = 1; PGOTO_ERROR( @@ -1061,9 +1061,9 @@ PDC_Meta_Server_buf_unmap(buf_unmap_in_t *in, hg_handle_t *handle) hg_return_t hg_ret = HG_SUCCESS; hg_handle_t server_send_buf_unmap_handle; struct transfer_buf_unmap_args *buf_unmap_args; - struct transfer_buf_unmap * addr_args; - pdc_metadata_t * target_meta = NULL; - region_buf_map_t * tmp, *elt; + struct transfer_buf_unmap *addr_args; + pdc_metadata_t *target_meta = NULL; + region_buf_map_t *tmp, *elt; int error = 0; FUNC_ENTER(NULL); @@ -1201,14 +1201,14 @@ region_buf_map_t * PDC_Data_Server_buf_map(const struct hg_info *info, buf_map_in_t *in, region_list_t *request_region, void *data_ptr) { - region_buf_map_t * ret_value = NULL; + region_buf_map_t *ret_value = NULL; data_server_region_t *new_obj_reg = NULL; - region_list_t * elt_reg; - region_buf_map_t * buf_map_ptr = NULL; - region_buf_map_t * tmp; + region_list_t *elt_reg; + region_buf_map_t *buf_map_ptr = NULL; + region_buf_map_t *tmp; int dup = 0; - char * data_path = NULL; - char * user_specified_data_path = NULL; + char *data_path = NULL; + char *user_specified_data_path = NULL; char storage_location[ADDR_MAX]; #ifdef ENABLE_LUSTRE int stripe_count, stripe_size; @@ -1394,9 +1394,9 @@ is_region_transfer_t_identical(region_info_transfer_t *a, region_info_transfer_t void * PDC_Server_maybe_allocate_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t region, size_t type_size) { - void * ret_value = NULL; + void *ret_value = NULL; data_server_region_t *target_obj = NULL, *elt = NULL; - region_buf_map_t * tmp; + region_buf_map_t *tmp; FUNC_ENTER(NULL); @@ -1455,9 +1455,9 @@ PDC_Server_maybe_allocate_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t void * PDC_Server_get_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t region) { - void * ret_value = NULL; + void *ret_value = NULL; data_server_region_t *target_obj = NULL, *elt = NULL; - region_buf_map_t * tmp; + region_buf_map_t *tmp; FUNC_ENTER(NULL); @@ -1523,7 +1523,7 @@ buf_map_lookup_remote_server_cb(const struct hg_cb_info *callback_info) struct buf_map_server_lookup_args_t *lookup_args; hg_handle_t server_send_buf_map_handle; hg_handle_t handle; - struct transfer_buf_map * tranx_args; + struct transfer_buf_map *tranx_args; int error = 0; FUNC_ENTER(NULL); @@ -1587,7 +1587,7 @@ PDC_Server_buf_map_lookup_server_id(int remote_server_id, struct transfer_buf_ma lookup_args->server_id = remote_server_id; lookup_args->buf_map_args = transfer_args; hg_ret = HG_Addr_lookup(hg_context_g, buf_map_lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { error = 1; PGOTO_ERROR( @@ -1643,9 +1643,9 @@ PDC_Meta_Server_buf_map(buf_map_in_t *in, region_buf_map_t *new_buf_map_ptr, hg_ hg_return_t hg_ret = HG_SUCCESS; hg_handle_t server_send_buf_map_handle; struct transfer_buf_map_args *tranx_args = NULL; - struct transfer_buf_map * addr_args; - pdc_metadata_t * target_meta = NULL; - region_buf_map_t * buf_map_ptr; + struct transfer_buf_map *addr_args; + pdc_metadata_t *target_meta = NULL; + region_buf_map_t *buf_map_ptr; int error = 0; FUNC_ENTER(NULL); @@ -2134,11 +2134,11 @@ PDC_Server_notify_client_multi_io_complete(uint32_t client_id, int client_seq_id hg_return_t hg_ret = HG_SUCCESS; hg_handle_t rpc_handle; hg_bulk_t bulk_handle; - void ** buf_ptrs; - hg_size_t * buf_sizes; + void **buf_ptrs; + hg_size_t *buf_sizes; bulk_rpc_in_t bulk_rpc_in; int i; - region_list_t * region_elt; + region_list_t *region_elt; notify_multi_io_args_t *bulk_args; FUNC_ENTER(NULL); @@ -2347,7 +2347,7 @@ PDC_Server_read_check(data_server_read_check_in_t *in, server_read_check_out_t * { perr_t ret_value = SUCCEED; pdc_data_server_io_list_t *io_elt = NULL, *io_target = NULL; - region_list_t * region_elt = NULL; + region_list_t *region_elt = NULL; region_list_t r_target; /* uint32_t i; */ @@ -2434,7 +2434,7 @@ PDC_Server_write_check(data_server_write_check_in_t *in, data_server_write_check { perr_t ret_value = FAIL; pdc_data_server_io_list_t *io_elt = NULL, *io_target = NULL; - region_list_t * region_elt = NULL, *region_tmp = NULL; + region_list_t *region_elt = NULL, *region_tmp = NULL; int found_region = 0; FUNC_ENTER(NULL); @@ -2542,7 +2542,7 @@ PDC_Server_get_local_storage_location_of_region(uint64_t obj_id, region_list_t * { perr_t ret_value = SUCCEED; pdc_metadata_t *target_meta = NULL; - region_list_t * region_elt = NULL; + region_list_t *region_elt = NULL; FUNC_ENTER(NULL); @@ -2670,7 +2670,7 @@ PDC_Server_count_write_check_update_storage_meta_cb(const struct hg_cb_info *cal } } // end of if - } // end of if (write_ret->ret == 1) + } // end of if (write_ret->ret == 1) done: @@ -2702,17 +2702,17 @@ PDC_Server_get_storage_location_of_region_mpi(region_list_t *regions_head) perr_t ret_value = SUCCEED; uint32_t server_id = 0; uint32_t i, j; - pdc_metadata_t * region_meta = NULL, *region_meta_prev = NULL; - region_list_t * region_elt, req_region, **overlap_regions_2d = NULL; + pdc_metadata_t *region_meta = NULL, *region_meta_prev = NULL; + region_list_t *region_elt, req_region, **overlap_regions_2d = NULL; region_info_transfer_t local_region_transfer[PDC_SERVER_MAX_PROC_PER_NODE]; - region_info_transfer_t * all_requests = NULL; + region_info_transfer_t *all_requests = NULL; update_region_storage_meta_bulk_t *send_buf = NULL; update_region_storage_meta_bulk_t *result_storage_meta = NULL; uint32_t total_request_cnt; int data_size = sizeof(region_info_transfer_t); - int * send_bytes = NULL; - int * displs = NULL; - int * request_overlap_cnt = NULL; + int *send_bytes = NULL; + int *displs = NULL; + int *request_overlap_cnt = NULL; int nrequest_per_server = 0; FUNC_ENTER(NULL); @@ -3045,7 +3045,7 @@ PDC_Server_data_io_via_shm(const struct hg_cb_info *callback_info) perr_t ret_value = SUCCEED; pdc_data_server_io_list_t *io_list_elt, *io_list = NULL, *io_list_target = NULL; - region_list_t * region_elt = NULL, *region_tmp; + region_list_t *region_elt = NULL, *region_tmp; int real_bb_cnt = 0, real_lustre_cnt = 0; int write_to_bb_cnt = 0; int count; @@ -3448,7 +3448,7 @@ PDC_Server_update_region_storagelocation_offset(region_list_t *region, int type) hg_return_t hg_ret; perr_t ret_value = SUCCEED; uint32_t server_id = 0; - pdc_metadata_t * region_meta = NULL; + pdc_metadata_t *region_meta = NULL; hg_handle_t update_region_loc_handle; update_region_loc_in_t in; server_lookup_args_t lookup_args; @@ -3552,7 +3552,7 @@ PDC_Server_add_region_storage_meta_to_bulk_buf(region_list_t *region, bulk_xfer_ int i; uint64_t obj_id = 0; update_region_storage_meta_bulk_t *curr_buf_ptr; - uint64_t * obj_id_ptr; + uint64_t *obj_id_ptr; FUNC_ENTER(NULL); @@ -3642,8 +3642,8 @@ PDC_Server_update_region_storage_meta_bulk_local(update_region_storage_meta_bulk { perr_t ret_value = SUCCEED; int i; - pdc_metadata_t * target_meta = NULL; - region_list_t * region_elt = NULL, *new_region = NULL; + pdc_metadata_t *target_meta = NULL; + region_list_t *region_elt = NULL, *new_region = NULL; update_region_storage_meta_bulk_t *bulk_ptr; int update_success = 0, express_insert = 0; uint64_t obj_id; @@ -3765,7 +3765,7 @@ PDC_Server_update_region_storage_meta_bulk_mpi(bulk_xfer_data_t *bulk_data) int i; uint32_t server_id = 0; update_region_storage_meta_bulk_t *recv_buf = NULL; - void ** all_meta = NULL; + void **all_meta = NULL; #endif FUNC_ENTER(NULL); @@ -3819,9 +3819,9 @@ PDC_Server_update_region_storage_meta_bulk_mpi(bulk_xfer_data_t *bulk_data) } perr_t -PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t * bulk_data, perr_t (*cb)(), +PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t *bulk_data, perr_t (*cb)(), update_storage_meta_list_t *meta_list_target, - int * n_updated) + int *n_updated) { hg_return_t hg_ret; perr_t ret_value = SUCCEED; @@ -4064,7 +4064,7 @@ PDC_Server_read_overlap_regions(uint32_t ndim, uint64_t *req_start, uint64_t *re } *total_read_bytes += read_bytes; } // for each row - } // ndim=2 + } // ndim=2 else if (ndim == 3) { uint64_t buf_serialize_offset; /* fseek (fp, storage_offset, SEEK_SET); */ @@ -4146,8 +4146,8 @@ PDC_Server_read_one_region(region_list_t *read_region) size_t total_read_bytes = 0; uint32_t n_storage_regions = 0; region_list_t *region_elt; - FILE * fp_read = NULL; - char * prev_path = NULL; + FILE *fp_read = NULL; + char *prev_path = NULL; int is_shm_created = 0, is_read_succeed = 0; #ifdef ENABLE_TIMING double fopen_time; @@ -4290,8 +4290,8 @@ PDC_Server_posix_one_file_io(region_list_t *region_list_head) uint64_t offset = 0; uint32_t i = 0; region_list_t *region_elt = NULL, *previous_region = NULL; - FILE * fp_read = NULL, *fp_write = NULL; - char * prev_path = NULL; + FILE *fp_read = NULL, *fp_write = NULL; + char *prev_path = NULL; #ifdef ENABLE_LUSTRE int stripe_count, stripe_size; #endif @@ -4723,11 +4723,11 @@ PDC_Server_data_write_out(uint64_t obj_id, struct pdc_region_info *region_info, { perr_t ret_value = SUCCEED; data_server_region_t *region = NULL; - region_list_t * overlap_region = NULL; + region_list_t *overlap_region = NULL; int is_contained = 0; uint64_t i, j, pos; - uint64_t * overlap_offset, *overlap_size; - char * tmp_buf; + uint64_t *overlap_offset, *overlap_size; + char *tmp_buf; #if 0 size_t total_write_size = 0, local_write_size; int is_overlap; @@ -5060,10 +5060,10 @@ PDC_Server_data_read_from(uint64_t obj_id, struct pdc_region_info *region_info, perr_t ret_value = SUCCEED; ssize_t request_bytes = unit; data_server_region_t *region = NULL; - region_list_t * elt; + region_list_t *elt; uint64_t i, j, pos; - uint64_t * overlap_offset, *overlap_size; - char * tmp_buf; + uint64_t *overlap_offset, *overlap_size; + char *tmp_buf; FUNC_ENTER(NULL); #ifdef PDC_TIMING @@ -5369,7 +5369,7 @@ PDC_Server_get_local_storage_meta_with_one_name(storage_meta_query_one_name_args { perr_t ret_value = SUCCEED; pdc_metadata_t *meta = NULL; - region_list_t * region_elt = NULL, *region_head = NULL, *res_region_list = NULL; + region_list_t *region_elt = NULL, *region_head = NULL, *res_region_list = NULL; int region_count = 0, i = 0; FUNC_ENTER(NULL); @@ -5502,7 +5502,7 @@ PDC_Server_accumulate_storage_meta_then_read(storage_meta_query_one_name_args_t { perr_t ret_value = SUCCEED; accumulate_storage_meta_t *accu_meta; - region_list_t * req_region = NULL, *region_elt = NULL, *read_list_head = NULL; + region_list_t *req_region = NULL, *region_elt = NULL, *read_list_head = NULL; int i, is_sort_read; size_t j; @@ -5671,16 +5671,16 @@ PDC_Server_storage_meta_name_query_bulk_respond(const struct hg_cb_info *callbac { hg_return_t hg_ret = HG_SUCCESS; perr_t ret_value; - storage_meta_name_query_in_t * args; + storage_meta_name_query_in_t *args; storage_meta_query_one_name_args_t *query_args; hg_handle_t rpc_handle; hg_bulk_t bulk_handle; bulk_rpc_in_t bulk_rpc_in; - void ** buf_ptrs; - hg_size_t * buf_sizes; + void **buf_ptrs; + hg_size_t *buf_sizes; uint32_t server_id; - region_info_transfer_t ** region_infos; - region_list_t * region_elt; + region_info_transfer_t **region_infos; + region_list_t *region_elt; int i, j; FUNC_ENTER(NULL); @@ -5823,9 +5823,9 @@ PDC_Server_add_client_shm_to_cache(int cnt, void *buf_cp) { perr_t ret_value = SUCCEED; int i, j; - region_storage_meta_t * storage_metas = (region_storage_meta_t *)buf_cp; + region_storage_meta_t *storage_metas = (region_storage_meta_t *)buf_cp; pdc_data_server_io_list_t *io_list_elt, *io_list_target; - region_list_t * new_region; + region_list_t *new_region; FUNC_ENTER(NULL); @@ -5938,7 +5938,7 @@ PDC_Server_data_read_to_buf_1_region(region_list_t *region) { perr_t ret_value = SUCCEED; uint64_t offset, read_bytes; - FILE * fp_read = NULL; + FILE *fp_read = NULL; if (region->is_data_ready == 1) return SUCCEED; @@ -5987,9 +5987,9 @@ PDC_Server_data_read_to_buf(region_list_t *region_list_head) { perr_t ret_value = SUCCEED; region_list_t *region_elt; - char * prev_path = NULL; + char *prev_path = NULL; uint64_t offset, read_bytes; - FILE * fp_read = NULL; + FILE *fp_read = NULL; int read_count = 0; @@ -6267,8 +6267,8 @@ static perr_t PDC_Server_load_query_data(query_task_t *task, pdc_query_t *query, pdc_query_combine_op_t combine_op) { perr_t ret_value = SUCCEED; - region_list_t * req_region = NULL, *region_tmp = NULL; - region_list_t * storage_region_list_head = NULL; + region_list_t *req_region = NULL, *region_tmp = NULL; + region_list_t *storage_region_list_head = NULL; pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; uint64_t obj_id; int iter, count, is_same_region, i, can_skip; @@ -6545,7 +6545,7 @@ compare_coords_3d(const void *a, const void *b) ({ \ uint64_t idx, iii, jjj, ttt, cur_count = 0, istart, has_dup; \ int is_good, _ndim; \ - TYPE * edata = (TYPE *)(_data); \ + TYPE *edata = (TYPE *)(_data); \ _ndim = (_region)->ndim; \ istart = (_sel)->nhits * _ndim; \ if (_ndim > 3) { \ @@ -6693,7 +6693,7 @@ compare_coords_3d(const void *a, const void *b) ({ \ uint64_t idx, iii, jjj, ttt, cur_count = 0, istart, has_dup; \ int is_good, _ndim; \ - TYPE * edata = (TYPE *)(_data); \ + TYPE *edata = (TYPE *)(_data); \ _ndim = (_region)->ndim; \ istart = (_sel)->nhits * _ndim; \ if (_ndim > 3) { \ @@ -6855,11 +6855,11 @@ generate_write_fastbit_idx(uint64_t obj_id, void *data, uint64_t dataCount, Fast char keyName[128]; char offName[128]; char out_name[256]; - double * keys = NULL; - int64_t * offsets = NULL; + double *keys = NULL; + int64_t *offsets = NULL; uint32_t *bms = NULL; uint64_t nk = 0, no = 0, nb = 0; - FILE * fp; + FILE *fp; FUNC_ENTER(NULL); @@ -6959,7 +6959,7 @@ int queryData(const char *name) { uint64_t nhits, i; - uint64_t * buf; + uint64_t *buf; double val1 = 0.0, val2 = 10.0; FastBitSelectionHandle sel1 = fastbit_selection_osr(name, FastBitCompareGreater, val1); FastBitSelectionHandle sel2 = fastbit_selection_osr(name, FastBitCompareLess, val2); @@ -6994,7 +6994,7 @@ PDC_load_fastbit_index(char *idx_name, uint64_t obj_id, FastBitDataType dtype, i char offName[128]; char out_name[256]; uint64_t nk = 0, no = 0, nb = 0, size; - FILE * fp; + FILE *fp; PDC_gen_fastbit_idx_name(bmsName, "bms", obj_id, timestep, ndim, start, count); PDC_gen_fastbit_idx_name(keyName, "key", obj_id, timestep, ndim, start, count); @@ -7070,9 +7070,9 @@ PDC_query_fastbit_idx(region_list_t *region, pdc_query_constraint_t *constraint, perr_t ret_value = SUCCEED; FastBitDataType ft = 0; uint64_t type_size; - uint32_t * bms = NULL; - double * keys = NULL; - int64_t * offsets = NULL; + uint32_t *bms = NULL; + double *keys = NULL; + int64_t *offsets = NULL; int timestep; double v1, v2; size_t i; @@ -7248,7 +7248,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ pdc_query_combine_op_t combine_op) { perr_t ret_value = SUCCEED; - region_list_t * region_elt, *region_list_head, *cache_region, tmp_region, *region_constraint = NULL; + region_list_t *region_elt, *region_list_head, *cache_region, tmp_region, *region_constraint = NULL; pdc_selection_t *sel = query->sel; uint64_t nelem; size_t i, j, unit_size; @@ -7262,7 +7262,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ uint32_t ulo = 0, uhi = 0; int64_t i64lo = 0, i64hi = 0; uint64_t ui64lo = 0, ui64hi = 0; - void * value = NULL, *buf = NULL; + void *value = NULL, *buf = NULL; int n_eval_region = 0, can_skip, region_iter = 0; printf("==PDC_SERVER[%d]: %s - start query evaluation!\n", pdc_server_rank_g, __func__); @@ -7634,7 +7634,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ n_eval_region++; } // End DL_FOREACH - } // End not use fastbit + } // End not use fastbit if (n_eval_region == 0 && combine_op == PDC_QUERY_AND) { if (sel->nhits > 0) { @@ -7975,7 +7975,7 @@ PDC_Server_send_coords_to_client(query_task_t *task) hg_bulk_t bulk_handle; bulk_rpc_in_t in; hg_size_t buf_sizes; - void * buf; + void *buf; int client_id; FUNC_ENTER(NULL); @@ -8060,7 +8060,7 @@ PDC_Server_send_coords_to_server(query_task_t *task) hg_bulk_t bulk_handle = NULL; bulk_rpc_in_t in; hg_size_t buf_sizes; - void * buf; + void *buf; int server_id; FUNC_ENTER(NULL); @@ -8271,9 +8271,9 @@ hg_return_t PDC_Server_read_coords(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; - query_task_t * task = (query_task_t *)callback_info->arg; + query_task_t *task = (query_task_t *)callback_info->arg; pdc_query_constraint_t *constraint; - region_list_t * storage_region_head, *region_elt, *cache_region; + region_list_t *storage_region_head, *region_elt, *cache_region; size_t ndim, unit_size; uint64_t i, *coord, data_off, buf_off, my_size; @@ -8339,11 +8339,11 @@ PDC_recv_read_coords(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; - query_task_t * task_elt = NULL; + query_task_t *task_elt = NULL; uint64_t nhits, obj_id; uint32_t ndim; int query_id, origin; - void * buf; + void *buf; pdc_int_ret_t out; out.ret = 1; @@ -8423,7 +8423,7 @@ PDC_recv_coords(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; - query_task_t * task_elt; + query_task_t *task_elt; uint64_t nhits = 0, total_hits; size_t ndim, unit_size; int i, query_id, origin, found_task; @@ -8644,7 +8644,7 @@ perr_t add_storage_region_to_buf(void **in_buf, uint64_t *buf_alloc, uint64_t *buf_off, const region_list_t *region) { perr_t ret_value = SUCCEED; - void * buf = *in_buf; + void *buf = *in_buf; uint64_t my_size, tmp_size; if (in_buf == NULL || *in_buf == NULL || region == NULL || buf_alloc == NULL || buf_off == NULL || @@ -8849,8 +8849,8 @@ PDC_Server_distribute_query_storage_info(query_task_t *task, uint64_t obj_id, in { pdc_metadata_t *meta = NULL; int i, server_id, count, avg_count, nsent, nsent_server; - region_list_t * elt, *new_region = NULL; - void * region_bulk_buf; + region_list_t *elt, *new_region = NULL; + void *region_bulk_buf; uint64_t buf_alloc = 0, buf_off = 0; bulk_rpc_in_t header; @@ -8989,16 +8989,16 @@ PDC_recv_query_metadata_bulk(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; - void * buf; - region_list_t * regions = NULL; + struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; + void *buf; + region_list_t *regions = NULL; int i, nregion, *loc_len_ptr, *has_hist_ptr, found_task; uint64_t buf_off, *offset_ptr = NULL, *size_ptr = NULL; - char * loc_ptr = NULL; + char *loc_ptr = NULL; region_info_transfer_t *region_info_ptr = NULL; - pdc_histogram_t * hist_ptr = NULL; - query_task_t * task_elt = NULL; - pdc_query_t * query = NULL; + pdc_histogram_t *hist_ptr = NULL; + query_task_t *task_elt = NULL; + pdc_query_t *query = NULL; pdc_int_ret_t out; out.ret = 1; @@ -9167,10 +9167,10 @@ PDC_Server_recv_data_query(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; pdc_query_xfer_t *query_xfer = (pdc_query_xfer_t *)callback_info->arg; int obj_idx = 0; - uint64_t * obj_ids; - query_task_t * new_task = NULL, *task_elt; + uint64_t *obj_ids; + query_task_t *new_task = NULL, *task_elt; int query_id_exist = 0; - pdc_query_t * query; + pdc_query_t *query; query = PDC_deserialize_query(query_xfer); if (NULL == query) { @@ -9276,7 +9276,7 @@ PDC_Server_send_read_coords_to_server(int server_id, uint64_t *coord, uint64_t n hg_bulk_t bulk_handle = NULL; bulk_rpc_in_t in; hg_size_t buf_sizes; - void * buf; + void *buf; FUNC_ENTER(NULL); @@ -9391,12 +9391,12 @@ hg_return_t PDC_Server_recv_read_sel_obj_data(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; - get_sel_data_rpc_in_t * in = (get_sel_data_rpc_in_t *)callback_info->arg; - query_task_t * task_elt, *task = NULL; + get_sel_data_rpc_in_t *in = (get_sel_data_rpc_in_t *)callback_info->arg; + query_task_t *task_elt, *task = NULL; uint64_t nhits, *coord, *coords = NULL, obj_id, buf_off, my_size, data_off, i; size_t ndim, unit_size; cache_storage_region_t *cache_region_elt; - region_list_t * storage_region_head = NULL, *cache_region, *region_elt; + region_list_t *storage_region_head = NULL, *cache_region, *region_elt; pdc_var_type_t data_type; // find task @@ -9484,8 +9484,8 @@ PDC_Server_recv_get_sel_data(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; get_sel_data_rpc_in_t *in = (get_sel_data_rpc_in_t *)callback_info->arg; - query_task_t * task_elt, *task = NULL; - pdc_metadata_t * meta; + query_task_t *task_elt, *task = NULL; + pdc_metadata_t *meta; struct hg_cb_info fake_callback_info = {0}; DL_FOREACH(query_task_list_head_g, task_elt) diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index 3e37de388..c6fa01b41 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -2,6 +2,8 @@ #include "pdc_server_region_cache.h" #include "pdc_timing.h" +/* #define TANG_DEBUG 1 */ + #ifdef PDC_SERVER_CACHE #ifdef PDC_SERVER_CACHE_MAX_SIZE @@ -23,7 +25,7 @@ #endif typedef struct pdc_region_cache { - struct pdc_region_info * region_cache_info; + struct pdc_region_info *region_cache_info; struct pdc_region_cache *next; } pdc_region_cache; @@ -31,9 +33,9 @@ typedef struct pdc_obj_cache { struct pdc_obj_cache *next; uint64_t obj_id; int ndim; - uint64_t * dims; - pdc_region_cache * region_cache; - pdc_region_cache * region_cache_end; + uint64_t *dims; + pdc_region_cache *region_cache; + pdc_region_cache *region_cache_end; int region_cache_size; struct timeval timestamp; } pdc_obj_cache; @@ -228,7 +230,7 @@ PDC_region_merge(const char *buf, const char *buf2, const uint64_t *offset, cons { int connect_flag, i, j; uint64_t tmp_buf_size; - char * buf_merged; + char *buf_merged; connect_flag = -1; // Detect if two regions are connected. This means one dimension is fully connected and all other // dimensions are identical. @@ -344,7 +346,7 @@ int PDC_region_cache_copy(char *buf, char *buf2, const uint64_t *offset, const uint64_t *size, const uint64_t *offset2, const uint64_t *size2, int ndim, size_t unit, int direction) { - char * src, *dst; + char *src, *dst; uint64_t i, j; uint64_t *local_offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim); memcpy(local_offset, offset2, sizeof(uint64_t) * ndim); @@ -414,7 +416,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim size_t buf_size, const uint64_t *offset, const uint64_t *size, int ndim, size_t unit) { - pdc_obj_cache * obj_cache_iter, *obj_cache = NULL; + pdc_obj_cache *obj_cache_iter, *obj_cache = NULL; struct pdc_region_info *region_cache_info; if (obj_ndim != ndim && obj_ndim > 0) { printf("%s reports obj_ndim != ndim, %d != %d\n", __func__, obj_ndim, ndim); @@ -515,7 +517,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim int PDC_region_cache_free() { - pdc_obj_cache * obj_cache_iter, *obj_temp; + pdc_obj_cache *obj_cache_iter, *obj_temp; pdc_region_cache *region_cache_iter, *region_temp; obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { @@ -539,9 +541,9 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ { // flag indicates whether the input region is fully contained in another cached region. int flag; - pdc_obj_cache * obj_cache, *obj_cache_iter; + pdc_obj_cache *obj_cache, *obj_cache_iter; pdc_region_cache *region_cache_iter; - uint64_t * overlap_offset, *overlap_size; + uint64_t *overlap_offset, *overlap_size; perr_t ret_value = SUCCEED; char cur_time[64]; @@ -647,7 +649,7 @@ merge_requests(uint64_t *start, uint64_t *end, int request_size, char **buf, uin { int i, index; int merged_requests = 1; - char * ptr; + char *ptr; size_t total_data_size = end[0] - start[0]; uint64_t prev_end = end[0]; for (i = 1; i < request_size; ++i) { @@ -716,11 +718,11 @@ int PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int flag) { int i, nflush = 0; - pdc_region_cache * region_cache_iter, *region_cache_temp; - struct pdc_region_info * region_cache_info; + pdc_region_cache *region_cache_iter, *region_cache_temp; + struct pdc_region_info *region_cache_info; uint64_t write_size = 0; - char ** buf, **new_buf, *buf_ptr = NULL; - uint64_t * start, *end, *new_start, *new_end; + char **buf, **new_buf, *buf_ptr = NULL; + uint64_t *start, *end, *new_start, *new_end; int merged_request_size = 0; uint64_t unit; struct pdc_region_info **obj_regions; @@ -740,7 +742,7 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int // Sort the regions based on start index obj_regions = (struct pdc_region_info **)malloc(sizeof(struct pdc_region_info *) * - obj_cache->region_cache_size); + obj_cache->region_cache_size); unit = obj_cache->region_cache->region_cache_info->unit; region_cache_iter = obj_cache->region_cache; i = 0; @@ -914,7 +916,7 @@ PDC_region_cache_clock_cycle(void *ptr) int nflush = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; time_t t; - struct tm * tm; + struct tm *tm; char cur_time[64]; char *p = getenv("PDC_SERVER_CACHE_FLUSH_FREQUENCY_S"); @@ -1020,7 +1022,7 @@ PDC_region_fetch(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims, struct int flag = 0; // size_t j; pdc_region_cache *region_cache_iter; - uint64_t * overlap_offset, *overlap_size; + uint64_t *overlap_offset, *overlap_size; obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 4ddb6482e..507f3e26c 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -1,3 +1,5 @@ +/* #define TANG_DEBUG 1 */ + hg_return_t transfer_request_all_bulk_transfer_read_cb2(const struct hg_cb_info *info) { @@ -38,14 +40,14 @@ hg_return_t transfer_request_all_bulk_transfer_read_cb(const struct hg_cb_info *info) { struct transfer_request_all_local_bulk_args2 *local_bulk_args2; - struct transfer_request_all_local_bulk_args * local_bulk_args = info->arg; - const struct hg_info * handle_info; + struct transfer_request_all_local_bulk_args *local_bulk_args = info->arg; + const struct hg_info *handle_info; transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info * remote_reg_info; + struct pdc_region_info *remote_reg_info; int i, j; uint64_t total_mem_size, mem_size; - char * ptr; + char *ptr; FUNC_ENTER(NULL); @@ -169,7 +171,7 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) struct transfer_request_all_local_bulk_args *local_bulk_args = info->arg; transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info * remote_reg_info; + struct pdc_region_info *remote_reg_info; int i; char cur_time[64]; @@ -283,8 +285,8 @@ transfer_request_wait_all_bulk_transfer_cb(const struct hg_cb_info *info) pdcid_t transfer_request_id; hg_return_t ret = HG_SUCCESS; int i, fast_return; - char * ptr; - int * handle_ref; + char *ptr; + int *handle_ref; pdc_transfer_status_t status; FUNC_ENTER(NULL); @@ -346,7 +348,7 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) { struct transfer_request_local_bulk_args *local_bulk_args = info->arg; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info * remote_reg_info; + struct pdc_region_info *remote_reg_info; uint64_t obj_dims[3]; FUNC_ENTER(NULL); @@ -357,6 +359,8 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) printf("%s ==PDC_SERVER[%d]: enter %s\n", cur_time, PDC_get_rank(), __func__); #endif + gettimeofday(&last_cache_activity_timeval_g, NULL); + #ifdef PDC_TIMING double end = MPI_Wtime(), start; pdc_server_timings->PDCreg_transfer_request_start_write_bulk_rpc += end - local_bulk_args->start_time; @@ -429,6 +433,8 @@ transfer_request_bulk_transfer_read_cb(const struct hg_cb_info *info) start = MPI_Wtime(); #endif + gettimeofday(&last_cache_activity_timeval_g, NULL); + pthread_mutex_lock(&transfer_request_status_mutex); PDC_finish_request(local_bulk_args->transfer_request_id); pthread_mutex_unlock(&transfer_request_status_mutex); @@ -478,7 +484,7 @@ HG_TEST_RPC_CB(transfer_request_wait, handle) transfer_request_wait_out_t out; pdc_transfer_status_t status; int fast_return = 0; - int * handle_ref; + int *handle_ref; FUNC_ENTER(NULL); #ifdef PDC_TIMING @@ -537,7 +543,7 @@ HG_TEST_RPC_CB(transfer_request_wait, handle) HG_TEST_RPC_CB(transfer_request_wait_all, handle) { struct transfer_request_wait_all_local_bulk_args *local_bulk_args; - const struct hg_info * info; + const struct hg_info *info; transfer_request_wait_all_in_t in; hg_return_t ret_value = HG_SUCCESS; FUNC_ENTER(NULL); @@ -574,7 +580,7 @@ HG_TEST_RPC_CB(transfer_request_wait_all, handle) HG_TEST_RPC_CB(transfer_request_all, handle) { struct transfer_request_all_local_bulk_args *local_bulk_args; - const struct hg_info * info; + const struct hg_info *info; transfer_request_all_in_t in; transfer_request_all_out_t out; hg_return_t ret_value = HG_SUCCESS; @@ -713,7 +719,7 @@ transfer_request_metadata_query_bulk_transfer_cb(const struct hg_cb_info *info) HG_TEST_RPC_CB(transfer_request_metadata_query, handle) { struct transfer_request_metadata_query_local_bulk_args *local_bulk_args; - const struct hg_info * info; + const struct hg_info *info; transfer_request_metadata_query_in_t in; hg_return_t ret_value = HG_SUCCESS; @@ -771,7 +777,7 @@ transfer_request_metadata_query2_bulk_transfer_cb(const struct hg_cb_info *info) HG_TEST_RPC_CB(transfer_request_metadata_query2, handle) { struct transfer_request_metadata_query2_local_bulk_args *local_bulk_args; - const struct hg_info * info; + const struct hg_info *info; transfer_request_metadata_query2_in_t in; hg_return_t ret_value = HG_SUCCESS; @@ -818,8 +824,8 @@ HG_TEST_RPC_CB(transfer_request, handle) transfer_request_out_t out; struct transfer_request_local_bulk_args *local_bulk_args; size_t total_mem_size; - const struct hg_info * info; - struct pdc_region_info * remote_reg_info; + const struct hg_info *info; + struct pdc_region_info *remote_reg_info; uint64_t obj_dims[3]; FUNC_ENTER(NULL); @@ -828,6 +834,8 @@ HG_TEST_RPC_CB(transfer_request, handle) double start = MPI_Wtime(), end; #endif + gettimeofday(&last_cache_activity_timeval_g, NULL); + HG_Get_input(handle, &in); info = HG_Get_info(handle); diff --git a/src/server/pdc_server_region/pdc_server_region_transfer.c b/src/server/pdc_server_region/pdc_server_region_transfer.c index 0fb4d5a67..338c61b8b 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer.c @@ -77,7 +77,7 @@ PDC_commit_request(uint64_t transfer_request_id) perr_t PDC_finish_request(uint64_t transfer_request_id) { - pdc_transfer_request_status * ptr, *tmp = NULL; + pdc_transfer_request_status *ptr, *tmp = NULL; perr_t ret_value = SUCCEED; transfer_request_wait_out_t out; transfer_request_wait_all_out_t out_all; @@ -272,8 +272,8 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob { perr_t ret_value = SUCCEED; int fd; - char * data_path = NULL; - char * user_specified_data_path = NULL; + char *data_path = NULL; + char *user_specified_data_path = NULL; char storage_location[ADDR_MAX]; ssize_t io_size; uint64_t i, j; @@ -437,7 +437,7 @@ print_bulk_data(transfer_request_all_data *request_data) int parse_bulk_data(void *buf, transfer_request_all_data *request_data, pdc_access_t access_type) { - char * ptr = (char *)buf; + char *ptr = (char *)buf; int i, j; uint64_t data_size; diff --git a/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c b/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c index 4e41132f8..979d77a4f 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c @@ -5,8 +5,8 @@ #include "pdc_region.h" typedef struct pdc_region_metadata_pkg { - uint64_t * reg_offset; - uint64_t * reg_size; + uint64_t *reg_offset; + uint64_t *reg_size; uint32_t data_server_id; struct pdc_region_metadata_pkg *next; } pdc_region_metadata_pkg; @@ -14,8 +14,8 @@ typedef struct pdc_region_metadata_pkg { typedef struct pdc_obj_metadata_pkg { int ndim; uint64_t obj_id; - pdc_region_metadata_pkg * regions; - pdc_region_metadata_pkg * regions_end; + pdc_region_metadata_pkg *regions; + pdc_region_metadata_pkg *regions_end; struct pdc_obj_metadata_pkg *next; } pdc_obj_metadata_pkg; @@ -28,13 +28,13 @@ typedef struct pdc_obj_region_metadata { typedef struct pdc_metadata_query_buf { uint64_t id; - char * buf; + char *buf; struct pdc_metadata_query_buf *next; } pdc_metadata_query_buf; -static pdc_obj_metadata_pkg * metadata_server_objs; -static pdc_obj_metadata_pkg * metadata_server_objs_end; -static uint64_t * data_server_bytes; +static pdc_obj_metadata_pkg *metadata_server_objs; +static pdc_obj_metadata_pkg *metadata_server_objs_end; +static uint64_t *data_server_bytes; static int pdc_server_size; static uint64_t query_id_g; static pdc_metadata_query_buf *metadata_query_buf_head; @@ -58,7 +58,7 @@ perr_t transfer_request_metadata_query_init(int pdc_server_size_input, char *checkpoint) { hg_return_t ret_value = HG_SUCCESS; - char * ptr; + char *ptr; int n_objs, reg_count; int i, j; FUNC_ENTER(NULL); @@ -139,7 +139,7 @@ perr_t transfer_request_metadata_query_finalize() { hg_return_t ret_value = HG_SUCCESS; - pdc_obj_metadata_pkg * obj_temp, *obj_temp2; + pdc_obj_metadata_pkg *obj_temp, *obj_temp2; pdc_region_metadata_pkg *region_temp, *region_temp2; FUNC_ENTER(NULL); @@ -177,9 +177,9 @@ perr_t transfer_request_metadata_query_checkpoint(char **checkpoint, uint64_t *checkpoint_size) { hg_return_t ret_value = HG_SUCCESS; - pdc_obj_metadata_pkg * obj_temp; + pdc_obj_metadata_pkg *obj_temp; pdc_region_metadata_pkg *region_temp; - char * ptr; + char *ptr; int reg_count, obj_count; FUNC_ENTER(NULL); pthread_mutex_lock(&metadata_query_mutex); @@ -245,15 +245,15 @@ transfer_request_metadata_query_checkpoint(char **checkpoint, uint64_t *checkpoi static uint64_t metadata_query_buf_create(pdc_obj_region_metadata *regions, int size, uint64_t *total_buf_size_ptr) { - pdc_obj_metadata_pkg * temp; + pdc_obj_metadata_pkg *temp; pdc_region_metadata_pkg *region_metadata; int i; uint64_t total_data_size; - pdc_metadata_query_buf * query_buf; + pdc_metadata_query_buf *query_buf; uint64_t query_id; - uint64_t * overlap_offset, *overlap_size; - char * ptr; - int * transfer_request_counters; + uint64_t *overlap_offset, *overlap_size; + char *ptr; + int *transfer_request_counters; int transfer_request_counter_total; FUNC_ENTER(NULL); @@ -412,7 +412,7 @@ uint64_t transfer_request_metadata_query_parse(int32_t n_objs, char *buf, uint8_t is_write, uint64_t *total_buf_size_ptr) { - char * ptr = buf; + char *ptr = buf; int i; uint64_t query_id = 0; size_t unit; @@ -509,7 +509,7 @@ static uint64_t transfer_request_metadata_query_append(uint64_t obj_id, int ndim, uint64_t *reg_offset, uint64_t *reg_size, size_t unit, uint32_t data_server_id, uint8_t region_partition) { - pdc_obj_metadata_pkg * temp; + pdc_obj_metadata_pkg *temp; pdc_region_metadata_pkg *region_metadata; pdc_region_metadata_pkg *temp_region_metadata; diff --git a/src/tests/bdcats.c b/src/tests/bdcats.c index 13c052b24..5866df4fd 100644 --- a/src/tests/bdcats.c +++ b/src/tests/bdcats.c @@ -57,9 +57,9 @@ main(int argc, char **argv) pdcid_t region_xx, region_yy, region_zz, region_pxx, region_pyy, region_pzz, region_id11, region_id22; perr_t ret; - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; uint64_t numparticles; int ndim = 1; uint64_t *offset; diff --git a/src/tests/bdcats_old.c b/src/tests/bdcats_old.c index b4cdc347b..22d5bab09 100644 --- a/src/tests/bdcats_old.c +++ b/src/tests/bdcats_old.c @@ -56,9 +56,9 @@ main(int argc, char **argv) pdcid_t region_x, region_y, region_z, region_px, region_py, region_pz, region_id1, region_id2; pdcid_t region_xx, region_yy, region_zz, region_pxx, region_pyy, region_pzz, region_id11, region_id22; perr_t ret; - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; uint64_t numparticles; int ndim = 1; uint64_t *offset; diff --git a/src/tests/bdcats_v2.c b/src/tests/bdcats_v2.c index 88a78b094..9a8de9390 100644 --- a/src/tests/bdcats_v2.c +++ b/src/tests/bdcats_v2.c @@ -60,14 +60,14 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; uint64_t numparticles; int ndim = 1; - uint64_t * offset; - uint64_t * offset_remote; - uint64_t * mysize; + uint64_t *offset; + uint64_t *offset_remote; + uint64_t *mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/blocked_lock.c b/src/tests/blocked_lock.c index 4bdcb7f79..533691e99 100644 --- a/src/tests/blocked_lock.c +++ b/src/tests/blocked_lock.c @@ -47,7 +47,7 @@ main(int argc, char **argv) pdcid_t obj2; pdcid_t r1, r2; perr_t ret; - float * x; + float *x; int x_dim = 64; long numparticles = 8388608; // const int my_data_size = 992; diff --git a/src/tests/buf_map_mpi_v2.c b/src/tests/buf_map_mpi_v2.c index 7cbc912f7..5158e45b7 100644 --- a/src/tests/buf_map_mpi_v2.c +++ b/src/tests/buf_map_mpi_v2.c @@ -52,7 +52,7 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x; + float *x; long numparticles = 4; uint64_t dims[1] = {numparticles}; // {8388608}; int ndim = 1; diff --git a/src/tests/buf_obj_map_mpi.c b/src/tests/buf_obj_map_mpi.c index 3de60aabd..e1096946c 100644 --- a/src/tests/buf_obj_map_mpi.c +++ b/src/tests/buf_obj_map_mpi.c @@ -52,7 +52,7 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x; + float *x; int x_dim = 64; long numparticles = 4; uint64_t dims[1] = {numparticles}; // {8388608}; @@ -96,7 +96,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI obj2 = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop2, 0, comm); #else - obj2 = PDCobj_create(cont_id, "obj-var-xx", obj_prop2); + obj2 = PDCobj_create(cont_id, "obj-var-xx", obj_prop2); #endif if (obj2 == 0) { printf("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); diff --git a/src/tests/client_server.c b/src/tests/client_server.c index f63e659de..ec5a7580a 100644 --- a/src/tests/client_server.c +++ b/src/tests/client_server.c @@ -190,7 +190,7 @@ main(int argc, char **argv) size = 1; #endif - hg_class_t * hg_class = NULL; + hg_class_t *hg_class = NULL; hg_context_t *hg_context = NULL; hg_return_t hg_ret = 0; diff --git a/src/tests/cont_add_del.c b/src/tests/cont_add_del.c index de55ff6e7..0fc20988e 100644 --- a/src/tests/cont_add_del.c +++ b/src/tests/cont_add_del.c @@ -79,7 +79,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/create_obj_scale.c b/src/tests/create_obj_scale.c index ebd0d373e..dd3bb33a2 100644 --- a/src/tests/create_obj_scale.c +++ b/src/tests/create_obj_scale.c @@ -76,7 +76,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/dart_algo_sim.c b/src/tests/dart_algo_sim.c index 5b216dd8e..df28917b2 100644 --- a/src/tests/dart_algo_sim.c +++ b/src/tests/dart_algo_sim.c @@ -404,7 +404,7 @@ main(int argc, char **argv) word_count = atoi(argv[7]); prefix_len = atoi(argv[8]); char **input_word_list = NULL; - int * req_count = NULL; + int *req_count = NULL; int i = 0; @@ -432,7 +432,7 @@ main(int argc, char **argv) void (*keyword_insert[])(char *, int) = {DHT_INITIAL_keyword_insert, DHT_FULL_keyword_insert, dart_keyword_insert}; int (*keyword_search[])(char *, int) = {DHT_INITIAL_keyword_search, DHT_FULL_keyword_search, - dart_keyword_search}; + dart_keyword_search}; if (INPUT_TYPE == INPUT_DICTIONARY) { // Init dart space. diff --git a/src/tests/dart_func_test.c b/src/tests/dart_func_test.c index 8d29379b8..629fe5777 100644 --- a/src/tests/dart_func_test.c +++ b/src/tests/dart_func_test.c @@ -50,15 +50,15 @@ main(int argc, char **argv) dart_object_ref_type_t ref_type = REF_PRIMARY_ID; dart_hash_algo_t hash_algo = DART_HASH; - char * key = "abcd"; - char * value = "1234"; + char *key = "abcd"; + char *value = "1234"; uint64_t data = 12341234; // if (rank == 0) { PDC_Client_insert_obj_ref_into_dart(hash_algo, key, value, ref_type, data); println("[Client_Side_Insert] Insert '%s=%s' for ref %llu", key, value, data); // This is for testing exact search - char * exact_query = "abcd=1234"; + char *exact_query = "abcd=1234"; uint64_t *out1; int rest_count1 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, exact_query, ref_type, &rest_count1, &out1); @@ -66,7 +66,7 @@ main(int argc, char **argv) println("[Client_Side_Exact] Search '%s' and get %d results : %llu", exact_query, rest_count1, out1[0]); // This function test is for testing the prefix search - char * prefix_query = "ab*=12*"; + char *prefix_query = "ab*=12*"; uint64_t *out2; int rest_count2 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, prefix_query, ref_type, &rest_count2, &out2); @@ -74,7 +74,7 @@ main(int argc, char **argv) println("[Client_Side_Prefix] Search '%s' and get %d results : %llu", prefix_query, rest_count2, out2[0]); // This function test is for testing the suffix search. - char * suffix_query = "*cd=*34"; + char *suffix_query = "*cd=*34"; uint64_t *out3; int rest_count3 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, suffix_query, ref_type, &rest_count3, &out3); @@ -82,7 +82,7 @@ main(int argc, char **argv) println("[Client_Side_Suffix] Search '%s' and get %d results : %llu", suffix_query, rest_count3, out3[0]); // This is for testing infix search. - char * infix_query = "*bc*=*23*"; + char *infix_query = "*bc*=*23*"; uint64_t *out4; int rest_count4 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, infix_query, ref_type, &rest_count4, &out4); diff --git a/src/tests/data_rw_test.c b/src/tests/data_rw_test.c index 1bcc0a45d..cb054ef39 100644 --- a/src/tests/data_rw_test.c +++ b/src/tests/data_rw_test.c @@ -51,7 +51,7 @@ int print_data(int ndim, uint64_t *start, uint64_t *count, void *data) { uint64_t i, j; - char * data_1d, **data_2d, ***data_3d; + char *data_1d, **data_2d, ***data_3d; if (ndim == 1) { data_1d = (char *)data; @@ -79,8 +79,8 @@ int data_verify(int ndim, uint64_t *start, uint64_t *count, void *data, uint64_t *truth_start, void *truth_data) { uint64_t i, j, k; - char * data_1d, **data_2d, ***data_3d; - char * truth_data_1d, **truth_data_2d, ***truth_data_3d; + char *data_1d, **data_2d, ***data_3d; + char *truth_data_1d, **truth_data_2d, ***truth_data_3d; if (ndim == 1) { data_1d = (char *)data; @@ -134,13 +134,13 @@ test1d(char *obj_name) uint64_t dims[3]; uint64_t i = 0; pdcid_t obj_id; - pdc_metadata_t * metadata; + pdc_metadata_t *metadata; struct pdc_region_info region_a, region_b, region_c, region_d, read_region; uint64_t storage_offset_a, storage_offset_b, storage_offset_c, storage_offset_d, read_offset; uint64_t storage_size_a, storage_size_b, storage_size_c, storage_size_d, read_size; uint32_t ndim = 1; uint64_t total_size; - char * data, *data0, *data1, *data2, *data3, *read_data; + char *data, *data0, *data1, *data2, *data3, *read_data; uint64_t data_offset_real[3]; uint64_t data_start[3] = {0, 0, 0}; int is_correct = 0, is_all_correct = 0; @@ -254,7 +254,7 @@ int test2d(char *obj_name) { pdcid_t obj_id; - pdc_metadata_t * metadata; + pdc_metadata_t *metadata; struct pdc_region_info region_a, region_b, region_c, region_d, read_region; uint64_t storage_offset_a[3], storage_offset_b[3], storage_offset_c[3], storage_offset_d[3], read_offset[3]; @@ -264,8 +264,8 @@ test2d(char *obj_name) uint64_t data_start[3] = {0, 0, 0}; uint64_t data_offset_real[3]; int is_correct = 0, is_all_correct = 0; - char * data, *read_data; - char ** data_2d, **data_a_2d, **data_b_2d, **data_c_2d, **data_d_2d, **read_data_2d; + char *data, *read_data; + char **data_2d, **data_a_2d, **data_b_2d, **data_c_2d, **data_d_2d, **read_data_2d; uint32_t ndim = 2; prob_domain[0] = 25 * size; @@ -439,7 +439,7 @@ test3d(char *obj_name) uint32_t ndim = 3; pdcid_t obj_id; - pdc_metadata_t * metadata; + pdc_metadata_t *metadata; struct pdc_region_info region_a; struct pdc_region_info region_b; struct pdc_region_info region_c; diff --git a/src/tests/data_server_meta.c b/src/tests/data_server_meta.c index b0f92746e..13ef1cf68 100644 --- a/src/tests/data_server_meta.c +++ b/src/tests/data_server_meta.c @@ -71,7 +71,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/data_server_meta_test.c b/src/tests/data_server_meta_test.c index 3f0e8fbf2..42c88a98b 100644 --- a/src/tests/data_server_meta_test.c +++ b/src/tests/data_server_meta_test.c @@ -33,16 +33,16 @@ main(int argc, char **argv) #endif pdc_metadata_t *metadata[NOBJ]; - char * obj_names[NOBJ]; + char *obj_names[NOBJ]; const int my_data_size = 1048576; int ndim = 1; uint64_t dims[1] = {my_data_size}; - char * write_data = (char *)malloc(my_data_size); + char *write_data = (char *)malloc(my_data_size); int my_read_obj = NOBJ / size; int my_read_obj_start = my_read_obj * rank; uint64_t *out_buf_sizes = (uint64_t *)calloc(sizeof(uint64_t), my_read_obj); - void ** out_buf; + void **out_buf; write_region.ndim = ndim; write_region.offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim); diff --git a/src/tests/data_server_read.c b/src/tests/data_server_read.c index f56ac5f09..99398868b 100644 --- a/src/tests/data_server_read.c +++ b/src/tests/data_server_read.c @@ -20,10 +20,10 @@ main(int argc, char **argv) uint64_t readsize; pdcid_t pdc, cont_prop, cont; struct pdc_region_info region; - pdc_metadata_t * metadata; + pdc_metadata_t *metadata; uint64_t my_readsize; int ndim = 1; - void * buf; + void *buf; struct timeval ht_total_start; struct timeval ht_total_end; diff --git a/src/tests/data_server_read_vpic.c b/src/tests/data_server_read_vpic.c index 2dd77651c..2a2ab47aa 100644 --- a/src/tests/data_server_read_vpic.c +++ b/src/tests/data_server_read_vpic.c @@ -59,12 +59,12 @@ main(int argc, char **argv) char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t * obj_metas[NUM_VAR]; + pdc_metadata_t *obj_metas[NUM_VAR]; uint64_t float_bytes = NPARTICLES * sizeof(float); uint64_t int_bytes = NPARTICLES * sizeof(int); uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR]; + void *mydata[NUM_VAR]; int read_var = NUM_VAR; @@ -214,7 +214,7 @@ main(int argc, char **argv) verify = 0; break; } // end if - } // end of + } // end of if (verify == 1) { if (rank == 0) printf("SUCCEED\n"); diff --git a/src/tests/data_server_read_vpic_multits.c b/src/tests/data_server_read_vpic_multits.c index f260e8cfb..c1529608b 100644 --- a/src/tests/data_server_read_vpic_multits.c +++ b/src/tests/data_server_read_vpic_multits.c @@ -81,10 +81,10 @@ main(int argc, char **argv) uint64_t float_bytes, int_bytes; uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR_MAX]; + void *mydata[NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/data_server_read_vpic_spatial.c b/src/tests/data_server_read_vpic_spatial.c index e5fdd16c8..d7c372074 100644 --- a/src/tests/data_server_read_vpic_spatial.c +++ b/src/tests/data_server_read_vpic_spatial.c @@ -61,14 +61,14 @@ main(int argc, char **argv) int rank = 0, size = 1, i; perr_t ret; pdcid_t pdc_id, cont_prop, cont_id; - char * obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; + char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t * obj_metas[NUM_VAR]; + pdc_metadata_t *obj_metas[NUM_VAR]; uint64_t float_bytes = NPARTICLES * sizeof(float); uint64_t int_bytes = NPARTICLES * sizeof(int); uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR]; + void *mydata[NUM_VAR]; int read_var = NUM_VAR; struct pdc_request request[NUM_VAR]; diff --git a/src/tests/data_server_read_vpic_spatial_multits.c b/src/tests/data_server_read_vpic_spatial_multits.c index e667736cf..57c20d7ae 100644 --- a/src/tests/data_server_read_vpic_spatial_multits.c +++ b/src/tests/data_server_read_vpic_spatial_multits.c @@ -82,10 +82,10 @@ main(int argc, char **argv) int n_particles; uint64_t float_bytes, int_bytes; uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR_MAX]; + void *mydata[NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/data_server_write.c b/src/tests/data_server_write.c index 174d780fe..66d6b47b5 100644 --- a/src/tests/data_server_write.c +++ b/src/tests/data_server_write.c @@ -20,15 +20,15 @@ main(int argc, char **argv) { int rank = 0, size = 1; uint64_t size_MB; - char * obj_name; + char *obj_name; pdcid_t test_obj = -1; pdcid_t pdc, cont_prop, cont, obj_prop; struct pdc_region_info region; int my_data_size; uint64_t dims[1]; int ndim = 1; - pdc_metadata_t * metadata; - char * mydata; + pdc_metadata_t *metadata; + char *mydata; struct timeval ht_total_start; struct timeval ht_total_end; diff --git a/src/tests/data_server_write_vpic.c b/src/tests/data_server_write_vpic.c index 2a5f9d646..63756c5e3 100644 --- a/src/tests/data_server_write_vpic.c +++ b/src/tests/data_server_write_vpic.c @@ -69,7 +69,7 @@ main(int argc, char **argv) pdcid_t obj_ids[NUM_VAR]; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t * obj_metas[NUM_VAR]; + pdc_metadata_t *obj_metas[NUM_VAR]; pdcid_t obj_prop_float, obj_prop_int; @@ -80,7 +80,7 @@ main(int argc, char **argv) uint64_t int_dims[NDIM] = {int_bytes * size}; uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR]; + void *mydata[NUM_VAR]; int write_var = NUM_VAR; diff --git a/src/tests/data_server_write_vpic_multits.c b/src/tests/data_server_write_vpic_multits.c index 6a943bb58..50c4d63a1 100644 --- a/src/tests/data_server_write_vpic_multits.c +++ b/src/tests/data_server_write_vpic_multits.c @@ -81,12 +81,12 @@ main(int argc, char **argv) uint64_t float_dims[NDIM]; uint64_t int_dims[NDIM]; uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR_MAX]; + void *mydata[NUM_VAR_MAX]; pdcid_t obj_prop_float, obj_prop_int; pdcid_t obj_ids[TS_MAX][NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/delete_obj.c b/src/tests/delete_obj.c index 22265de88..af6b4c4de 100644 --- a/src/tests/delete_obj.c +++ b/src/tests/delete_obj.c @@ -65,9 +65,9 @@ main(int argc, char **argv) int use_name = -1; char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; - char * env_str; + char *env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char obj_name[1024]; perr_t ret; diff --git a/src/tests/delete_obj_scale.c b/src/tests/delete_obj_scale.c index e97aa409f..d6f486bde 100644 --- a/src/tests/delete_obj_scale.c +++ b/src/tests/delete_obj_scale.c @@ -70,9 +70,9 @@ main(int argc, char **argv) char tmp_str[128]; int use_name = -1; int progress_factor; - char * env_str; + char *env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/gen_fastbit_idx.c b/src/tests/gen_fastbit_idx.c index 14afc92d7..544df75f6 100644 --- a/src/tests/gen_fastbit_idx.c +++ b/src/tests/gen_fastbit_idx.c @@ -13,8 +13,8 @@ int main(int argc, char **argv) { uint64_t nhits; - char * var_name; - pdc_query_t * qpreload_x; + char *var_name; + pdc_query_t *qpreload_x; pdc_metadata_t *meta; pdcid_t pdc, id; float preload_value = -2000000000.0; diff --git a/src/tests/hash_table.c b/src/tests/hash_table.c index dac6cf357..eb4180216 100644 --- a/src/tests/hash_table.c +++ b/src/tests/hash_table.c @@ -74,10 +74,10 @@ main(int argc, char *argv[]) { hg_hash_table_t *hash_table = NULL; - int * key1, *key2; + int *key1, *key2; hash_value_metadata_t *value1, *value2; const int num = 100; - int * keys[num]; + int *keys[num]; int i; hash_value_metadata_t *values[num]; hash_value_metadata_t *lookup_value = NULL; diff --git a/src/tests/helper/julia_helper_loader.c b/src/tests/helper/julia_helper_loader.c index 887051e46..c010e70f4 100644 --- a/src/tests/helper/julia_helper_loader.c +++ b/src/tests/helper/julia_helper_loader.c @@ -55,9 +55,9 @@ run_jl_function(const char *mod_name, const char *fun_name, jl_fn_args_t *args) { char module_eval_cmd[strlen(mod_name) + 15]; sprintf(module_eval_cmd, "Main.%s", mod_name); - jl_module_t * JuliaModule = (jl_module_t *)jl_eval_string(module_eval_cmd); + jl_module_t *JuliaModule = (jl_module_t *)jl_eval_string(module_eval_cmd); jl_function_t *jl_func = jl_get_function(JuliaModule, fun_name); - jl_value_t * result = jl_call(jl_func, args->args, args->nargs); + jl_value_t *result = jl_call(jl_func, args->args, args->nargs); printf("[PDC_JL_HELPER] Function called: %s.%s\n", mod_name, fun_name); return result; } @@ -69,7 +69,7 @@ run_jl_get_int64_array(const char *mod_name, const char *fun_name, jl_fn_args_t jl_value_t *ret = run_jl_function(mod_name, fun_name, args); JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; - int64_t * data = (int64_t *)jl_array_data(ret_array); + int64_t *data = (int64_t *)jl_array_data(ret_array); *arr_ptr = data; *arr_len = jl_array_len(ret_array); JL_GC_POP(); @@ -82,7 +82,7 @@ run_jl_get_float64_array(const char *mod_name, const char *fun_name, jl_fn_args_ jl_value_t *ret = run_jl_function(mod_name, fun_name, args); JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; - double * data = (double *)jl_array_data(ret_array); + double *data = (double *)jl_array_data(ret_array); *arr_ptr = data; *arr_len = jl_array_len(ret_array); JL_GC_POP(); @@ -96,7 +96,7 @@ run_jl_get_string_array(const char *mod_name, const char *fun_name, jl_fn_args_t JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; size_t length = jl_array_len(ret); - char ** strings = malloc(length * sizeof(char *)); + char **strings = malloc(length * sizeof(char *)); for (size_t i = 0; i < length; ++i) { jl_value_t *julia_str = jl_arrayref(ret_array, i); diff --git a/src/tests/import_vpic.c b/src/tests/import_vpic.c index ea1aeaa77..167598211 100644 --- a/src/tests/import_vpic.c +++ b/src/tests/import_vpic.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) { int my_rank = 0, num_procs = 1, i, ndim, region_MB = 0; - char * file_name, *group_name; - char * dset_names[7] = {"Energy", "x", "y", "z", "Ux", "Uy", "Uz"}; - void * data; + char *file_name, *group_name; + char *dset_names[7] = {"Energy", "x", "y", "z", "Ux", "Uy", "Uz"}; + void *data; hid_t file_id, group_id, dset_ids[NVAR], filespace, memspace, fapl; hsize_t dims[1], my_elem_off, my_nelem, region_offset, region_size; hsize_t elem_offset, elem_count, total_elem, my_nregion, total_region, j; @@ -32,7 +32,7 @@ main(int argc, char *argv[]) pdcid_t pdc_id, cont_prop, cont_id, obj_ids[NVAR], obj_prop; perr_t ret; - pdc_metadata_t * obj_meta; + pdc_metadata_t *obj_meta; struct PDC_region_info obj_region; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_add_get.c b/src/tests/kvtag_add_get.c index ad06b506b..303132a42 100644 --- a/src/tests/kvtag_add_get.c +++ b/src/tests/kvtag_add_get.c @@ -35,11 +35,11 @@ main() { pdcid_t pdc, cont_prop, cont, obj_prop1, obj_prop2, obj1, obj2; pdc_kvtag_t kvtag1, kvtag2, kvtag3; - char * v1 = "value1"; + char *v1 = "value1"; int v2 = 2; double v3 = 3.45; pdc_var_type_t type1, type2, type3; - void * value1, *value2, *value3; + void *value1, *value2, *value3; psize_t value_size; // create a pdc diff --git a/src/tests/kvtag_add_get_benchmark.c b/src/tests/kvtag_add_get_benchmark.c index a682e30ee..555ec6bc4 100644 --- a/src/tests/kvtag_add_get_benchmark.c +++ b/src/tests/kvtag_add_get_benchmark.c @@ -34,7 +34,7 @@ uint64_t atoui64(char *arg) { - char * endptr; + char *endptr; uint64_t num = strtoull(arg, &endptr, 10); if (*endptr != '\0') { @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; uint64_t n_obj, n_obj_incr, my_obj, my_obj_s; uint64_t n_attr, n_attr_len, n_query, my_query, my_query_s; uint64_t n_servers, n_clients; @@ -335,7 +335,7 @@ main(int argc, char *argv[]) double stime = 0.0, step_elapse = 0.0; double total_object_time = 0.0, total_tag_time = 0.0, total_query_time = 0.0; uint64_t total_object_count = 0, total_tag_count = 0, total_query_count = 0; - void ** query_rst_cache; + void **query_rst_cache; uint64_t *value_size; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_add_get_scale.c b/src/tests/kvtag_add_get_scale.c index dc14c597e..1798aeef7 100644 --- a/src/tests/kvtag_add_get_scale.c +++ b/src/tests/kvtag_add_get_scale.c @@ -68,14 +68,14 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; int n_obj, n_add_tag, n_query, my_obj, my_obj_s, my_add_tag, my_query, my_add_tag_s, my_query_s; int obj_1percent = 0, tag_1percent = 0, query_1percent = 0; int proc_num, my_rank, i, v; char obj_name[128]; double stime, total_time, percent_time; pdc_kvtag_t kvtag; - void ** values; + void **values; pdc_var_type_t value_type; size_t value_size; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_get.c b/src/tests/kvtag_get.c index 7ca1e7c0e..7b9f708f6 100644 --- a/src/tests/kvtag_get.c +++ b/src/tests/kvtag_get.c @@ -34,7 +34,7 @@ int main() { pdcid_t pdc, cont_prop, cont, obj_prop1, obj_prop2, obj1, obj2; - pdc_kvtag_t * value1, *value2, *value3; + pdc_kvtag_t *value1, *value2, *value3; pdc_var_type_t type1, type2, type3; psize_t value_size; diff --git a/src/tests/kvtag_query.c b/src/tests/kvtag_query.c index 3a6038d3f..5113748dd 100644 --- a/src/tests/kvtag_query.c +++ b/src/tests/kvtag_query.c @@ -78,13 +78,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num = 1, my_rank = 0, i, v, iter, round, selectivity, is_using_dart; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t * pdc_ids; + uint64_t *pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_mpi.c b/src/tests/kvtag_query_mpi.c index 22c619c97..e38efd028 100644 --- a/src/tests/kvtag_query_mpi.c +++ b/src/tests/kvtag_query_mpi.c @@ -68,13 +68,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num, my_rank, i, v, iter, round; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t * pdc_ids; + uint64_t *pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_scale.c b/src/tests/kvtag_query_scale.c index 99336cebc..f1dc94634 100644 --- a/src/tests/kvtag_query_scale.c +++ b/src/tests/kvtag_query_scale.c @@ -78,13 +78,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num, my_rank, i, v, iter, round, selectivity, is_using_dart, query_type; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t * pdc_ids; + uint64_t *pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_scale_col.c b/src/tests/kvtag_query_scale_col.c index 91c6d7481..83efdbe88 100644 --- a/src/tests/kvtag_query_scale_col.c +++ b/src/tests/kvtag_query_scale_col.c @@ -135,15 +135,15 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t * obj_ids; + pdcid_t *obj_ids; int n_obj, my_obj, my_obj_s; int proc_num, my_rank, i, v, iter, round, selectivity, is_using_dart, query_type, comm_type; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t * pdc_ids; + uint64_t *pdc_ids; int nres, ntotal; - int * my_cnt_round; - int * total_cnt_round; + int *my_cnt_round; + int *total_cnt_round; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); @@ -282,9 +282,9 @@ main(int argc, char *argv[]) if (is_using_dart) { char *query_string = gen_query_str(&output); ret_value = (comm_type == 0) - ? PDC_Client_search_obj_ref_through_dart(hash_algo, query_string, - ref_type, &nres, &pdc_ids) - : PDC_Client_search_obj_ref_through_dart_mpi( + ? PDC_Client_search_obj_ref_through_dart(hash_algo, query_string, + ref_type, &nres, &pdc_ids) + : PDC_Client_search_obj_ref_through_dart_mpi( hash_algo, query_string, ref_type, &nres, &pdc_ids, MPI_COMM_WORLD); } else { @@ -331,7 +331,7 @@ main(int argc, char *argv[]) } #endif } // end query type - } // end comm type + } // end comm type if (my_rank == 0) { println("Rank %d: All queries are done.", my_rank); diff --git a/src/tests/list_all.c b/src/tests/list_all.c index 508d23db6..a36a7303a 100644 --- a/src/tests/list_all.c +++ b/src/tests/list_all.c @@ -73,9 +73,9 @@ main(int argc, char **argv) int use_name = -1; uint64_t dims[3] = {100, 200, 700}; pdcid_t test_obj = -1; - char * env_str; + char *env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; pdc_metadata_t **out; int n_obj; diff --git a/src/tests/obj_buf.c b/src/tests/obj_buf.c index 6da89387c..4e78d7430 100644 --- a/src/tests/obj_buf.c +++ b/src/tests/obj_buf.c @@ -33,7 +33,7 @@ main(int argc, char **argv) pdcid_t pdc, cont_prop, cont, obj_prop, obj1; int rank = 0, size = 1; int myArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - void ** rbuf; + void **rbuf; int ret_value = 0; char cont_name[128], obj_name1[128]; diff --git a/src/tests/obj_iter.c b/src/tests/obj_iter.c index bc96d56a3..92a78e679 100644 --- a/src/tests/obj_iter.c +++ b/src/tests/obj_iter.c @@ -33,7 +33,7 @@ main(int argc, char **argv) { pdcid_t pdc, cont_prop, cont, obj_prop, obj1, obj2, obj3; int rank = 0, size = 1; - obj_handle * oh; + obj_handle *oh; struct pdc_obj_info *info; int ret_value = 0, ret; char cont_name[128], obj_name1[128], obj_name2[128], obj_name3[128]; diff --git a/src/tests/obj_map.c b/src/tests/obj_map.c index 2efae2e43..de330a192 100644 --- a/src/tests/obj_map.c +++ b/src/tests/obj_map.c @@ -71,9 +71,9 @@ main(int argc, char **argv) uint64_t dims[2] = {3, 3}; uint64_t offset[2] = {1, 1}; uint64_t rdims[2] = {2, 2}; - char * env_str = getenv("PDC_OBJ_NAME"); + char *env_str = getenv("PDC_OBJ_NAME"); char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/obj_transformation.c b/src/tests/obj_transformation.c index a9e2a23d6..927642b7b 100644 --- a/src/tests/obj_transformation.c +++ b/src/tests/obj_transformation.c @@ -62,18 +62,18 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; uint64_t numparticles, i; uint64_t dims[1]; int ndim = 1; - uint64_t * offset; - uint64_t * offset_remote; - uint64_t * mysize; + uint64_t *offset; + uint64_t *offset_remote; + uint64_t *mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/pdc_transforms_lib.c b/src/tests/pdc_transforms_lib.c index 6397bdc70..1296b1631 100644 --- a/src/tests/pdc_transforms_lib.c +++ b/src/tests/pdc_transforms_lib.c @@ -567,7 +567,7 @@ pdc_transform_increment(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_t { int i; int64_t nval, nbytes; - void * destBuff; + void *destBuff; size_t typesize = 1; if (srcType >= 0) { if ((srcType == PDC_INT) || (srcType == PDC_UINT) || (srcType == PDC_FLOAT)) @@ -625,7 +625,7 @@ pdc_transform_compress(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_t int doshuffle = BLOSC_BITSHUFFLE; int nval, i, typesize; int64_t destsize, nbytes, csize; - void * destBuff; + void *destBuff; if ((srcType == PDC_INT) || (srcType == PDC_UINT) || (srcType == PDC_FLOAT)) typesize = sizeof(int); @@ -667,7 +667,7 @@ pdc_transform_decompress(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_ { int i; size_t typesize, destsize, dsize; - void * destBuff = *dataOut; + void *destBuff = *dataOut; fprintf(stdout, "\n[TRANSFORM] Entering pdc_transform_decompress\n"); diff --git a/src/tests/query_data.c b/src/tests/query_data.c index 62112f6ed..cc484c4c1 100644 --- a/src/tests/query_data.c +++ b/src/tests/query_data.c @@ -24,16 +24,16 @@ main(int argc, char **argv) struct pdc_region_info region; uint64_t i, dims[1]; pdc_selection_t sel; - char * obj_name; + char *obj_name; int my_data_count; - pdc_metadata_t * metadata; + pdc_metadata_t *metadata; pdcid_t pdc, cont_prop, cont, obj_prop; int ndim = 1; - int * mydata; + int *mydata; int lo0 = 1000; int lo1 = 2000, hi1 = 3000; int lo2 = 5000, hi2 = 7000; - pdc_query_t * q0, *q1l, *q1h, *q1, *q2l, *q2h, *q2, *q, *q12; + pdc_query_t *q0, *q1l, *q1h, *q1, *q2l, *q2h, *q2, *q, *q12; int ret_value = 0; struct timeval ht_total_start; diff --git a/src/tests/query_metadata_agg.c b/src/tests/query_metadata_agg.c index 7ad9cd4b3..829469efc 100644 --- a/src/tests/query_metadata_agg.c +++ b/src/tests/query_metadata_agg.c @@ -18,7 +18,7 @@ main(int argc, const char *argv[]) { int rank = 0, size = 1; uint64_t size_MB = 0; - char * obj_name = "test"; + char *obj_name = "test"; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/query_vpic.c b/src/tests/query_vpic.c index 5b3a43305..ed9448c7f 100644 --- a/src/tests/query_vpic.c +++ b/src/tests/query_vpic.c @@ -18,7 +18,7 @@ main(void) // Construct query constraints float energy_lo0 = 3.75, energy_hi0 = 4.0; - pdc_query_t * q0l, *q0h, *q; + pdc_query_t *q0l, *q0h, *q; pdc_selection_t sel; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_bin_sds1_nopreload.c b/src/tests/query_vpic_bin_sds1_nopreload.c index c2ce6e8d2..8d68d1291 100644 --- a/src/tests/query_vpic_bin_sds1_nopreload.c +++ b/src/tests/query_vpic_bin_sds1_nopreload.c @@ -14,10 +14,10 @@ main(void) { pdc_metadata_t *x_meta, *y_meta, *energy_meta; pdcid_t pdc, x_id, y_id, energy_id; - pdc_query_t * ql, *q2_lo, *q2_hi, *q2, *q12, *q3_lo, *q3_hi, *q3, *q; + pdc_query_t *ql, *q2_lo, *q2_hi, *q2, *q12, *q3_lo, *q3_hi, *q3, *q; pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo0 = 3.0; float x_lo = 300, x_hi = 310; float y_lo = 140, y_hi = 150; diff --git a/src/tests/query_vpic_bin_sds1_preload.c b/src/tests/query_vpic_bin_sds1_preload.c index b6e3dd5a3..0408c5757 100644 --- a/src/tests/query_vpic_bin_sds1_preload.c +++ b/src/tests/query_vpic_bin_sds1_preload.c @@ -18,7 +18,7 @@ main(void) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL; float preload_value = 0; int preload_int = 0; pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *ql, *q2_lo, *q2_hi, *q2, *q3_lo, *q3_hi, *q3, *q, diff --git a/src/tests/query_vpic_bin_sds_nopreload.c b/src/tests/query_vpic_bin_sds_nopreload.c index d4a89dd44..437ae5143 100644 --- a/src/tests/query_vpic_bin_sds_nopreload.c +++ b/src/tests/query_vpic_bin_sds_nopreload.c @@ -20,7 +20,7 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo = 1.2, energy_hi = 1.3; float x_lo = 308, x_hi = 309; diff --git a/src/tests/query_vpic_bin_sds_preload.c b/src/tests/query_vpic_bin_sds_preload.c index c0606f66d..372deb691 100644 --- a/src/tests/query_vpic_bin_sds_preload.c +++ b/src/tests/query_vpic_bin_sds_preload.c @@ -20,7 +20,7 @@ main(void) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo = 1.2, energy_hi = 1.3; float x_lo = 308, x_hi = 309; float y_lo = 149, y_hi = 150; diff --git a/src/tests/query_vpic_create_data.c b/src/tests/query_vpic_create_data.c index 49c709185..9e016f945 100644 --- a/src/tests/query_vpic_create_data.c +++ b/src/tests/query_vpic_create_data.c @@ -58,19 +58,19 @@ main(int argc, char **argv) pdcid_t pdc_id, cont_prop, cont_id; uint64_t nparticles = NPARTICLES, j; int write_var = NUM_VAR, i; - char * obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; + char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; uint64_t float_bytes, int_bytes; pdcid_t obj_ids[NUM_VAR]; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t * obj_metas[NUM_VAR]; + pdc_metadata_t *obj_metas[NUM_VAR]; pdcid_t obj_prop_float, obj_prop_int; struct timeval pdc_timer_start; struct timeval pdc_timer_end; double write_time = 0.0, total_size = 0.0; uint64_t myoffset[NDIM], mysize[NDIM]; - void * mydata[NUM_VAR]; + void *mydata[NUM_VAR]; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/query_vpic_exyz_nopreload.c b/src/tests/query_vpic_exyz_nopreload.c index d3593b90a..9ccb60bdf 100644 --- a/src/tests/query_vpic_exyz_nopreload.c +++ b/src/tests/query_vpic_exyz_nopreload.c @@ -22,9 +22,9 @@ main(int argc, char **argv) pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; uint64_t nhits, i; - pdc_query_t * qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; + pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; struct timeval pdc_timer_start; struct timeval pdc_timer_end; diff --git a/src/tests/query_vpic_exyz_preload.c b/src/tests/query_vpic_exyz_preload.c index 80313d58d..d98a35a8e 100644 --- a/src/tests/query_vpic_exyz_preload.c +++ b/src/tests/query_vpic_exyz_preload.c @@ -24,7 +24,7 @@ main(int argc, char **argv) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; + float *energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; float preload_value = -10000.0; pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; diff --git a/src/tests/query_vpic_multi.c b/src/tests/query_vpic_multi.c index 4704b3e1d..f39728849 100644 --- a/src/tests/query_vpic_multi.c +++ b/src/tests/query_vpic_multi.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data; - pdc_query_t * ql, *qh, *q; + float *energy_data; + pdc_query_t *ql, *qh, *q; float energy_lo0 = 2.0, energy_hi0 = 2.1; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_nopreload.c b/src/tests/query_vpic_multi_nopreload.c index dc0da4494..7dccd1055 100644 --- a/src/tests/query_vpic_multi_nopreload.c +++ b/src/tests/query_vpic_multi_nopreload.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data; - pdc_query_t * ql, *qh, *q; + float *energy_data; + pdc_query_t *ql, *qh, *q; float energy_lo0 = 3.9, energy_hi0 = 4.0; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_nopreload1.c b/src/tests/query_vpic_multi_nopreload1.c index f2c73f68b..06c18c2df 100644 --- a/src/tests/query_vpic_multi_nopreload1.c +++ b/src/tests/query_vpic_multi_nopreload1.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data; - pdc_query_t * ql, *qh, *q; + float *energy_data; + pdc_query_t *ql, *qh, *q; float energy_lo0 = 2.8, energy_hi0 = 2.9; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_preload.c b/src/tests/query_vpic_multi_preload.c index 4704b3e1d..f39728849 100644 --- a/src/tests/query_vpic_multi_preload.c +++ b/src/tests/query_vpic_multi_preload.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float * energy_data; - pdc_query_t * ql, *qh, *q; + float *energy_data; + pdc_query_t *ql, *qh, *q; float energy_lo0 = 2.0, energy_hi0 = 2.1; struct timeval pdc_timer_start; diff --git a/src/tests/read_obj.c b/src/tests/read_obj.c index e688219f3..db52aded1 100644 --- a/src/tests/read_obj.c +++ b/src/tests/read_obj.c @@ -27,7 +27,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Comm comm; #else - int comm = 1; + int comm = 1; #endif struct timeval pdc_timer_start; struct timeval pdc_timer_end; @@ -39,7 +39,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char * mydata; + char *mydata; char obj_name[128], cont_name[128]; uint64_t my_data_size; diff --git a/src/tests/read_obj_shared.c b/src/tests/read_obj_shared.c index 6f56965d8..2cfea8f0b 100644 --- a/src/tests/read_obj_shared.c +++ b/src/tests/read_obj_shared.c @@ -26,7 +26,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Comm comm; #else - int comm = 1; + int comm = 1; #endif pdcid_t global_obj = 0; pdcid_t local_region, global_region; @@ -35,7 +35,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char * mydata; + char *mydata; char obj_name[128], cont_name[128]; uint64_t my_data_size; diff --git a/src/tests/region_transfer_all.c b/src/tests/region_transfer_all.c index 4e8475e1b..2ee7efaef 100644 --- a/src/tests/region_transfer_all.c +++ b/src/tests/region_transfer_all.c @@ -138,10 +138,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } diff --git a/src/tests/region_transfer_all_2D.c b/src/tests/region_transfer_all_2D.c index 03fe83d6f..3ae2dbf67 100644 --- a/src/tests/region_transfer_all_2D.c +++ b/src/tests/region_transfer_all_2D.c @@ -137,10 +137,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } diff --git a/src/tests/region_transfer_all_3D.c b/src/tests/region_transfer_all_3D.c index bcfaadb4c..d745dbed4 100644 --- a/src/tests/region_transfer_all_3D.c +++ b/src/tests/region_transfer_all_3D.c @@ -140,10 +140,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } diff --git a/src/tests/region_transfer_all_append.c b/src/tests/region_transfer_all_append.c index 28ebfb2c6..19292e288 100644 --- a/src/tests/region_transfer_all_append.c +++ b/src/tests/region_transfer_all_append.c @@ -133,10 +133,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } @@ -260,6 +260,9 @@ main(int argc, char **argv) /* printf("successfully closed local region @ line %d\n", __LINE__); */ /* } */ + if (rank == 0) + printf("Test 0 done\n"); + for (i = 0; i < OBJ_NUM; ++i) { sprintf(obj_name, "o%d_%d", i, rank); obj[i] = PDCobj_open(obj_name, pdc); @@ -373,6 +376,9 @@ main(int argc, char **argv) } } + if (rank == 0) + printf("Test 1 done\n"); + for (i = 0; i < OBJ_NUM; ++i) { sprintf(obj_name, "o%d_%d", i, rank); obj[i] = PDCobj_open(obj_name, pdc); @@ -495,6 +501,9 @@ main(int argc, char **argv) /* printf("successfully local region @ line %d\n", __LINE__); */ /* } */ + if (rank == 0) + printf("Test 2 done\n"); + // Now we rewrite the whole object and check its values. // open object for (i = 0; i < OBJ_NUM; ++i) { @@ -612,6 +621,9 @@ main(int argc, char **argv) /* } */ } + if (rank == 0) + printf("Test 3 done\n"); + // open object for (i = 0; i < OBJ_NUM; ++i) { sprintf(obj_name, "o%d_%d", i, rank); @@ -732,6 +744,9 @@ main(int argc, char **argv) } } + if (rank == 0) + printf("Test 4 done\n"); + // close a container if (PDCcont_close(cont) < 0) { printf("fail to close container c1 @ line %d\n", __LINE__); diff --git a/src/tests/region_transfer_all_append_2D.c b/src/tests/region_transfer_all_append_2D.c index c747afcab..23d0c9f62 100644 --- a/src/tests/region_transfer_all_append_2D.c +++ b/src/tests/region_transfer_all_append_2D.c @@ -142,10 +142,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } diff --git a/src/tests/region_transfer_all_append_3D.c b/src/tests/region_transfer_all_append_3D.c index 254771379..298afd5c7 100644 --- a/src/tests/region_transfer_all_append_3D.c +++ b/src/tests/region_transfer_all_append_3D.c @@ -144,10 +144,10 @@ main(int argc, char **argv) ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_LOCAL); break; } - case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); - break; - } + /* case 3: { */ + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ + /* break; */ + /* } */ default: { } } diff --git a/src/tests/region_transfer_all_split_wait.c b/src/tests/region_transfer_all_split_wait.c index a69fa9ba6..61caaf3ce 100644 --- a/src/tests/region_transfer_all_split_wait.c +++ b/src/tests/region_transfer_all_split_wait.c @@ -129,7 +129,7 @@ main(int argc, char **argv) break; } case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ break; } default: { diff --git a/src/tests/region_transfer_set_dims.c b/src/tests/region_transfer_set_dims.c index 1efd1d3be..dc49dc1aa 100644 --- a/src/tests/region_transfer_set_dims.c +++ b/src/tests/region_transfer_set_dims.c @@ -140,7 +140,7 @@ main(int argc, char **argv) break; } case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ break; } default: { diff --git a/src/tests/region_transfer_set_dims_2D.c b/src/tests/region_transfer_set_dims_2D.c index 991658709..b8adbf48a 100644 --- a/src/tests/region_transfer_set_dims_2D.c +++ b/src/tests/region_transfer_set_dims_2D.c @@ -143,7 +143,7 @@ main(int argc, char **argv) break; } case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ break; } default: { diff --git a/src/tests/region_transfer_set_dims_3D.c b/src/tests/region_transfer_set_dims_3D.c index 1752c6315..6b9827593 100644 --- a/src/tests/region_transfer_set_dims_3D.c +++ b/src/tests/region_transfer_set_dims_3D.c @@ -145,7 +145,7 @@ main(int argc, char **argv) break; } case 3: { - ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); + /* ret = PDCprop_set_obj_transfer_region_type(obj_prop, PDC_REGION_DYNAMIC); */ break; } default: { diff --git a/src/tests/search_obj.c b/src/tests/search_obj.c index 465a48b6c..ceac65233 100644 --- a/src/tests/search_obj.c +++ b/src/tests/search_obj.c @@ -67,16 +67,16 @@ main(int argc, char **argv) double ht_total_sec; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char filename[128], pdc_server_tmp_dir_g[128]; - char * env_str; - char ** obj_names; - int * obj_ts; - char * tmp_dir; + char *env_str; + char **obj_names; + int *obj_ts; + char *tmp_dir; int n_entry; int use_name = -1; pdc_metadata_t entry; - uint32_t * hash_key; + uint32_t *hash_key; int j, read_count = 0, tmp_count; #ifdef ENABLE_MPI diff --git a/src/tests/search_obj_scale.c b/src/tests/search_obj_scale.c index 88506ffc7..60729eea3 100644 --- a/src/tests/search_obj_scale.c +++ b/src/tests/search_obj_scale.c @@ -69,11 +69,11 @@ main(int argc, char **argv) char obj_name[512]; char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; - char * env_str; + char *env_str; pdc_metadata_t *res = NULL; int progress_factor; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/stat_obj.c b/src/tests/stat_obj.c index 6a068edc7..0eae75a50 100644 --- a/src/tests/stat_obj.c +++ b/src/tests/stat_obj.c @@ -52,16 +52,16 @@ main(int argc, char **argv) long long ht_total_elapsed; double ht_total_sec; - char ** obj_names; - char * env_str; - int * obj_ts; + char **obj_names; + char *env_str; + int *obj_ts; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char filename[1024], pdc_server_tmp_dir_g[128]; int n_entry; - char * tmp_dir; + char *tmp_dir; pdc_metadata_t entry; - uint32_t * hash_key; + uint32_t *hash_key; int j, read_count = 0, tmp_count; int progress_factor; pdc_metadata_t *res; diff --git a/src/tests/update_obj.c b/src/tests/update_obj.c index b63082361..e8f73d968 100644 --- a/src/tests/update_obj.c +++ b/src/tests/update_obj.c @@ -50,20 +50,20 @@ main(int argc, char **argv) long long ht_total_elapsed; double ht_total_sec; int use_name = -1; - char * env_str, *tmp_dir; + char *env_str, *tmp_dir; pdc_metadata_t new; - char ** obj_names; - int * obj_ts; + char **obj_names; + int *obj_ts; char filename[1024], pdc_server_tmp_dir_g[128]; int n_entry; pdc_metadata_t entry; - uint32_t * hash_key; + uint32_t *hash_key; int j, read_count = 0, tmp_count; pdc_metadata_t *res = NULL; int progress_factor; - FILE * file; + FILE *file; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/vpicio.c b/src/tests/vpicio.c index e7bd51f07..e96c52d10 100644 --- a/src/tests/vpicio.c +++ b/src/tests/vpicio.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_mts.c b/src/tests/vpicio_mts.c index 4c4679459..bdc21c416 100644 --- a/src/tests/vpicio_mts.c +++ b/src/tests/vpicio_mts.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c index 1993609e9..6a5c043df 100644 --- a/src/tests/vpicio_mts_all.c +++ b/src/tests/vpicio_mts_all.c @@ -60,8 +60,8 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x, *y, *z, *px, *py, *pz; - int * id1, *id2; + float *x, *y, *z, *px, *py, *pz; + int *id1, *id2; int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; double t0, t1; @@ -360,8 +360,9 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); + PDC_get_time_str(cur_time); if (rank == 0) - printf("Obj close time: %.5e\n", t1 - t0); + printf("[%s] Obj close time: %.5e\n", cur_time, t1 - t0); #endif } // End for steps diff --git a/src/tests/vpicio_old.c b/src/tests/vpicio_old.c index f3a2088fa..6d2e772f7 100644 --- a/src/tests/vpicio_old.c +++ b/src/tests/vpicio_old.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_v2.c b/src/tests/vpicio_v2.c index 89839352b..f0ac26f9a 100644 --- a/src/tests/vpicio_v2.c +++ b/src/tests/vpicio_v2.c @@ -65,18 +65,18 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; + float *x, *y, *z; + float *px, *py, *pz; + int *id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; uint64_t numparticles, i; uint64_t dims[1]; int ndim = 1; - uint64_t * offset; - uint64_t * offset_remote; - uint64_t * mysize; + uint64_t *offset; + uint64_t *offset_remote; + uint64_t *mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/write_obj_shared.c b/src/tests/write_obj_shared.c index d8796bb61..11b274035 100644 --- a/src/tests/write_obj_shared.c +++ b/src/tests/write_obj_shared.c @@ -39,7 +39,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char * mydata, *obj_data; + char *mydata, *obj_data; char obj_name[128], cont_name[128]; uint64_t my_data_size; From c1eacbcda1f856526e5d050766d02f23b72e207f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 27 Aug 2024 01:20:57 +0000 Subject: [PATCH 15/23] Committing clang-format changes --- src/api/include/pdc_client_connect.h | 22 +- .../pdc_analysis_and_transforms_common.h | 10 +- src/api/pdc_analysis/pdc_analysis.c | 34 +-- .../pdc_analysis_and_transforms_connect.c | 12 +- src/api/pdc_analysis/pdc_analysis_common.c | 12 +- src/api/pdc_analysis/pdc_hist_pkg.c | 4 +- src/api/pdc_client_connect.c | 210 ++++++++-------- src/api/pdc_obj/include/pdc_cont.h | 2 +- src/api/pdc_obj/include/pdc_cont_pkg.h | 2 +- src/api/pdc_obj/include/pdc_obj_pkg.h | 10 +- src/api/pdc_obj/include/pdc_prop.h | 2 +- src/api/pdc_obj/include/pdc_prop_pkg.h | 12 +- src/api/pdc_obj/pdc_cont.c | 16 +- src/api/pdc_obj/pdc_mpi.c | 6 +- src/api/pdc_obj/pdc_obj.c | 40 +-- src/api/pdc_obj/pdc_prop.c | 16 +- src/api/pdc_query/include/pdc_query.h | 24 +- src/api/pdc_query/pdc_query.c | 4 +- src/api/pdc_region/include/pdc_region.h | 6 +- src/api/pdc_region/pdc_region.c | 20 +- src/api/pdc_region/pdc_region_transfer.c | 56 ++--- .../include/pdc_transforms_pkg.h | 4 +- src/api/pdc_transform/pdc_transform.c | 44 ++-- src/api/pdc_transform/pdc_transforms_common.c | 2 +- src/server/dablooms/pdc_dablooms.c | 2 +- src/server/dablooms/pdc_dablooms.h | 8 +- src/server/include/pdc_client_server_common.h | 72 +++--- src/server/include/pdc_hash-table.h | 2 +- src/server/include/pdc_server_common.h | 8 +- src/server/include/pdc_server_metadata.h | 12 +- .../include/pdc_server_metadata_index.h | 10 +- src/server/pdc_client_server_common.c | 210 ++++++++-------- src/server/pdc_hash-table.c | 18 +- src/server/pdc_server.c | 60 ++--- .../pdc_server_analysis/pdc_server_analysis.c | 4 +- src/server/pdc_server_metadata.c | 86 +++---- src/server/pdc_server_metadata_index.c | 26 +- src/server/pdc_server_metadata_index_test.c | 2 +- .../include/pdc_server_data.h | 86 +++---- .../include/pdc_server_region_transfer.h | 12 +- .../pdc_server_region/pdc_server_data.c | 238 +++++++++--------- .../pdc_server_region_cache.c | 36 +-- .../pdc_server_region_request_handler.h | 30 +-- .../pdc_server_region_transfer.c | 8 +- ...dc_server_region_transfer_metadata_query.c | 38 +-- src/tests/bdcats.c | 6 +- src/tests/bdcats_old.c | 6 +- src/tests/bdcats_v2.c | 12 +- src/tests/blocked_lock.c | 2 +- src/tests/buf_map_mpi_v2.c | 2 +- src/tests/buf_obj_map_mpi.c | 4 +- src/tests/client_server.c | 2 +- src/tests/cont_add_del.c | 2 +- src/tests/create_obj_scale.c | 2 +- src/tests/dart_algo_sim.c | 4 +- src/tests/dart_func_test.c | 12 +- src/tests/data_rw_test.c | 18 +- src/tests/data_server_meta.c | 2 +- src/tests/data_server_meta_test.c | 6 +- src/tests/data_server_read.c | 4 +- src/tests/data_server_read_vpic.c | 6 +- src/tests/data_server_read_vpic_multits.c | 4 +- src/tests/data_server_read_vpic_spatial.c | 6 +- .../data_server_read_vpic_spatial_multits.c | 4 +- src/tests/data_server_write.c | 6 +- src/tests/data_server_write_vpic.c | 4 +- src/tests/data_server_write_vpic_multits.c | 4 +- src/tests/delete_obj.c | 4 +- src/tests/delete_obj_scale.c | 4 +- src/tests/gen_fastbit_idx.c | 4 +- src/tests/hash_table.c | 4 +- src/tests/helper/julia_helper_loader.c | 10 +- src/tests/import_vpic.c | 8 +- src/tests/kvtag_add_get.c | 4 +- src/tests/kvtag_add_get_benchmark.c | 6 +- src/tests/kvtag_add_get_scale.c | 4 +- src/tests/kvtag_get.c | 2 +- src/tests/kvtag_query.c | 4 +- src/tests/kvtag_query_mpi.c | 4 +- src/tests/kvtag_query_scale.c | 4 +- src/tests/kvtag_query_scale_col.c | 16 +- src/tests/list_all.c | 4 +- src/tests/obj_buf.c | 2 +- src/tests/obj_iter.c | 2 +- src/tests/obj_map.c | 4 +- src/tests/obj_transformation.c | 12 +- src/tests/pdc_transforms_lib.c | 6 +- src/tests/query_data.c | 8 +- src/tests/query_metadata_agg.c | 2 +- src/tests/query_vpic.c | 2 +- src/tests/query_vpic_bin_sds1_nopreload.c | 4 +- src/tests/query_vpic_bin_sds1_preload.c | 2 +- src/tests/query_vpic_bin_sds_nopreload.c | 2 +- src/tests/query_vpic_bin_sds_preload.c | 2 +- src/tests/query_vpic_create_data.c | 6 +- src/tests/query_vpic_exyz_nopreload.c | 4 +- src/tests/query_vpic_exyz_preload.c | 2 +- src/tests/query_vpic_multi.c | 4 +- src/tests/query_vpic_multi_nopreload.c | 4 +- src/tests/query_vpic_multi_nopreload1.c | 4 +- src/tests/query_vpic_multi_preload.c | 4 +- src/tests/read_obj.c | 4 +- src/tests/read_obj_shared.c | 4 +- src/tests/search_obj.c | 12 +- src/tests/search_obj_scale.c | 4 +- src/tests/stat_obj.c | 12 +- src/tests/update_obj.c | 12 +- src/tests/vpicio.c | 6 +- src/tests/vpicio_mts.c | 6 +- src/tests/vpicio_mts_all.c | 4 +- src/tests/vpicio_old.c | 6 +- src/tests/vpicio_v2.c | 12 +- src/tests/write_obj_shared.c | 2 +- 113 files changed, 949 insertions(+), 949 deletions(-) diff --git a/src/api/include/pdc_client_connect.h b/src/api/include/pdc_client_connect.h index 8ba5949b6..52208588b 100644 --- a/src/api/include/pdc_client_connect.h +++ b/src/api/include/pdc_client_connect.h @@ -60,23 +60,23 @@ struct _pdc_client_lookup_args { uint32_t client_id; int ret; int is_init; - char *ret_string; - char *client_addr; + char * ret_string; + char * client_addr; uint32_t user_id; - const char *app_name; + const char * app_name; int time_step; uint32_t hash_value; - const char *tags; + const char * tags; hg_request_t *request; }; struct _pdc_client_transform_args { size_t size; - void *data; - void *transform_result; + void * data; + void * transform_result; struct _pdc_region_transform_ftn_info *this_transform; - struct pdc_region_info *region_info; + struct pdc_region_info * region_info; int type_extent; int transform_state; int ret; @@ -148,8 +148,8 @@ struct _pdc_query_result_list { int query_id; uint64_t nhits; uint64_t *coords; - void *data; - void **data_arr; + void * data; + void ** data_arr; uint64_t *data_arr_size; uint64_t recv_data_nhits; @@ -187,8 +187,8 @@ struct client_genetic_lookup_args { struct _dart_perform_one_thread_param { int server_id; dart_perform_one_server_in_t *dart_in; - uint64_t **dart_out; - size_t *dart_out_size; + uint64_t ** dart_out; + size_t * dart_out_size; }; #define PDC_CLIENT_DATA_SERVER() ((pdc_client_mpi_rank_g / pdc_nclient_per_server_g) % pdc_server_num_g) diff --git a/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h b/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h index 2c6cca1e0..79ccbf3db 100644 --- a/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h +++ b/src/api/pdc_analysis/include/pdc_analysis_and_transforms_common.h @@ -47,7 +47,7 @@ struct _pdc_region_analysis_ftn_info { int client_id; int ftn_lastResult; _pdc_analysis_language_t lang; - void *data; + void * data; }; /* @@ -85,9 +85,9 @@ struct _pdc_region_analysis_ftn_info { */ struct _pdc_iterator_info { - void *srcStart; /**** Constant that points to the data buffer */ - void *srcNext; /**** Updated data pointer for each iteration */ - void *copy_region; /* Normally unused (see special cases) */ + void * srcStart; /**** Constant that points to the data buffer */ + void * srcNext; /**** Updated data pointer for each iteration */ + void * copy_region; /* Normally unused (see special cases) */ size_t sliceCount; /**** Total # of slices to return */ size_t sliceNext; /* Current count that we are going to return */ size_t sliceResetCount; /* For 3d, when to recalculate 'srcNext' */ @@ -118,7 +118,7 @@ struct _pdc_iterator_info { struct _pdc_my_rpc_state { hg_int64_t value; hg_size_t size; - void *buffer; + void * buffer; hg_bulk_t bulk_handle; hg_handle_t handle; }; diff --git a/src/api/pdc_analysis/pdc_analysis.c b/src/api/pdc_analysis/pdc_analysis.c index 086541627..0add84746 100644 --- a/src/api/pdc_analysis/pdc_analysis.c +++ b/src/api/pdc_analysis/pdc_analysis.c @@ -62,7 +62,7 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator int ret_value = 0; int k, d_offset; size_t i, element_size = 0; - char *data = NULL; + char * data = NULL; size_t sliceCount = 1; size_t elementsPerSlice = 1; size_t elementsPerBlock; @@ -71,8 +71,8 @@ iterator_init(pdcid_t objectId, pdcid_t reg_id, int blocks, struct _pdc_iterator size_t skipCount = 0; size_t totalElements; struct pdc_region_info *region_info = NULL; - struct _pdc_obj_info *object_info = PDC_obj_get_info(objectId); - struct _pdc_obj_prop *obj_prop_ptr; + struct _pdc_obj_info * object_info = PDC_obj_get_info(objectId); + struct _pdc_obj_prop * obj_prop_ptr; FUNC_ENTER(NULL); @@ -308,7 +308,7 @@ PDCobj_data_iter_create(pdcid_t obj_id, pdcid_t reg_id) char * PDC_get_argv0_() { - char *ret_value = NULL; + char * ret_value = NULL; static char *_argv0 = NULL; char fullPath[PATH_MAX] = { 0, @@ -317,9 +317,9 @@ PDC_get_argv0_() 0, }; pid_t mypid = getpid(); - char *next; - char *procpath = NULL; - FILE *shellcmd = NULL; + char * next; + char * procpath = NULL; + FILE * shellcmd = NULL; size_t cmdLength; FUNC_ENTER(NULL); @@ -415,18 +415,18 @@ perr_t PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut) { perr_t ret_value = SUCCEED; /* Return value */ - void *ftnHandle = NULL; + void * ftnHandle = NULL; int (*ftnPtr)(pdcid_t, pdcid_t) = NULL; struct _pdc_region_analysis_ftn_info *thisFtn = NULL; - struct _pdc_iterator_info *i_in = NULL, *i_out = NULL; + struct _pdc_iterator_info * i_in = NULL, *i_out = NULL; pdcid_t meta_id_in = 0, meta_id_out = 0; pdcid_t local_id_in = 0, local_id_out = 0; - char *thisApp = NULL; - char *colonsep = NULL; - char *analyislibrary = NULL; - char *applicationDir = NULL; - char *userdefinedftn = NULL; - char *loadpath = NULL; + char * thisApp = NULL; + char * colonsep = NULL; + char * analyislibrary = NULL; + char * applicationDir = NULL; + char * userdefinedftn = NULL; + char * loadpath = NULL; FUNC_ENTER(NULL); @@ -537,8 +537,8 @@ PDCobj_data_getNextBlock(pdcid_t iter, void **nextBlock, size_t *dims) size_t ret_value = 0; struct _pdc_iterator_info *thisIter = NULL; size_t current_total, remaining, offset; - struct _pdc_obj_info *object_info; - struct _pdc_obj_prop *obj_prop_ptr; + struct _pdc_obj_info * object_info; + struct _pdc_obj_prop * obj_prop_ptr; FUNC_ENTER(NULL); diff --git a/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c b/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c index 7c5713725..4fd664e4c 100644 --- a/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c +++ b/src/api/pdc_analysis/pdc_analysis_and_transforms_connect.c @@ -27,7 +27,7 @@ #include "pdc_analysis_pkg.h" #include "pdc_transforms_common.h" -static hg_context_t *send_context_g = NULL; +static hg_context_t * send_context_g = NULL; static hg_atomic_int32_t *atomic_work_todo_g = NULL; /* Forward References:: */ @@ -51,12 +51,12 @@ PDC_Client_send_iter_recv_id(pdcid_t iter_id, pdcid_t *meta_id) { uint64_t ret_value = SUCCEED; struct _pdc_iterator_info *thisIter = NULL; - struct _pdc_my_rpc_state *my_rpc_state_p; + struct _pdc_my_rpc_state * my_rpc_state_p; obj_data_iterator_in_t in; hg_return_t hg_ret; int server_id = 0; int n_retry = 0; - struct _pdc_obj_info *object_info; + struct _pdc_obj_info * object_info; FUNC_ENTER(NULL); if (atomic_work_todo_g == NULL) { @@ -172,11 +172,11 @@ PDC_Client_register_obj_analysis(struct _pdc_region_analysis_ftn_info *thisFtn, uint32_t server_id = 0; hg_return_t hg_ret; analysis_ftn_in_t in; - struct _pdc_my_rpc_state *my_rpc_state_p; + struct _pdc_my_rpc_state * my_rpc_state_p; struct _pdc_iterator_info *thisIter; int n_retry = 0; int input_server = -1, output_server = -1; - struct _pdc_obj_info *obj_prop; + struct _pdc_obj_info * obj_prop; FUNC_ENTER(NULL); if (atomic_work_todo_g == NULL) { @@ -293,7 +293,7 @@ PDC_Client_register_region_transform(const char *func, const char *loadpath, uint32_t server_id = 0; hg_return_t hg_ret; transform_ftn_in_t in; - struct _pdc_obj_info *object_info = NULL; + struct _pdc_obj_info * object_info = NULL; struct _pdc_my_rpc_state *my_rpc_state_p; FUNC_ENTER(NULL); diff --git a/src/api/pdc_analysis/pdc_analysis_common.c b/src/api/pdc_analysis/pdc_analysis_common.c index 1cc51825e..e04a8d6a7 100644 --- a/src/api/pdc_analysis/pdc_analysis_common.c +++ b/src/api/pdc_analysis/pdc_analysis_common.c @@ -40,7 +40,7 @@ size_t analysis_registry_size = 0; size_t transform_registry_size = 0; hg_atomic_int32_t registered_transform_ftn_count_g; -int *i_cache_freed = NULL; +int * i_cache_freed = NULL; size_t iterator_cache_entries = CACHE_SIZE; hg_atomic_int32_t i_cache_index; hg_atomic_int32_t i_free_index; @@ -56,7 +56,7 @@ compare_gt(int *a, int b) { return (*a) > (b); } -struct _pdc_region_analysis_ftn_info **pdc_region_analysis_registry = NULL; +struct _pdc_region_analysis_ftn_info ** pdc_region_analysis_registry = NULL; struct _pdc_region_transform_ftn_info **pdc_region_transform_registry = NULL; #ifndef IS_PDC_SERVER @@ -242,7 +242,7 @@ PDCiter_get_nextId(void) { int ret_value = 0; size_t nextId = 0; - int *previous_i_cache_freed = 0; + int * previous_i_cache_freed = 0; int next_free = 0; struct _pdc_iterator_info *previous_state; @@ -422,8 +422,8 @@ PDC_get_ftnPtr_(const char *ftn, const char *loadpath, void **ftnPtr) { int ret_value = 0; static void *appHandle = NULL; - void *ftnHandle = NULL; - char *this_error = NULL; + void * ftnHandle = NULL; + char * this_error = NULL; FUNC_ENTER(NULL); @@ -456,7 +456,7 @@ HG_TEST_RPC_CB(analysis_ftn, handle) int nulliter_count = 0; pdcid_t iterIn = -1, iterOut = -1; pdcid_t registrationId = -1; - void *ftnHandle = NULL; + void * ftnHandle = NULL; int (*ftnPtr)(pdcid_t, pdcid_t) = NULL; int result; diff --git a/src/api/pdc_analysis/pdc_hist_pkg.c b/src/api/pdc_analysis/pdc_hist_pkg.c index 4551967bf..75343a144 100644 --- a/src/api/pdc_analysis/pdc_hist_pkg.c +++ b/src/api/pdc_analysis/pdc_hist_pkg.c @@ -5,7 +5,7 @@ #define MACRO_SAMPLE_MIN_MAX(TYPE, n, data, sample_pct, min, max) \ ({ \ uint64_t i, sample_n, iter = 0; \ - TYPE *ldata = (TYPE *)data; \ + TYPE * ldata = (TYPE *)data; \ (min) = ldata[0]; \ (max) = ldata[0]; \ sample_n = (n) * (sample_pct); \ @@ -161,7 +161,7 @@ PDC_create_hist(pdc_var_type_t dtype, int nbin, double min, double max) ({ \ uint64_t i; \ int lo, mid = 0, hi; \ - TYPE *ldata = (TYPE *)(_data); \ + TYPE * ldata = (TYPE *)(_data); \ if ((hist)->incr > 0) { \ for (i = 0; i < (n); i++) { \ if (ldata[i] < (hist)->range[1]) { \ diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 5d1becc1b..967921b6f 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -93,7 +93,7 @@ int pdc_nclient_per_server_g = 0; char pdc_client_tmp_dir_g[ADDR_MAX]; struct _pdc_server_info *pdc_server_info_g = NULL; -static int *debug_server_id_count = NULL; +static int * debug_server_id_count = NULL; int pdc_io_request_seq_id = PDC_SEQ_ID_INIT_VALUE; struct pdc_request *pdc_io_request_list_g = NULL; @@ -109,7 +109,7 @@ int nread_bb_g = 0; double read_bb_size_g = 0.0; static int mercury_has_init_g = 0; -static hg_class_t *send_class_g = NULL; +static hg_class_t * send_class_g = NULL; static hg_context_t *send_context_g = NULL; int query_id_g = 0; @@ -124,7 +124,7 @@ static hg_atomic_int32_t response_done_g; hg_atomic_int32_t bulk_transfer_done_g; // global variables for DART -static DART *dart_g; +static DART * dart_g; static dart_hash_algo_t dart_hash_algo_g = DART_HASH; static dart_object_ref_type_t dart_obj_ref_type_g = REF_PRIMARY_ID; @@ -403,8 +403,8 @@ PDC_Client_read_server_addr_from_file() perr_t ret_value = SUCCEED; int max_tries = 9, sleeptime = 1; int i = 0, is_server_ready = 0; - char *p; - FILE *na_config = NULL; + char * p; + FILE * na_config = NULL; char config_fname[PATH_MAX]; char n_server_string[PATH_MAX]; @@ -486,7 +486,7 @@ client_send_flush_obj_all_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; flush_obj_all_out_t output; - int *rpc_return; + int * rpc_return; FUNC_ENTER(NULL); @@ -543,7 +543,7 @@ client_send_flush_obj_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; flush_obj_out_t output; - int *rpc_return; + int * rpc_return; FUNC_ENTER(NULL); @@ -572,7 +572,7 @@ client_send_close_all_server_rpc_cb(const struct hg_cb_info *callback_info) hg_return_t ret_value = HG_SUCCESS; hg_handle_t handle; close_server_out_t output; - int *rpc_return; + int * rpc_return; FUNC_ENTER(NULL); @@ -963,7 +963,7 @@ PDC_Client_lookup_server(int server_id, int is_init) hg_return_t hg_ret; struct _pdc_client_lookup_args lookup_args; char self_addr[ADDR_MAX]; - char *target_addr_string; + char * target_addr_string; FUNC_ENTER(NULL); @@ -1239,14 +1239,14 @@ hg_test_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args; hg_bulk_t local_bulk_handle; uint32_t i; - void *buf = NULL; - void **ids_buf; + void * buf = NULL; + void ** ids_buf; uint32_t n_meta; uint64_t buf_sizes[2] = {0, 0}; - uint64_t *ids_buf_sizes; + uint64_t * ids_buf_sizes; uint32_t actual_cnt; - pdc_metadata_t *meta_ptr; - uint64_t *u64_arr_ptr; + pdc_metadata_t * meta_ptr; + uint64_t * u64_arr_ptr; uint32_t bulk_sgnum; FUNC_ENTER(NULL); @@ -1349,7 +1349,7 @@ PDC_Client_check_bulk(hg_context_t *hg_context) static const char * drc_strerror(int errnum) { - char *ret_value = NULL; + char * ret_value = NULL; const char *errstring = "UNDEFINED"; FUNC_ENTER(NULL); @@ -1387,13 +1387,13 @@ PDC_Client_mercury_init(hg_class_t **hg_class, hg_context_t **hg_context, int po * "cci+tcp" */ struct hg_init_info init_info = {0}; - char *default_hg_transport = "ofi+tcp"; - char *hg_transport; + char * default_hg_transport = "ofi+tcp"; + char * hg_transport; #ifdef PDC_HAS_CRAY_DRC uint32_t credential, cookie; drc_info_handle_t credential_info; char pdc_auth_key[256] = {'\0'}; - char *auth_key; + char * auth_key; int rc; #endif @@ -1587,7 +1587,7 @@ PDC_Client_init() { perr_t ret_value = SUCCEED; pdc_server_info_g = NULL; - char *tmp_dir; + char * tmp_dir; uint32_t port; int is_mpi_init = 0; @@ -1793,16 +1793,16 @@ static hg_return_t metadata_query_bulk_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t *client_lookup_args; + struct bulk_args_t * client_lookup_args; hg_handle_t handle; metadata_query_transfer_out_t output; uint32_t n_meta; hg_op_id_t hg_bulk_op_id; hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; - const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args; - void *recv_meta; + const struct hg_info * hg_info = NULL; + struct bulk_args_t * bulk_args; + void * recv_meta; FUNC_ENTER(NULL); @@ -2212,7 +2212,7 @@ PDC_Client_add_tag(pdcid_t obj_id, const char *tag) hg_handle_t metadata_add_tag_handle; uint64_t meta_id; uint32_t server_id; - struct _pdc_obj_info *obj_prop; + struct _pdc_obj_info * obj_prop; struct _pdc_client_lookup_args lookup_args; metadata_add_tag_in_t in; @@ -2433,7 +2433,7 @@ PDC_Client_delete_metadata(char *delete_name, pdcid_t obj_delete_prop) { perr_t ret_value = SUCCEED; hg_return_t hg_ret = 0; - struct _pdc_obj_prop *delete_prop; + struct _pdc_obj_prop * delete_prop; metadata_delete_in_t in; int hash_name_value; uint32_t server_id; @@ -2493,7 +2493,7 @@ PDC_Client_query_metadata_name_only(const char *obj_name, pdc_metadata_t **out) struct _pdc_metadata_query_args **lookup_args; uint32_t server_id; uint32_t i, count = 0; - hg_handle_t *metadata_query_handle; + hg_handle_t * metadata_query_handle; FUNC_ENTER(NULL); @@ -2835,7 +2835,7 @@ PDC_Client_send_name_recv_id(const char *obj_name, uint64_t cont_id, pdcid_t obj perr_t ret_value = SUCCEED; hg_return_t hg_ret; uint32_t server_id = 0; - struct _pdc_obj_prop *create_prop = NULL; + struct _pdc_obj_prop * create_prop = NULL; gen_obj_id_in_t in; uint32_t hash_name_value; struct _pdc_client_lookup_args lookup_args; @@ -2994,7 +2994,7 @@ PDC_Client_close_all_server() if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "PDC_Client_close_all_server(): Could not destroy handle"); } // End pdc_client_mpi_rank_g < pdc_server_num_g - } // End pdc_client_mpi_size_g >= pdc_server_num_g + } // End pdc_client_mpi_size_g >= pdc_server_num_g else { if (pdc_client_mpi_rank_g == 0) { for (i = 0; i < (uint32_t)pdc_server_num_g; i++) { @@ -3023,7 +3023,7 @@ PDC_Client_close_all_server() PGOTO_ERROR(FAIL, "PDC_Client_close_all_server(): Could not destroy handle"); } } // End of mpi_rank == 0 - } // End pdc_client_mpi_size_g < pdc_server_num_g + } // End pdc_client_mpi_size_g < pdc_server_num_g #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); @@ -3221,7 +3221,7 @@ PDC_Client_transfer_request_all(int n_objs, pdc_access_t access_type, uint32_t d perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_all_in_t in; - hg_class_t *hg_class; + hg_class_t * hg_class; int i; hg_handle_t client_send_transfer_request_all_handle; struct _pdc_transfer_request_all_args transfer_args; @@ -3356,7 +3356,7 @@ PDC_Client_transfer_request_metadata_query2(char *buf, uint64_t total_buf_size, perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_metadata_query2_in_t in; - hg_class_t *hg_class; + hg_class_t * hg_class; hg_handle_t client_send_transfer_request_metadata_query2_handle; struct _pdc_transfer_request_metadata_query2_args transfer_args; @@ -3424,7 +3424,7 @@ PDC_Client_transfer_request_metadata_query(char *buf, uint64_t total_buf_size, i perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_metadata_query_in_t in; - hg_class_t *hg_class; + hg_class_t * hg_class; hg_handle_t client_send_transfer_request_metadata_query_handle; struct _pdc_transfer_request_metadata_query_args transfer_args; @@ -3493,7 +3493,7 @@ PDC_Client_transfer_request_wait_all(int n_objs, pdcid_t *transfer_request_id, u perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_wait_all_in_t in; - hg_class_t *hg_class; + hg_class_t * hg_class; hg_handle_t client_send_transfer_request_wait_all_handle; struct _pdc_transfer_request_wait_all_args transfer_args; char cur_time[64]; @@ -3576,7 +3576,7 @@ PDC_Client_transfer_request(void *buf, pdcid_t obj_id, uint32_t data_server_id, perr_t ret_value = SUCCEED; hg_return_t hg_ret = HG_SUCCESS; transfer_request_in_t in; - hg_class_t *hg_class; + hg_class_t * hg_class; uint32_t meta_server_id; hg_size_t total_data_size; int i; @@ -3826,12 +3826,12 @@ PDC_Client_buf_map(pdcid_t local_region_id, pdcid_t remote_obj_id, size_t ndim, hg_return_t hg_ret = HG_SUCCESS; buf_map_in_t in; uint32_t data_server_id, meta_server_id; - hg_class_t *hg_class; + hg_class_t * hg_class; hg_uint32_t i, j; hg_uint32_t local_count; - void **data_ptrs = NULL; - size_t *data_size = NULL; + void ** data_ptrs = NULL; + size_t * data_size = NULL; size_t unit, unit_to; struct _pdc_buf_map_args map_args; hg_handle_t client_send_buf_map_handle; @@ -4781,11 +4781,11 @@ PDC_Client_get_data_from_server_shm_cb(const struct hg_cb_info *callback_info) int shm_fd = -1; // file descriptor, from shm_open() uint32_t i = 0; - char *shm_base = NULL; // base address, from mmap() - char *shm_addr = NULL; + char * shm_base = NULL; // base address, from mmap() + char * shm_addr = NULL; uint64_t data_size = 1; - client_read_info_t *read_info = NULL; - struct pdc_request *elt = NULL; + client_read_info_t * read_info = NULL; + struct pdc_request * elt = NULL; struct pdc_region_info *target_region = NULL; #ifdef ENABLE_TIMING struct timeval pdc_timer_start; @@ -4877,8 +4877,8 @@ PDC_Client_data_server_read_check(int server_id, uint32_t client_id, pdc_metadat uint64_t read_size = 1; hg_handle_t data_server_read_check_handle; int shm_fd; // file descriptor, from shm_open() - char *shm_base; // base address, from mmap() - char *shm_addr; + char * shm_base; // base address, from mmap() + char * shm_addr; #ifdef ENABLE_TIMING struct timeval pdc_timer_start; struct timeval pdc_timer_end; @@ -5013,8 +5013,8 @@ PDC_Client_data_server_read(struct pdc_request *request) data_server_read_in_t in; hg_handle_t data_server_read_handle; int server_id, n_client, n_update; - pdc_metadata_t *meta; - struct pdc_region_info *region; + pdc_metadata_t * meta; + struct pdc_region_info * region; FUNC_ENTER(NULL); @@ -5146,8 +5146,8 @@ PDC_Client_data_server_write_check(struct pdc_request *request, int *status) data_server_write_check_in_t in; hg_handle_t data_server_write_check_handle; int server_id; - pdc_metadata_t *meta; - struct pdc_region_info *region; + pdc_metadata_t * meta; + struct pdc_region_info * region; uint64_t write_size = 1; uint32_t i; @@ -5248,9 +5248,9 @@ PDC_Client_data_server_write(struct pdc_request *request) int server_ret; hg_handle_t data_server_write_handle; int server_id, n_client, n_update; - pdc_metadata_t *meta; - struct pdc_region_info *region; - void *buf; + pdc_metadata_t * meta; + struct pdc_region_info * region; + void * buf; int rnd; #ifdef ENABLE_TIMING @@ -5519,7 +5519,7 @@ PDC_Client_write_id(pdcid_t local_obj_id, struct pdc_region_info *region, void * struct _pdc_id_info *info; struct _pdc_obj_info *object; - pdc_metadata_t *meta; + pdc_metadata_t * meta; perr_t ret_value = SUCCEED; FUNC_ENTER(NULL); @@ -5750,7 +5750,7 @@ PDC_Client_add_objects_to_container(int nobj, pdcid_t *local_obj_ids, pdcid_t lo { perr_t ret_value = SUCCEED; int i; - uint64_t *obj_ids; + uint64_t * obj_ids; uint64_t cont_meta_id; struct _pdc_id_info *id_info = NULL; @@ -5776,7 +5776,7 @@ PDC_Client_del_objects_to_container(int nobj, pdcid_t *local_obj_ids, pdcid_t lo { perr_t ret_value = SUCCEED; int i; - uint64_t *obj_ids; + uint64_t * obj_ids; uint64_t cont_meta_id; struct _pdc_id_info *id_info = NULL; @@ -5804,7 +5804,7 @@ PDC_Client_add_tags_to_container(pdcid_t cont_id, char *tags) hg_return_t hg_ret = HG_SUCCESS; hg_handle_t rpc_handle; uint32_t server_id; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_cont_info *object; uint64_t cont_meta_id; cont_add_tags_rpc_in_t add_tag_rpc_in; @@ -6059,12 +6059,12 @@ PDC_Client_query_name_read_entire_obj(int nobj, char **obj_names, void ***out_bu hg_handle_t rpc_handle; hg_bulk_t bulk_handle; uint32_t server_id; - uint64_t *buf_sizes, total_size; + uint64_t * buf_sizes, total_size; int i; query_read_obj_name_in_t bulk_rpc_in; // Reuse the existing args structure update_region_storage_meta_bulk_args_t cb_args; - struct pdc_request *request; + struct pdc_request * request; FUNC_ENTER(NULL); @@ -6382,7 +6382,7 @@ static region_list_t * PDC_get_storage_meta_from_io_list(pdc_data_server_io_list_t **list, region_storage_meta_t *storage_meta) { pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; - region_list_t *ret_value = NULL; + region_list_t * ret_value = NULL; FUNC_ENTER(NULL); @@ -6408,7 +6408,7 @@ PDC_add_storage_meta_to_io_list(pdc_data_server_io_list_t **list, region_storage { pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; - region_list_t *new_region; + region_list_t * new_region; int j; perr_t ret_value = SUCCEED; @@ -6475,7 +6475,7 @@ PDC_send_region_storage_meta_shm(uint32_t server_id, int n, region_storage_meta_ buf_sizes = n * sizeof(region_storage_meta_t); hg_ret = HG_Bulk_create(send_class_g, 1, (void **)&storage_meta, (const hg_size_t *)&buf_sizes, - HG_BULK_READ_ONLY, &bulk_handle); + HG_BULK_READ_ONLY, &bulk_handle); if (hg_ret != HG_SUCCESS) PGOTO_ERROR(FAIL, "Could not create bulk data handle"); @@ -6508,7 +6508,7 @@ PDC_Client_cp_data_to_local_server(int nobj, region_storage_meta_t **all_storage perr_t ret_value = SUCCEED; uint32_t ndim, server_id; uint64_t total_size = 0, cp_loc = 0; - void *buf = NULL; + void * buf = NULL; char shm_addr[ADDR_MAX]; int i, *total_obj = NULL, ntotal_obj = nobj, *recvcounts = NULL, *displs = NULL; region_storage_meta_t *all_region_storage_meta_1d = NULL, *my_region_storage_meta_1d = NULL; @@ -6620,8 +6620,8 @@ PDC_Client_read_with_storage_meta(int nobj, region_storage_meta_t **all_storage_ { perr_t ret_value = SUCCEED; int i; - char *fname, *prev_fname; - FILE *fp_read = NULL; + char * fname, *prev_fname; + FILE * fp_read = NULL; uint32_t ndim; uint64_t req_start, req_count, storage_start, storage_count, file_offset, buf_size; size_t read_bytes; @@ -6725,15 +6725,15 @@ PDC_Client_query_multi_storage_info(int nobj, char **obj_names, region_storage_m hg_bulk_t bulk_handle; uint32_t server_id; - uint64_t *buf_sizes = NULL, total_size; + uint64_t * buf_sizes = NULL, total_size; int i, j, loc, iter, *n_obj_name_by_server = NULL; - int **obj_names_server_seq_mapping = NULL, *obj_names_server_seq_mapping_1d; + int ** obj_names_server_seq_mapping = NULL, *obj_names_server_seq_mapping_1d; int send_n_request = 0; - char ***obj_names_by_server = NULL; - char **obj_names_by_server_2d = NULL; + char *** obj_names_by_server = NULL; + char ** obj_names_by_server_2d = NULL; query_read_obj_name_in_t bulk_rpc_in; update_region_storage_meta_bulk_args_t cb_args; - struct pdc_request **requests, *request; + struct pdc_request ** requests, *request; FUNC_ENTER(NULL); @@ -6957,12 +6957,12 @@ PDC_Client_query_name_read_entire_obj_client_agg(int my_nobj, char **my_obj_name size_t *out_buf_sizes) { perr_t ret_value = SUCCEED; - char **all_names = my_obj_names; - char *local_names_1d, *all_names_1d = NULL; - int *total_obj = NULL, i, ntotal_obj = my_nobj, *recvcounts = NULL, *displs = NULL; + char ** all_names = my_obj_names; + char * local_names_1d, *all_names_1d = NULL; + int * total_obj = NULL, i, ntotal_obj = my_nobj, *recvcounts = NULL, *displs = NULL; size_t max_name_len = 64; region_storage_meta_t **all_storage_meta = NULL, **my_storage_meta = NULL; - region_storage_meta_t *my_storage_meta_1d = NULL, *res_storage_meta_1d = NULL; + region_storage_meta_t * my_storage_meta_1d = NULL, *res_storage_meta_1d = NULL; #ifdef ENABLE_TIMING struct timeval pdc_timer1; @@ -7252,7 +7252,7 @@ PDC_Client_read_overlap_regions(uint32_t ndim, uint64_t *req_start, uint64_t *re *total_read_bytes += read_bytes; } // for each row - } // ndim=2 + } // ndim=2 else if (ndim == 3) { if (is_client_debug_g == 1) { @@ -7323,8 +7323,8 @@ PDC_add_kvtag(pdcid_t obj_id, pdc_kvtag_t *kvtag, int is_cont) uint32_t server_id; hg_handle_t metadata_add_kvtag_handle; metadata_add_kvtag_in_t in; - struct _pdc_obj_info *obj_prop; - struct _pdc_cont_info *cont_prop; + struct _pdc_obj_info * obj_prop; + struct _pdc_cont_info * cont_prop; struct _pdc_client_lookup_args lookup_args; FUNC_ENTER(NULL); @@ -7432,8 +7432,8 @@ PDC_get_kvtag(pdcid_t obj_id, char *tag_name, pdc_kvtag_t **kvtag, int is_cont) hg_handle_t metadata_get_kvtag_handle; metadata_get_kvtag_in_t in; struct _pdc_get_kvtag_args lookup_args; - struct _pdc_obj_info *obj_prop; - struct _pdc_cont_info *cont_prop; + struct _pdc_obj_info * obj_prop; + struct _pdc_cont_info * cont_prop; FUNC_ENTER(NULL); @@ -7493,12 +7493,12 @@ kvtag_query_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_bulk_t origin_bulk_handle = hg_cb_info->info.bulk.origin_handle; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; uint32_t n_meta, actual_cnt; - void *buf = NULL; + void * buf = NULL; uint64_t buf_sizes[1]; uint32_t bulk_sgnum; - uint64_t *ids_buf_sizes; - void **ids_buf; - uint64_t *u64_arr_ptr; + uint64_t * ids_buf_sizes; + void ** ids_buf; + uint64_t * u64_arr_ptr; FUNC_ENTER(NULL); @@ -7551,14 +7551,14 @@ static hg_return_t kvtag_query_forward_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t *bulk_arg; + struct bulk_args_t * bulk_arg; hg_handle_t handle; metadata_query_transfer_out_t output; uint32_t n_meta; hg_op_id_t hg_bulk_op_id; hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; - const struct hg_info *hg_info = NULL; + const struct hg_info * hg_info = NULL; FUNC_ENTER(NULL); @@ -7736,8 +7736,8 @@ PDCtag_delete(pdcid_t obj_id, char *tag_name, int is_cont) uint32_t server_id; hg_handle_t metadata_del_kvtag_handle; metadata_get_kvtag_in_t in; - struct _pdc_obj_info *obj_prop; - struct _pdc_cont_info *cont_prop; + struct _pdc_obj_info * obj_prop; + struct _pdc_cont_info * cont_prop; struct _pdc_client_lookup_args lookup_args; FUNC_ENTER(NULL); @@ -7984,7 +7984,7 @@ PDCobj_put_data(const char *obj_name, void *data, uint64_t size, pdcid_t cont_id perr_t ret; // pdc_metadata_t *meta; struct _pdc_cont_info *info = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; pdcid_t transfer_request; FUNC_ENTER(NULL); @@ -8090,7 +8090,7 @@ PDC_Client_del_metadata(pdcid_t obj_id, int is_cont) { perr_t ret_value = SUCCEED; uint64_t meta_id; - struct _pdc_obj_info *obj_prop; + struct _pdc_obj_info * obj_prop; struct _pdc_cont_info *cont_prop; FUNC_ENTER(NULL); @@ -8223,7 +8223,7 @@ hg_return_t PDC_recv_nhits(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; - send_nhits_t *in = (send_nhits_t *)callback_info->arg; + send_nhits_t * in = (send_nhits_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; FUNC_ENTER(NULL); @@ -8252,10 +8252,10 @@ PDC_send_data_query(pdc_query_t *query, pdc_query_get_op_t get_op, uint64_t *nhi { perr_t ret_value = SUCCEED; hg_return_t hg_ret = 0; - uint32_t *target_servers = NULL; + uint32_t * target_servers = NULL; int i, server_id, next_server = 0, prev_server = 0, ntarget = 0; hg_handle_t handle; - pdc_query_xfer_t *query_xfer; + pdc_query_xfer_t * query_xfer; struct _pdc_client_lookup_args lookup_args; struct _pdc_query_result_list *result; @@ -8343,12 +8343,12 @@ PDC_recv_coords(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; uint64_t nhits = 0; uint32_t ndim; int query_id, origin; - void *buf; + void * buf; pdc_int_ret_t out; FUNC_ENTER(NULL); @@ -8429,7 +8429,7 @@ PDC_Client_get_sel_data(pdcid_t obj_id, pdc_selection_t *sel, void *data) uint64_t meta_id, off; get_sel_data_rpc_in_t in; struct _pdc_client_lookup_args lookup_args; - struct _pdc_obj_info *obj_prop; + struct _pdc_obj_info * obj_prop; struct _pdc_query_result_list *result_elt; FUNC_ENTER(NULL); @@ -8502,11 +8502,11 @@ PDC_recv_read_coords_data(const struct hg_cb_info *callback_info) { hg_return_t ret_value = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; struct _pdc_query_result_list *result_elt; uint64_t nhits = 0; int query_id, seq_id; - void *buf; + void * buf; pdc_int_ret_t out; FUNC_ENTER(NULL); @@ -8578,9 +8578,9 @@ report_avg_server_profiling_rst() { for (int i = 0; i < pdc_server_num_g; i++) { - double avg_srv_time = server_call_count_g[i] > 0 - ? (double)(server_time_total_g[i]) / (double)(server_call_count_g[i]) - : 0.0; + double avg_srv_time = server_call_count_g[i] > 0 + ? (double)(server_time_total_g[i]) / (double)(server_call_count_g[i]) + : 0.0; double srv_mem_usage = server_mem_usage_g[i] / 1024.0 / 1024.0; printf("==PDC_CLIENT[%d]: server %d, avg profiling time: %.4f ms, memory usage: %.4f MB\n", pdc_client_mpi_rank_g, i, avg_srv_time / 1000.0, srv_mem_usage); @@ -8725,7 +8725,7 @@ static hg_return_t dart_perform_one_server_on_receive_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; - struct bulk_args_t *client_lookup_args; + struct bulk_args_t * client_lookup_args; hg_handle_t handle; dart_perform_one_server_out_t output; uint32_t n_meta; @@ -8734,8 +8734,8 @@ dart_perform_one_server_on_receive_cb(const struct hg_cb_info *callback_info) hg_bulk_t local_bulk_handle = HG_BULK_NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args; - void *recv_meta; + struct bulk_args_t * bulk_args; + void * recv_meta; FUNC_ENTER(NULL); @@ -8901,7 +8901,7 @@ dart_perform_on_servers(index_hash_result_t **hash_result, int num_servers, { struct bulk_args_t *lookup_args = (struct bulk_args_t *)calloc(num_servers, sizeof(struct bulk_args_t)); uint64_t ret_value = 0; - hg_handle_t *dart_request_handles = (hg_handle_t *)calloc(num_servers, sizeof(hg_handle_t)); + hg_handle_t * dart_request_handles = (hg_handle_t *)calloc(num_servers, sizeof(hg_handle_t)); int num_requests = 0; uint32_t total_n_meta = 0; dart_op_type_t op_type = dart_in->op_type; @@ -8971,10 +8971,10 @@ PDC_Client_search_obj_ref_through_dart(dart_hash_algo_t hash_algo, char *query_s stopwatch_t timer; timer_start(&timer); - char *k_query = get_key(query_string, '='); - char *v_query = get_value(query_string, '='); - char *tok = NULL; - char *affix = NULL; + char * k_query = get_key(query_string, '='); + char * v_query = get_value(query_string, '='); + char * tok = NULL; + char * affix = NULL; dart_op_type_t dart_op; pattern_type_t dart_query_type = determine_pattern_type(k_query); diff --git a/src/api/pdc_obj/include/pdc_cont.h b/src/api/pdc_obj/include/pdc_cont.h index 5132e6184..33e924c14 100644 --- a/src/api/pdc_obj/include/pdc_cont.h +++ b/src/api/pdc_obj/include/pdc_cont.h @@ -33,7 +33,7 @@ typedef struct _pdc_id_info cont_handle; /* Library Public Struct */ /**************************/ struct pdc_cont_info { - char *name; + char * name; pdcid_t local_id; uint64_t meta_id; }; diff --git a/src/api/pdc_obj/include/pdc_cont_pkg.h b/src/api/pdc_obj/include/pdc_cont_pkg.h index f8d0a15d6..262192048 100644 --- a/src/api/pdc_obj/include/pdc_cont_pkg.h +++ b/src/api/pdc_obj/include/pdc_cont_pkg.h @@ -31,7 +31,7 @@ /* Library Private Struct */ /**************************/ struct _pdc_cont_info { - struct pdc_cont_info *cont_info_pub; + struct pdc_cont_info * cont_info_pub; struct _pdc_cont_prop *cont_pt; }; diff --git a/src/api/pdc_obj/include/pdc_obj_pkg.h b/src/api/pdc_obj/include/pdc_obj_pkg.h index adf0bc329..11effda8e 100644 --- a/src/api/pdc_obj/include/pdc_obj_pkg.h +++ b/src/api/pdc_obj/include/pdc_obj_pkg.h @@ -42,12 +42,12 @@ typedef struct pdc_local_transfer_request { } pdc_local_transfer_request; struct _pdc_obj_info { - struct pdc_obj_info *obj_info_pub; + struct pdc_obj_info * obj_info_pub; _pdc_obj_location_t location; - void *metadata; - struct _pdc_cont_info *cont; - struct _pdc_obj_prop *obj_pt; - struct region_map_list *region_list_head; + void * metadata; + struct _pdc_cont_info * cont; + struct _pdc_obj_prop * obj_pt; + struct region_map_list * region_list_head; pdc_local_transfer_request *local_transfer_request_head; pdc_local_transfer_request *local_transfer_request_end; int local_transfer_request_size; diff --git a/src/api/pdc_obj/include/pdc_prop.h b/src/api/pdc_obj/include/pdc_prop.h index fd714d1e5..0459e0283 100644 --- a/src/api/pdc_obj/include/pdc_prop.h +++ b/src/api/pdc_obj/include/pdc_prop.h @@ -34,7 +34,7 @@ struct pdc_obj_prop { pdcid_t obj_prop_id; size_t ndim; - uint64_t *dims; + uint64_t * dims; pdc_var_type_t type; pdc_region_partition_t region_partition; pdc_consistency_t consistency; diff --git a/src/api/pdc_obj/include/pdc_prop_pkg.h b/src/api/pdc_obj/include/pdc_prop_pkg.h index 823ce634b..16524314b 100644 --- a/src/api/pdc_obj/include/pdc_prop_pkg.h +++ b/src/api/pdc_obj/include/pdc_prop_pkg.h @@ -47,14 +47,14 @@ struct _pdc_transform_state { struct _pdc_obj_prop { struct pdc_obj_prop *obj_prop_pub; - struct _pdc_class *pdc; + struct _pdc_class * pdc; uint32_t user_id; - char *app_name; + char * app_name; uint32_t time_step; - char *data_loc; - char *tags; - void *buf; - pdc_kvtag_t *kvtag; + char * data_loc; + char * tags; + void * buf; + pdc_kvtag_t * kvtag; /* The following have been added to support of PDC analysis and transforms */ size_t type_extent; diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index 8370d5d54..4366c4156 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -57,7 +57,7 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id) perr_t ret = SUCCEED; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; FUNC_ENTER(NULL); @@ -106,7 +106,7 @@ PDCcont_create_col(const char *cont_name, pdcid_t cont_prop_id) perr_t ret = SUCCEED; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; FUNC_ENTER(NULL); @@ -152,7 +152,7 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id) pdcid_t ret_value = 0; struct _pdc_cont_info *p = NULL; struct _pdc_cont_prop *cont_prop = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; pdcid_t cont_prop_id; FUNC_ENTER(NULL); @@ -312,7 +312,7 @@ PDC_cont_get_info(pdcid_t cont_id) { struct _pdc_cont_info *ret_value = NULL; struct _pdc_cont_info *info = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; FUNC_ENTER(NULL); @@ -356,7 +356,7 @@ PDC_cont_get_info(pdcid_t cont_id) struct pdc_cont_info * PDCcont_get_info(const char *cont_name) { - struct pdc_cont_info *ret_value = NULL; + struct pdc_cont_info * ret_value = NULL; struct _pdc_cont_info *tmp = NULL; pdcid_t cont_id; @@ -380,8 +380,8 @@ PDCcont_get_info(const char *cont_name) cont_handle * PDCcont_iter_start() { - cont_handle *ret_value = NULL; - cont_handle *conthl = NULL; + cont_handle * ret_value = NULL; + cont_handle * conthl = NULL; struct PDC_id_type *type_ptr; FUNC_ENTER(NULL); @@ -431,7 +431,7 @@ PDCcont_iter_next(cont_handle *chandle) struct pdc_cont_info * PDCcont_iter_get_info(cont_handle *chandle) { - struct pdc_cont_info *ret_value = NULL; + struct pdc_cont_info * ret_value = NULL; struct _pdc_cont_info *info = NULL; FUNC_ENTER(NULL); diff --git a/src/api/pdc_obj/pdc_mpi.c b/src/api/pdc_obj/pdc_mpi.c index 063fd27ab..4db4d0479 100644 --- a/src/api/pdc_obj/pdc_mpi.c +++ b/src/api/pdc_obj/pdc_mpi.c @@ -34,7 +34,7 @@ PDCobj_create_mpi(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, in { pdcid_t ret_value = SUCCEED; struct _pdc_obj_info *p = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_id_info * id_info = NULL; int rank; FUNC_ENTER(NULL); @@ -63,7 +63,7 @@ perr_t PDCobj_encode(pdcid_t obj_id, pdcid_t *meta_id) { perr_t ret_value = FAIL; - struct _pdc_id_info *objinfo; + struct _pdc_id_info * objinfo; struct _pdc_obj_info *obj; int client_rank, client_size; @@ -93,7 +93,7 @@ pdcid_t PDCobj_decode(pdcid_t obj_id, pdcid_t meta_id) { pdcid_t ret_value = 0; - struct _pdc_id_info *objinfo; + struct _pdc_id_info * objinfo; struct _pdc_obj_info *obj; int client_rank, client_size; diff --git a/src/api/pdc_obj/pdc_obj.c b/src/api/pdc_obj/pdc_obj.c index 43e2a11c7..9b307e5fa 100644 --- a/src/api/pdc_obj/pdc_obj.c +++ b/src/api/pdc_obj/pdc_obj.c @@ -228,10 +228,10 @@ pdcid_t PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_obj_location_t location) { pdcid_t ret_value = 0; - struct _pdc_obj_info *p = NULL; - struct _pdc_id_info *id_info = NULL; + struct _pdc_obj_info * p = NULL; + struct _pdc_id_info * id_info = NULL; struct _pdc_cont_info *cont_info = NULL; - struct _pdc_obj_prop *obj_prop; + struct _pdc_obj_prop * obj_prop; uint64_t meta_id; uint32_t data_server_id, metadata_server_id; size_t i; @@ -391,7 +391,7 @@ perr_t PDC_obj_close(struct _pdc_obj_info *op) { perr_t ret_value = SUCCEED; - pdcid_t *transfer_request_id; + pdcid_t * transfer_request_id; pdc_local_transfer_request *temp, *previous; int i; @@ -530,7 +530,7 @@ PDCobj_open_common(const char *obj_name, pdcid_t pdc, int is_col) pdcid_t ret_value = 0; perr_t ret = SUCCEED; struct _pdc_obj_info *p = NULL; - pdc_metadata_t *out = NULL; + pdc_metadata_t * out = NULL; pdcid_t obj_prop; size_t i; uint32_t metadata_server_id; @@ -665,8 +665,8 @@ PDCobj_open_col(const char *obj_name, pdcid_t pdc) obj_handle * PDCobj_iter_start(pdcid_t cont_id) { - obj_handle *ret_value = NULL; - obj_handle *objhl = NULL; + obj_handle * ret_value = NULL; + obj_handle * objhl = NULL; struct PDC_id_type *type_ptr; FUNC_ENTER(NULL); @@ -728,7 +728,7 @@ PDCobj_iter_next(obj_handle *ohandle, pdcid_t cont_id) struct pdc_obj_info * PDCobj_iter_get_info(obj_handle *ohandle) { - struct pdc_obj_info *ret_value = NULL; + struct pdc_obj_info * ret_value = NULL; struct _pdc_obj_info *info = NULL; unsigned i; @@ -861,7 +861,7 @@ perr_t PDCprop_set_obj_dims(pdcid_t obj_prop, PDC_int_t ndim, uint64_t *dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -888,7 +888,7 @@ perr_t PDCprop_set_obj_type(pdcid_t obj_prop, pdc_var_type_t type) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -908,7 +908,7 @@ perr_t PDCprop_set_obj_transfer_region_type(pdcid_t obj_prop, pdc_region_partition_t region_partition) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -928,7 +928,7 @@ perr_t PDCprop_set_obj_consistency_semantics(pdcid_t obj_prop, pdc_consistency_t consistency) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -948,7 +948,7 @@ perr_t PDCprop_set_obj_buf(pdcid_t obj_prop, void *buf) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_prop *prop; FUNC_ENTER(NULL); @@ -968,7 +968,7 @@ perr_t PDCobj_set_dims(pdcid_t obj_id, int ndim, uint64_t *dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_info *object; int reset; @@ -1006,7 +1006,7 @@ perr_t PDCobj_get_dims(pdcid_t obj_id, int *ndim, uint64_t **dims) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info; + struct _pdc_id_info * info; struct _pdc_obj_info *object; FUNC_ENTER(NULL); @@ -1025,10 +1025,10 @@ PDCobj_get_dims(pdcid_t obj_id, int *ndim, uint64_t **dims) void ** PDCobj_buf_retrieve(pdcid_t obj_id) { - void **ret_value = NULL; - struct _pdc_id_info *info; + void ** ret_value = NULL; + struct _pdc_id_info * info; struct _pdc_obj_info *object; - void **buffer; + void ** buffer; FUNC_ENTER(NULL); info = PDC_find_id(obj_id); @@ -1048,7 +1048,7 @@ PDC_obj_get_info(pdcid_t obj_id) { struct _pdc_obj_info *ret_value = NULL; struct _pdc_obj_info *info = NULL; - struct _pdc_id_info *obj; + struct _pdc_id_info * obj; size_t i; FUNC_ENTER(NULL); @@ -1227,7 +1227,7 @@ PDC_free_obj_info(struct _pdc_obj_info *obj) struct pdc_obj_info * PDCobj_get_info(pdcid_t obj_id) { - struct pdc_obj_info *ret_value = NULL; + struct pdc_obj_info * ret_value = NULL; struct _pdc_obj_info *tmp = NULL; /* pdcid_t obj_id; */ diff --git a/src/api/pdc_obj/pdc_prop.c b/src/api/pdc_obj/pdc_prop.c index 5d66b91a4..65f1985ec 100644 --- a/src/api/pdc_obj/pdc_prop.c +++ b/src/api/pdc_obj/pdc_prop.c @@ -58,9 +58,9 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) { pdcid_t ret_value = 0; struct _pdc_cont_prop *p = NULL; - struct _pdc_obj_prop *q = NULL; - struct _pdc_id_info *id_info = NULL; - struct _pdc_class *pdc_class; + struct _pdc_obj_prop * q = NULL; + struct _pdc_id_info * id_info = NULL; + struct _pdc_class * pdc_class; pdcid_t new_id_c; pdcid_t new_id_o; @@ -130,7 +130,7 @@ PDCprop_obj_dup(pdcid_t prop_id) pdcid_t ret_value = 0; struct _pdc_obj_prop *q = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info *prop = NULL; + struct _pdc_id_info * prop = NULL; pdcid_t new_id; size_t i; @@ -294,7 +294,7 @@ PDCcont_prop_get_info(pdcid_t cont_prop) { struct _pdc_cont_prop *ret_value = NULL; struct _pdc_cont_prop *info = NULL; - struct _pdc_id_info *prop; + struct _pdc_id_info * prop; FUNC_ENTER(NULL); @@ -324,9 +324,9 @@ PDCcont_prop_get_info(pdcid_t cont_prop) struct pdc_obj_prop * PDCobj_prop_get_info(pdcid_t obj_prop) { - struct pdc_obj_prop *ret_value = NULL; + struct pdc_obj_prop * ret_value = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info *prop; + struct _pdc_id_info * prop; size_t i; FUNC_ENTER(NULL); @@ -357,7 +357,7 @@ PDC_obj_prop_get_info(pdcid_t obj_prop) { struct _pdc_obj_prop *ret_value = NULL; struct _pdc_obj_prop *info = NULL; - struct _pdc_id_info *prop; + struct _pdc_id_info * prop; size_t i; FUNC_ENTER(NULL); diff --git a/src/api/pdc_query/include/pdc_query.h b/src/api/pdc_query/include/pdc_query.h index 4fb838876..d71abb286 100644 --- a/src/api/pdc_query/include/pdc_query.h +++ b/src/api/pdc_query/include/pdc_query.h @@ -39,7 +39,7 @@ typedef struct pdc_query_constraint_t { pdc_query_op_t op2; double value2; - void *storage_region_list_head; + void * storage_region_list_head; pdcid_t origin_server; int n_sent; int n_recv; @@ -47,12 +47,12 @@ typedef struct pdc_query_constraint_t { typedef struct pdc_query_t { pdc_query_constraint_t *constraint; - struct pdc_query_t *left; - struct pdc_query_t *right; + struct pdc_query_t * left; + struct pdc_query_t * right; pdc_query_combine_op_t combine_op; struct pdc_region_info *region; // used only on client - void *region_constraint; // used only on server - pdc_selection_t *sel; + void * region_constraint; // used only on server + pdc_selection_t * sel; } pdc_query_t; // Request structure for async read/write @@ -62,9 +62,9 @@ struct pdc_request { int n_client; int n_update; pdc_access_t access_type; - void *metadata; + void * metadata; struct pdc_region_info *region; - void *buf; + void * buf; char *shm_base; char shm_addr[128]; @@ -72,11 +72,11 @@ struct pdc_request { int shm_size; int n_buf_arr; - void ***buf_arr; - int *buf_arr_idx; - char **shm_base_arr; - char **shm_addr_arr; - int *shm_fd_arr; + void *** buf_arr; + int * buf_arr_idx; + char ** shm_base_arr; + char ** shm_addr_arr; + int * shm_fd_arr; uint64_t *shm_size_arr; void *storage_meta; diff --git a/src/api/pdc_query/pdc_query.c b/src/api/pdc_query/pdc_query.c index d90d69933..25df43ea7 100644 --- a/src/api/pdc_query/pdc_query.c +++ b/src/api/pdc_query/pdc_query.c @@ -22,8 +22,8 @@ pdc_query_t * PDCquery_create(pdcid_t obj_id, pdc_query_op_t op, pdc_var_type_t type, void *value) { - pdc_query_t *ret_value = NULL; - pdc_query_t *query; + pdc_query_t * ret_value = NULL; + pdc_query_t * query; int type_size; struct _pdc_obj_info *obj_prop; uint64_t meta_id; diff --git a/src/api/pdc_region/include/pdc_region.h b/src/api/pdc_region/include/pdc_region.h index ff989900a..f30c2e595 100644 --- a/src/api/pdc_region/include/pdc_region.h +++ b/src/api/pdc_region/include/pdc_region.h @@ -35,11 +35,11 @@ struct pdc_region_info { pdcid_t local_id; struct _pdc_obj_info *obj; size_t ndim; - uint64_t *offset; - uint64_t *size; + uint64_t * offset; + uint64_t * size; bool mapping; int registered_op; - void *buf; + void * buf; size_t unit; }; diff --git a/src/api/pdc_region/pdc_region.c b/src/api/pdc_region/pdc_region.c index 9156133c8..5b5aa1fe3 100644 --- a/src/api/pdc_region/pdc_region.c +++ b/src/api/pdc_region/pdc_region.c @@ -212,12 +212,12 @@ PDCbuf_obj_map(void *buf, pdc_var_type_t local_type, pdcid_t local_reg, pdcid_t { pdcid_t ret_value = SUCCEED; size_t i; - struct _pdc_id_info *objinfo2; + struct _pdc_id_info * objinfo2; struct _pdc_obj_info *obj2; pdcid_t remote_meta_id; pdc_var_type_t remote_type; - struct _pdc_id_info *reginfo1, *reginfo2; + struct _pdc_id_info * reginfo1, *reginfo2; struct pdc_region_info *reg1, *reg2; FUNC_ENTER(NULL); @@ -265,7 +265,7 @@ PDCregion_get_info(pdcid_t reg_id) { struct pdc_region_info *ret_value = NULL; struct pdc_region_info *info = NULL; - struct _pdc_id_info *region; + struct _pdc_id_info * region; FUNC_ENTER(NULL); @@ -285,8 +285,8 @@ perr_t PDCbuf_obj_unmap(pdcid_t remote_obj_id, pdcid_t remote_reg_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *info1; - struct _pdc_obj_info *object1; + struct _pdc_id_info * info1; + struct _pdc_obj_info * object1; struct pdc_region_info *reginfo; pdc_var_type_t data_type; @@ -320,11 +320,11 @@ perr_t PDCreg_obtain_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type, pdc_lock_mode_t lock_mode) { perr_t ret_value = SUCCEED; - struct _pdc_obj_info *object_info; + struct _pdc_obj_info * object_info; struct pdc_region_info *region_info; pdc_var_type_t data_type; pbool_t obtained; - struct _pdc_id_info *info1; + struct _pdc_id_info * info1; FUNC_ENTER(NULL); @@ -336,7 +336,7 @@ PDCreg_obtain_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type, pdc data_type = object_info->obj_pt->obj_prop_pub->type; region_info = PDCregion_get_info(reg_id); ret_value = PDC_Client_region_lock(object_info->obj_info_pub->meta_id, object_info, region_info, - access_type, lock_mode, data_type, &obtained); + access_type, lock_mode, data_type, &obtained); // PDC_free_obj_info(object_info); done: @@ -348,10 +348,10 @@ PDCreg_release_lock(pdcid_t obj_id, pdcid_t reg_id, pdc_access_t access_type) { perr_t ret_value = SUCCEED; pbool_t released; - struct _pdc_obj_info *object_info; + struct _pdc_obj_info * object_info; struct pdc_region_info *region_info; pdc_var_type_t data_type; - struct _pdc_id_info *info1; + struct _pdc_id_info * info1; FUNC_ENTER(NULL); diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 1c04e0666..2d2cacf5b 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -73,7 +73,7 @@ typedef struct pdc_transfer_request { // For each of the contig buffer sent to a server, we have a bulk buffer. char **bulk_buf; // Reference counter for bulk_buf, if 0, we free it. - int **bulk_buf_ref; + int ** bulk_buf_ref; pdc_region_partition_t region_partition; // Consistency semantics required by user @@ -122,7 +122,7 @@ typedef struct pdc_transfer_request_start_all_pkg { int index; // Data buffer. This data buffer is contiguous according to the remote region. We assume this is after // transformation of local regions - char *buf; + char * buf; struct pdc_transfer_request_start_all_pkg *next; } pdc_transfer_request_start_all_pkg; @@ -136,7 +136,7 @@ typedef struct pdc_transfer_request_wait_all_pkg { // Record the index of the metadata_id in the current transfer_request int index; // Pointer to the transfer request - pdc_transfer_request *transfer_request; + pdc_transfer_request * transfer_request; struct pdc_transfer_request_wait_all_pkg *next; } pdc_transfer_request_wait_all_pkg; @@ -190,12 +190,12 @@ PDCregion_transfer_create(void *buf, pdc_access_t access_type, pdcid_t obj_id, p pdcid_t remote_reg) { pdcid_t ret_value = SUCCEED; - struct _pdc_id_info *objinfo2; - struct _pdc_obj_info *obj2; - pdc_transfer_request *p; - struct _pdc_id_info *reginfo1, *reginfo2; + struct _pdc_id_info * objinfo2; + struct _pdc_obj_info * obj2; + pdc_transfer_request * p; + struct _pdc_id_info * reginfo1, *reginfo2; struct pdc_region_info *reg1, *reg2; - uint64_t *ptr; + uint64_t * ptr; uint64_t unit; int j; @@ -279,7 +279,7 @@ PDCregion_transfer_create(void *buf, pdc_access_t access_type, pdcid_t obj_id, p perr_t PDCregion_transfer_close(pdcid_t transfer_request_id) { - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; perr_t ret_value = SUCCEED; FUNC_ENTER(NULL); @@ -527,7 +527,7 @@ pack_region_buffer(char *buf, uint64_t *obj_dims, size_t total_data_size, int lo { uint64_t i, j; perr_t ret_value = SUCCEED; - char *ptr; + char * ptr; FUNC_ENTER(NULL); @@ -596,7 +596,7 @@ pack_region_metadata_query(pdc_transfer_request_start_all_pkg **transfer_request { perr_t ret_value = SUCCEED; int i; - char *ptr; + char * ptr; uint64_t total_buf_size; uint8_t region_partition; @@ -644,13 +644,13 @@ unpack_region_metadata_query(char *buf, pdc_transfer_request_start_all_pkg **tra { perr_t ret_value = SUCCEED; pdc_transfer_request_start_all_pkg *transfer_request_head, *transfer_request_end; - pdc_transfer_request *local_request; + pdc_transfer_request * local_request; int size; int i, j, index; int counter; - char *ptr; + char * ptr; uint64_t region_size; - uint64_t *sub_offset; + uint64_t * sub_offset; FUNC_ENTER(NULL); local_request = NULL; @@ -762,10 +762,10 @@ register_metadata(pdc_transfer_request_start_all_pkg **transfer_request_input, i perr_t ret_value = SUCCEED; int i, j, index, size, output_size, remain_size, n_objs; pdc_transfer_request_start_all_pkg **transfer_requests; - pdc_transfer_request_start_all_pkg *transfer_request_head, *transfer_request_front_head, + pdc_transfer_request_start_all_pkg * transfer_request_head, *transfer_request_front_head, *transfer_request_end, **transfer_request_output, *previous = NULL; uint64_t total_buf_size, output_buf_size, query_id; - char *buf, *output_buf; + char * buf, *output_buf; FUNC_ENTER(NULL); transfer_request_output = NULL; @@ -922,7 +922,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, *read_request_pkgs, *write_request_pkgs_end, *read_request_pkgs_end, *request_pkgs, **transfer_request_output; int write_size, read_size, output_size; - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; int set_output_buf = 0; @@ -1125,7 +1125,7 @@ PDC_Client_pack_all_requests(int n_objs, pdc_transfer_request_start_all_pkg **tr char **read_bulk_buf) { perr_t ret_value = SUCCEED; - char *bulk_buf, *ptr, *ptr2; + char * bulk_buf, *ptr, *ptr2; size_t total_buf_size, obj_data_size, total_obj_data_size, unit, data_size, metadata_size; int i, j; @@ -1239,10 +1239,10 @@ PDC_Client_start_all_requests(pdc_transfer_request_start_all_pkg **transfer_requ int index, i, j; int n_objs; uint64_t *metadata_id; - char **read_bulk_buf; - char *bulk_buf; + char ** read_bulk_buf; + char * bulk_buf; size_t bulk_buf_size; - int *bulk_buf_ref; + int * bulk_buf_ref; FUNC_ENTER(NULL); @@ -1344,7 +1344,7 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) perr_t ret_value = SUCCEED; int write_size = 0, read_size = 0, posix_size = 0; pdc_transfer_request_start_all_pkg **write_transfer_requests = NULL, **read_transfer_requests = NULL; - pdcid_t *posix_transfer_request_id; + pdcid_t * posix_transfer_request_id; FUNC_ENTER(NULL); @@ -1473,7 +1473,7 @@ perr_t PDCregion_transfer_start(pdcid_t transfer_request_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; @@ -1591,7 +1591,7 @@ release_region_buffer(char *buf, uint64_t *obj_dims, int local_ndim, uint64_t *l int k; perr_t ret_value = SUCCEED; - char *ptr; + char * ptr; FUNC_ENTER(NULL); if (local_ndim == 2) { if (access_type == PDC_READ) { @@ -1645,7 +1645,7 @@ perr_t PDCregion_transfer_status(pdcid_t transfer_request_id, pdc_transfer_status_t *completed) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; @@ -1750,11 +1750,11 @@ PDCregion_transfer_wait_all(pdcid_t *transfer_request_id, int size) int index, i, j; size_t unit; int total_requests, n_objs; - uint64_t *metadata_ids; + uint64_t * metadata_ids; pdc_transfer_request_wait_all_pkg **transfer_requests, *transfer_request_head, *transfer_request_end, *temp; - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; FUNC_ENTER(NULL); @@ -1958,7 +1958,7 @@ perr_t PDCregion_transfer_wait(pdcid_t transfer_request_id) { perr_t ret_value = SUCCEED; - struct _pdc_id_info *transferinfo; + struct _pdc_id_info * transferinfo; pdc_transfer_request *transfer_request; size_t unit; int i; diff --git a/src/api/pdc_transform/include/pdc_transforms_pkg.h b/src/api/pdc_transform/include/pdc_transforms_pkg.h index c753dd4e8..4929f1f12 100644 --- a/src/api/pdc_transform/include/pdc_transforms_pkg.h +++ b/src/api/pdc_transform/include/pdc_transforms_pkg.h @@ -53,8 +53,8 @@ struct _pdc_region_transform_ftn_info { pdc_obj_transform_t op_type; pdc_data_movement_t when; _pdc_analysis_language_t lang; - void *data; - void *result; + void * data; + void * result; }; /***************************************/ diff --git a/src/api/pdc_transform/pdc_transform.c b/src/api/pdc_transform/pdc_transform.c index 7327c2e96..884cbf434 100644 --- a/src/api/pdc_transform/pdc_transform.c +++ b/src/api/pdc_transform/pdc_transform.c @@ -50,23 +50,23 @@ PDCobj_transform_register(char *func, pdcid_t obj_id, int current_state, int nex pdc_obj_transform_t op_type, pdc_data_movement_t when) { perr_t ret_value = SUCCEED; - void *ftnHandle = NULL; + void * ftnHandle = NULL; size_t (*ftnPtr)() = NULL; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - struct _pdc_obj_info *obj1, *obj2; - struct _pdc_id_info *objinfo1; - struct _pdc_obj_prop *prop; - struct pdc_region_info *reg1 = NULL, *reg2 = NULL; + struct _pdc_obj_info * obj1, *obj2; + struct _pdc_id_info * objinfo1; + struct _pdc_obj_prop * prop; + struct pdc_region_info * reg1 = NULL, *reg2 = NULL; pdcid_t src_region_id = 0, dest_region_id = 0; pdcid_t dest_object_id = 0; - char *thisApp = NULL; - char *colonsep = NULL; - char *transformslibrary = NULL; - char *applicationDir = NULL; - char *userdefinedftn = NULL; - char *loadpath = NULL; + char * thisApp = NULL; + char * colonsep = NULL; + char * transformslibrary = NULL; + char * applicationDir = NULL; + char * userdefinedftn = NULL; + char * loadpath = NULL; int local_regIndex; - struct _pdc_id_info *id_info; + struct _pdc_id_info * id_info; FUNC_ENTER(NULL); @@ -168,18 +168,18 @@ PDCbuf_map_transform_register(char *func, void *buf, pdcid_t src_region_id, pdci pdc_data_movement_t when) { perr_t ret_value = SUCCEED; /* Return value */ - void *ftnHandle = NULL; + void * ftnHandle = NULL; size_t (*ftnPtr)() = NULL; - struct _pdc_obj_info *object1 = NULL; + struct _pdc_obj_info * object1 = NULL; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - struct pdc_region_info *region_info = NULL; - struct _pdc_id_info *id_info; - char *thisApp = NULL; - char *colonsep = NULL; - char *transformslibrary = NULL; - char *applicationDir = NULL; - char *userdefinedftn = NULL; - char *loadpath = NULL; + struct pdc_region_info * region_info = NULL; + struct _pdc_id_info * id_info; + char * thisApp = NULL; + char * colonsep = NULL; + char * transformslibrary = NULL; + char * applicationDir = NULL; + char * userdefinedftn = NULL; + char * loadpath = NULL; int local_regIndex; FUNC_ENTER(NULL); diff --git a/src/api/pdc_transform/pdc_transforms_common.c b/src/api/pdc_transform/pdc_transforms_common.c index fed48090f..34ecd7b07 100644 --- a/src/api/pdc_transform/pdc_transforms_common.c +++ b/src/api/pdc_transform/pdc_transforms_common.c @@ -41,7 +41,7 @@ HG_TEST_RPC_CB(transform_ftn, handle) transform_ftn_in_t in; transform_ftn_out_t out = {0, 0, 0, -1}; struct _pdc_region_transform_ftn_info *thisFtn = NULL; - void *ftnHandle = NULL; + void * ftnHandle = NULL; FUNC_ENTER(NULL); diff --git a/src/server/dablooms/pdc_dablooms.c b/src/server/dablooms/pdc_dablooms.c index f78557cf3..2be56c884 100644 --- a/src/server/dablooms/pdc_dablooms.c +++ b/src/server/dablooms/pdc_dablooms.c @@ -403,7 +403,7 @@ scaling_bloom_t * new_scaling_bloom(unsigned int capacity, double error_rate) { - scaling_bloom_t *bloom; + scaling_bloom_t * bloom; counting_bloom_t *cur_bloom; bloom = scaling_bloom_init(capacity, error_rate); diff --git a/src/server/dablooms/pdc_dablooms.h b/src/server/dablooms/pdc_dablooms.h index 4de824daa..0e4b79bf5 100644 --- a/src/server/dablooms/pdc_dablooms.h +++ b/src/server/dablooms/pdc_dablooms.h @@ -10,7 +10,7 @@ const char *dablooms_version(void); typedef struct { size_t bytes; - char *array; + char * array; } bitmap_t; bitmap_t *bitmap_resize(bitmap_t *bitmap, size_t new_size); @@ -33,12 +33,12 @@ typedef struct { unsigned int capacity; long offset; unsigned int counts_per_func; - uint32_t *hashes; + uint32_t * hashes; size_t nfuncs; size_t size; size_t num_bytes; double error_rate; - bitmap_t *bitmap; + bitmap_t * bitmap; } counting_bloom_t; int free_counting_bloom(counting_bloom_t *bloom); @@ -65,7 +65,7 @@ typedef struct { double error_rate; /* int fd; */ counting_bloom_t **blooms; - bitmap_t *bitmap; + bitmap_t * bitmap; } scaling_bloom_t; /* scaling_bloom_t *new_scaling_bloom(unsigned int capacity, double error_rate, const char *filename); */ diff --git a/src/server/include/pdc_client_server_common.h b/src/server/include/pdc_client_server_common.h index 0ba950a48..ddc07249e 100644 --- a/src/server/include/pdc_client_server_common.h +++ b/src/server/include/pdc_client_server_common.h @@ -133,17 +133,17 @@ typedef struct pdc_kvtag_list_t { typedef struct get_storage_loc_args_t { perr_t (*cb)(); - void *cb_args; + void * cb_args; region_list_t **region_lists; hg_handle_t rpc_handle; - uint32_t *n_loc; - void *void_buf; + uint32_t * n_loc; + void * void_buf; } get_storage_loc_args_t; typedef struct update_region_storage_meta_bulk_args_t { perr_t (*cb)(); - void *meta_list_target; - int *n_updated; + void * meta_list_target; + int * n_updated; int server_id; hg_bulk_t bulk_handle; hg_handle_t rpc_handle; @@ -166,8 +166,8 @@ typedef struct region_list_t { int is_data_ready; char shm_addr[ADDR_MAX]; int shm_fd; - pdc_histogram_t *region_hist; - char *buf; + pdc_histogram_t * region_hist; + char * buf; _pdc_data_loc_t data_loc_type; char storage_location[ADDR_MAX]; uint64_t offset; @@ -268,7 +268,7 @@ typedef struct region_map_t { pdcid_t local_reg_id; /* origin of region id */ region_info_transfer_t local_region; size_t local_ndim; - uint64_t *local_reg_size; + uint64_t * local_reg_size; hg_addr_t local_addr; hg_bulk_t local_bulk_handle; pdc_var_type_t local_data_type; @@ -279,7 +279,7 @@ typedef struct region_map_t { } region_map_t; typedef struct region_buf_map_t { - void *remote_data_ptr; + void * remote_data_ptr; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -293,7 +293,7 @@ typedef struct region_buf_map_t { pdcid_t local_reg_id; /* origin of region id */ region_info_transfer_t local_region; size_t local_ndim; - uint64_t *local_reg_size; + uint64_t * local_reg_size; hg_addr_t local_addr; hg_bulk_t local_bulk_handle; pdc_var_type_t local_data_type; @@ -335,8 +335,8 @@ typedef struct data_server_region_t { region_list_t *region_storage_head; // For non-mapped object analysis // Used primarily as a local_temp - void *obj_data_ptr; - char *storage_location; // save the file location to enable reopening + void * obj_data_ptr; + char * storage_location; // save the file location to enable reopening struct data_server_region_t *prev; struct data_server_region_t *next; } data_server_region_t; @@ -345,7 +345,7 @@ typedef struct data_server_region_unmap_t { uint64_t obj_id; region_info_transfer_t unmap_region; - const struct hg_info *info; + const struct hg_info * info; struct data_server_region_unmap_t *prev; struct data_server_region_unmap_t *next; @@ -397,7 +397,7 @@ typedef struct pdc_metadata_t { // For hash table list struct pdc_metadata_t *prev; struct pdc_metadata_t *next; - void *bloom; + void * bloom; } pdc_metadata_t; @@ -418,7 +418,7 @@ typedef struct query_read_names_args_t { int cnt; int is_select_all; char **obj_names; - char *obj_names_1d; + char * obj_names_1d; } query_read_names_args_t; /********************************************************/ @@ -1112,7 +1112,7 @@ typedef struct pdc_query_xfer_t { int n_unique_obj; int query_op; int n_combine_ops; - int *combine_ops; + int * combine_ops; int n_constraints; int get_op; int next_server_id; @@ -1143,7 +1143,7 @@ typedef struct query_storage_region_transfer_t { int manager; uint64_t obj_id; region_info_transfer_t region_transfer; - char *storage_location; + char * storage_location; uint64_t offset; uint64_t size; int has_hist; @@ -4007,10 +4007,10 @@ struct bulk_args_t { size_t nbytes; int origin; size_t ret; - pdc_metadata_t **meta_arr; + pdc_metadata_t ** meta_arr; uint32_t n_meta; uint64_t obj_id; - uint64_t *obj_ids; + uint64_t * obj_ids; int client_seq_id; int is_id; // if is_id == true, then use uint64_t; otherwise, pdc_metadata_t int8_t op_type; @@ -4034,7 +4034,7 @@ struct buf_map_release_bulk_args { double start_time; #endif hg_handle_t handle; - void *data_buf; + void * data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -4062,11 +4062,11 @@ struct buf_map_release_bulk_args { struct buf_map_transform_and_release_bulk_args { hg_handle_t handle; - void *data_buf; + void * data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; - struct pdc_region_info *remote_reg_info; + struct pdc_region_info * remote_reg_info; region_info_transfer_t remote_region; hg_bulk_t remote_bulk_handle; hg_bulk_t local_bulk_handle; @@ -4080,7 +4080,7 @@ struct buf_map_transform_and_release_bulk_args { struct buf_map_analysis_and_release_bulk_args { hg_handle_t handle; - void *data_buf; + void * data_buf; pdcid_t remote_obj_id; /* target of object id */ pdcid_t remote_reg_id; /* target of region id */ int32_t remote_client_id; @@ -4101,8 +4101,8 @@ struct lock_bulk_args { hg_handle_t handle; region_lock_in_t in; struct pdc_region_info *server_region; - void *data_buf; - region_map_t *mapping_list; + void * data_buf; + region_map_t * mapping_list; hg_addr_t addr; }; @@ -4112,14 +4112,14 @@ struct region_lock_update_bulk_args { pdcid_t remote_obj_id; pdcid_t remote_reg_id; int32_t remote_client_id; - void *data_buf; + void * data_buf; struct pdc_region_info *server_region; }; struct transfer_request_wait_all_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; - void *data_buf; + void * data_buf; transfer_request_wait_all_in_t in; #ifdef PDC_TIMING double start_time; @@ -4130,8 +4130,8 @@ struct transfer_request_all_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; transfer_request_all_in_t in; - uint64_t *transfer_request_id; - void *data_buf; + uint64_t * transfer_request_id; + void * data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4141,8 +4141,8 @@ struct transfer_request_all_local_bulk_args2 { hg_handle_t handle; transfer_request_all_data request_data; hg_bulk_t bulk_handle; - uint64_t *transfer_request_id; - void *data_buf; + uint64_t * transfer_request_id; + void * data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4152,7 +4152,7 @@ struct transfer_request_metadata_query_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; transfer_request_metadata_query_in_t in; - void *data_buf; + void * data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4161,7 +4161,7 @@ struct transfer_request_metadata_query_local_bulk_args { struct transfer_request_metadata_query2_local_bulk_args { hg_handle_t handle; hg_bulk_t bulk_handle; - void *data_buf; + void * data_buf; #ifdef PDC_TIMING double start_time; #endif @@ -4172,7 +4172,7 @@ struct transfer_request_local_bulk_args { hg_bulk_t bulk_handle; transfer_request_in_t in; uint64_t transfer_request_id; - void *data_buf; + void * data_buf; size_t total_mem_size; #ifdef PDC_TIMING @@ -4221,12 +4221,12 @@ typedef struct process_bulk_storage_meta_args_t { typedef struct region_meta_transfer_t { int loc_len; - char *storage_location; + char * storage_location; region_info_transfer_t region_info; uint64_t offset; uint64_t size; int has_hist; - pdc_histogram_t *histogram; + pdc_histogram_t * histogram; } region_meta_transfer_t; typedef struct storage_region_bulk_header_t { diff --git a/src/server/include/pdc_hash-table.h b/src/server/include/pdc_hash-table.h index 207c4e578..76474d33d 100644 --- a/src/server/include/pdc_hash-table.h +++ b/src/server/include/pdc_hash-table.h @@ -94,7 +94,7 @@ typedef struct _HashTablePair { */ struct _HashTableIterator { - HashTable *hash_table; + HashTable * hash_table; HashTableEntry *next_entry; unsigned int next_chain; }; diff --git a/src/server/include/pdc_server_common.h b/src/server/include/pdc_server_common.h index c42223e57..628bbdc1b 100644 --- a/src/server/include/pdc_server_common.h +++ b/src/server/include/pdc_server_common.h @@ -34,9 +34,9 @@ typedef struct server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char *ret_string; - void *void_buf; - char *server_addr; + char * ret_string; + void * void_buf; + char * server_addr; pdc_metadata_t *meta; region_list_t **region_lists; uint32_t n_loc; @@ -49,7 +49,7 @@ struct transfer_buf_map { }; typedef struct pdc_remote_server_info_t { - char *addr_string; + char * addr_string; int addr_valid; hg_addr_t addr; } pdc_remote_server_info_t; diff --git a/src/server/include/pdc_server_metadata.h b/src/server/include/pdc_server_metadata.h index 1dca89f15..de3c15c80 100644 --- a/src/server/include/pdc_server_metadata.h +++ b/src/server/include/pdc_server_metadata.h @@ -49,15 +49,15 @@ extern int pdc_server_rank_g; extern int pdc_server_size_g; extern char pdc_server_tmp_dir_g[TMP_DIR_STRING_LEN]; extern uint32_t n_metadata_g; -extern HashTable *metadata_hash_table_g; -extern HashTable *container_hash_table_g; -extern hg_class_t *hg_class_g; +extern HashTable * metadata_hash_table_g; +extern HashTable * container_hash_table_g; +extern hg_class_t * hg_class_g; extern hg_context_t *hg_context_g; extern int is_debug_g; extern hg_id_t get_metadata_by_id_register_id_g; extern hg_id_t send_client_storage_meta_rpc_register_id_g; -extern pdc_client_info_t *pdc_client_info_g; +extern pdc_client_info_t * pdc_client_info_g; extern pdc_remote_server_info_t *pdc_remote_server_info_g; extern double total_mem_usage_g; extern int is_hash_table_init_g; @@ -70,7 +70,7 @@ extern int use_sqlite3_g; /****************************/ typedef struct pdc_hash_table_entry_head { int n_obj; - void *bloom; + void * bloom; pdc_metadata_t *metadata; } pdc_hash_table_entry_head; @@ -80,7 +80,7 @@ typedef struct pdc_cont_hash_table_entry_t { int n_obj; int n_deleted; int n_allocated; - uint64_t *obj_ids; + uint64_t * obj_ids; char tags[TAG_LEN_MAX]; pdc_kvtag_list_t *kvtag_list_head; } pdc_cont_hash_table_entry_t; diff --git a/src/server/include/pdc_server_metadata_index.h b/src/server/include/pdc_server_metadata_index.h index 64e1aa436..d5360539c 100644 --- a/src/server/include/pdc_server_metadata_index.h +++ b/src/server/include/pdc_server_metadata_index.h @@ -26,11 +26,11 @@ typedef struct { } key_index_leaf_content; typedef struct pdc_art_iterator_param { - char *query_str; - char *level_one_infix; - char *level_two_infix; + char * query_str; + char * level_one_infix; + char * level_two_infix; uint32_t total_count; - Set *out; + Set * out; } pdc_art_iterator_param_t; /** @@ -77,7 +77,7 @@ perr_t PDC_Server_dart_get_server_info(dart_get_server_info_in_t *in, dart_get_s * @param out [OUT] Output parameters for the DART operation * @return perr_t SUCCESS on success, FAIL on failure */ -perr_t PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t *in, +perr_t PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t * in, dart_perform_one_server_out_t *out, uint64_t *n_obj_ids_ptr, uint64_t **buf_ptrs); diff --git a/src/server/pdc_client_server_common.c b/src/server/pdc_client_server_common.c index fb9062d79..37df71ab0 100644 --- a/src/server/pdc_client_server_common.c +++ b/src/server/pdc_client_server_common.c @@ -1722,7 +1722,7 @@ HG_TEST_RPC_CB(metadata_query, handle) hg_return_t ret_value = HG_SUCCESS; metadata_query_in_t in; metadata_query_out_t out; - pdc_metadata_t *query_result = NULL; + pdc_metadata_t * query_result = NULL; FUNC_ENTER(NULL); @@ -1763,7 +1763,7 @@ HG_TEST_RPC_CB(obj_reset_dims, handle) hg_return_t ret_value = HG_SUCCESS; obj_reset_dims_in_t in; obj_reset_dims_out_t out; - pdc_metadata_t *query_result = NULL; + pdc_metadata_t * query_result = NULL; FUNC_ENTER(NULL); @@ -2151,7 +2151,7 @@ pdc_region_write_out_progress(void *arg) { HG_THREAD_RETURN_TYPE ret_value = (HG_THREAD_RETURN_TYPE)0; struct buf_map_release_bulk_args *bulk_args = (struct buf_map_release_bulk_args *)arg; - struct pdc_region_info *remote_reg_info = NULL; + struct pdc_region_info * remote_reg_info = NULL; region_lock_out_t out; FUNC_ENTER(NULL); @@ -2251,7 +2251,7 @@ pdc_region_read_from_progress(void *arg) { HG_THREAD_RETURN_TYPE ret_value = (HG_THREAD_RETURN_TYPE)0; struct buf_map_release_bulk_args *bulk_args = (struct buf_map_release_bulk_args *)arg; - const struct hg_info *hg_info = NULL; + const struct hg_info * hg_info = NULL; hg_return_t hg_ret; size_t size; int error = 0; @@ -2304,21 +2304,21 @@ transform_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_inf hg_return_t ret_value = HG_SUCCESS; region_lock_out_t out; struct buf_map_transform_and_release_bulk_args *bulk_args = NULL; - void *data_buf; - char *buf; + void * data_buf; + char * buf; int ndim; int transform_id; int type_extent = 0; int use_transform_size = 0; size_t unit = 1; int64_t transform_size, expected_size; - uint64_t *dims = NULL; + uint64_t * dims = NULL; pdc_var_type_t destType; - struct _pdc_region_transform_ftn_info **registry = NULL; + struct _pdc_region_transform_ftn_info ** registry = NULL; int registered_count; #ifdef ENABLE_MULTITHREAD data_server_region_t *target_reg = NULL; - region_buf_map_t *elt; + region_buf_map_t * elt; #else struct pdc_region_info *remote_reg_info = NULL; #endif @@ -2495,12 +2495,12 @@ analysis_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info hg_return_t ret_value = HG_SUCCESS; region_lock_out_t out; struct buf_map_analysis_and_release_bulk_args *bulk_args = NULL; - void *data_buf; + void * data_buf; int ndim; uint64_t type_extent; - uint64_t *dims = NULL; - struct pdc_region_info *remote_reg_info = NULL; - struct pdc_region_info *local_reg_info = NULL; + uint64_t * dims = NULL; + struct pdc_region_info * remote_reg_info = NULL; + struct pdc_region_info * local_reg_info = NULL; double start_t, end_t, analysis_t, io_t; double averages[4]; @@ -2553,7 +2553,7 @@ analysis_and_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info int registered_count = PDC_get_analysis_registry(®istry); if ((registered_count >= analysis_meta_index) && (registry != NULL)) { - int (*analysis_ftn)(pdcid_t iterIn, pdcid_t iterOut, struct _pdc_iterator_cbs_t *_cbs) = + int (*analysis_ftn)(pdcid_t iterIn, pdcid_t iterOut, struct _pdc_iterator_cbs_t * _cbs) = registry[analysis_meta_index]->ftnPtr; int result = analysis_ftn(bulk_args->in.input_iter, bulk_args->in.output_iter, &iter_cbs); printf("==PDC_SERVER: Analysis returned %d\n", result); @@ -2670,7 +2670,7 @@ buf_map_region_release_bulk_transfer_cb(const struct hg_cb_info *hg_cb_info) struct buf_map_release_bulk_args *bulk_args = NULL; #ifdef ENABLE_MULTITHREAD data_server_region_t *target_reg = NULL; - region_buf_map_t *elt; + region_buf_map_t * elt; #else struct pdc_region_info *remote_reg_info = NULL; #endif @@ -2883,23 +2883,23 @@ HG_TEST_RPC_CB(region_release, handle) hg_return_t hg_ret; region_lock_in_t in; region_lock_out_t out; - const struct hg_info *hg_info = NULL; - data_server_region_t *target_obj; + const struct hg_info * hg_info = NULL; + data_server_region_t * target_obj; int error = 0; int dirty_reg = 0; hg_size_t size, size2; - void *data_buf; - struct pdc_region_info *server_region; - region_list_t *elt, *request_region, *tmp, *elt_tmp; + void * data_buf; + struct pdc_region_info * server_region; + region_list_t * elt, *request_region, *tmp, *elt_tmp; struct region_lock_update_bulk_args *lock_update_bulk_args = NULL; - struct buf_map_release_bulk_args *buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; + struct buf_map_release_bulk_args * buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; hg_bulk_t lock_local_bulk_handle = HG_BULK_NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - struct pdc_region_info *remote_reg_info; - region_buf_map_t *eltt, *eltt2, *eltt_tmp; + struct pdc_region_info * remote_reg_info; + region_buf_map_t * eltt, *eltt2, *eltt_tmp; hg_uint32_t /*k, m, */ remote_count; - void **data_ptrs_to = NULL; - size_t *data_size_to = NULL; + void ** data_ptrs_to = NULL; + size_t * data_size_to = NULL; // size_t type_size = 0; // size_t dims[4] = {0, 0, 0, 0}; #ifdef PDC_TIMING @@ -3397,10 +3397,10 @@ region_read_transform_release(region_transform_and_lock_in_t *in, hg_handle_t ha const struct hg_info *hg_info = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; hg_uint32_t remote_count; - void *data_buf = NULL; + void * data_buf = NULL; ; - void **data_ptrs_to = NULL; - size_t *data_size_to = NULL; + void ** data_ptrs_to = NULL; + size_t * data_size_to = NULL; region_buf_map_t *eltt2; region_lock_out_t out; @@ -3409,8 +3409,8 @@ region_read_transform_release(region_transform_and_lock_in_t *in, hg_handle_t ha int dirty_reg = 0; struct buf_map_transform_and_release_bulk_args *transform_release_bulk_args = NULL; - struct pdc_region_info *remote_reg_info = NULL; - data_server_region_t *target_obj = NULL; + struct pdc_region_info * remote_reg_info = NULL; + data_server_region_t * target_obj = NULL; region_list_t *tmp, *elt, *request_region = (region_list_t *)malloc(sizeof(region_list_t)); FUNC_ENTER(NULL); @@ -3563,19 +3563,19 @@ HG_TEST_RPC_CB(transform_region_release, handle) region_transform_and_lock_in_t in; region_lock_in_t reg_lock_in; region_lock_out_t out; - const struct hg_info *hg_info = NULL; - data_server_region_t *target_obj; + const struct hg_info * hg_info = NULL; + data_server_region_t * target_obj; int error = 0; int dirty_reg = 0; hg_size_t size; - void *data_buf; - region_list_t *elt, *request_region, *tmp; + void * data_buf; + region_list_t * elt, *request_region, *tmp; struct buf_map_transform_and_release_bulk_args *buf_map_bulk_args = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - region_buf_map_t *eltt; + region_buf_map_t * eltt; hg_uint32_t remote_count; - void **data_ptrs_to = NULL; - size_t *data_size_to = NULL; + void ** data_ptrs_to = NULL; + size_t * data_size_to = NULL; FUNC_ENTER(NULL); @@ -3711,14 +3711,14 @@ HG_TEST_RPC_CB(region_transform_release, handle) int dirty_reg = 0; hg_size_t size, remote_size; ; - void *data_buf; - region_list_t *elt, *request_region, *tmp; + void * data_buf; + region_list_t * elt, *request_region, *tmp; struct buf_map_release_bulk_args *buf_map_bulk_args = NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - region_buf_map_t *eltt; + region_buf_map_t * eltt; hg_uint32_t k, remote_count = 0; - void **data_ptrs_to = NULL; - size_t *data_size_to = NULL; + void ** data_ptrs_to = NULL; + size_t * data_size_to = NULL; size_t type_size = 0; ; size_t dims[4] = {0, 0, 0, 0}; @@ -3870,26 +3870,26 @@ HG_TEST_RPC_CB(region_analysis_release, handle) } in; region_lock_out_t out; - const struct hg_info *hg_info = NULL; - data_server_region_t *target_obj; - data_server_region_t *lock_obj; + const struct hg_info * hg_info = NULL; + data_server_region_t * target_obj; + data_server_region_t * lock_obj; int error = 0; int dirty_reg = 0; hg_size_t size; hg_return_t hg_ret; - void *data_buf; - struct pdc_region_info *server_region; - region_list_t *elt, *request_region, *tmp; - struct region_lock_update_bulk_args *lock_update_bulk_args = NULL; + void * data_buf; + struct pdc_region_info * server_region; + region_list_t * elt, *request_region, *tmp; + struct region_lock_update_bulk_args * lock_update_bulk_args = NULL; struct buf_map_analysis_and_release_bulk_args *buf_map_bulk_args = NULL, *obj_map_bulk_args = NULL; hg_bulk_t lock_local_bulk_handle = HG_BULK_NULL; hg_bulk_t remote_bulk_handle = HG_BULK_NULL; - struct pdc_region_info *remote_reg_info; - region_buf_map_t *eltt, *eltt2; + struct pdc_region_info * remote_reg_info; + region_buf_map_t * eltt, *eltt2; hg_uint32_t k, remote_count = 0; - void **data_ptrs_to = NULL; - size_t *data_size_to = NULL; + void ** data_ptrs_to = NULL; + size_t * data_size_to = NULL; size_t type_size = 0; size_t dims[4] = {0, 0, 0, 0}; @@ -4329,7 +4329,7 @@ HG_TEST_RPC_CB(get_remote_metadata, handle) hg_return_t ret_value = HG_SUCCESS; get_remote_metadata_in_t in; get_remote_metadata_out_t out; - pdc_metadata_t *meta; + pdc_metadata_t * meta; FUNC_ENTER(NULL); @@ -4364,7 +4364,7 @@ HG_TEST_RPC_CB(buf_unmap_server, handle) hg_return_t ret_value = HG_SUCCESS; buf_unmap_in_t in; buf_unmap_out_t out; - pdc_metadata_t *target_obj; + pdc_metadata_t * target_obj; region_buf_map_t *tmp, *elt; FUNC_ENTER(NULL); @@ -4413,8 +4413,8 @@ HG_TEST_RPC_CB(buf_map_server, handle) hg_return_t ret_value = HG_SUCCESS; buf_map_in_t in; buf_map_out_t out; - pdc_metadata_t *target_obj; - region_list_t *elt, *request_region; + pdc_metadata_t * target_obj; + region_list_t * elt, *request_region; region_buf_map_t *buf_map_ptr; FUNC_ENTER(NULL); @@ -4478,9 +4478,9 @@ HG_TEST_RPC_CB(buf_map, handle) buf_map_in_t in; buf_map_out_t out; const struct hg_info *info; - region_list_t *request_region; - region_buf_map_t *new_buf_map_ptr = NULL; - void *data_ptr; + region_list_t * request_region; + region_buf_map_t * new_buf_map_ptr = NULL; + void * data_ptr; size_t ndim; #ifdef PDC_TIMING double start, end; @@ -4559,9 +4559,9 @@ HG_TEST_RPC_CB(query_partial, handle) hg_return_t hg_ret; hg_bulk_t bulk_handle = HG_BULK_NULL; uint32_t i; - void **buf_ptrs; - size_t *buf_sizes; - uint32_t *n_meta_ptr, n_buf; + void ** buf_ptrs; + size_t * buf_sizes; + uint32_t * n_meta_ptr, n_buf; metadata_query_transfer_in_t in; metadata_query_transfer_out_t out; @@ -4654,7 +4654,7 @@ HG_TEST_RPC_CB(query_kvtag, handle) hg_return_t ret_value; hg_return_t hg_ret; hg_bulk_t bulk_handle = HG_BULK_NULL; - uint64_t *buf_ptr; + uint64_t * buf_ptr; size_t buf_size[1]; uint32_t nmeta; pdc_kvtag_t in; @@ -4715,10 +4715,10 @@ update_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int cnt, i; - uint64_t *obj_id_ptr; + uint64_t * obj_id_ptr; pdc_int_ret_t out_struct; - void **buf; - void *buf_1d; + void ** buf; + void * buf_1d; FUNC_ENTER(NULL); @@ -4774,7 +4774,7 @@ HG_TEST_RPC_CB(bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t *bulk_args = NULL; + struct bulk_args_t * bulk_args = NULL; bulk_rpc_in_t in_struct; int cnt; @@ -4922,7 +4922,7 @@ HG_TEST_RPC_CB(data_server_read_check, handle) // Decode input data_server_read_check_in_t in; data_server_read_check_out_t out; - server_read_check_out_t *read_out = calloc(1, sizeof(server_read_check_out_t)); + server_read_check_out_t * read_out = calloc(1, sizeof(server_read_check_out_t)); FUNC_ENTER(NULL); @@ -5024,7 +5024,7 @@ HG_TEST_RPC_CB(get_metadata_by_id, handle) hg_return_t ret_value = HG_SUCCESS; get_metadata_by_id_in_t in; get_metadata_by_id_out_t out; - pdc_metadata_t *target = NULL; + pdc_metadata_t * target = NULL; FUNC_ENTER(NULL); @@ -5130,8 +5130,8 @@ char * PDC_find_in_path(char *workingDir, char *application) { struct stat fileStat; - char *ret_value = NULL; - char *pathVar = getenv("PATH"); + char * ret_value = NULL; + char * pathVar = getenv("PATH"); char colon = ':'; char checkPath[PATH_MAX]; @@ -5186,11 +5186,11 @@ cont_add_del_objs_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int cnt, op; cont_add_del_objs_rpc_out_t out_struct; - uint64_t *obj_ids, cont_id; + uint64_t * obj_ids, cont_id; FUNC_ENTER(NULL); @@ -5241,8 +5241,8 @@ cont_add_del_objs_bulk_cb(const struct hg_cb_info *hg_cb_info) HG_TEST_RPC_CB(cont_add_del_objs_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; - const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args = NULL; + const struct hg_info * hg_info = NULL; + struct bulk_args_t * bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; cont_add_del_objs_rpc_in_t in_struct; @@ -5322,13 +5322,13 @@ query_read_obj_name_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_return_t ret_value = HG_SUCCESS; hg_return_t ret = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int iter; size_t i; - char *tmp_buf; + char * tmp_buf; query_read_obj_name_out_t out_struct; - query_read_names_args_t *query_read_names_args; + query_read_names_args_t * query_read_names_args; FUNC_ENTER(NULL); @@ -5384,8 +5384,8 @@ HG_TEST_RPC_CB(query_read_obj_name_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; hg_return_t ret = HG_SUCCESS; - const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args = NULL; + const struct hg_info * hg_info = NULL; + struct bulk_args_t * bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; query_read_obj_name_in_t in_struct; @@ -5493,13 +5493,13 @@ get_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int i, task_id, n_regions; - int *int_ptr; - char *char_ptr, *file_path; - uint64_t *uint64_ptr, offset; + int * int_ptr; + char * char_ptr, *file_path; + uint64_t * uint64_ptr, offset; - void *buf; + void * buf; region_info_transfer_t *region_info_ptr; - region_list_t *region_list, *region_list_head = NULL; + region_list_t * region_list, *region_list_head = NULL; pdc_int_ret_t out_struct; FUNC_ENTER(NULL); @@ -5569,7 +5569,7 @@ HG_TEST_RPC_CB(get_storage_meta_name_query_bulk_result_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args = NULL; + struct bulk_args_t * bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; bulk_rpc_in_t in_struct; @@ -5622,8 +5622,8 @@ notify_client_multi_io_complete_bulk_cb(const struct hg_cb_info *hg_cb_info) struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int n_shm; - void *buf; - char *buf_cp; + void * buf; + char * buf_cp; pdc_int_ret_t out_struct; FUNC_ENTER(NULL); @@ -5666,7 +5666,7 @@ HG_TEST_RPC_CB(notify_client_multi_io_complete_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args = NULL; + struct bulk_args_t * bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; bulk_rpc_in_t in_struct; @@ -5709,7 +5709,7 @@ PDC_add_task_to_list(pdc_task_list_t **target_list, perr_t (*cb)(), void *cb_arg #ifdef ENABLE_MULTITHREAD void *_mutex) #else - void *_mutex ATTRIBUTE(unused)) + void *_mutex ATTRIBUTE(unused)) #endif { int ret_value = 0; @@ -5753,7 +5753,7 @@ PDC_del_task_from_list(pdc_task_list_t **target_list, pdc_task_list_t *del, #ifdef ENABLE_MULTITHREAD void *_mutex) #else - void *_mutex ATTRIBUTE(unused)) + void *_mutex ATTRIBUTE(unused)) #endif { perr_t ret_value = SUCCEED; @@ -5937,13 +5937,13 @@ query_read_obj_name_client_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; // Server executes after received request from client - struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; int iter; size_t i; - char *tmp_buf; + char * tmp_buf; query_read_obj_name_out_t out_struct; - query_read_names_args_t *query_read_names_args; + query_read_names_args_t * query_read_names_args; FUNC_ENTER(NULL); @@ -5999,8 +5999,8 @@ query_read_obj_name_client_bulk_cb(const struct hg_cb_info *hg_cb_info) HG_TEST_RPC_CB(query_read_obj_name_client_rpc, handle) { hg_return_t ret_value = HG_SUCCESS; - const struct hg_info *hg_info = NULL; - struct bulk_args_t *bulk_args = NULL; + const struct hg_info * hg_info = NULL; + struct bulk_args_t * bulk_args = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; query_read_obj_name_in_t in_struct; @@ -6050,9 +6050,9 @@ static hg_return_t send_client_storage_meta_bulk_cb(const struct hg_cb_info *hg_cb_info) { hg_return_t ret_value = HG_SUCCESS; - struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; - void *buf = NULL, *buf_cp = NULL; + void * buf = NULL, *buf_cp = NULL; process_bulk_storage_meta_args_t *process_args = NULL; FUNC_ENTER(NULL); @@ -6097,7 +6097,7 @@ HG_TEST_RPC_CB(send_client_storage_meta_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t *bulk_args = NULL; + struct bulk_args_t * bulk_args = NULL; bulk_rpc_in_t in_struct; pdc_int_ret_t out_struct; int cnt; @@ -6157,7 +6157,7 @@ server_recv_shm_bulk_cb(const struct hg_cb_info *hg_cb_info) hg_return_t ret_value = HG_SUCCESS; struct bulk_args_t *bulk_args = (struct bulk_args_t *)hg_cb_info->arg; hg_bulk_t local_bulk_handle = hg_cb_info->info.bulk.local_handle; - void *buf = NULL, *buf_cp = NULL; + void * buf = NULL, *buf_cp = NULL; FUNC_ENTER(NULL); @@ -6194,7 +6194,7 @@ HG_TEST_RPC_CB(send_shm_bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t *bulk_args = NULL; + struct bulk_args_t * bulk_args = NULL; bulk_rpc_in_t in_struct; pdc_int_ret_t out_struct; int cnt; @@ -6362,7 +6362,7 @@ HG_TEST_RPC_CB(send_bulk_rpc, handle) const struct hg_info *hg_info = NULL; hg_bulk_t origin_bulk_handle = HG_BULK_NULL; hg_bulk_t local_bulk_handle = HG_BULK_NULL; - struct bulk_args_t *bulk_arg = NULL; + struct bulk_args_t * bulk_arg = NULL; bulk_rpc_in_t in_struct; hg_return_t (*func_ptr)(const struct hg_cb_info *hg_cb_info); struct hg_cb_info callback_info; @@ -6462,10 +6462,10 @@ HG_TEST_RPC_CB(dart_perform_one_server, handle) dart_perform_one_server_out_t out; hg_bulk_t bulk_handle = HG_BULK_NULL; - uint64_t *n_obj_ids_ptr; + uint64_t * n_obj_ids_ptr; uint64_t n_buf; uint64_t **buf_ptrs; - size_t *buf_sizes; + size_t * buf_sizes; uint32_t i; FUNC_ENTER(NULL); diff --git a/src/server/pdc_hash-table.c b/src/server/pdc_hash-table.c index 27003a93e..f4804a24a 100644 --- a/src/server/pdc_hash-table.c +++ b/src/server/pdc_hash-table.c @@ -34,7 +34,7 @@ struct _HashTableEntry { }; struct _HashTable { - HashTableEntry **table; + HashTableEntry ** table; unsigned int table_size; HashTableHashFunc hash_func; HashTableEqualFunc equal_func; @@ -175,9 +175,9 @@ hash_table_enlarge(HashTable *hash_table) HashTableEntry **old_table; unsigned int old_table_size; unsigned int old_prime_index; - HashTableEntry *rover; - HashTablePair *pair; - HashTableEntry *next; + HashTableEntry * rover; + HashTablePair * pair; + HashTableEntry * next; unsigned int index; unsigned int i; @@ -232,7 +232,7 @@ int hash_table_insert(HashTable *hash_table, HashTableKey key, HashTableValue value) { HashTableEntry *rover; - HashTablePair *pair; + HashTablePair * pair; HashTableEntry *newentry; unsigned int index; @@ -316,7 +316,7 @@ HashTableValue hash_table_lookup(HashTable *hash_table, HashTableKey key) { HashTableEntry *rover; - HashTablePair *pair; + HashTablePair * pair; unsigned int index; /* Generate the hash of the key and hence the index into the table */ @@ -346,8 +346,8 @@ int hash_table_remove(HashTable *hash_table, HashTableKey key) { HashTableEntry **rover; - HashTableEntry *entry; - HashTablePair *pair; + HashTableEntry * entry; + HashTablePair * pair; unsigned int index; int result; @@ -430,7 +430,7 @@ HashTablePair hash_table_iter_next(HashTableIterator *iterator) { HashTableEntry *current_entry; - HashTable *hash_table; + HashTable * hash_table; HashTablePair pair = {NULL, NULL}; unsigned int chain; diff --git a/src/server/pdc_server.c b/src/server/pdc_server.c index 0022ceb63..7ba1d1090 100644 --- a/src/server/pdc_server.c +++ b/src/server/pdc_server.c @@ -81,7 +81,7 @@ sqlite3 *sqlite3_db_g; int is_debug_g = 0; int pdc_client_num_g = 0; -hg_class_t *hg_class_g = NULL; +hg_class_t * hg_class_g = NULL; hg_context_t *hg_context_g = NULL; // Below three are guarded by pdc_server_task_mutex_g for multi-thread @@ -89,10 +89,10 @@ pdc_task_list_t *pdc_server_agg_task_head_g = NULL; pdc_task_list_t *pdc_server_s2s_task_head_g = NULL; int pdc_server_task_id_g = PDC_SERVER_TASK_INIT_VALUE; -pdc_client_info_t *pdc_client_info_g = NULL; +pdc_client_info_t * pdc_client_info_g = NULL; pdc_remote_server_info_t *pdc_remote_server_info_g = NULL; -char *all_addr_strings_1d_g = NULL; -char **all_addr_strings_g = NULL; +char * all_addr_strings_1d_g = NULL; +char ** all_addr_strings_g = NULL; int is_hash_table_init_g = 0; int lustre_stripe_size_mb_g = 16; int lustre_total_ost_g = 0; @@ -144,7 +144,7 @@ int gen_fastbit_idx_g = 0; int use_fastbit_idx_g = 0; int use_rocksdb_g = 0; int use_sqlite3_g = 0; -char *gBinningOption = NULL; +char * gBinningOption = NULL; double server_write_time_g = 0.0; double server_read_time_g = 0.0; @@ -162,9 +162,9 @@ volatile int dbg_sleep_g = 1; double total_mem_usage_g = 0.0; // Data server related -pdc_data_server_io_list_t *pdc_data_server_read_list_head_g = NULL; -pdc_data_server_io_list_t *pdc_data_server_write_list_head_g = NULL; -update_storage_meta_list_t *pdc_update_storage_meta_list_head_g = NULL; +pdc_data_server_io_list_t * pdc_data_server_read_list_head_g = NULL; +pdc_data_server_io_list_t * pdc_data_server_write_list_head_g = NULL; +update_storage_meta_list_t * pdc_update_storage_meta_list_head_g = NULL; extern data_server_region_t *dataserver_region_g; /* @@ -376,7 +376,7 @@ static int remove_directory(const char *dir) { int ret = 0; - FTS *ftsp = NULL; + FTS * ftsp = NULL; FTSENT *curr; // Cast needed (in C) because fts_open() takes a "char * const *", instead @@ -540,7 +540,7 @@ PDC_Server_lookup_server_id(int remote_server_id) lookup_args->server_id = remote_server_id; hg_ret = HG_Addr_lookup(hg_context_g, lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { printf("==PDC_SERVER: Connection to remote server FAILED!\n"); ret_value = FAIL; @@ -659,7 +659,7 @@ PDC_Server_lookup_client(uint32_t client_id) // Lookup and fill the client info server_lookup_args_t lookup_args; - char *target_addr_string; + char * target_addr_string; lookup_args.server_id = pdc_server_rank_g; lookup_args.client_id = client_id; @@ -801,7 +801,7 @@ PDC_Server_init(int port, hg_class_t **hg_class, hg_context_t **hg_context) uint32_t credential = 0, cookie; drc_info_handle_t credential_info; char pdc_auth_key[256] = {'\0'}; - char *auth_key; + char * auth_key; int rc; #endif @@ -1052,7 +1052,7 @@ perr_t PDC_Server_finalize() { pdc_data_server_io_list_t *io_elt = NULL; - region_list_t *region_elt = NULL, *region_tmp = NULL; + region_list_t * region_elt = NULL, *region_tmp = NULL; perr_t ret_value = SUCCEED; hg_return_t hg_ret; @@ -1219,21 +1219,21 @@ perr_t PDC_Server_checkpoint() { perr_t ret_value = SUCCEED; - pdc_metadata_t *elt; - region_list_t *region_elt; - pdc_kvtag_list_t *kvlist_elt; - pdc_hash_table_entry_head *head; + pdc_metadata_t * elt; + region_list_t * region_elt; + pdc_kvtag_list_t * kvlist_elt; + pdc_hash_table_entry_head * head; pdc_cont_hash_table_entry_t *cont_head; int n_entry, metadata_size = 0, region_count = 0, n_region, n_objs, n_write_region = 0, n_kvtag, key_len; uint32_t hash_key; HashTablePair pair; char checkpoint_file[ADDR_MAX], checkpoint_file_local[ADDR_MAX], cmd[4096]; HashTableIterator hash_table_iter; - char *checkpoint; - char *env_char; + char * checkpoint; + char * env_char; uint64_t checkpoint_size; bool use_tmpfs = false; - FILE *file; + FILE * file; FUNC_ENTER(NULL); @@ -1371,7 +1371,7 @@ PDC_Server_checkpoint() metadata_size++; region_count += n_region; } // End for metadata entry linked list - } // End for hash table metadata entry + } // End for hash table metadata entry // Note data server region are managed by data server instead of metadata server data_server_region_t *region = NULL; @@ -1463,14 +1463,14 @@ PDC_Server_restart(char *filename) int n_entry, count, i, j, nobj = 0, all_nobj = 0, all_n_region, n_region, n_objs, total_region = 0, n_kvtag, key_len; int n_cont, all_cont; - pdc_metadata_t *metadata, *elt; - region_list_t *region_list; - pdc_hash_table_entry_head *entry; + pdc_metadata_t * metadata, *elt; + region_list_t * region_list; + pdc_hash_table_entry_head * entry; pdc_cont_hash_table_entry_t *cont_entry; - uint32_t *hash_key; + uint32_t * hash_key; unsigned idx; uint64_t checkpoint_size; - char *checkpoint_buf; + char * checkpoint_buf; #ifdef PDC_TIMING double start = MPI_Wtime(); #endif @@ -1754,8 +1754,8 @@ PDC_Server_restart(char *filename) MPI_Reduce(&nobj, &all_nobj, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); MPI_Reduce(&total_region, &all_n_region, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); #else - all_nobj = nobj; - all_n_region = total_region; + all_nobj = nobj; + all_n_region = total_region; #endif if (pdc_server_rank_g == 0) { @@ -1783,7 +1783,7 @@ PDC_Server_restart(char *filename) static HG_THREAD_RETURN_TYPE hg_progress_thread(void *arg) { - hg_context_t *context = (hg_context_t *)arg; + hg_context_t * context = (hg_context_t *)arg; HG_THREAD_RETURN_TYPE tret = (HG_THREAD_RETURN_TYPE)0; hg_return_t ret = HG_SUCCESS; @@ -2261,7 +2261,7 @@ server_run(int argc, char *argv[]) rocksdb_options_set_create_if_missing(options, 1); rocksdb_block_based_table_options_t *table_options = rocksdb_block_based_options_create(); - rocksdb_filterpolicy_t *filter_policy = rocksdb_filterpolicy_create_bloom(10); + rocksdb_filterpolicy_t * filter_policy = rocksdb_filterpolicy_create_bloom(10); rocksdb_block_based_options_set_filter_policy(table_options, filter_policy); rocksdb_options_set_block_based_table_factory(options, table_options); diff --git a/src/server/pdc_server_analysis/pdc_server_analysis.c b/src/server/pdc_server_analysis/pdc_server_analysis.c index b1218be66..8e2609bac 100644 --- a/src/server/pdc_server_analysis/pdc_server_analysis.c +++ b/src/server/pdc_server_analysis/pdc_server_analysis.c @@ -87,7 +87,7 @@ perr_t PDC_Server_instantiate_data_iterator(obj_data_iterator_in_t *in, obj_data_iterator_out_t *out) { perr_t ret_value = SUCCEED; - data_server_region_t *region_reference = NULL; + data_server_region_t * region_reference = NULL; struct _pdc_iterator_info *thisIter; FUNC_ENTER(NULL); @@ -204,7 +204,7 @@ void * PDC_Server_get_ftn_reference(char *ftn) { static void *appHandle = NULL; - void *ftnHandle = NULL; + void * ftnHandle = NULL; if (appHandle == NULL) { /* We need the in_process address of the function */ if ((appHandle = dlopen(0, RTLD_NOW)) == NULL) { diff --git a/src/server/pdc_server_metadata.c b/src/server/pdc_server_metadata.c index 03bab1f2d..02380fcc8 100644 --- a/src/server/pdc_server_metadata.c +++ b/src/server/pdc_server_metadata.c @@ -155,7 +155,7 @@ PDC_Server_metadata_int_hash_key_free(void *key) static void PDC_Server_metadata_hash_value_free(void *value) { - pdc_metadata_t *elt, *tmp; + pdc_metadata_t * elt, *tmp; pdc_hash_table_entry_head *head; FUNC_ENTER(NULL); @@ -282,9 +282,9 @@ find_metadata_by_id_from_list(pdc_metadata_t *mlist, uint64_t obj_id) pdc_metadata_t * find_metadata_by_id(uint64_t obj_id) { - pdc_metadata_t *ret_value = NULL; + pdc_metadata_t * ret_value = NULL; pdc_hash_table_entry_head *head; - pdc_metadata_t *elt; + pdc_metadata_t * elt; HashTableIterator hash_table_iter; HashTablePair pair; int n_entry; @@ -350,7 +350,7 @@ static pdc_metadata_t * find_identical_metadata(pdc_hash_table_entry_head *entry, pdc_metadata_t *a) { pdc_metadata_t *ret_value = NULL; - BLOOM_TYPE_T *bloom; + BLOOM_TYPE_T * bloom; int bloom_check; char combined_string[TAG_LEN_MAX]; pdc_metadata_t *elt; @@ -803,8 +803,8 @@ PDC_Server_update_metadata(metadata_update_in_t *in, metadata_update_out_t *out) perr_t ret_value = SUCCEED; uint64_t obj_id; pdc_hash_table_entry_head *lookup_value; - uint32_t *hash_key = NULL; - pdc_metadata_t *target; + uint32_t * hash_key = NULL; + pdc_metadata_t * target; FUNC_ENTER(NULL); @@ -928,7 +928,7 @@ perr_t PDC_Server_delete_metadata_by_id(metadata_delete_by_id_in_t *in, metadata_delete_by_id_out_t *out) { perr_t ret_value = FAIL; - pdc_metadata_t *elt; + pdc_metadata_t * elt; HashTableIterator hash_table_iter; HashTablePair pair; uint64_t target_obj_id; @@ -1014,8 +1014,8 @@ PDC_Server_delete_metadata_by_id(metadata_delete_by_id_in_t *in, metadata_delete ret_value = SUCCEED; } } // DL_FOREACH - } // while - } // if (metadata_hash_table_g != NULL) + } // while + } // if (metadata_hash_table_g != NULL) else { printf("==PDC_SERVER: metadata_hash_table_g not initialized!\n"); ret_value = FAIL; @@ -1069,7 +1069,7 @@ perr_t PDC_delete_metadata_from_hash_table(metadata_delete_in_t *in, metadata_delete_out_t *out) { perr_t ret_value = SUCCEED; - uint32_t *hash_key = NULL; + uint32_t * hash_key = NULL; pdc_metadata_t *target; FUNC_ENTER(NULL); @@ -1199,7 +1199,7 @@ PDC_insert_metadata_to_hash_table(gen_obj_id_in_t *in, gen_obj_id_out_t *out) { perr_t ret_value = SUCCEED; pdc_metadata_t *metadata; - uint32_t *hash_key, i; + uint32_t * hash_key, i; #ifdef ENABLE_MULTITHREAD // Obtain lock for hash table int unlocked = 0; @@ -1263,7 +1263,7 @@ PDC_insert_metadata_to_hash_table(gen_obj_id_in_t *in, gen_obj_id_out_t *out) *hash_key = in->hash_value; pdc_hash_table_entry_head *lookup_value; - pdc_metadata_t *found_identical; + pdc_metadata_t * found_identical; #ifdef ENABLE_MULTITHREAD // Obtain lock for hash table @@ -1370,7 +1370,7 @@ PDC_Server_print_all_metadata() { perr_t ret_value = SUCCEED; HashTableIterator hash_table_iter; - pdc_metadata_t *elt; + pdc_metadata_t * elt; pdc_hash_table_entry_head *head; HashTablePair pair; @@ -1425,7 +1425,7 @@ PDC_Server_metadata_duplicate_check() int all_maybe, all_total, all_entry; int has_dup_obj = 0; int all_dup_obj = 0; - pdc_metadata_t *elt, *elt_next; + pdc_metadata_t * elt, *elt_next; pdc_hash_table_entry_head *head; FUNC_ENTER(NULL); @@ -1437,9 +1437,9 @@ PDC_Server_metadata_duplicate_check() MPI_Reduce(&n_bloom_total_g, &all_total, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); MPI_Reduce(&n_entry, &all_entry, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); #else - all_maybe = n_bloom_maybe_g; - all_total = n_bloom_total_g; - all_entry = n_entry; + all_maybe = n_bloom_maybe_g; + all_total = n_bloom_total_g; + all_entry = n_entry; #endif if (pdc_server_rank_g == 0) { @@ -1545,7 +1545,7 @@ PDC_Server_get_partial_query_result(metadata_query_transfer_in_t *in, uint32_t * uint32_t i; uint32_t n_buf, iter = 0; pdc_hash_table_entry_head *head; - pdc_metadata_t *elt; + pdc_metadata_t * elt; HashTableIterator hash_table_iter; int n_entry; HashTablePair pair; @@ -1661,7 +1661,7 @@ PDC_Server_query_kvtag_rocksdb(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj uint32_t iter = 0; rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); - rocksdb_iterator_t *rocksdb_iter = rocksdb_create_iterator(rocksdb_g, readoptions); + rocksdb_iterator_t * rocksdb_iter = rocksdb_create_iterator(rocksdb_g, readoptions); rocksdb_iter_seek_to_first(rocksdb_iter); // Iterate over all rocksdb kv @@ -1707,8 +1707,8 @@ PDC_Server_query_kvtag_sqlite(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ perr_t ret_value = SUCCEED; #ifdef ENABLE_SQLITE3 char sql[TAG_LEN_MAX]; - char *errMessage = NULL; - char *tmp_value, *tmp_name, *current_pos; + char * errMessage = NULL; + char * tmp_value, *tmp_name, *current_pos; pdc_sqlite3_query_t query_data; // Check if there is * in tag name @@ -1812,8 +1812,8 @@ PDC_Server_query_kvtag_someta(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ perr_t ret_value = SUCCEED; uint32_t iter = 0; pdc_hash_table_entry_head *head; - pdc_metadata_t *elt; - pdc_kvtag_list_t *kvtag_list_elt; + pdc_metadata_t * elt; + pdc_kvtag_list_t * kvtag_list_elt; HashTableIterator hash_table_iter; int n_entry, is_name_match, is_value_match; HashTablePair pair; @@ -1853,8 +1853,8 @@ PDC_Server_query_kvtag_someta(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_ #endif } } // End for each kvtag in list - } // End for each metadata from hash table entry - } // End looping metadata hash table + } // End for each metadata from hash table entry + } // End looping metadata hash table *n_meta = iter; #ifdef PDC_DEBUG_OUTPUT printf("==PDC_SERVER[%d]: found %d objids \n", pdc_server_rank_g, iter); @@ -1917,7 +1917,7 @@ PDC_Server_search_with_name_timestep(const char *obj_name, uint32_t hash_key, ui perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *lookup_value; pdc_metadata_t metadata; - const char *name; + const char * name; FUNC_ENTER(NULL); @@ -1968,7 +1968,7 @@ PDC_Server_search_with_name_hash(const char *obj_name, uint32_t hash_key, pdc_me perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *lookup_value; pdc_metadata_t metadata; - const char *name; + const char * name; FUNC_ENTER(NULL); @@ -2020,7 +2020,7 @@ PDC_Server_get_local_metadata_by_id(uint64_t obj_id, pdc_metadata_t **res_meta_p perr_t ret_value = SUCCEED; pdc_hash_table_entry_head *head; - pdc_metadata_t *elt; + pdc_metadata_t * elt; HashTableIterator hash_table_iter; int n_entry; HashTablePair pair; @@ -2070,7 +2070,7 @@ PDC_Server_get_metadata_by_id_cb(const struct hg_cb_info *callback_info) { hg_return_t ret_value; hg_handle_t handle; - pdc_metadata_t *meta = NULL; + pdc_metadata_t * meta = NULL; get_metadata_by_id_args_t *cb_args; get_metadata_by_id_out_t output; @@ -2117,7 +2117,7 @@ PDC_Server_get_metadata_by_id_cb(const struct hg_cb_info *callback_info) perr_t PDC_Server_get_metadata_by_id_with_cb(uint64_t obj_id, perr_t (*cb)(), void *args) { - pdc_metadata_t *res_meta_ptr = NULL; + pdc_metadata_t * res_meta_ptr = NULL; hg_return_t hg_ret; perr_t ret_value = SUCCEED; uint32_t server_id = 0; @@ -2614,14 +2614,14 @@ PDC_Server_get_storage_meta_by_names(query_read_names_args_t *args) hg_handle_t rpc_handle; hg_bulk_t bulk_handle; bulk_rpc_in_t bulk_rpc_in; - void **buf_ptrs; - hg_size_t *buf_sizes; + void ** buf_ptrs; + hg_size_t * buf_sizes; uint32_t client_id; - char *obj_name; - pdc_metadata_t *meta = NULL; + char * obj_name; + pdc_metadata_t * meta = NULL; int i = 0, j = 0; region_storage_meta_t **all_storage_meta; - int *all_nregion, total_region; + int * all_nregion, total_region; FUNC_ENTER(NULL); // Get the storage meta for each queried object name @@ -2762,7 +2762,7 @@ PDC_add_kvtag_to_list(pdc_kvtag_list_t **list_head, pdc_kvtag_t *tag) { perr_t ret_value = SUCCEED; pdc_kvtag_list_t *new_list_item; - pdc_kvtag_t *newtag; + pdc_kvtag_t * newtag; FUNC_ENTER(NULL); PDC_kvtag_dup(tag, &newtag); @@ -2853,7 +2853,7 @@ static perr_t PDC_Server_add_kvtag_someta(metadata_add_kvtag_in_t *in, metadata_add_tag_out_t *out) { perr_t ret_value = SUCCEED; - pdc_hash_table_entry_head *lookup_value; + pdc_hash_table_entry_head * lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; uint32_t hash_key; @@ -2872,7 +2872,7 @@ PDC_Server_add_kvtag_someta(metadata_add_kvtag_in_t *in, metadata_add_tag_out_t ret_value = FAIL; out->ret = -1; } - } // if lookup_value != NULL + } // if lookup_value != NULL else { // look for containers cont_lookup_value = hash_table_lookup(container_hash_table_g, &hash_key); if (cont_lookup_value != NULL) { @@ -3053,9 +3053,9 @@ PDC_Server_get_kvtag_rocksdb(metadata_get_kvtag_in_t *in, metadata_get_kvtag_out rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); char rocksdb_key[TAG_LEN_MAX] = {0}; sprintf(rocksdb_key, "%lu`%s", in->obj_id, in->key); - char *err = NULL; + char * err = NULL; size_t len; - char *value = rocksdb_get(rocksdb_g, readoptions, rocksdb_key, strlen(rocksdb_key) + 1, &len, &err); + char * value = rocksdb_get(rocksdb_g, readoptions, rocksdb_key, strlen(rocksdb_key) + 1, &len, &err); if (value == NULL) { printf("==PDC_SERVER[%d]: error with rocksdb_get %s, [%s]!\n", pdc_server_rank_g, in->key, err); ret_value = FAIL; @@ -3108,7 +3108,7 @@ PDC_Server_get_kvtag_someta(metadata_get_kvtag_in_t *in, metadata_get_kvtag_out_ perr_t ret_value = SUCCEED; uint32_t hash_key; uint64_t obj_id; - pdc_hash_table_entry_head *lookup_value; + pdc_hash_table_entry_head * lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; hash_key = in->hash_value; @@ -3255,7 +3255,7 @@ PDC_Server_del_kvtag_rocksdb(metadata_get_kvtag_in_t *in, metadata_add_tag_out_t { perr_t ret_value = SUCCEED; #ifdef ENABLE_ROCKSDB - char *err = NULL; + char * err = NULL; char rocksdb_key[TAG_LEN_MAX] = {0}; rocksdb_writeoptions_t *writeoptions = rocksdb_writeoptions_create(); @@ -3306,7 +3306,7 @@ PDC_Server_del_kvtag_someta(metadata_get_kvtag_in_t *in, metadata_add_tag_out_t perr_t ret_value = SUCCEED; uint32_t hash_key; uint64_t obj_id; - pdc_hash_table_entry_head *lookup_value; + pdc_hash_table_entry_head * lookup_value; pdc_cont_hash_table_entry_t *cont_lookup_value; hash_key = in->hash_value; diff --git a/src/server/pdc_server_metadata_index.c b/src/server/pdc_server_metadata_index.c index 4e72ccfe4..1e91c42f7 100644 --- a/src/server/pdc_server_metadata_index.c +++ b/src/server/pdc_server_metadata_index.c @@ -240,8 +240,8 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) int len = strlen(attr_name); key_index_leaf_content *leaf_content = NULL; - art_tree *nm_trie = NULL; - unsigned char *nm_key = NULL; + art_tree * nm_trie = NULL; + unsigned char * nm_key = NULL; #ifndef PDC_DART_SFX_TREE int rr = 0; @@ -252,7 +252,7 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) int sub_loop_count = len; // should be 'len', but we already iterate all suffixes at client side nm_trie = art_key_prefix_tree_g; for (int j = 0; j < sub_loop_count; j++) { - nm_key = (unsigned char *)substring(attr_name, j, len); + nm_key = (unsigned char *)substring(attr_name, j, len); #endif key_index_leaf_content *leafcnt = (key_index_leaf_content *)art_search(nm_trie, nm_key, strlen((const char *)nm_key)); @@ -290,7 +290,7 @@ create_index_for_attr_name(char *attr_name, char *attr_value, void *data) #endif create_prefix_index_for_attr_value((void **)&secondary_trie, val_key, data); } // this matches with the 'r' loop or 'jj' loop - } // this matches with the 'rr' loop or 'j' loop + } // this matches with the 'rr' loop or 'j' loop return nm_trie; } @@ -366,8 +366,8 @@ delete_index_for_attr_name(char *attr_name, char *attr_value, void *data) { int len = strlen(attr_name); key_index_leaf_content *leaf_content = NULL; - art_tree *nm_trie = NULL; - unsigned char *nm_key = NULL; + art_tree * nm_trie = NULL; + unsigned char * nm_key = NULL; #ifndef PDC_DART_SFX_TREE int rr = 0; @@ -407,7 +407,7 @@ delete_index_for_attr_name(char *attr_name, char *attr_value, void *data) } // TODO: deal with index for range query. } // this matches with the 'r' loop or 'jj' loop - } // this matches with the 'rr' loop or 'j' loop + } // this matches with the 'rr' loop or 'j' loop } perr_t @@ -471,7 +471,7 @@ level_two_art_callback(void *data, const unsigned char *key, uint32_t key_len, v } } if (value != NULL) { - Set *obj_id_set = (Set *)value; + Set * obj_id_set = (Set *)value; SetIterator value_set_iter; set_iterate(obj_id_set, &value_set_iter); @@ -493,7 +493,7 @@ level_two_art_callback(void *data, const unsigned char *key, uint32_t key_len, v int level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, void *value) { - key_index_leaf_content *leafcnt = (key_index_leaf_content *)value; + key_index_leaf_content * leafcnt = (key_index_leaf_content *)value; pdc_art_iterator_param_t *param = (pdc_art_iterator_param_t *)(data); if (param->level_one_infix != NULL) { @@ -512,7 +512,7 @@ level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, v else { // DO TEXT QUERY HERE. pattern_type_t level_two_ptn_type = determine_pattern_type(secondary_query); - char *tok = NULL; + char * tok = NULL; switch (level_two_ptn_type) { case PATTERN_EXACT: tok = secondary_query; @@ -539,7 +539,7 @@ level_one_art_callback(void *data, const unsigned char *key, uint32_t key_len, v tok = reverse_str(tok); secondary_trie = (art_tree *)leafcnt->extra_suffix_index; #else - secondary_trie = (art_tree *)leafcnt->extra_prefix_index; + secondary_trie = (art_tree *)leafcnt->extra_prefix_index; #endif if (secondary_trie != NULL) { #ifndef PDC_DART_SFX_TREE @@ -696,8 +696,8 @@ PDC_Server_dart_perform_one_server(dart_perform_one_server_in_t *in, dart_perfor perr_t result = SUCCEED; dart_op_type_t op_type = in->op_type; dart_hash_algo_t hash_algo = in->hash_algo; - char *attr_key = (char *)in->attr_key; - char *attr_val = (char *)in->attr_val; + char * attr_key = (char *)in->attr_key; + char * attr_val = (char *)in->attr_val; dart_object_ref_type_t ref_type = in->obj_ref_type; uint64_t obj_locator = in->obj_primary_ref; diff --git a/src/server/pdc_server_metadata_index_test.c b/src/server/pdc_server_metadata_index_test.c index 63e6def99..d385c717f 100644 --- a/src/server/pdc_server_metadata_index_test.c +++ b/src/server/pdc_server_metadata_index_test.c @@ -29,7 +29,7 @@ query_result_from_kvtag(char *key_value_query, int8_t op_type) dart_perform_one_server_in_t input; dart_perform_one_server_out_t output; uint64_t n_obj_ids = 0; - uint64_t *buf_ptr = NULL; + uint64_t * buf_ptr = NULL; input.op_type = op_type; input.attr_key = key_value_query; assert(PDC_Server_dart_perform_one_server(&input, &output, &n_obj_ids, &buf_ptr) == SUCCEED); diff --git a/src/server/pdc_server_region/include/pdc_server_data.h b/src/server/pdc_server_region/include/pdc_server_data.h index c33f60be1..a204aa437 100644 --- a/src/server/pdc_server_region/include/pdc_server_data.h +++ b/src/server/pdc_server_region/include/pdc_server_data.h @@ -47,11 +47,11 @@ struct buf_map_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char *ret_string; - void *void_buf; - char *server_addr; - pdc_metadata_t *meta; - region_list_t **region_lists; + char * ret_string; + void * void_buf; + char * server_addr; + pdc_metadata_t * meta; + region_list_t ** region_lists; uint32_t n_loc; struct transfer_buf_map *buf_map_args; } buf_map_server_lookup_args_t; @@ -60,11 +60,11 @@ struct obj_map_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char *ret_string; - void *void_buf; - char *server_addr; - pdc_metadata_t *meta; - region_list_t **region_lists; + char * ret_string; + void * void_buf; + char * server_addr; + pdc_metadata_t * meta; + region_list_t ** region_lists; uint32_t n_loc; struct transfer_obj_map *obj_map_args; } obj_map_server_lookup_args_t; @@ -78,11 +78,11 @@ struct buf_unmap_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char *ret_string; - void *void_buf; - char *server_addr; - pdc_metadata_t *meta; - region_list_t **region_lists; + char * ret_string; + void * void_buf; + char * server_addr; + pdc_metadata_t * meta; + region_list_t ** region_lists; uint32_t n_loc; struct transfer_buf_unmap *buf_unmap_args; } buf_unmap_server_lookup_args_t; @@ -91,11 +91,11 @@ struct obj_unmap_server_lookup_args_t { int server_id; uint32_t client_id; int ret_int; - char *ret_string; - void *void_buf; - char *server_addr; - pdc_metadata_t *meta; - region_list_t **region_lists; + char * ret_string; + void * void_buf; + char * server_addr; + pdc_metadata_t * meta; + region_list_t ** region_lists; uint32_t n_loc; struct transfer_obj_unmap *obj_unmap_args; } obj_unmap_server_lookup_args_t; @@ -138,13 +138,13 @@ struct transfer_buf_unmap_args { /****************************/ typedef struct notify_multi_io_args_t { hg_bulk_t bulk_handle; - void *buf_sizes; - void *buf_ptrs; + void * buf_sizes; + void * buf_ptrs; region_list_t *region_list; } notify_multi_io_args_t; typedef struct bulk_xfer_data_t { - void **buf_ptrs; + void ** buf_ptrs; hg_size_t *buf_sizes; int n_alloc; int idx; @@ -173,13 +173,13 @@ typedef struct accumulate_storage_meta_t { } accumulate_storage_meta_t; typedef struct storage_meta_query_one_name_args_t { - char *name; + char * name; int n_res; int seq_id; region_list_t *req_region; region_list_t *overlap_storage_region_list; perr_t (*cb)(); - void *cb_args; + void * cb_args; accumulate_storage_meta_t *accu_meta; } storage_meta_query_one_name_args_t; @@ -187,24 +187,24 @@ typedef struct server_read_check_out_t { int ret; int is_cache_to_bb; region_list_t *region; - char *shm_addr; + char * shm_addr; } server_read_check_out_t; // Data query typedef struct query_task_t { - pdc_query_t *query; + pdc_query_t * query; int query_id; int manager; int client_id; int n_sent_server; int n_unique_obj; - uint64_t *obj_ids; + uint64_t * obj_ids; int n_recv_obj; int ndim; pdc_query_get_op_t get_op; - region_list_t *region_constraint; + region_list_t * region_constraint; uint64_t total_elem; - int *invalid_region_ids; + int * invalid_region_ids; int ninvalid_region; int prev_server_id; int next_server_id; @@ -213,17 +213,17 @@ typedef struct query_task_t { int is_done; int n_recv; uint64_t nhits; - uint64_t *coords; + uint64_t * coords; uint64_t **coords_arr; - uint64_t *n_hits_from_server; + uint64_t * n_hits_from_server; // Data read int n_read_data_region; - void **data_arr; + void ** data_arr; uint64_t *my_read_coords; uint64_t my_nread_coords; uint64_t my_read_obj_id; - void *my_data; + void * my_data; int client_seq_id; struct query_task_t *prev; @@ -272,21 +272,21 @@ extern int buffer_write_request_total_g; extern int buffer_write_request_num_g; extern int buffer_read_request_num_g; extern int is_server_direct_io_g; -extern pdc_task_list_t *pdc_server_agg_task_head_g; -extern pdc_task_list_t *pdc_server_s2s_task_head_g; +extern pdc_task_list_t * pdc_server_agg_task_head_g; +extern pdc_task_list_t * pdc_server_s2s_task_head_g; extern int pdc_server_task_id_g; -extern hg_class_t *hg_class_g; -extern hg_context_t *hg_context_g; +extern hg_class_t * hg_class_g; +extern hg_context_t * hg_context_g; extern pdc_remote_server_info_t *pdc_remote_server_info_g; extern int is_debug_g; extern int n_read_from_bb_g; extern int read_from_bb_size_g; extern int gen_hist_g; -extern pdc_data_server_io_list_t *pdc_data_server_read_list_head_g; -extern pdc_data_server_io_list_t *pdc_data_server_write_list_head_g; +extern pdc_data_server_io_list_t * pdc_data_server_read_list_head_g; +extern pdc_data_server_io_list_t * pdc_data_server_write_list_head_g; extern update_storage_meta_list_t *pdc_update_storage_meta_list_head_g; -extern pdc_client_info_t *pdc_client_info_g; +extern pdc_client_info_t * pdc_client_info_g; extern int pdc_client_num_g; extern double total_mem_usage_g; extern int lustre_stripe_size_mb_g; @@ -309,7 +309,7 @@ extern hg_id_t send_data_query_region_register_id_g; extern hg_id_t send_read_sel_obj_id_rpc_register_id_g; extern hg_id_t send_nhits_register_id_g; extern hg_id_t send_bulk_rpc_register_id_g; -extern char *gBinningOption; +extern char * gBinningOption; extern int gen_fastbit_idx_g; extern int use_fastbit_idx_g; @@ -663,7 +663,7 @@ perr_t PDC_Server_close_shm(region_list_t *region, int is_remove); */ perr_t PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t *bulk_data, perr_t (*cb)(), update_storage_meta_list_t *meta_list_target, - int *n_updated); + int * n_updated); /** * ********** diff --git a/src/server/pdc_server_region/include/pdc_server_region_transfer.h b/src/server/pdc_server_region/include/pdc_server_region_transfer.h index 9f1f4a252..7b210e8e3 100644 --- a/src/server/pdc_server_region/include/pdc_server_region_transfer.h +++ b/src/server/pdc_server_region/include/pdc_server_region_transfer.h @@ -4,11 +4,11 @@ typedef struct transfer_request_all_data { uint64_t **obj_dims; uint64_t **remote_offset; uint64_t **remote_length; - pdcid_t *obj_id; - int *obj_ndim; - size_t *unit; - int *remote_ndim; - char **data_buf; + pdcid_t * obj_id; + int * obj_ndim; + size_t * unit; + int * remote_ndim; + char ** data_buf; int n_objs; } transfer_request_all_data; @@ -16,7 +16,7 @@ typedef struct pdc_transfer_request_status { hg_handle_t handle; uint64_t transfer_request_id; uint32_t status; - int *handle_ref; + int * handle_ref; int out_type; struct pdc_transfer_request_status *next; } pdc_transfer_request_status; diff --git a/src/server/pdc_server_region/pdc_server_data.c b/src/server/pdc_server_region/pdc_server_data.c index 9e09e9d41..9b3ae5b6f 100644 --- a/src/server/pdc_server_region/pdc_server_data.c +++ b/src/server/pdc_server_region/pdc_server_data.c @@ -57,7 +57,7 @@ #include "pdc_region.h" // Global object region info list in local data server -data_server_region_t *dataserver_region_g = NULL; +data_server_region_t * dataserver_region_g = NULL; data_server_region_unmap_t *dataserver_region_unmap = NULL; int pdc_buffered_bulk_update_total_g = 0; @@ -74,10 +74,10 @@ uint64_t max_mem_cache_size_mb_g = 0; int cache_percentage_g = 0; int current_read_from_cache_cnt_g = 0; int total_read_from_cache_cnt_g = 0; -FILE *pdc_cache_file_ptr_g = NULL; +FILE * pdc_cache_file_ptr_g = NULL; char pdc_cache_file_path_g[ADDR_MAX]; -query_task_t *query_task_list_head_g = NULL; +query_task_t * query_task_list_head_g = NULL; cache_storage_region_t *cache_storage_region_head_g = NULL; static int @@ -218,7 +218,7 @@ PDC_Server_local_region_lock_status(PDC_mapping_info_t *mapped_region, int *lock { perr_t ret_value = SUCCEED; pdc_metadata_t *res_meta; - region_list_t *elt, *request_region; + region_list_t * elt, *request_region; FUNC_ENTER(NULL); @@ -303,7 +303,7 @@ PDC_Server_clear_obj_region() { perr_t ret_value = SUCCEED; data_server_region_t *elt, *tmp; - region_list_t *elt2, *tmp2; + region_list_t * elt2, *tmp2; FUNC_ENTER(NULL); if (dataserver_region_g != NULL) { @@ -412,10 +412,10 @@ PDC_Data_Server_region_lock(region_lock_in_t *in, region_lock_out_t *out, hg_han { perr_t ret_value = SUCCEED; int ndim; - region_list_t *request_region; + region_list_t * request_region; data_server_region_t *new_obj_reg; - region_list_t *elt1, *tmp; - region_buf_map_t *eltt; + region_list_t * elt1, *tmp; + region_buf_map_t * eltt; int error = 0; int found_lock = 0; // time_t t; @@ -540,8 +540,8 @@ perr_t PDC_Server_release_lock_request(uint64_t obj_id, struct pdc_region_info *region) { perr_t ret_value = SUCCEED; - region_list_t *request_region; - region_list_t *elt, *tmp; + region_list_t * request_region; + region_list_t * elt, *tmp; data_server_region_t *new_obj_reg; region_lock_out_t out; @@ -583,7 +583,7 @@ PDC_Data_Server_region_release(region_lock_in_t *in, region_lock_out_t *out) { perr_t ret_value = SUCCEED; int ndim; - region_list_t *tmp1, *tmp2; + region_list_t * tmp1, *tmp2; region_list_t request_region; int found = 0; data_server_region_t *obj_reg = NULL; @@ -742,7 +742,7 @@ PDC_Data_Server_buf_unmap(const struct hg_info *info, buf_unmap_in_t *in) { perr_t ret_value = SUCCEED; int ret = HG_UTIL_SUCCESS; - region_buf_map_t *tmp, *elt; + region_buf_map_t * tmp, *elt; data_server_region_t *target_obj; FUNC_ENTER(NULL); @@ -836,9 +836,9 @@ PDC_Data_Server_check_unmap() perr_t ret_value = SUCCEED; int ret = HG_UTIL_SUCCESS; pdcid_t remote_obj_id; - region_buf_map_t *tmp, *elt; + region_buf_map_t * tmp, *elt; data_server_region_unmap_t *tmp1, *elt1; - data_server_region_t *target_obj; + data_server_region_t * target_obj; int completed = 0; FUNC_ENTER(NULL); @@ -937,7 +937,7 @@ buf_unmap_lookup_remote_server_cb(const struct hg_cb_info *callback_info) struct buf_unmap_server_lookup_args_t *lookup_args; hg_handle_t server_send_buf_unmap_handle; hg_handle_t handle; - struct transfer_buf_unmap *tranx_args; + struct transfer_buf_unmap * tranx_args; int error = 0; FUNC_ENTER(NULL); @@ -1001,7 +1001,7 @@ PDC_Server_buf_unmap_lookup_server_id(int remote_server_id, struct transfer_buf_ lookup_args->server_id = remote_server_id; lookup_args->buf_unmap_args = transfer_args; hg_ret = HG_Addr_lookup(hg_context_g, buf_unmap_lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { error = 1; PGOTO_ERROR( @@ -1061,9 +1061,9 @@ PDC_Meta_Server_buf_unmap(buf_unmap_in_t *in, hg_handle_t *handle) hg_return_t hg_ret = HG_SUCCESS; hg_handle_t server_send_buf_unmap_handle; struct transfer_buf_unmap_args *buf_unmap_args; - struct transfer_buf_unmap *addr_args; - pdc_metadata_t *target_meta = NULL; - region_buf_map_t *tmp, *elt; + struct transfer_buf_unmap * addr_args; + pdc_metadata_t * target_meta = NULL; + region_buf_map_t * tmp, *elt; int error = 0; FUNC_ENTER(NULL); @@ -1201,14 +1201,14 @@ region_buf_map_t * PDC_Data_Server_buf_map(const struct hg_info *info, buf_map_in_t *in, region_list_t *request_region, void *data_ptr) { - region_buf_map_t *ret_value = NULL; + region_buf_map_t * ret_value = NULL; data_server_region_t *new_obj_reg = NULL; - region_list_t *elt_reg; - region_buf_map_t *buf_map_ptr = NULL; - region_buf_map_t *tmp; + region_list_t * elt_reg; + region_buf_map_t * buf_map_ptr = NULL; + region_buf_map_t * tmp; int dup = 0; - char *data_path = NULL; - char *user_specified_data_path = NULL; + char * data_path = NULL; + char * user_specified_data_path = NULL; char storage_location[ADDR_MAX]; #ifdef ENABLE_LUSTRE int stripe_count, stripe_size; @@ -1394,9 +1394,9 @@ is_region_transfer_t_identical(region_info_transfer_t *a, region_info_transfer_t void * PDC_Server_maybe_allocate_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t region, size_t type_size) { - void *ret_value = NULL; + void * ret_value = NULL; data_server_region_t *target_obj = NULL, *elt = NULL; - region_buf_map_t *tmp; + region_buf_map_t * tmp; FUNC_ENTER(NULL); @@ -1455,9 +1455,9 @@ PDC_Server_maybe_allocate_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t void * PDC_Server_get_region_buf_ptr(pdcid_t obj_id, region_info_transfer_t region) { - void *ret_value = NULL; + void * ret_value = NULL; data_server_region_t *target_obj = NULL, *elt = NULL; - region_buf_map_t *tmp; + region_buf_map_t * tmp; FUNC_ENTER(NULL); @@ -1523,7 +1523,7 @@ buf_map_lookup_remote_server_cb(const struct hg_cb_info *callback_info) struct buf_map_server_lookup_args_t *lookup_args; hg_handle_t server_send_buf_map_handle; hg_handle_t handle; - struct transfer_buf_map *tranx_args; + struct transfer_buf_map * tranx_args; int error = 0; FUNC_ENTER(NULL); @@ -1587,7 +1587,7 @@ PDC_Server_buf_map_lookup_server_id(int remote_server_id, struct transfer_buf_ma lookup_args->server_id = remote_server_id; lookup_args->buf_map_args = transfer_args; hg_ret = HG_Addr_lookup(hg_context_g, buf_map_lookup_remote_server_cb, lookup_args, - pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); + pdc_remote_server_info_g[remote_server_id].addr_string, HG_OP_ID_IGNORE); if (hg_ret != HG_SUCCESS) { error = 1; PGOTO_ERROR( @@ -1643,9 +1643,9 @@ PDC_Meta_Server_buf_map(buf_map_in_t *in, region_buf_map_t *new_buf_map_ptr, hg_ hg_return_t hg_ret = HG_SUCCESS; hg_handle_t server_send_buf_map_handle; struct transfer_buf_map_args *tranx_args = NULL; - struct transfer_buf_map *addr_args; - pdc_metadata_t *target_meta = NULL; - region_buf_map_t *buf_map_ptr; + struct transfer_buf_map * addr_args; + pdc_metadata_t * target_meta = NULL; + region_buf_map_t * buf_map_ptr; int error = 0; FUNC_ENTER(NULL); @@ -2134,11 +2134,11 @@ PDC_Server_notify_client_multi_io_complete(uint32_t client_id, int client_seq_id hg_return_t hg_ret = HG_SUCCESS; hg_handle_t rpc_handle; hg_bulk_t bulk_handle; - void **buf_ptrs; - hg_size_t *buf_sizes; + void ** buf_ptrs; + hg_size_t * buf_sizes; bulk_rpc_in_t bulk_rpc_in; int i; - region_list_t *region_elt; + region_list_t * region_elt; notify_multi_io_args_t *bulk_args; FUNC_ENTER(NULL); @@ -2347,7 +2347,7 @@ PDC_Server_read_check(data_server_read_check_in_t *in, server_read_check_out_t * { perr_t ret_value = SUCCEED; pdc_data_server_io_list_t *io_elt = NULL, *io_target = NULL; - region_list_t *region_elt = NULL; + region_list_t * region_elt = NULL; region_list_t r_target; /* uint32_t i; */ @@ -2434,7 +2434,7 @@ PDC_Server_write_check(data_server_write_check_in_t *in, data_server_write_check { perr_t ret_value = FAIL; pdc_data_server_io_list_t *io_elt = NULL, *io_target = NULL; - region_list_t *region_elt = NULL, *region_tmp = NULL; + region_list_t * region_elt = NULL, *region_tmp = NULL; int found_region = 0; FUNC_ENTER(NULL); @@ -2542,7 +2542,7 @@ PDC_Server_get_local_storage_location_of_region(uint64_t obj_id, region_list_t * { perr_t ret_value = SUCCEED; pdc_metadata_t *target_meta = NULL; - region_list_t *region_elt = NULL; + region_list_t * region_elt = NULL; FUNC_ENTER(NULL); @@ -2670,7 +2670,7 @@ PDC_Server_count_write_check_update_storage_meta_cb(const struct hg_cb_info *cal } } // end of if - } // end of if (write_ret->ret == 1) + } // end of if (write_ret->ret == 1) done: @@ -2702,17 +2702,17 @@ PDC_Server_get_storage_location_of_region_mpi(region_list_t *regions_head) perr_t ret_value = SUCCEED; uint32_t server_id = 0; uint32_t i, j; - pdc_metadata_t *region_meta = NULL, *region_meta_prev = NULL; - region_list_t *region_elt, req_region, **overlap_regions_2d = NULL; + pdc_metadata_t * region_meta = NULL, *region_meta_prev = NULL; + region_list_t * region_elt, req_region, **overlap_regions_2d = NULL; region_info_transfer_t local_region_transfer[PDC_SERVER_MAX_PROC_PER_NODE]; - region_info_transfer_t *all_requests = NULL; + region_info_transfer_t * all_requests = NULL; update_region_storage_meta_bulk_t *send_buf = NULL; update_region_storage_meta_bulk_t *result_storage_meta = NULL; uint32_t total_request_cnt; int data_size = sizeof(region_info_transfer_t); - int *send_bytes = NULL; - int *displs = NULL; - int *request_overlap_cnt = NULL; + int * send_bytes = NULL; + int * displs = NULL; + int * request_overlap_cnt = NULL; int nrequest_per_server = 0; FUNC_ENTER(NULL); @@ -3045,7 +3045,7 @@ PDC_Server_data_io_via_shm(const struct hg_cb_info *callback_info) perr_t ret_value = SUCCEED; pdc_data_server_io_list_t *io_list_elt, *io_list = NULL, *io_list_target = NULL; - region_list_t *region_elt = NULL, *region_tmp; + region_list_t * region_elt = NULL, *region_tmp; int real_bb_cnt = 0, real_lustre_cnt = 0; int write_to_bb_cnt = 0; int count; @@ -3448,7 +3448,7 @@ PDC_Server_update_region_storagelocation_offset(region_list_t *region, int type) hg_return_t hg_ret; perr_t ret_value = SUCCEED; uint32_t server_id = 0; - pdc_metadata_t *region_meta = NULL; + pdc_metadata_t * region_meta = NULL; hg_handle_t update_region_loc_handle; update_region_loc_in_t in; server_lookup_args_t lookup_args; @@ -3552,7 +3552,7 @@ PDC_Server_add_region_storage_meta_to_bulk_buf(region_list_t *region, bulk_xfer_ int i; uint64_t obj_id = 0; update_region_storage_meta_bulk_t *curr_buf_ptr; - uint64_t *obj_id_ptr; + uint64_t * obj_id_ptr; FUNC_ENTER(NULL); @@ -3642,8 +3642,8 @@ PDC_Server_update_region_storage_meta_bulk_local(update_region_storage_meta_bulk { perr_t ret_value = SUCCEED; int i; - pdc_metadata_t *target_meta = NULL; - region_list_t *region_elt = NULL, *new_region = NULL; + pdc_metadata_t * target_meta = NULL; + region_list_t * region_elt = NULL, *new_region = NULL; update_region_storage_meta_bulk_t *bulk_ptr; int update_success = 0, express_insert = 0; uint64_t obj_id; @@ -3765,7 +3765,7 @@ PDC_Server_update_region_storage_meta_bulk_mpi(bulk_xfer_data_t *bulk_data) int i; uint32_t server_id = 0; update_region_storage_meta_bulk_t *recv_buf = NULL; - void **all_meta = NULL; + void ** all_meta = NULL; #endif FUNC_ENTER(NULL); @@ -3819,9 +3819,9 @@ PDC_Server_update_region_storage_meta_bulk_mpi(bulk_xfer_data_t *bulk_data) } perr_t -PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t *bulk_data, perr_t (*cb)(), +PDC_Server_update_region_storage_meta_bulk_with_cb(bulk_xfer_data_t * bulk_data, perr_t (*cb)(), update_storage_meta_list_t *meta_list_target, - int *n_updated) + int * n_updated) { hg_return_t hg_ret; perr_t ret_value = SUCCEED; @@ -4064,7 +4064,7 @@ PDC_Server_read_overlap_regions(uint32_t ndim, uint64_t *req_start, uint64_t *re } *total_read_bytes += read_bytes; } // for each row - } // ndim=2 + } // ndim=2 else if (ndim == 3) { uint64_t buf_serialize_offset; /* fseek (fp, storage_offset, SEEK_SET); */ @@ -4146,8 +4146,8 @@ PDC_Server_read_one_region(region_list_t *read_region) size_t total_read_bytes = 0; uint32_t n_storage_regions = 0; region_list_t *region_elt; - FILE *fp_read = NULL; - char *prev_path = NULL; + FILE * fp_read = NULL; + char * prev_path = NULL; int is_shm_created = 0, is_read_succeed = 0; #ifdef ENABLE_TIMING double fopen_time; @@ -4290,8 +4290,8 @@ PDC_Server_posix_one_file_io(region_list_t *region_list_head) uint64_t offset = 0; uint32_t i = 0; region_list_t *region_elt = NULL, *previous_region = NULL; - FILE *fp_read = NULL, *fp_write = NULL; - char *prev_path = NULL; + FILE * fp_read = NULL, *fp_write = NULL; + char * prev_path = NULL; #ifdef ENABLE_LUSTRE int stripe_count, stripe_size; #endif @@ -4723,11 +4723,11 @@ PDC_Server_data_write_out(uint64_t obj_id, struct pdc_region_info *region_info, { perr_t ret_value = SUCCEED; data_server_region_t *region = NULL; - region_list_t *overlap_region = NULL; + region_list_t * overlap_region = NULL; int is_contained = 0; uint64_t i, j, pos; - uint64_t *overlap_offset, *overlap_size; - char *tmp_buf; + uint64_t * overlap_offset, *overlap_size; + char * tmp_buf; #if 0 size_t total_write_size = 0, local_write_size; int is_overlap; @@ -5060,10 +5060,10 @@ PDC_Server_data_read_from(uint64_t obj_id, struct pdc_region_info *region_info, perr_t ret_value = SUCCEED; ssize_t request_bytes = unit; data_server_region_t *region = NULL; - region_list_t *elt; + region_list_t * elt; uint64_t i, j, pos; - uint64_t *overlap_offset, *overlap_size; - char *tmp_buf; + uint64_t * overlap_offset, *overlap_size; + char * tmp_buf; FUNC_ENTER(NULL); #ifdef PDC_TIMING @@ -5369,7 +5369,7 @@ PDC_Server_get_local_storage_meta_with_one_name(storage_meta_query_one_name_args { perr_t ret_value = SUCCEED; pdc_metadata_t *meta = NULL; - region_list_t *region_elt = NULL, *region_head = NULL, *res_region_list = NULL; + region_list_t * region_elt = NULL, *region_head = NULL, *res_region_list = NULL; int region_count = 0, i = 0; FUNC_ENTER(NULL); @@ -5502,7 +5502,7 @@ PDC_Server_accumulate_storage_meta_then_read(storage_meta_query_one_name_args_t { perr_t ret_value = SUCCEED; accumulate_storage_meta_t *accu_meta; - region_list_t *req_region = NULL, *region_elt = NULL, *read_list_head = NULL; + region_list_t * req_region = NULL, *region_elt = NULL, *read_list_head = NULL; int i, is_sort_read; size_t j; @@ -5671,16 +5671,16 @@ PDC_Server_storage_meta_name_query_bulk_respond(const struct hg_cb_info *callbac { hg_return_t hg_ret = HG_SUCCESS; perr_t ret_value; - storage_meta_name_query_in_t *args; + storage_meta_name_query_in_t * args; storage_meta_query_one_name_args_t *query_args; hg_handle_t rpc_handle; hg_bulk_t bulk_handle; bulk_rpc_in_t bulk_rpc_in; - void **buf_ptrs; - hg_size_t *buf_sizes; + void ** buf_ptrs; + hg_size_t * buf_sizes; uint32_t server_id; - region_info_transfer_t **region_infos; - region_list_t *region_elt; + region_info_transfer_t ** region_infos; + region_list_t * region_elt; int i, j; FUNC_ENTER(NULL); @@ -5823,9 +5823,9 @@ PDC_Server_add_client_shm_to_cache(int cnt, void *buf_cp) { perr_t ret_value = SUCCEED; int i, j; - region_storage_meta_t *storage_metas = (region_storage_meta_t *)buf_cp; + region_storage_meta_t * storage_metas = (region_storage_meta_t *)buf_cp; pdc_data_server_io_list_t *io_list_elt, *io_list_target; - region_list_t *new_region; + region_list_t * new_region; FUNC_ENTER(NULL); @@ -5938,7 +5938,7 @@ PDC_Server_data_read_to_buf_1_region(region_list_t *region) { perr_t ret_value = SUCCEED; uint64_t offset, read_bytes; - FILE *fp_read = NULL; + FILE * fp_read = NULL; if (region->is_data_ready == 1) return SUCCEED; @@ -5987,9 +5987,9 @@ PDC_Server_data_read_to_buf(region_list_t *region_list_head) { perr_t ret_value = SUCCEED; region_list_t *region_elt; - char *prev_path = NULL; + char * prev_path = NULL; uint64_t offset, read_bytes; - FILE *fp_read = NULL; + FILE * fp_read = NULL; int read_count = 0; @@ -6267,8 +6267,8 @@ static perr_t PDC_Server_load_query_data(query_task_t *task, pdc_query_t *query, pdc_query_combine_op_t combine_op) { perr_t ret_value = SUCCEED; - region_list_t *req_region = NULL, *region_tmp = NULL; - region_list_t *storage_region_list_head = NULL; + region_list_t * req_region = NULL, *region_tmp = NULL; + region_list_t * storage_region_list_head = NULL; pdc_data_server_io_list_t *io_list_elt, *io_list_target = NULL; uint64_t obj_id; int iter, count, is_same_region, i, can_skip; @@ -6545,7 +6545,7 @@ compare_coords_3d(const void *a, const void *b) ({ \ uint64_t idx, iii, jjj, ttt, cur_count = 0, istart, has_dup; \ int is_good, _ndim; \ - TYPE *edata = (TYPE *)(_data); \ + TYPE * edata = (TYPE *)(_data); \ _ndim = (_region)->ndim; \ istart = (_sel)->nhits * _ndim; \ if (_ndim > 3) { \ @@ -6693,7 +6693,7 @@ compare_coords_3d(const void *a, const void *b) ({ \ uint64_t idx, iii, jjj, ttt, cur_count = 0, istart, has_dup; \ int is_good, _ndim; \ - TYPE *edata = (TYPE *)(_data); \ + TYPE * edata = (TYPE *)(_data); \ _ndim = (_region)->ndim; \ istart = (_sel)->nhits * _ndim; \ if (_ndim > 3) { \ @@ -6855,11 +6855,11 @@ generate_write_fastbit_idx(uint64_t obj_id, void *data, uint64_t dataCount, Fast char keyName[128]; char offName[128]; char out_name[256]; - double *keys = NULL; - int64_t *offsets = NULL; + double * keys = NULL; + int64_t * offsets = NULL; uint32_t *bms = NULL; uint64_t nk = 0, no = 0, nb = 0; - FILE *fp; + FILE * fp; FUNC_ENTER(NULL); @@ -6959,7 +6959,7 @@ int queryData(const char *name) { uint64_t nhits, i; - uint64_t *buf; + uint64_t * buf; double val1 = 0.0, val2 = 10.0; FastBitSelectionHandle sel1 = fastbit_selection_osr(name, FastBitCompareGreater, val1); FastBitSelectionHandle sel2 = fastbit_selection_osr(name, FastBitCompareLess, val2); @@ -6994,7 +6994,7 @@ PDC_load_fastbit_index(char *idx_name, uint64_t obj_id, FastBitDataType dtype, i char offName[128]; char out_name[256]; uint64_t nk = 0, no = 0, nb = 0, size; - FILE *fp; + FILE * fp; PDC_gen_fastbit_idx_name(bmsName, "bms", obj_id, timestep, ndim, start, count); PDC_gen_fastbit_idx_name(keyName, "key", obj_id, timestep, ndim, start, count); @@ -7070,9 +7070,9 @@ PDC_query_fastbit_idx(region_list_t *region, pdc_query_constraint_t *constraint, perr_t ret_value = SUCCEED; FastBitDataType ft = 0; uint64_t type_size; - uint32_t *bms = NULL; - double *keys = NULL; - int64_t *offsets = NULL; + uint32_t * bms = NULL; + double * keys = NULL; + int64_t * offsets = NULL; int timestep; double v1, v2; size_t i; @@ -7248,7 +7248,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ pdc_query_combine_op_t combine_op) { perr_t ret_value = SUCCEED; - region_list_t *region_elt, *region_list_head, *cache_region, tmp_region, *region_constraint = NULL; + region_list_t * region_elt, *region_list_head, *cache_region, tmp_region, *region_constraint = NULL; pdc_selection_t *sel = query->sel; uint64_t nelem; size_t i, j, unit_size; @@ -7262,7 +7262,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ uint32_t ulo = 0, uhi = 0; int64_t i64lo = 0, i64hi = 0; uint64_t ui64lo = 0, ui64hi = 0; - void *value = NULL, *buf = NULL; + void * value = NULL, *buf = NULL; int n_eval_region = 0, can_skip, region_iter = 0; printf("==PDC_SERVER[%d]: %s - start query evaluation!\n", pdc_server_rank_g, __func__); @@ -7634,7 +7634,7 @@ PDC_Server_query_evaluate_merge_opt(pdc_query_t *query, query_task_t *task, pdc_ n_eval_region++; } // End DL_FOREACH - } // End not use fastbit + } // End not use fastbit if (n_eval_region == 0 && combine_op == PDC_QUERY_AND) { if (sel->nhits > 0) { @@ -7975,7 +7975,7 @@ PDC_Server_send_coords_to_client(query_task_t *task) hg_bulk_t bulk_handle; bulk_rpc_in_t in; hg_size_t buf_sizes; - void *buf; + void * buf; int client_id; FUNC_ENTER(NULL); @@ -8060,7 +8060,7 @@ PDC_Server_send_coords_to_server(query_task_t *task) hg_bulk_t bulk_handle = NULL; bulk_rpc_in_t in; hg_size_t buf_sizes; - void *buf; + void * buf; int server_id; FUNC_ENTER(NULL); @@ -8271,9 +8271,9 @@ hg_return_t PDC_Server_read_coords(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; - query_task_t *task = (query_task_t *)callback_info->arg; + query_task_t * task = (query_task_t *)callback_info->arg; pdc_query_constraint_t *constraint; - region_list_t *storage_region_head, *region_elt, *cache_region; + region_list_t * storage_region_head, *region_elt, *cache_region; size_t ndim, unit_size; uint64_t i, *coord, data_off, buf_off, my_size; @@ -8339,11 +8339,11 @@ PDC_recv_read_coords(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; - query_task_t *task_elt = NULL; + query_task_t * task_elt = NULL; uint64_t nhits, obj_id; uint32_t ndim; int query_id, origin; - void *buf; + void * buf; pdc_int_ret_t out; out.ret = 1; @@ -8423,7 +8423,7 @@ PDC_recv_coords(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; - query_task_t *task_elt; + query_task_t * task_elt; uint64_t nhits = 0, total_hits; size_t ndim, unit_size; int i, query_id, origin, found_task; @@ -8644,7 +8644,7 @@ perr_t add_storage_region_to_buf(void **in_buf, uint64_t *buf_alloc, uint64_t *buf_off, const region_list_t *region) { perr_t ret_value = SUCCEED; - void *buf = *in_buf; + void * buf = *in_buf; uint64_t my_size, tmp_size; if (in_buf == NULL || *in_buf == NULL || region == NULL || buf_alloc == NULL || buf_off == NULL || @@ -8849,8 +8849,8 @@ PDC_Server_distribute_query_storage_info(query_task_t *task, uint64_t obj_id, in { pdc_metadata_t *meta = NULL; int i, server_id, count, avg_count, nsent, nsent_server; - region_list_t *elt, *new_region = NULL; - void *region_bulk_buf; + region_list_t * elt, *new_region = NULL; + void * region_bulk_buf; uint64_t buf_alloc = 0, buf_off = 0; bulk_rpc_in_t header; @@ -8989,16 +8989,16 @@ PDC_recv_query_metadata_bulk(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; hg_bulk_t local_bulk_handle = callback_info->info.bulk.local_handle; - struct bulk_args_t *bulk_args = (struct bulk_args_t *)callback_info->arg; - void *buf; - region_list_t *regions = NULL; + struct bulk_args_t * bulk_args = (struct bulk_args_t *)callback_info->arg; + void * buf; + region_list_t * regions = NULL; int i, nregion, *loc_len_ptr, *has_hist_ptr, found_task; uint64_t buf_off, *offset_ptr = NULL, *size_ptr = NULL; - char *loc_ptr = NULL; + char * loc_ptr = NULL; region_info_transfer_t *region_info_ptr = NULL; - pdc_histogram_t *hist_ptr = NULL; - query_task_t *task_elt = NULL; - pdc_query_t *query = NULL; + pdc_histogram_t * hist_ptr = NULL; + query_task_t * task_elt = NULL; + pdc_query_t * query = NULL; pdc_int_ret_t out; out.ret = 1; @@ -9167,10 +9167,10 @@ PDC_Server_recv_data_query(const struct hg_cb_info *callback_info) hg_return_t ret = HG_SUCCESS; pdc_query_xfer_t *query_xfer = (pdc_query_xfer_t *)callback_info->arg; int obj_idx = 0; - uint64_t *obj_ids; - query_task_t *new_task = NULL, *task_elt; + uint64_t * obj_ids; + query_task_t * new_task = NULL, *task_elt; int query_id_exist = 0; - pdc_query_t *query; + pdc_query_t * query; query = PDC_deserialize_query(query_xfer); if (NULL == query) { @@ -9276,7 +9276,7 @@ PDC_Server_send_read_coords_to_server(int server_id, uint64_t *coord, uint64_t n hg_bulk_t bulk_handle = NULL; bulk_rpc_in_t in; hg_size_t buf_sizes; - void *buf; + void * buf; FUNC_ENTER(NULL); @@ -9391,12 +9391,12 @@ hg_return_t PDC_Server_recv_read_sel_obj_data(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; - get_sel_data_rpc_in_t *in = (get_sel_data_rpc_in_t *)callback_info->arg; - query_task_t *task_elt, *task = NULL; + get_sel_data_rpc_in_t * in = (get_sel_data_rpc_in_t *)callback_info->arg; + query_task_t * task_elt, *task = NULL; uint64_t nhits, *coord, *coords = NULL, obj_id, buf_off, my_size, data_off, i; size_t ndim, unit_size; cache_storage_region_t *cache_region_elt; - region_list_t *storage_region_head = NULL, *cache_region, *region_elt; + region_list_t * storage_region_head = NULL, *cache_region, *region_elt; pdc_var_type_t data_type; // find task @@ -9484,8 +9484,8 @@ PDC_Server_recv_get_sel_data(const struct hg_cb_info *callback_info) { hg_return_t ret = HG_SUCCESS; get_sel_data_rpc_in_t *in = (get_sel_data_rpc_in_t *)callback_info->arg; - query_task_t *task_elt, *task = NULL; - pdc_metadata_t *meta; + query_task_t * task_elt, *task = NULL; + pdc_metadata_t * meta; struct hg_cb_info fake_callback_info = {0}; DL_FOREACH(query_task_list_head_g, task_elt) diff --git a/src/server/pdc_server_region/pdc_server_region_cache.c b/src/server/pdc_server_region/pdc_server_region_cache.c index c6fa01b41..98cd5758c 100644 --- a/src/server/pdc_server_region/pdc_server_region_cache.c +++ b/src/server/pdc_server_region/pdc_server_region_cache.c @@ -25,7 +25,7 @@ #endif typedef struct pdc_region_cache { - struct pdc_region_info *region_cache_info; + struct pdc_region_info * region_cache_info; struct pdc_region_cache *next; } pdc_region_cache; @@ -33,9 +33,9 @@ typedef struct pdc_obj_cache { struct pdc_obj_cache *next; uint64_t obj_id; int ndim; - uint64_t *dims; - pdc_region_cache *region_cache; - pdc_region_cache *region_cache_end; + uint64_t * dims; + pdc_region_cache * region_cache; + pdc_region_cache * region_cache_end; int region_cache_size; struct timeval timestamp; } pdc_obj_cache; @@ -230,7 +230,7 @@ PDC_region_merge(const char *buf, const char *buf2, const uint64_t *offset, cons { int connect_flag, i, j; uint64_t tmp_buf_size; - char *buf_merged; + char * buf_merged; connect_flag = -1; // Detect if two regions are connected. This means one dimension is fully connected and all other // dimensions are identical. @@ -346,7 +346,7 @@ int PDC_region_cache_copy(char *buf, char *buf2, const uint64_t *offset, const uint64_t *size, const uint64_t *offset2, const uint64_t *size2, int ndim, size_t unit, int direction) { - char *src, *dst; + char * src, *dst; uint64_t i, j; uint64_t *local_offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim); memcpy(local_offset, offset2, sizeof(uint64_t) * ndim); @@ -416,7 +416,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim size_t buf_size, const uint64_t *offset, const uint64_t *size, int ndim, size_t unit) { - pdc_obj_cache *obj_cache_iter, *obj_cache = NULL; + pdc_obj_cache * obj_cache_iter, *obj_cache = NULL; struct pdc_region_info *region_cache_info; if (obj_ndim != ndim && obj_ndim > 0) { printf("%s reports obj_ndim != ndim, %d != %d\n", __func__, obj_ndim, ndim); @@ -517,7 +517,7 @@ PDC_region_cache_register(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dim int PDC_region_cache_free() { - pdc_obj_cache *obj_cache_iter, *obj_temp; + pdc_obj_cache * obj_cache_iter, *obj_temp; pdc_region_cache *region_cache_iter, *region_temp; obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { @@ -541,9 +541,9 @@ PDC_transfer_request_data_write_out(uint64_t obj_id, int obj_ndim, const uint64_ { // flag indicates whether the input region is fully contained in another cached region. int flag; - pdc_obj_cache *obj_cache, *obj_cache_iter; + pdc_obj_cache * obj_cache, *obj_cache_iter; pdc_region_cache *region_cache_iter; - uint64_t *overlap_offset, *overlap_size; + uint64_t * overlap_offset, *overlap_size; perr_t ret_value = SUCCEED; char cur_time[64]; @@ -649,7 +649,7 @@ merge_requests(uint64_t *start, uint64_t *end, int request_size, char **buf, uin { int i, index; int merged_requests = 1; - char *ptr; + char * ptr; size_t total_data_size = end[0] - start[0]; uint64_t prev_end = end[0]; for (i = 1; i < request_size; ++i) { @@ -718,11 +718,11 @@ int PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int flag) { int i, nflush = 0; - pdc_region_cache *region_cache_iter, *region_cache_temp; - struct pdc_region_info *region_cache_info; + pdc_region_cache * region_cache_iter, *region_cache_temp; + struct pdc_region_info * region_cache_info; uint64_t write_size = 0; - char **buf, **new_buf, *buf_ptr = NULL; - uint64_t *start, *end, *new_start, *new_end; + char ** buf, **new_buf, *buf_ptr = NULL; + uint64_t * start, *end, *new_start, *new_end; int merged_request_size = 0; uint64_t unit; struct pdc_region_info **obj_regions; @@ -742,7 +742,7 @@ PDC_region_cache_flush_by_pointer(uint64_t obj_id, pdc_obj_cache *obj_cache, int // Sort the regions based on start index obj_regions = (struct pdc_region_info **)malloc(sizeof(struct pdc_region_info *) * - obj_cache->region_cache_size); + obj_cache->region_cache_size); unit = obj_cache->region_cache->region_cache_info->unit; region_cache_iter = obj_cache->region_cache; i = 0; @@ -916,7 +916,7 @@ PDC_region_cache_clock_cycle(void *ptr) int nflush = 0; double flush_frequency_s = PDC_CACHE_FLUSH_TIME_INT, elapsed_time; time_t t; - struct tm *tm; + struct tm * tm; char cur_time[64]; char *p = getenv("PDC_SERVER_CACHE_FLUSH_FREQUENCY_S"); @@ -1022,7 +1022,7 @@ PDC_region_fetch(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims, struct int flag = 0; // size_t j; pdc_region_cache *region_cache_iter; - uint64_t *overlap_offset, *overlap_size; + uint64_t * overlap_offset, *overlap_size; obj_cache_iter = obj_cache_list; while (obj_cache_iter != NULL) { diff --git a/src/server/pdc_server_region/pdc_server_region_request_handler.h b/src/server/pdc_server_region/pdc_server_region_request_handler.h index 507f3e26c..c6f96f6ab 100644 --- a/src/server/pdc_server_region/pdc_server_region_request_handler.h +++ b/src/server/pdc_server_region/pdc_server_region_request_handler.h @@ -40,14 +40,14 @@ hg_return_t transfer_request_all_bulk_transfer_read_cb(const struct hg_cb_info *info) { struct transfer_request_all_local_bulk_args2 *local_bulk_args2; - struct transfer_request_all_local_bulk_args *local_bulk_args = info->arg; - const struct hg_info *handle_info; + struct transfer_request_all_local_bulk_args * local_bulk_args = info->arg; + const struct hg_info * handle_info; transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info *remote_reg_info; + struct pdc_region_info * remote_reg_info; int i, j; uint64_t total_mem_size, mem_size; - char *ptr; + char * ptr; FUNC_ENTER(NULL); @@ -171,7 +171,7 @@ transfer_request_all_bulk_transfer_write_cb(const struct hg_cb_info *info) struct transfer_request_all_local_bulk_args *local_bulk_args = info->arg; transfer_request_all_data request_data; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info *remote_reg_info; + struct pdc_region_info * remote_reg_info; int i; char cur_time[64]; @@ -285,8 +285,8 @@ transfer_request_wait_all_bulk_transfer_cb(const struct hg_cb_info *info) pdcid_t transfer_request_id; hg_return_t ret = HG_SUCCESS; int i, fast_return; - char *ptr; - int *handle_ref; + char * ptr; + int * handle_ref; pdc_transfer_status_t status; FUNC_ENTER(NULL); @@ -348,7 +348,7 @@ transfer_request_bulk_transfer_write_cb(const struct hg_cb_info *info) { struct transfer_request_local_bulk_args *local_bulk_args = info->arg; hg_return_t ret = HG_SUCCESS; - struct pdc_region_info *remote_reg_info; + struct pdc_region_info * remote_reg_info; uint64_t obj_dims[3]; FUNC_ENTER(NULL); @@ -484,7 +484,7 @@ HG_TEST_RPC_CB(transfer_request_wait, handle) transfer_request_wait_out_t out; pdc_transfer_status_t status; int fast_return = 0; - int *handle_ref; + int * handle_ref; FUNC_ENTER(NULL); #ifdef PDC_TIMING @@ -543,7 +543,7 @@ HG_TEST_RPC_CB(transfer_request_wait, handle) HG_TEST_RPC_CB(transfer_request_wait_all, handle) { struct transfer_request_wait_all_local_bulk_args *local_bulk_args; - const struct hg_info *info; + const struct hg_info * info; transfer_request_wait_all_in_t in; hg_return_t ret_value = HG_SUCCESS; FUNC_ENTER(NULL); @@ -580,7 +580,7 @@ HG_TEST_RPC_CB(transfer_request_wait_all, handle) HG_TEST_RPC_CB(transfer_request_all, handle) { struct transfer_request_all_local_bulk_args *local_bulk_args; - const struct hg_info *info; + const struct hg_info * info; transfer_request_all_in_t in; transfer_request_all_out_t out; hg_return_t ret_value = HG_SUCCESS; @@ -719,7 +719,7 @@ transfer_request_metadata_query_bulk_transfer_cb(const struct hg_cb_info *info) HG_TEST_RPC_CB(transfer_request_metadata_query, handle) { struct transfer_request_metadata_query_local_bulk_args *local_bulk_args; - const struct hg_info *info; + const struct hg_info * info; transfer_request_metadata_query_in_t in; hg_return_t ret_value = HG_SUCCESS; @@ -777,7 +777,7 @@ transfer_request_metadata_query2_bulk_transfer_cb(const struct hg_cb_info *info) HG_TEST_RPC_CB(transfer_request_metadata_query2, handle) { struct transfer_request_metadata_query2_local_bulk_args *local_bulk_args; - const struct hg_info *info; + const struct hg_info * info; transfer_request_metadata_query2_in_t in; hg_return_t ret_value = HG_SUCCESS; @@ -824,8 +824,8 @@ HG_TEST_RPC_CB(transfer_request, handle) transfer_request_out_t out; struct transfer_request_local_bulk_args *local_bulk_args; size_t total_mem_size; - const struct hg_info *info; - struct pdc_region_info *remote_reg_info; + const struct hg_info * info; + struct pdc_region_info * remote_reg_info; uint64_t obj_dims[3]; FUNC_ENTER(NULL); diff --git a/src/server/pdc_server_region/pdc_server_region_transfer.c b/src/server/pdc_server_region/pdc_server_region_transfer.c index 338c61b8b..0fb4d5a67 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer.c @@ -77,7 +77,7 @@ PDC_commit_request(uint64_t transfer_request_id) perr_t PDC_finish_request(uint64_t transfer_request_id) { - pdc_transfer_request_status *ptr, *tmp = NULL; + pdc_transfer_request_status * ptr, *tmp = NULL; perr_t ret_value = SUCCEED; transfer_request_wait_out_t out; transfer_request_wait_all_out_t out_all; @@ -272,8 +272,8 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob { perr_t ret_value = SUCCEED; int fd; - char *data_path = NULL; - char *user_specified_data_path = NULL; + char * data_path = NULL; + char * user_specified_data_path = NULL; char storage_location[ADDR_MAX]; ssize_t io_size; uint64_t i, j; @@ -437,7 +437,7 @@ print_bulk_data(transfer_request_all_data *request_data) int parse_bulk_data(void *buf, transfer_request_all_data *request_data, pdc_access_t access_type) { - char *ptr = (char *)buf; + char * ptr = (char *)buf; int i, j; uint64_t data_size; diff --git a/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c b/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c index 979d77a4f..4e41132f8 100644 --- a/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c +++ b/src/server/pdc_server_region/pdc_server_region_transfer_metadata_query.c @@ -5,8 +5,8 @@ #include "pdc_region.h" typedef struct pdc_region_metadata_pkg { - uint64_t *reg_offset; - uint64_t *reg_size; + uint64_t * reg_offset; + uint64_t * reg_size; uint32_t data_server_id; struct pdc_region_metadata_pkg *next; } pdc_region_metadata_pkg; @@ -14,8 +14,8 @@ typedef struct pdc_region_metadata_pkg { typedef struct pdc_obj_metadata_pkg { int ndim; uint64_t obj_id; - pdc_region_metadata_pkg *regions; - pdc_region_metadata_pkg *regions_end; + pdc_region_metadata_pkg * regions; + pdc_region_metadata_pkg * regions_end; struct pdc_obj_metadata_pkg *next; } pdc_obj_metadata_pkg; @@ -28,13 +28,13 @@ typedef struct pdc_obj_region_metadata { typedef struct pdc_metadata_query_buf { uint64_t id; - char *buf; + char * buf; struct pdc_metadata_query_buf *next; } pdc_metadata_query_buf; -static pdc_obj_metadata_pkg *metadata_server_objs; -static pdc_obj_metadata_pkg *metadata_server_objs_end; -static uint64_t *data_server_bytes; +static pdc_obj_metadata_pkg * metadata_server_objs; +static pdc_obj_metadata_pkg * metadata_server_objs_end; +static uint64_t * data_server_bytes; static int pdc_server_size; static uint64_t query_id_g; static pdc_metadata_query_buf *metadata_query_buf_head; @@ -58,7 +58,7 @@ perr_t transfer_request_metadata_query_init(int pdc_server_size_input, char *checkpoint) { hg_return_t ret_value = HG_SUCCESS; - char *ptr; + char * ptr; int n_objs, reg_count; int i, j; FUNC_ENTER(NULL); @@ -139,7 +139,7 @@ perr_t transfer_request_metadata_query_finalize() { hg_return_t ret_value = HG_SUCCESS; - pdc_obj_metadata_pkg *obj_temp, *obj_temp2; + pdc_obj_metadata_pkg * obj_temp, *obj_temp2; pdc_region_metadata_pkg *region_temp, *region_temp2; FUNC_ENTER(NULL); @@ -177,9 +177,9 @@ perr_t transfer_request_metadata_query_checkpoint(char **checkpoint, uint64_t *checkpoint_size) { hg_return_t ret_value = HG_SUCCESS; - pdc_obj_metadata_pkg *obj_temp; + pdc_obj_metadata_pkg * obj_temp; pdc_region_metadata_pkg *region_temp; - char *ptr; + char * ptr; int reg_count, obj_count; FUNC_ENTER(NULL); pthread_mutex_lock(&metadata_query_mutex); @@ -245,15 +245,15 @@ transfer_request_metadata_query_checkpoint(char **checkpoint, uint64_t *checkpoi static uint64_t metadata_query_buf_create(pdc_obj_region_metadata *regions, int size, uint64_t *total_buf_size_ptr) { - pdc_obj_metadata_pkg *temp; + pdc_obj_metadata_pkg * temp; pdc_region_metadata_pkg *region_metadata; int i; uint64_t total_data_size; - pdc_metadata_query_buf *query_buf; + pdc_metadata_query_buf * query_buf; uint64_t query_id; - uint64_t *overlap_offset, *overlap_size; - char *ptr; - int *transfer_request_counters; + uint64_t * overlap_offset, *overlap_size; + char * ptr; + int * transfer_request_counters; int transfer_request_counter_total; FUNC_ENTER(NULL); @@ -412,7 +412,7 @@ uint64_t transfer_request_metadata_query_parse(int32_t n_objs, char *buf, uint8_t is_write, uint64_t *total_buf_size_ptr) { - char *ptr = buf; + char * ptr = buf; int i; uint64_t query_id = 0; size_t unit; @@ -509,7 +509,7 @@ static uint64_t transfer_request_metadata_query_append(uint64_t obj_id, int ndim, uint64_t *reg_offset, uint64_t *reg_size, size_t unit, uint32_t data_server_id, uint8_t region_partition) { - pdc_obj_metadata_pkg *temp; + pdc_obj_metadata_pkg * temp; pdc_region_metadata_pkg *region_metadata; pdc_region_metadata_pkg *temp_region_metadata; diff --git a/src/tests/bdcats.c b/src/tests/bdcats.c index 5866df4fd..13c052b24 100644 --- a/src/tests/bdcats.c +++ b/src/tests/bdcats.c @@ -57,9 +57,9 @@ main(int argc, char **argv) pdcid_t region_xx, region_yy, region_zz, region_pxx, region_pyy, region_pzz, region_id11, region_id22; perr_t ret; - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; uint64_t numparticles; int ndim = 1; uint64_t *offset; diff --git a/src/tests/bdcats_old.c b/src/tests/bdcats_old.c index 22d5bab09..b4cdc347b 100644 --- a/src/tests/bdcats_old.c +++ b/src/tests/bdcats_old.c @@ -56,9 +56,9 @@ main(int argc, char **argv) pdcid_t region_x, region_y, region_z, region_px, region_py, region_pz, region_id1, region_id2; pdcid_t region_xx, region_yy, region_zz, region_pxx, region_pyy, region_pzz, region_id11, region_id22; perr_t ret; - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; uint64_t numparticles; int ndim = 1; uint64_t *offset; diff --git a/src/tests/bdcats_v2.c b/src/tests/bdcats_v2.c index 9a8de9390..88a78b094 100644 --- a/src/tests/bdcats_v2.c +++ b/src/tests/bdcats_v2.c @@ -60,14 +60,14 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; uint64_t numparticles; int ndim = 1; - uint64_t *offset; - uint64_t *offset_remote; - uint64_t *mysize; + uint64_t * offset; + uint64_t * offset_remote; + uint64_t * mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/blocked_lock.c b/src/tests/blocked_lock.c index 533691e99..4bdcb7f79 100644 --- a/src/tests/blocked_lock.c +++ b/src/tests/blocked_lock.c @@ -47,7 +47,7 @@ main(int argc, char **argv) pdcid_t obj2; pdcid_t r1, r2; perr_t ret; - float *x; + float * x; int x_dim = 64; long numparticles = 8388608; // const int my_data_size = 992; diff --git a/src/tests/buf_map_mpi_v2.c b/src/tests/buf_map_mpi_v2.c index 5158e45b7..7cbc912f7 100644 --- a/src/tests/buf_map_mpi_v2.c +++ b/src/tests/buf_map_mpi_v2.c @@ -52,7 +52,7 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x; + float * x; long numparticles = 4; uint64_t dims[1] = {numparticles}; // {8388608}; int ndim = 1; diff --git a/src/tests/buf_obj_map_mpi.c b/src/tests/buf_obj_map_mpi.c index e1096946c..3de60aabd 100644 --- a/src/tests/buf_obj_map_mpi.c +++ b/src/tests/buf_obj_map_mpi.c @@ -52,7 +52,7 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x; + float * x; int x_dim = 64; long numparticles = 4; uint64_t dims[1] = {numparticles}; // {8388608}; @@ -96,7 +96,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI obj2 = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop2, 0, comm); #else - obj2 = PDCobj_create(cont_id, "obj-var-xx", obj_prop2); + obj2 = PDCobj_create(cont_id, "obj-var-xx", obj_prop2); #endif if (obj2 == 0) { printf("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); diff --git a/src/tests/client_server.c b/src/tests/client_server.c index ec5a7580a..f63e659de 100644 --- a/src/tests/client_server.c +++ b/src/tests/client_server.c @@ -190,7 +190,7 @@ main(int argc, char **argv) size = 1; #endif - hg_class_t *hg_class = NULL; + hg_class_t * hg_class = NULL; hg_context_t *hg_context = NULL; hg_return_t hg_ret = 0; diff --git a/src/tests/cont_add_del.c b/src/tests/cont_add_del.c index 0fc20988e..de55ff6e7 100644 --- a/src/tests/cont_add_del.c +++ b/src/tests/cont_add_del.c @@ -79,7 +79,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/create_obj_scale.c b/src/tests/create_obj_scale.c index dd3bb33a2..ebd0d373e 100644 --- a/src/tests/create_obj_scale.c +++ b/src/tests/create_obj_scale.c @@ -76,7 +76,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/dart_algo_sim.c b/src/tests/dart_algo_sim.c index df28917b2..5b216dd8e 100644 --- a/src/tests/dart_algo_sim.c +++ b/src/tests/dart_algo_sim.c @@ -404,7 +404,7 @@ main(int argc, char **argv) word_count = atoi(argv[7]); prefix_len = atoi(argv[8]); char **input_word_list = NULL; - int *req_count = NULL; + int * req_count = NULL; int i = 0; @@ -432,7 +432,7 @@ main(int argc, char **argv) void (*keyword_insert[])(char *, int) = {DHT_INITIAL_keyword_insert, DHT_FULL_keyword_insert, dart_keyword_insert}; int (*keyword_search[])(char *, int) = {DHT_INITIAL_keyword_search, DHT_FULL_keyword_search, - dart_keyword_search}; + dart_keyword_search}; if (INPUT_TYPE == INPUT_DICTIONARY) { // Init dart space. diff --git a/src/tests/dart_func_test.c b/src/tests/dart_func_test.c index 629fe5777..8d29379b8 100644 --- a/src/tests/dart_func_test.c +++ b/src/tests/dart_func_test.c @@ -50,15 +50,15 @@ main(int argc, char **argv) dart_object_ref_type_t ref_type = REF_PRIMARY_ID; dart_hash_algo_t hash_algo = DART_HASH; - char *key = "abcd"; - char *value = "1234"; + char * key = "abcd"; + char * value = "1234"; uint64_t data = 12341234; // if (rank == 0) { PDC_Client_insert_obj_ref_into_dart(hash_algo, key, value, ref_type, data); println("[Client_Side_Insert] Insert '%s=%s' for ref %llu", key, value, data); // This is for testing exact search - char *exact_query = "abcd=1234"; + char * exact_query = "abcd=1234"; uint64_t *out1; int rest_count1 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, exact_query, ref_type, &rest_count1, &out1); @@ -66,7 +66,7 @@ main(int argc, char **argv) println("[Client_Side_Exact] Search '%s' and get %d results : %llu", exact_query, rest_count1, out1[0]); // This function test is for testing the prefix search - char *prefix_query = "ab*=12*"; + char * prefix_query = "ab*=12*"; uint64_t *out2; int rest_count2 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, prefix_query, ref_type, &rest_count2, &out2); @@ -74,7 +74,7 @@ main(int argc, char **argv) println("[Client_Side_Prefix] Search '%s' and get %d results : %llu", prefix_query, rest_count2, out2[0]); // This function test is for testing the suffix search. - char *suffix_query = "*cd=*34"; + char * suffix_query = "*cd=*34"; uint64_t *out3; int rest_count3 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, suffix_query, ref_type, &rest_count3, &out3); @@ -82,7 +82,7 @@ main(int argc, char **argv) println("[Client_Side_Suffix] Search '%s' and get %d results : %llu", suffix_query, rest_count3, out3[0]); // This is for testing infix search. - char *infix_query = "*bc*=*23*"; + char * infix_query = "*bc*=*23*"; uint64_t *out4; int rest_count4 = 0; PDC_Client_search_obj_ref_through_dart(hash_algo, infix_query, ref_type, &rest_count4, &out4); diff --git a/src/tests/data_rw_test.c b/src/tests/data_rw_test.c index cb054ef39..1bcc0a45d 100644 --- a/src/tests/data_rw_test.c +++ b/src/tests/data_rw_test.c @@ -51,7 +51,7 @@ int print_data(int ndim, uint64_t *start, uint64_t *count, void *data) { uint64_t i, j; - char *data_1d, **data_2d, ***data_3d; + char * data_1d, **data_2d, ***data_3d; if (ndim == 1) { data_1d = (char *)data; @@ -79,8 +79,8 @@ int data_verify(int ndim, uint64_t *start, uint64_t *count, void *data, uint64_t *truth_start, void *truth_data) { uint64_t i, j, k; - char *data_1d, **data_2d, ***data_3d; - char *truth_data_1d, **truth_data_2d, ***truth_data_3d; + char * data_1d, **data_2d, ***data_3d; + char * truth_data_1d, **truth_data_2d, ***truth_data_3d; if (ndim == 1) { data_1d = (char *)data; @@ -134,13 +134,13 @@ test1d(char *obj_name) uint64_t dims[3]; uint64_t i = 0; pdcid_t obj_id; - pdc_metadata_t *metadata; + pdc_metadata_t * metadata; struct pdc_region_info region_a, region_b, region_c, region_d, read_region; uint64_t storage_offset_a, storage_offset_b, storage_offset_c, storage_offset_d, read_offset; uint64_t storage_size_a, storage_size_b, storage_size_c, storage_size_d, read_size; uint32_t ndim = 1; uint64_t total_size; - char *data, *data0, *data1, *data2, *data3, *read_data; + char * data, *data0, *data1, *data2, *data3, *read_data; uint64_t data_offset_real[3]; uint64_t data_start[3] = {0, 0, 0}; int is_correct = 0, is_all_correct = 0; @@ -254,7 +254,7 @@ int test2d(char *obj_name) { pdcid_t obj_id; - pdc_metadata_t *metadata; + pdc_metadata_t * metadata; struct pdc_region_info region_a, region_b, region_c, region_d, read_region; uint64_t storage_offset_a[3], storage_offset_b[3], storage_offset_c[3], storage_offset_d[3], read_offset[3]; @@ -264,8 +264,8 @@ test2d(char *obj_name) uint64_t data_start[3] = {0, 0, 0}; uint64_t data_offset_real[3]; int is_correct = 0, is_all_correct = 0; - char *data, *read_data; - char **data_2d, **data_a_2d, **data_b_2d, **data_c_2d, **data_d_2d, **read_data_2d; + char * data, *read_data; + char ** data_2d, **data_a_2d, **data_b_2d, **data_c_2d, **data_d_2d, **read_data_2d; uint32_t ndim = 2; prob_domain[0] = 25 * size; @@ -439,7 +439,7 @@ test3d(char *obj_name) uint32_t ndim = 3; pdcid_t obj_id; - pdc_metadata_t *metadata; + pdc_metadata_t * metadata; struct pdc_region_info region_a; struct pdc_region_info region_b; struct pdc_region_info region_c; diff --git a/src/tests/data_server_meta.c b/src/tests/data_server_meta.c index 13ef1cf68..b0f92746e 100644 --- a/src/tests/data_server_meta.c +++ b/src/tests/data_server_meta.c @@ -71,7 +71,7 @@ main(int argc, char **argv) char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/data_server_meta_test.c b/src/tests/data_server_meta_test.c index 42c88a98b..3f0e8fbf2 100644 --- a/src/tests/data_server_meta_test.c +++ b/src/tests/data_server_meta_test.c @@ -33,16 +33,16 @@ main(int argc, char **argv) #endif pdc_metadata_t *metadata[NOBJ]; - char *obj_names[NOBJ]; + char * obj_names[NOBJ]; const int my_data_size = 1048576; int ndim = 1; uint64_t dims[1] = {my_data_size}; - char *write_data = (char *)malloc(my_data_size); + char * write_data = (char *)malloc(my_data_size); int my_read_obj = NOBJ / size; int my_read_obj_start = my_read_obj * rank; uint64_t *out_buf_sizes = (uint64_t *)calloc(sizeof(uint64_t), my_read_obj); - void **out_buf; + void ** out_buf; write_region.ndim = ndim; write_region.offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim); diff --git a/src/tests/data_server_read.c b/src/tests/data_server_read.c index 99398868b..f56ac5f09 100644 --- a/src/tests/data_server_read.c +++ b/src/tests/data_server_read.c @@ -20,10 +20,10 @@ main(int argc, char **argv) uint64_t readsize; pdcid_t pdc, cont_prop, cont; struct pdc_region_info region; - pdc_metadata_t *metadata; + pdc_metadata_t * metadata; uint64_t my_readsize; int ndim = 1; - void *buf; + void * buf; struct timeval ht_total_start; struct timeval ht_total_end; diff --git a/src/tests/data_server_read_vpic.c b/src/tests/data_server_read_vpic.c index 2a2ab47aa..2dd77651c 100644 --- a/src/tests/data_server_read_vpic.c +++ b/src/tests/data_server_read_vpic.c @@ -59,12 +59,12 @@ main(int argc, char **argv) char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t *obj_metas[NUM_VAR]; + pdc_metadata_t * obj_metas[NUM_VAR]; uint64_t float_bytes = NPARTICLES * sizeof(float); uint64_t int_bytes = NPARTICLES * sizeof(int); uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR]; + void * mydata[NUM_VAR]; int read_var = NUM_VAR; @@ -214,7 +214,7 @@ main(int argc, char **argv) verify = 0; break; } // end if - } // end of + } // end of if (verify == 1) { if (rank == 0) printf("SUCCEED\n"); diff --git a/src/tests/data_server_read_vpic_multits.c b/src/tests/data_server_read_vpic_multits.c index c1529608b..f260e8cfb 100644 --- a/src/tests/data_server_read_vpic_multits.c +++ b/src/tests/data_server_read_vpic_multits.c @@ -81,10 +81,10 @@ main(int argc, char **argv) uint64_t float_bytes, int_bytes; uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR_MAX]; + void * mydata[NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/data_server_read_vpic_spatial.c b/src/tests/data_server_read_vpic_spatial.c index d7c372074..e5fdd16c8 100644 --- a/src/tests/data_server_read_vpic_spatial.c +++ b/src/tests/data_server_read_vpic_spatial.c @@ -61,14 +61,14 @@ main(int argc, char **argv) int rank = 0, size = 1, i; perr_t ret; pdcid_t pdc_id, cont_prop, cont_id; - char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; + char * obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t *obj_metas[NUM_VAR]; + pdc_metadata_t * obj_metas[NUM_VAR]; uint64_t float_bytes = NPARTICLES * sizeof(float); uint64_t int_bytes = NPARTICLES * sizeof(int); uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR]; + void * mydata[NUM_VAR]; int read_var = NUM_VAR; struct pdc_request request[NUM_VAR]; diff --git a/src/tests/data_server_read_vpic_spatial_multits.c b/src/tests/data_server_read_vpic_spatial_multits.c index 57c20d7ae..e667736cf 100644 --- a/src/tests/data_server_read_vpic_spatial_multits.c +++ b/src/tests/data_server_read_vpic_spatial_multits.c @@ -82,10 +82,10 @@ main(int argc, char **argv) int n_particles; uint64_t float_bytes, int_bytes; uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR_MAX]; + void * mydata[NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/data_server_write.c b/src/tests/data_server_write.c index 66d6b47b5..174d780fe 100644 --- a/src/tests/data_server_write.c +++ b/src/tests/data_server_write.c @@ -20,15 +20,15 @@ main(int argc, char **argv) { int rank = 0, size = 1; uint64_t size_MB; - char *obj_name; + char * obj_name; pdcid_t test_obj = -1; pdcid_t pdc, cont_prop, cont, obj_prop; struct pdc_region_info region; int my_data_size; uint64_t dims[1]; int ndim = 1; - pdc_metadata_t *metadata; - char *mydata; + pdc_metadata_t * metadata; + char * mydata; struct timeval ht_total_start; struct timeval ht_total_end; diff --git a/src/tests/data_server_write_vpic.c b/src/tests/data_server_write_vpic.c index 63756c5e3..2a5f9d646 100644 --- a/src/tests/data_server_write_vpic.c +++ b/src/tests/data_server_write_vpic.c @@ -69,7 +69,7 @@ main(int argc, char **argv) pdcid_t obj_ids[NUM_VAR]; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t *obj_metas[NUM_VAR]; + pdc_metadata_t * obj_metas[NUM_VAR]; pdcid_t obj_prop_float, obj_prop_int; @@ -80,7 +80,7 @@ main(int argc, char **argv) uint64_t int_dims[NDIM] = {int_bytes * size}; uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR]; + void * mydata[NUM_VAR]; int write_var = NUM_VAR; diff --git a/src/tests/data_server_write_vpic_multits.c b/src/tests/data_server_write_vpic_multits.c index 50c4d63a1..6a943bb58 100644 --- a/src/tests/data_server_write_vpic_multits.c +++ b/src/tests/data_server_write_vpic_multits.c @@ -81,12 +81,12 @@ main(int argc, char **argv) uint64_t float_dims[NDIM]; uint64_t int_dims[NDIM]; uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR_MAX]; + void * mydata[NUM_VAR_MAX]; pdcid_t obj_prop_float, obj_prop_int; pdcid_t obj_ids[TS_MAX][NUM_VAR_MAX]; struct pdc_region_info obj_regions[TS_MAX][NUM_VAR_MAX]; - pdc_metadata_t *obj_metas[TS_MAX][NUM_VAR_MAX]; + pdc_metadata_t * obj_metas[TS_MAX][NUM_VAR_MAX]; struct pdc_request request[TS_MAX][NUM_VAR_MAX]; struct timeval pdc_timer_start; diff --git a/src/tests/delete_obj.c b/src/tests/delete_obj.c index af6b4c4de..22265de88 100644 --- a/src/tests/delete_obj.c +++ b/src/tests/delete_obj.c @@ -65,9 +65,9 @@ main(int argc, char **argv) int use_name = -1; char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; - char *env_str; + char * env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char obj_name[1024]; perr_t ret; diff --git a/src/tests/delete_obj_scale.c b/src/tests/delete_obj_scale.c index d6f486bde..e97aa409f 100644 --- a/src/tests/delete_obj_scale.c +++ b/src/tests/delete_obj_scale.c @@ -70,9 +70,9 @@ main(int argc, char **argv) char tmp_str[128]; int use_name = -1; int progress_factor; - char *env_str; + char * env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/gen_fastbit_idx.c b/src/tests/gen_fastbit_idx.c index 544df75f6..14afc92d7 100644 --- a/src/tests/gen_fastbit_idx.c +++ b/src/tests/gen_fastbit_idx.c @@ -13,8 +13,8 @@ int main(int argc, char **argv) { uint64_t nhits; - char *var_name; - pdc_query_t *qpreload_x; + char * var_name; + pdc_query_t * qpreload_x; pdc_metadata_t *meta; pdcid_t pdc, id; float preload_value = -2000000000.0; diff --git a/src/tests/hash_table.c b/src/tests/hash_table.c index eb4180216..dac6cf357 100644 --- a/src/tests/hash_table.c +++ b/src/tests/hash_table.c @@ -74,10 +74,10 @@ main(int argc, char *argv[]) { hg_hash_table_t *hash_table = NULL; - int *key1, *key2; + int * key1, *key2; hash_value_metadata_t *value1, *value2; const int num = 100; - int *keys[num]; + int * keys[num]; int i; hash_value_metadata_t *values[num]; hash_value_metadata_t *lookup_value = NULL; diff --git a/src/tests/helper/julia_helper_loader.c b/src/tests/helper/julia_helper_loader.c index c010e70f4..887051e46 100644 --- a/src/tests/helper/julia_helper_loader.c +++ b/src/tests/helper/julia_helper_loader.c @@ -55,9 +55,9 @@ run_jl_function(const char *mod_name, const char *fun_name, jl_fn_args_t *args) { char module_eval_cmd[strlen(mod_name) + 15]; sprintf(module_eval_cmd, "Main.%s", mod_name); - jl_module_t *JuliaModule = (jl_module_t *)jl_eval_string(module_eval_cmd); + jl_module_t * JuliaModule = (jl_module_t *)jl_eval_string(module_eval_cmd); jl_function_t *jl_func = jl_get_function(JuliaModule, fun_name); - jl_value_t *result = jl_call(jl_func, args->args, args->nargs); + jl_value_t * result = jl_call(jl_func, args->args, args->nargs); printf("[PDC_JL_HELPER] Function called: %s.%s\n", mod_name, fun_name); return result; } @@ -69,7 +69,7 @@ run_jl_get_int64_array(const char *mod_name, const char *fun_name, jl_fn_args_t jl_value_t *ret = run_jl_function(mod_name, fun_name, args); JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; - int64_t *data = (int64_t *)jl_array_data(ret_array); + int64_t * data = (int64_t *)jl_array_data(ret_array); *arr_ptr = data; *arr_len = jl_array_len(ret_array); JL_GC_POP(); @@ -82,7 +82,7 @@ run_jl_get_float64_array(const char *mod_name, const char *fun_name, jl_fn_args_ jl_value_t *ret = run_jl_function(mod_name, fun_name, args); JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; - double *data = (double *)jl_array_data(ret_array); + double * data = (double *)jl_array_data(ret_array); *arr_ptr = data; *arr_len = jl_array_len(ret_array); JL_GC_POP(); @@ -96,7 +96,7 @@ run_jl_get_string_array(const char *mod_name, const char *fun_name, jl_fn_args_t JL_GC_PUSH1(&ret); jl_array_t *ret_array = (jl_array_t *)ret; size_t length = jl_array_len(ret); - char **strings = malloc(length * sizeof(char *)); + char ** strings = malloc(length * sizeof(char *)); for (size_t i = 0; i < length; ++i) { jl_value_t *julia_str = jl_arrayref(ret_array, i); diff --git a/src/tests/import_vpic.c b/src/tests/import_vpic.c index 167598211..ea1aeaa77 100644 --- a/src/tests/import_vpic.c +++ b/src/tests/import_vpic.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) { int my_rank = 0, num_procs = 1, i, ndim, region_MB = 0; - char *file_name, *group_name; - char *dset_names[7] = {"Energy", "x", "y", "z", "Ux", "Uy", "Uz"}; - void *data; + char * file_name, *group_name; + char * dset_names[7] = {"Energy", "x", "y", "z", "Ux", "Uy", "Uz"}; + void * data; hid_t file_id, group_id, dset_ids[NVAR], filespace, memspace, fapl; hsize_t dims[1], my_elem_off, my_nelem, region_offset, region_size; hsize_t elem_offset, elem_count, total_elem, my_nregion, total_region, j; @@ -32,7 +32,7 @@ main(int argc, char *argv[]) pdcid_t pdc_id, cont_prop, cont_id, obj_ids[NVAR], obj_prop; perr_t ret; - pdc_metadata_t *obj_meta; + pdc_metadata_t * obj_meta; struct PDC_region_info obj_region; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_add_get.c b/src/tests/kvtag_add_get.c index 303132a42..ad06b506b 100644 --- a/src/tests/kvtag_add_get.c +++ b/src/tests/kvtag_add_get.c @@ -35,11 +35,11 @@ main() { pdcid_t pdc, cont_prop, cont, obj_prop1, obj_prop2, obj1, obj2; pdc_kvtag_t kvtag1, kvtag2, kvtag3; - char *v1 = "value1"; + char * v1 = "value1"; int v2 = 2; double v3 = 3.45; pdc_var_type_t type1, type2, type3; - void *value1, *value2, *value3; + void * value1, *value2, *value3; psize_t value_size; // create a pdc diff --git a/src/tests/kvtag_add_get_benchmark.c b/src/tests/kvtag_add_get_benchmark.c index 555ec6bc4..a682e30ee 100644 --- a/src/tests/kvtag_add_get_benchmark.c +++ b/src/tests/kvtag_add_get_benchmark.c @@ -34,7 +34,7 @@ uint64_t atoui64(char *arg) { - char *endptr; + char * endptr; uint64_t num = strtoull(arg, &endptr, 10); if (*endptr != '\0') { @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; uint64_t n_obj, n_obj_incr, my_obj, my_obj_s; uint64_t n_attr, n_attr_len, n_query, my_query, my_query_s; uint64_t n_servers, n_clients; @@ -335,7 +335,7 @@ main(int argc, char *argv[]) double stime = 0.0, step_elapse = 0.0; double total_object_time = 0.0, total_tag_time = 0.0, total_query_time = 0.0; uint64_t total_object_count = 0, total_tag_count = 0, total_query_count = 0; - void **query_rst_cache; + void ** query_rst_cache; uint64_t *value_size; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_add_get_scale.c b/src/tests/kvtag_add_get_scale.c index 1798aeef7..dc14c597e 100644 --- a/src/tests/kvtag_add_get_scale.c +++ b/src/tests/kvtag_add_get_scale.c @@ -68,14 +68,14 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; int n_obj, n_add_tag, n_query, my_obj, my_obj_s, my_add_tag, my_query, my_add_tag_s, my_query_s; int obj_1percent = 0, tag_1percent = 0, query_1percent = 0; int proc_num, my_rank, i, v; char obj_name[128]; double stime, total_time, percent_time; pdc_kvtag_t kvtag; - void **values; + void ** values; pdc_var_type_t value_type; size_t value_size; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_get.c b/src/tests/kvtag_get.c index 7b9f708f6..7ca1e7c0e 100644 --- a/src/tests/kvtag_get.c +++ b/src/tests/kvtag_get.c @@ -34,7 +34,7 @@ int main() { pdcid_t pdc, cont_prop, cont, obj_prop1, obj_prop2, obj1, obj2; - pdc_kvtag_t *value1, *value2, *value3; + pdc_kvtag_t * value1, *value2, *value3; pdc_var_type_t type1, type2, type3; psize_t value_size; diff --git a/src/tests/kvtag_query.c b/src/tests/kvtag_query.c index 5113748dd..3a6038d3f 100644 --- a/src/tests/kvtag_query.c +++ b/src/tests/kvtag_query.c @@ -78,13 +78,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num = 1, my_rank = 0, i, v, iter, round, selectivity, is_using_dart; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t *pdc_ids; + uint64_t * pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_mpi.c b/src/tests/kvtag_query_mpi.c index e38efd028..22c619c97 100644 --- a/src/tests/kvtag_query_mpi.c +++ b/src/tests/kvtag_query_mpi.c @@ -68,13 +68,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num, my_rank, i, v, iter, round; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t *pdc_ids; + uint64_t * pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_scale.c b/src/tests/kvtag_query_scale.c index f1dc94634..99336cebc 100644 --- a/src/tests/kvtag_query_scale.c +++ b/src/tests/kvtag_query_scale.c @@ -78,13 +78,13 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; int n_obj, n_add_tag, my_obj, my_obj_s, my_add_tag, my_add_tag_s; int proc_num, my_rank, i, v, iter, round, selectivity, is_using_dart, query_type; char obj_name[128]; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t *pdc_ids; + uint64_t * pdc_ids; int nres, ntotal; #ifdef ENABLE_MPI diff --git a/src/tests/kvtag_query_scale_col.c b/src/tests/kvtag_query_scale_col.c index 83efdbe88..91c6d7481 100644 --- a/src/tests/kvtag_query_scale_col.c +++ b/src/tests/kvtag_query_scale_col.c @@ -135,15 +135,15 @@ int main(int argc, char *argv[]) { pdcid_t pdc, cont_prop, cont, obj_prop; - pdcid_t *obj_ids; + pdcid_t * obj_ids; int n_obj, my_obj, my_obj_s; int proc_num, my_rank, i, v, iter, round, selectivity, is_using_dart, query_type, comm_type; double stime, total_time; pdc_kvtag_t kvtag; - uint64_t *pdc_ids; + uint64_t * pdc_ids; int nres, ntotal; - int *my_cnt_round; - int *total_cnt_round; + int * my_cnt_round; + int * total_cnt_round; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); @@ -282,9 +282,9 @@ main(int argc, char *argv[]) if (is_using_dart) { char *query_string = gen_query_str(&output); ret_value = (comm_type == 0) - ? PDC_Client_search_obj_ref_through_dart(hash_algo, query_string, - ref_type, &nres, &pdc_ids) - : PDC_Client_search_obj_ref_through_dart_mpi( + ? PDC_Client_search_obj_ref_through_dart(hash_algo, query_string, + ref_type, &nres, &pdc_ids) + : PDC_Client_search_obj_ref_through_dart_mpi( hash_algo, query_string, ref_type, &nres, &pdc_ids, MPI_COMM_WORLD); } else { @@ -331,7 +331,7 @@ main(int argc, char *argv[]) } #endif } // end query type - } // end comm type + } // end comm type if (my_rank == 0) { println("Rank %d: All queries are done.", my_rank); diff --git a/src/tests/list_all.c b/src/tests/list_all.c index a36a7303a..508d23db6 100644 --- a/src/tests/list_all.c +++ b/src/tests/list_all.c @@ -73,9 +73,9 @@ main(int argc, char **argv) int use_name = -1; uint64_t dims[3] = {100, 200, 700}; pdcid_t test_obj = -1; - char *env_str; + char * env_str; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; pdc_metadata_t **out; int n_obj; diff --git a/src/tests/obj_buf.c b/src/tests/obj_buf.c index 4e78d7430..6da89387c 100644 --- a/src/tests/obj_buf.c +++ b/src/tests/obj_buf.c @@ -33,7 +33,7 @@ main(int argc, char **argv) pdcid_t pdc, cont_prop, cont, obj_prop, obj1; int rank = 0, size = 1; int myArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - void **rbuf; + void ** rbuf; int ret_value = 0; char cont_name[128], obj_name1[128]; diff --git a/src/tests/obj_iter.c b/src/tests/obj_iter.c index 92a78e679..bc96d56a3 100644 --- a/src/tests/obj_iter.c +++ b/src/tests/obj_iter.c @@ -33,7 +33,7 @@ main(int argc, char **argv) { pdcid_t pdc, cont_prop, cont, obj_prop, obj1, obj2, obj3; int rank = 0, size = 1; - obj_handle *oh; + obj_handle * oh; struct pdc_obj_info *info; int ret_value = 0, ret; char cont_name[128], obj_name1[128], obj_name2[128], obj_name3[128]; diff --git a/src/tests/obj_map.c b/src/tests/obj_map.c index de330a192..2efae2e43 100644 --- a/src/tests/obj_map.c +++ b/src/tests/obj_map.c @@ -71,9 +71,9 @@ main(int argc, char **argv) uint64_t dims[2] = {3, 3}; uint64_t offset[2] = {1, 1}; uint64_t rdims[2] = {2, 2}; - char *env_str = getenv("PDC_OBJ_NAME"); + char * env_str = getenv("PDC_OBJ_NAME"); char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/obj_transformation.c b/src/tests/obj_transformation.c index 927642b7b..a9e2a23d6 100644 --- a/src/tests/obj_transformation.c +++ b/src/tests/obj_transformation.c @@ -62,18 +62,18 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; uint64_t numparticles, i; uint64_t dims[1]; int ndim = 1; - uint64_t *offset; - uint64_t *offset_remote; - uint64_t *mysize; + uint64_t * offset; + uint64_t * offset_remote; + uint64_t * mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/pdc_transforms_lib.c b/src/tests/pdc_transforms_lib.c index 1296b1631..6397bdc70 100644 --- a/src/tests/pdc_transforms_lib.c +++ b/src/tests/pdc_transforms_lib.c @@ -567,7 +567,7 @@ pdc_transform_increment(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_t { int i; int64_t nval, nbytes; - void *destBuff; + void * destBuff; size_t typesize = 1; if (srcType >= 0) { if ((srcType == PDC_INT) || (srcType == PDC_UINT) || (srcType == PDC_FLOAT)) @@ -625,7 +625,7 @@ pdc_transform_compress(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_t int doshuffle = BLOSC_BITSHUFFLE; int nval, i, typesize; int64_t destsize, nbytes, csize; - void *destBuff; + void * destBuff; if ((srcType == PDC_INT) || (srcType == PDC_UINT) || (srcType == PDC_FLOAT)) typesize = sizeof(int); @@ -667,7 +667,7 @@ pdc_transform_decompress(void *dataIn, PDC_var_type_t srcType, int ndim, uint64_ { int i; size_t typesize, destsize, dsize; - void *destBuff = *dataOut; + void * destBuff = *dataOut; fprintf(stdout, "\n[TRANSFORM] Entering pdc_transform_decompress\n"); diff --git a/src/tests/query_data.c b/src/tests/query_data.c index cc484c4c1..62112f6ed 100644 --- a/src/tests/query_data.c +++ b/src/tests/query_data.c @@ -24,16 +24,16 @@ main(int argc, char **argv) struct pdc_region_info region; uint64_t i, dims[1]; pdc_selection_t sel; - char *obj_name; + char * obj_name; int my_data_count; - pdc_metadata_t *metadata; + pdc_metadata_t * metadata; pdcid_t pdc, cont_prop, cont, obj_prop; int ndim = 1; - int *mydata; + int * mydata; int lo0 = 1000; int lo1 = 2000, hi1 = 3000; int lo2 = 5000, hi2 = 7000; - pdc_query_t *q0, *q1l, *q1h, *q1, *q2l, *q2h, *q2, *q, *q12; + pdc_query_t * q0, *q1l, *q1h, *q1, *q2l, *q2h, *q2, *q, *q12; int ret_value = 0; struct timeval ht_total_start; diff --git a/src/tests/query_metadata_agg.c b/src/tests/query_metadata_agg.c index 829469efc..7ad9cd4b3 100644 --- a/src/tests/query_metadata_agg.c +++ b/src/tests/query_metadata_agg.c @@ -18,7 +18,7 @@ main(int argc, const char *argv[]) { int rank = 0, size = 1; uint64_t size_MB = 0; - char *obj_name = "test"; + char * obj_name = "test"; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/query_vpic.c b/src/tests/query_vpic.c index ed9448c7f..5b3a43305 100644 --- a/src/tests/query_vpic.c +++ b/src/tests/query_vpic.c @@ -18,7 +18,7 @@ main(void) // Construct query constraints float energy_lo0 = 3.75, energy_hi0 = 4.0; - pdc_query_t *q0l, *q0h, *q; + pdc_query_t * q0l, *q0h, *q; pdc_selection_t sel; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_bin_sds1_nopreload.c b/src/tests/query_vpic_bin_sds1_nopreload.c index 8d68d1291..c2ce6e8d2 100644 --- a/src/tests/query_vpic_bin_sds1_nopreload.c +++ b/src/tests/query_vpic_bin_sds1_nopreload.c @@ -14,10 +14,10 @@ main(void) { pdc_metadata_t *x_meta, *y_meta, *energy_meta; pdcid_t pdc, x_id, y_id, energy_id; - pdc_query_t *ql, *q2_lo, *q2_hi, *q2, *q12, *q3_lo, *q3_hi, *q3, *q; + pdc_query_t * ql, *q2_lo, *q2_hi, *q2, *q12, *q3_lo, *q3_hi, *q3, *q; pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo0 = 3.0; float x_lo = 300, x_hi = 310; float y_lo = 140, y_hi = 150; diff --git a/src/tests/query_vpic_bin_sds1_preload.c b/src/tests/query_vpic_bin_sds1_preload.c index 0408c5757..b6e3dd5a3 100644 --- a/src/tests/query_vpic_bin_sds1_preload.c +++ b/src/tests/query_vpic_bin_sds1_preload.c @@ -18,7 +18,7 @@ main(void) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL; float preload_value = 0; int preload_int = 0; pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *ql, *q2_lo, *q2_hi, *q2, *q3_lo, *q3_hi, *q3, *q, diff --git a/src/tests/query_vpic_bin_sds_nopreload.c b/src/tests/query_vpic_bin_sds_nopreload.c index 437ae5143..d4a89dd44 100644 --- a/src/tests/query_vpic_bin_sds_nopreload.c +++ b/src/tests/query_vpic_bin_sds_nopreload.c @@ -20,7 +20,7 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo = 1.2, energy_hi = 1.3; float x_lo = 308, x_hi = 309; diff --git a/src/tests/query_vpic_bin_sds_preload.c b/src/tests/query_vpic_bin_sds_preload.c index 372deb691..c0606f66d 100644 --- a/src/tests/query_vpic_bin_sds_preload.c +++ b/src/tests/query_vpic_bin_sds_preload.c @@ -20,7 +20,7 @@ main(void) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL; float energy_lo = 1.2, energy_hi = 1.3; float x_lo = 308, x_hi = 309; float y_lo = 149, y_hi = 150; diff --git a/src/tests/query_vpic_create_data.c b/src/tests/query_vpic_create_data.c index 9e016f945..49c709185 100644 --- a/src/tests/query_vpic_create_data.c +++ b/src/tests/query_vpic_create_data.c @@ -58,19 +58,19 @@ main(int argc, char **argv) pdcid_t pdc_id, cont_prop, cont_id; uint64_t nparticles = NPARTICLES, j; int write_var = NUM_VAR, i; - char *obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; + char * obj_names[] = {"x", "y", "z", "px", "py", "pz", "id1", "id2"}; uint64_t float_bytes, int_bytes; pdcid_t obj_ids[NUM_VAR]; struct pdc_region_info obj_regions[NUM_VAR]; - pdc_metadata_t *obj_metas[NUM_VAR]; + pdc_metadata_t * obj_metas[NUM_VAR]; pdcid_t obj_prop_float, obj_prop_int; struct timeval pdc_timer_start; struct timeval pdc_timer_end; double write_time = 0.0, total_size = 0.0; uint64_t myoffset[NDIM], mysize[NDIM]; - void *mydata[NUM_VAR]; + void * mydata[NUM_VAR]; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/query_vpic_exyz_nopreload.c b/src/tests/query_vpic_exyz_nopreload.c index 9ccb60bdf..d3593b90a 100644 --- a/src/tests/query_vpic_exyz_nopreload.c +++ b/src/tests/query_vpic_exyz_nopreload.c @@ -22,9 +22,9 @@ main(int argc, char **argv) pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; uint64_t nhits, i; - pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; + pdc_query_t * qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; struct timeval pdc_timer_start; struct timeval pdc_timer_end; diff --git a/src/tests/query_vpic_exyz_preload.c b/src/tests/query_vpic_exyz_preload.c index d98a35a8e..80313d58d 100644 --- a/src/tests/query_vpic_exyz_preload.c +++ b/src/tests/query_vpic_exyz_preload.c @@ -24,7 +24,7 @@ main(int argc, char **argv) uint64_t nhits; pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; + float * energy_data = NULL, *x_data = NULL, *y_data = NULL, *z_data = NULL; float preload_value = -10000.0; pdc_query_t *qpreload_energy, *qpreload_x, *qpreload, *q1_lo, *q1_hi, *q1, *q2_lo, *q2_hi, *q2, *q; diff --git a/src/tests/query_vpic_multi.c b/src/tests/query_vpic_multi.c index f39728849..4704b3e1d 100644 --- a/src/tests/query_vpic_multi.c +++ b/src/tests/query_vpic_multi.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data; - pdc_query_t *ql, *qh, *q; + float * energy_data; + pdc_query_t * ql, *qh, *q; float energy_lo0 = 2.0, energy_hi0 = 2.1; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_nopreload.c b/src/tests/query_vpic_multi_nopreload.c index 7dccd1055..dc0da4494 100644 --- a/src/tests/query_vpic_multi_nopreload.c +++ b/src/tests/query_vpic_multi_nopreload.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data; - pdc_query_t *ql, *qh, *q; + float * energy_data; + pdc_query_t * ql, *qh, *q; float energy_lo0 = 3.9, energy_hi0 = 4.0; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_nopreload1.c b/src/tests/query_vpic_multi_nopreload1.c index 06c18c2df..f2c73f68b 100644 --- a/src/tests/query_vpic_multi_nopreload1.c +++ b/src/tests/query_vpic_multi_nopreload1.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data; - pdc_query_t *ql, *qh, *q; + float * energy_data; + pdc_query_t * ql, *qh, *q; float energy_lo0 = 2.8, energy_hi0 = 2.9; struct timeval pdc_timer_start; diff --git a/src/tests/query_vpic_multi_preload.c b/src/tests/query_vpic_multi_preload.c index f39728849..4704b3e1d 100644 --- a/src/tests/query_vpic_multi_preload.c +++ b/src/tests/query_vpic_multi_preload.c @@ -20,8 +20,8 @@ main(void) // Construct query constraints pdc_selection_t sel; double get_sel_time, get_data_time; - float *energy_data; - pdc_query_t *ql, *qh, *q; + float * energy_data; + pdc_query_t * ql, *qh, *q; float energy_lo0 = 2.0, energy_hi0 = 2.1; struct timeval pdc_timer_start; diff --git a/src/tests/read_obj.c b/src/tests/read_obj.c index db52aded1..e688219f3 100644 --- a/src/tests/read_obj.c +++ b/src/tests/read_obj.c @@ -27,7 +27,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Comm comm; #else - int comm = 1; + int comm = 1; #endif struct timeval pdc_timer_start; struct timeval pdc_timer_end; @@ -39,7 +39,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char *mydata; + char * mydata; char obj_name[128], cont_name[128]; uint64_t my_data_size; diff --git a/src/tests/read_obj_shared.c b/src/tests/read_obj_shared.c index 2cfea8f0b..6f56965d8 100644 --- a/src/tests/read_obj_shared.c +++ b/src/tests/read_obj_shared.c @@ -26,7 +26,7 @@ main(int argc, char **argv) #ifdef ENABLE_MPI MPI_Comm comm; #else - int comm = 1; + int comm = 1; #endif pdcid_t global_obj = 0; pdcid_t local_region, global_region; @@ -35,7 +35,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char *mydata; + char * mydata; char obj_name[128], cont_name[128]; uint64_t my_data_size; diff --git a/src/tests/search_obj.c b/src/tests/search_obj.c index ceac65233..465a48b6c 100644 --- a/src/tests/search_obj.c +++ b/src/tests/search_obj.c @@ -67,16 +67,16 @@ main(int argc, char **argv) double ht_total_sec; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char filename[128], pdc_server_tmp_dir_g[128]; - char *env_str; - char **obj_names; - int *obj_ts; - char *tmp_dir; + char * env_str; + char ** obj_names; + int * obj_ts; + char * tmp_dir; int n_entry; int use_name = -1; pdc_metadata_t entry; - uint32_t *hash_key; + uint32_t * hash_key; int j, read_count = 0, tmp_count; #ifdef ENABLE_MPI diff --git a/src/tests/search_obj_scale.c b/src/tests/search_obj_scale.c index 60729eea3..88506ffc7 100644 --- a/src/tests/search_obj_scale.c +++ b/src/tests/search_obj_scale.c @@ -69,11 +69,11 @@ main(int argc, char **argv) char obj_name[512]; char obj_prefix[4][10] = {"x", "y", "z", "energy"}; char tmp_str[128]; - char *env_str; + char * env_str; pdc_metadata_t *res = NULL; int progress_factor; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/stat_obj.c b/src/tests/stat_obj.c index 0eae75a50..6a068edc7 100644 --- a/src/tests/stat_obj.c +++ b/src/tests/stat_obj.c @@ -52,16 +52,16 @@ main(int argc, char **argv) long long ht_total_elapsed; double ht_total_sec; - char **obj_names; - char *env_str; - int *obj_ts; + char ** obj_names; + char * env_str; + int * obj_ts; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; char filename[1024], pdc_server_tmp_dir_g[128]; int n_entry; - char *tmp_dir; + char * tmp_dir; pdc_metadata_t entry; - uint32_t *hash_key; + uint32_t * hash_key; int j, read_count = 0, tmp_count; int progress_factor; pdc_metadata_t *res; diff --git a/src/tests/update_obj.c b/src/tests/update_obj.c index e8f73d968..b63082361 100644 --- a/src/tests/update_obj.c +++ b/src/tests/update_obj.c @@ -50,20 +50,20 @@ main(int argc, char **argv) long long ht_total_elapsed; double ht_total_sec; int use_name = -1; - char *env_str, *tmp_dir; + char * env_str, *tmp_dir; pdc_metadata_t new; - char **obj_names; - int *obj_ts; + char ** obj_names; + int * obj_ts; char filename[1024], pdc_server_tmp_dir_g[128]; int n_entry; pdc_metadata_t entry; - uint32_t *hash_key; + uint32_t * hash_key; int j, read_count = 0, tmp_count; pdc_metadata_t *res = NULL; int progress_factor; - FILE *file; + FILE * file; char name_mode[6][32] = {"Random Obj Names", "INVALID!", "One Obj Name", - "INVALID!", "INVALID!", "Four Obj Names"}; + "INVALID!", "INVALID!", "Four Obj Names"}; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/vpicio.c b/src/tests/vpicio.c index e96c52d10..e7bd51f07 100644 --- a/src/tests/vpicio.c +++ b/src/tests/vpicio.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_mts.c b/src/tests/vpicio_mts.c index bdc21c416..4c4679459 100644 --- a/src/tests/vpicio_mts.c +++ b/src/tests/vpicio_mts.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c index 6a5c043df..8aa9c1b9e 100644 --- a/src/tests/vpicio_mts_all.c +++ b/src/tests/vpicio_mts_all.c @@ -60,8 +60,8 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x, *y, *z, *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z, *px, *py, *pz; + int * id1, *id2; int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; double t0, t1; diff --git a/src/tests/vpicio_old.c b/src/tests/vpicio_old.c index 6d2e772f7..f3a2088fa 100644 --- a/src/tests/vpicio_old.c +++ b/src/tests/vpicio_old.c @@ -63,9 +63,9 @@ main(int argc, char **argv) #else int comm = 1; #endif - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; diff --git a/src/tests/vpicio_v2.c b/src/tests/vpicio_v2.c index f0ac26f9a..89839352b 100644 --- a/src/tests/vpicio_v2.c +++ b/src/tests/vpicio_v2.c @@ -65,18 +65,18 @@ main(int argc, char **argv) struct timeval ht_total_end; long long ht_total_elapsed; double ht_total_sec; - float *x, *y, *z; - float *px, *py, *pz; - int *id1, *id2; + float * x, *y, *z; + float * px, *py, *pz; + int * id1, *id2; int x_dim = 64; int y_dim = 64; int z_dim = 64; uint64_t numparticles, i; uint64_t dims[1]; int ndim = 1; - uint64_t *offset; - uint64_t *offset_remote; - uint64_t *mysize; + uint64_t * offset; + uint64_t * offset_remote; + uint64_t * mysize; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); diff --git a/src/tests/write_obj_shared.c b/src/tests/write_obj_shared.c index 11b274035..d8796bb61 100644 --- a/src/tests/write_obj_shared.c +++ b/src/tests/write_obj_shared.c @@ -39,7 +39,7 @@ main(int argc, char **argv) uint64_t *offset, *local_offset; uint64_t *mysize; int i, j; - char *mydata, *obj_data; + char * mydata, *obj_data; char obj_name[128], cont_name[128]; uint64_t my_data_size; From d95a437f7ee166537c93e0787cb0a80c60e4bdfb Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Mon, 26 Aug 2024 18:23:16 -0700 Subject: [PATCH 16/23] Test --- src/api/pdc_client_connect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 967921b6f..ee67c9ea9 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -63,7 +63,6 @@ #include #include #include - #include "pdc_timing.h" /* #define TANG_DEBUG 1 */ From 4cb590fb95cd2e8ba455ba7d5daa0410aa1190a4 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Mon, 26 Aug 2024 19:10:17 -0700 Subject: [PATCH 17/23] Trigger test --- src/api/pdc_client_connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index ee67c9ea9..350cec6c3 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -65,6 +65,7 @@ #include #include "pdc_timing.h" + /* #define TANG_DEBUG 1 */ int is_client_debug_g = 0; From a4bb2c01ad5e1385b142f1a05df35407e1f900dd Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 27 Aug 2024 02:10:47 +0000 Subject: [PATCH 18/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 350cec6c3..ee67c9ea9 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -65,7 +65,6 @@ #include #include "pdc_timing.h" - /* #define TANG_DEBUG 1 */ int is_client_debug_g = 0; From 6701859dbc1677354fa6697421ca978dd6744a8c Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Mon, 26 Aug 2024 19:15:20 -0700 Subject: [PATCH 19/23] Trigger CI --- src/api/pdc_client_connect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index ee67c9ea9..5c8a8e1d5 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -191,7 +191,6 @@ int cache_total_g = 0; pdc_data_server_io_list_t *client_cache_list_head_g = NULL; static uint64_t object_selection_query_counter_g = 0; - static pthread_t hg_progress_tid_g; static int hg_progress_flag_g = -1; // -1 thread unintialized, 0 thread created, 1 terminate thread static int hg_progress_task_cnt_g = 0; From e2f6461cce0dfc12251880929e2e1e787a01bd5a Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 27 Aug 2024 02:15:43 +0000 Subject: [PATCH 20/23] Committing clang-format changes --- src/api/pdc_client_connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 5c8a8e1d5..0813bbd89 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -190,7 +190,7 @@ int cache_count_g = 0; int cache_total_g = 0; pdc_data_server_io_list_t *client_cache_list_head_g = NULL; -static uint64_t object_selection_query_counter_g = 0; +static uint64_t object_selection_query_counter_g = 0; static pthread_t hg_progress_tid_g; static int hg_progress_flag_g = -1; // -1 thread unintialized, 0 thread created, 1 terminate thread static int hg_progress_task_cnt_g = 0; From cfb87635030f477c7c02c4d735ad8dd9e9c27cba Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Mon, 26 Aug 2024 19:17:37 -0700 Subject: [PATCH 21/23] Trigger CI --- src/api/pdc_client_connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 0813bbd89..a6d05dc35 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -266,7 +266,7 @@ hg_progress_fn(void *foo) #ifdef TANG_DEBUG char cur_time[64]; PDC_get_time_str(cur_time); - printf("[%s] enter %s\n", cur_time, __func__); + printf("[%s] enter %s \n", cur_time, __func__); #endif while (hg_progress_flag_g != 1) { From 43e87454f338f6f300ce20a93b4866f41016e7f4 Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Tue, 27 Aug 2024 14:21:34 -0700 Subject: [PATCH 22/23] Switch to static partition for vpicio --- src/tests/vpicio_mts_all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c index 8aa9c1b9e..102891ff0 100644 --- a/src/tests/vpicio_mts_all.c +++ b/src/tests/vpicio_mts_all.c @@ -124,7 +124,8 @@ main(int argc, char **argv) PDCprop_set_obj_user_id(obj_prop_float, getuid()); PDCprop_set_obj_app_name(obj_prop_float, "VPICIO"); PDCprop_set_obj_tags(obj_prop_float, "tag0=1"); - PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_LOCAL); + /* PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_LOCAL); */ + PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_STATIC); obj_prop_int = PDCprop_obj_dup(obj_prop_float); PDCprop_set_obj_type(obj_prop_int, PDC_INT); From a96dc221648ecb1fa23340840aa5f95f5bce7e0f Mon Sep 17 00:00:00 2001 From: Houjun Tang Date: Tue, 27 Aug 2024 14:33:27 -0700 Subject: [PATCH 23/23] Replace vpicio_mts with new implementation --- src/tests/CMakeLists.txt | 1 - src/tests/vpicio_mts.c | 619 ++++++++++++------------------------- src/tests/vpicio_mts_all.c | 413 ------------------------- 3 files changed, 196 insertions(+), 837 deletions(-) delete mode 100644 src/tests/vpicio_mts_all.c diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index ccee3687c..30667ddcd 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -88,7 +88,6 @@ set(PROGRAMS delete_obj vpicio vpicio_mts - vpicio_mts_all bdcats vpicio_old bdcats_old diff --git a/src/tests/vpicio_mts.c b/src/tests/vpicio_mts.c index 4c4679459..102891ff0 100644 --- a/src/tests/vpicio_mts.c +++ b/src/tests/vpicio_mts.c @@ -32,6 +32,7 @@ #include #include #include "pdc.h" +#include "pdc_timing.h" #define NPARTICLES 8388608 @@ -51,35 +52,26 @@ int main(int argc, char **argv) { int rank = 0, size = 1; - pdcid_t pdc_id, cont_prop, cont_id; - pdcid_t obj_prop_xx, obj_prop_yy, obj_prop_zz, obj_prop_pxx, obj_prop_pyy, obj_prop_pzz, obj_prop_id11, - obj_prop_id22; + pdcid_t pdc_id, cont_prop, cont_id, region_local, region_remote; + pdcid_t obj_prop_float, obj_prop_int; pdcid_t obj_xx, obj_yy, obj_zz, obj_pxx, obj_pyy, obj_pzz, obj_id11, obj_id22; - pdcid_t region_x, region_y, region_z, region_px, region_py, region_pz, region_id1, region_id2; - pdcid_t region_xx, region_yy, region_zz, region_pxx, region_pyy, region_pzz, region_id11, region_id22; - perr_t ret; #ifdef ENABLE_MPI MPI_Comm comm; #else int comm = 1; #endif - float * x, *y, *z; - float * px, *py, *pz; - int * id1, *id2; - int x_dim = 64; - int y_dim = 64; - int z_dim = 64; - uint64_t numparticles, i; - uint64_t dims[1]; - int ndim = 1; - uint64_t *offset; - uint64_t *offset_remote; - uint64_t *mysize; - double t0, t1; - uint64_t steps = 1, sleeptime = 0; + float * x, *y, *z, *px, *py, *pz; + int * id1, *id2; + int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; + uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; + double t0, t1; + char cur_time[64]; + time_t t; + struct tm *tm; pdcid_t transfer_request_x, transfer_request_y, transfer_request_z, transfer_request_px, transfer_request_py, transfer_request_pz, transfer_request_id1, transfer_request_id2; + pdcid_t transfer_requests[8]; #ifdef ENABLE_MPI MPI_Init(&argc, &argv); @@ -95,15 +87,14 @@ main(int argc, char **argv) sleeptime = atoi(argv[3]); } if (rank == 0) - printf("Writing %" PRIu64 " number of particles for %llu steps with %d clients.\n", numparticles, - steps, size); + printf("Writing %" PRIu64 " number of particles for %d steps with %d clients.\n", numparticles, steps, + size); dims[0] = numparticles * size; - x = (float *)malloc(numparticles * sizeof(float)); - y = (float *)malloc(numparticles * sizeof(float)); - z = (float *)malloc(numparticles * sizeof(float)); - + x = (float *)malloc(numparticles * sizeof(float)); + y = (float *)malloc(numparticles * sizeof(float)); + z = (float *)malloc(numparticles * sizeof(float)); px = (float *)malloc(numparticles * sizeof(float)); py = (float *)malloc(numparticles * sizeof(float)); pz = (float *)malloc(numparticles * sizeof(float)); @@ -118,45 +109,28 @@ main(int argc, char **argv) cont_prop = PDCprop_create(PDC_CONT_CREATE, pdc_id); if (cont_prop <= 0) { printf("Fail to create container property @ line %d!\n", __LINE__); - return 1; + return FAIL; } // create a container cont_id = PDCcont_create_col("c1", cont_prop); if (cont_id <= 0) { printf("Fail to create container @ line %d!\n", __LINE__); - return 1; + return FAIL; } // create an object property - obj_prop_xx = PDCprop_create(PDC_OBJ_CREATE, pdc_id); - - PDCprop_set_obj_dims(obj_prop_xx, 1, dims); - PDCprop_set_obj_type(obj_prop_xx, PDC_FLOAT); - PDCprop_set_obj_user_id(obj_prop_xx, getuid()); - PDCprop_set_obj_app_name(obj_prop_xx, "VPICIO"); - PDCprop_set_obj_tags(obj_prop_xx, "tag0=1"); - - obj_prop_yy = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_yy, PDC_FLOAT); - - obj_prop_zz = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_zz, PDC_FLOAT); - - obj_prop_pxx = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_pxx, PDC_FLOAT); - - obj_prop_pyy = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_pyy, PDC_FLOAT); - - obj_prop_pzz = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_pzz, PDC_FLOAT); - - obj_prop_id11 = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_id11, PDC_INT); - - obj_prop_id22 = PDCprop_obj_dup(obj_prop_xx); - PDCprop_set_obj_type(obj_prop_id22, PDC_INT); - - for (i = 0; i < numparticles; i++) { + obj_prop_float = PDCprop_create(PDC_OBJ_CREATE, pdc_id); + PDCprop_set_obj_dims(obj_prop_float, 1, dims); + PDCprop_set_obj_type(obj_prop_float, PDC_FLOAT); + PDCprop_set_obj_user_id(obj_prop_float, getuid()); + PDCprop_set_obj_app_name(obj_prop_float, "VPICIO"); + PDCprop_set_obj_tags(obj_prop_float, "tag0=1"); + /* PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_LOCAL); */ + PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_STATIC); + + obj_prop_int = PDCprop_obj_dup(obj_prop_float); + PDCprop_set_obj_type(obj_prop_int, PDC_INT); + + for (uint64_t i = 0; i < numparticles; i++) { id1[i] = i; id2[i] = i * 2; x[i] = uniform_random_number() * x_dim; @@ -167,463 +141,262 @@ main(int argc, char **argv) pz[i] = ((float)id2[i] / numparticles) * z_dim; } - offset = (uint64_t *)malloc(sizeof(uint64_t) * ndim); - offset_remote = (uint64_t *)malloc(sizeof(uint64_t) * ndim); - mysize = (uint64_t *)malloc(sizeof(uint64_t) * ndim); - offset[0] = 0; + offset_local[0] = 0; offset_remote[0] = rank * numparticles; mysize[0] = numparticles; - // create a region - region_x = PDCregion_create(ndim, offset, mysize); - region_y = PDCregion_create(ndim, offset, mysize); - region_z = PDCregion_create(ndim, offset, mysize); - region_px = PDCregion_create(ndim, offset, mysize); - region_py = PDCregion_create(ndim, offset, mysize); - region_pz = PDCregion_create(ndim, offset, mysize); - region_id1 = PDCregion_create(ndim, offset, mysize); - region_id2 = PDCregion_create(ndim, offset, mysize); - - region_xx = PDCregion_create(ndim, offset_remote, mysize); - region_yy = PDCregion_create(ndim, offset_remote, mysize); - region_zz = PDCregion_create(ndim, offset_remote, mysize); - region_pxx = PDCregion_create(ndim, offset_remote, mysize); - region_pyy = PDCregion_create(ndim, offset_remote, mysize); - region_pzz = PDCregion_create(ndim, offset_remote, mysize); - region_id11 = PDCregion_create(ndim, offset_remote, mysize); - region_id22 = PDCregion_create(ndim, offset_remote, mysize); - - for (i = 0; i < steps; i++) { + // create local and remote region + region_local = PDCregion_create(ndim, offset_local, mysize); + region_remote = PDCregion_create(ndim, offset_remote, mysize); + + for (int iter = 0; iter < steps; iter++) { #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); + PDC_get_time_str(cur_time); + if (rank == 0) + printf("\n[%s] #Step %d\n", cur_time, iter); t0 = MPI_Wtime(); - if (rank == 0) { - printf("\n#Step %llu\n", i); - } #endif - PDCprop_set_obj_time_step(obj_prop_xx, i); - PDCprop_set_obj_time_step(obj_prop_yy, i); - PDCprop_set_obj_time_step(obj_prop_zz, i); - PDCprop_set_obj_time_step(obj_prop_pxx, i); - PDCprop_set_obj_time_step(obj_prop_pyy, i); - PDCprop_set_obj_time_step(obj_prop_pzz, i); - PDCprop_set_obj_time_step(obj_prop_id11, i); - PDCprop_set_obj_time_step(obj_prop_id22, i); - - obj_xx = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop_xx, 0, comm); + PDCprop_set_obj_time_step(obj_prop_float, iter); + PDCprop_set_obj_time_step(obj_prop_int, iter); + + obj_xx = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop_float, 0, comm); if (obj_xx == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); - exit(-1); + printf("Error getting an object id of %s from server\n", "x"); + return FAIL; } - obj_yy = PDCobj_create_mpi(cont_id, "obj-var-yy", obj_prop_yy, 0, comm); + obj_yy = PDCobj_create_mpi(cont_id, "obj-var-yy", obj_prop_float, 0, comm); if (obj_yy == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-yy"); - exit(-1); + printf("Error getting an object id of %s from server\n", "y"); + return FAIL; } - obj_zz = PDCobj_create_mpi(cont_id, "obj-var-zz", obj_prop_zz, 0, comm); + obj_zz = PDCobj_create_mpi(cont_id, "obj-var-zz", obj_prop_float, 0, comm); if (obj_zz == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-zz"); - exit(-1); + printf("Error getting an object id of %s from server\n", "z"); + return FAIL; } - obj_pxx = PDCobj_create_mpi(cont_id, "obj-var-pxx", obj_prop_pxx, 0, comm); + obj_pxx = PDCobj_create_mpi(cont_id, "obj-var-pxx", obj_prop_float, 0, comm); if (obj_pxx == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-pxx"); - exit(-1); + printf("Error getting an object id of %s from server\n", "px"); + return FAIL; } - obj_pyy = PDCobj_create_mpi(cont_id, "obj-var-pyy", obj_prop_pyy, 0, comm); + obj_pyy = PDCobj_create_mpi(cont_id, "obj-var-pyy", obj_prop_float, 0, comm); if (obj_pyy == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-pyy"); - exit(-1); + printf("Error getting an object id of %s from server\n", "py"); + return FAIL; } - obj_pzz = PDCobj_create_mpi(cont_id, "obj-var-pzz", obj_prop_pzz, 0, comm); + obj_pzz = PDCobj_create_mpi(cont_id, "obj-var-pzz", obj_prop_float, 0, comm); if (obj_pzz == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj-var-pzz"); - exit(-1); + printf("Error getting an object id of %s from server\n", "pz"); + return FAIL; } - obj_id11 = PDCobj_create_mpi(cont_id, "id11", obj_prop_id11, 0, comm); + obj_id11 = PDCobj_create_mpi(cont_id, "id11", obj_prop_int, 0, comm); if (obj_id11 == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj_id11"); - exit(-1); + printf("Error getting an object id of %s from server\n", "id1"); + return FAIL; } - obj_id22 = PDCobj_create_mpi(cont_id, "id22", obj_prop_id22, 0, comm); + obj_id22 = PDCobj_create_mpi(cont_id, "id22", obj_prop_int, 0, comm); if (obj_id22 == 0) { - printf("Error getting an object id of %s from server, exit...\n", "obj_id22"); - exit(-1); + printf("Error getting an object id of %s from server\n", "id2"); + return FAIL; } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - if (rank == 0) { - printf("Obj create time: %.5e\n", t1 - t0); - } + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Obj create time: %.5e\n", cur_time, t1 - t0); #endif - transfer_request_x = PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_x, region_xx); - if (transfer_request_x == 0) { - printf("Array x transfer request creation failed\n"); - return 1; - } - transfer_request_y = PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_y, region_yy); - if (transfer_request_y == 0) { - printf("Array y transfer request creation failed\n"); - return 1; - } - transfer_request_z = PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_z, region_zz); - if (transfer_request_z == 0) { - printf("Array z transfer request creation failed\n"); - return 1; - } - transfer_request_px = PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_px, region_pxx); - if (transfer_request_px == 0) { - printf("Array px transfer request creation failed\n"); - return 1; - } - transfer_request_py = PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_py, region_pyy); - if (transfer_request_py == 0) { - printf("Array py transfer request creation failed\n"); - return 1; - } - transfer_request_pz = PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_pz, region_pzz); - if (transfer_request_pz == 0) { - printf("Array pz transfer request creation failed\n"); - return 1; - } - transfer_request_id1 = - PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_id1, region_id11); - if (transfer_request_id1 == 0) { - printf("Array id1 transfer request creation failed\n"); - return 1; - } - transfer_request_id2 = - PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_id2, region_id22); - if (transfer_request_id2 == 0) { - printf("Array id2 transfer request creation failed\n"); - return 1; + transfer_requests[0] = + PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_local, region_remote); + if (transfer_requests[0] == 0) { + printf("x transfer request creation failed\n"); + return FAIL; + } + transfer_requests[1] = + PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_local, region_remote); + if (transfer_requests[1] == 0) { + printf("y transfer request creation failed\n"); + return FAIL; + } + transfer_requests[2] = + PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_local, region_remote); + if (transfer_requests[2] == 0) { + printf("z transfer request creation failed\n"); + return FAIL; + } + transfer_requests[3] = + PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_local, region_remote); + if (transfer_requests[3] == 0) { + printf("px transfer request creation failed\n"); + return FAIL; + } + transfer_requests[4] = + PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_local, region_remote); + if (transfer_requests[4] == 0) { + printf("py transfer request creation failed\n"); + return FAIL; + } + transfer_requests[5] = + PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_local, region_remote); + if (transfer_requests[5] == 0) { + printf("pz transfer request creation failed\n"); + return FAIL; + } + transfer_requests[6] = + PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_local, region_remote); + if (transfer_requests[6] == 0) { + printf("id1 transfer request creation failed\n"); + return FAIL; + } + transfer_requests[7] = + PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_local, region_remote); + if (transfer_requests[7] == 0) { + printf("id2 transfer request creation failed\n"); + return FAIL; } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - if (rank == 0) { - printf("Transfer create time: %.5e\n", t0 - t1); - } + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Transfer create time: %.5e\n", cur_time, t0 - t1); #endif - ret = PDCregion_transfer_start(transfer_request_x); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_xx\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_y); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_yy\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_z); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_zz\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_px); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_pxx\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_py); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_pyy\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_pz); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_pzz\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_id1); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_id11\n"); - return 1; - } - ret = PDCregion_transfer_start(transfer_request_id2); - if (ret != SUCCEED) { - printf("Failed to start transfer for region_id22\n"); - return 1; + if (PDCregion_transfer_start_all(transfer_requests, 8) != SUCCEED) { + printf("Failed to start transfer requests\n"); + return FAIL; } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - if (rank == 0) { - printf("Transfer start time: %.5e\n", t1 - t0); - } + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Transfer start time: %.5e\n", cur_time, t1 - t0); #endif - - ret = PDCregion_transfer_wait(transfer_request_x); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_xx\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_y); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_yy\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_z); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_zz\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_px); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_pxx\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_py); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_pyy\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_pz); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_pzz\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_id1); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_id11\n"); - return 1; - } - ret = PDCregion_transfer_wait(transfer_request_id2); - if (ret != SUCCEED) { - printf("Failed to transfer wait for region_id22\n"); - return 1; + // Emulate compute with sleep + if (iter != steps - 1) { + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Sleep start: %llu.00\n", cur_time, sleeptime); + sleep(sleeptime); + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Sleep end: %llu.00\n", cur_time, sleeptime); } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t0 = MPI_Wtime(); - if (rank == 0) { - printf("Transfer wait time: %.5e\n", t0 - t1); - } #endif - ret = PDCregion_transfer_close(transfer_request_x); - if (ret != SUCCEED) { - printf("region xx transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_y); - if (ret != SUCCEED) { - printf("region yy transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_z); - if (ret != SUCCEED) { - printf("region zz transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_px); - if (ret != SUCCEED) { - printf("region pxx transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_py); - if (ret != SUCCEED) { - printf("region pyy transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_pz); - if (ret != SUCCEED) { - printf("region pzz transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_id1); - if (ret != SUCCEED) { - printf("region id11 transfer close failed\n"); - return 1; - } - ret = PDCregion_transfer_close(transfer_request_id2); - if (ret != SUCCEED) { - printf("region id22 transfer close failed\n"); - return 1; + if (PDCregion_transfer_wait_all(transfer_requests, 8) != SUCCEED) { + printf("Failed to transfer wait all\n"); + return FAIL; } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); t1 = MPI_Wtime(); - if (rank == 0) { - printf("Transfer close time: %.5e\n", t1 - t0); + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Transfer wait time: %.5e\n", cur_time, t1 - t0); +#endif + + for (int j = 0; j < 8; j++) { + if (PDCregion_transfer_close(transfer_requests[j]) != SUCCEED) { + printf("region transfer close failed\n"); + return FAIL; + } } + +#ifdef ENABLE_MPI + MPI_Barrier(MPI_COMM_WORLD); + t0 = MPI_Wtime(); + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Transfer close time: %.5e\n", cur_time, t0 - t1); #endif - if (PDCobj_close(obj_xx) < 0) { + if (PDCobj_close(obj_xx) != SUCCEED) { printf("fail to close obj_xx\n"); - return 1; + return FAIL; } - - if (PDCobj_close(obj_yy) < 0) { + if (PDCobj_close(obj_yy) != SUCCEED) { printf("fail to close object obj_yy\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_zz) < 0) { + if (PDCobj_close(obj_zz) != SUCCEED) { printf("fail to close object obj_zz\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_pxx) < 0) { + if (PDCobj_close(obj_pxx) != SUCCEED) { printf("fail to close object obj_pxx\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_pyy) < 0) { + if (PDCobj_close(obj_pyy) != SUCCEED) { printf("fail to close object obj_pyy\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_pzz) < 0) { + if (PDCobj_close(obj_pzz) != SUCCEED) { printf("fail to close object obj_pzz\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_id11) < 0) { + if (PDCobj_close(obj_id11) != SUCCEED) { printf("fail to close object obj_id11\n"); - return 1; + return FAIL; } - if (PDCobj_close(obj_id22) < 0) { + if (PDCobj_close(obj_id22) != SUCCEED) { printf("fail to close object obj_id22\n"); - return 1; + return FAIL; } #ifdef ENABLE_MPI MPI_Barrier(MPI_COMM_WORLD); - t0 = MPI_Wtime(); - if (rank == 0) { - printf("Obj close time: %.5e\n", t0 - t1); - } + t1 = MPI_Wtime(); + PDC_get_time_str(cur_time); + if (rank == 0) + printf("[%s] Obj close time: %.5e\n", cur_time, t1 - t0); #endif - if (i != steps - 1) { - sleep(sleeptime); - if (rank == 0) { - printf("Sleep time: %llu.00\n", sleeptime); - } - } } // End for steps PDC_timing_report("write"); - if (PDCprop_close(obj_prop_xx) < 0) { - printf("Fail to close obj property obj_prop_xx\n"); - return 1; - } - if (PDCprop_close(obj_prop_yy) < 0) { - printf("Fail to close obj property obj_prop_yy\n"); - return 1; - } - if (PDCprop_close(obj_prop_zz) < 0) { - printf("Fail to close obj property obj_prop_zz\n"); - return 1; - } - if (PDCprop_close(obj_prop_pxx) < 0) { - printf("Fail to close obj property obj_prop_pxx\n"); - return 1; - } - if (PDCprop_close(obj_prop_pyy) < 0) { - printf("Fail to close obj property obj_prop_pyy\n"); - return 1; - } - if (PDCprop_close(obj_prop_pzz) < 0) { - printf("Fail to close obj property obj_prop_pzz\n"); - return 1; - } - if (PDCprop_close(obj_prop_id11) < 0) { - printf("Fail to close obj property obj_prop_id11\n"); - return 1; - } - if (PDCprop_close(obj_prop_id22) < 0) { - printf("Fail to close obj property obj_prop_id22\n"); - return 1; - } - if (PDCregion_close(region_x) < 0) { - printf("fail to close region region_x\n"); - return 1; - } - if (PDCregion_close(region_y) < 0) { - printf("fail to close region region_y\n"); - return 1; - } - if (PDCregion_close(region_z) < 0) { - printf("fail to close region region_z\n"); - return 1; - } - if (PDCregion_close(region_px) < 0) { - printf("fail to close region region_px\n"); - return 1; - } - if (PDCregion_close(region_py) < 0) { - printf("fail to close region region_py\n"); - return 1; - } - if (PDCobj_close(region_pz) < 0) { - printf("fail to close region region_pz\n"); - return 1; - } - if (PDCobj_close(region_id1) < 0) { - printf("fail to close region region_id1\n"); - return 1; - } - if (PDCobj_close(region_id2) < 0) { - printf("fail to close region region_id2\n"); - return 1; - } - if (PDCregion_close(region_xx) < 0) { - printf("fail to close region region_xx\n"); - return 1; - } - if (PDCregion_close(region_yy) < 0) { - printf("fail to close region region_yy\n"); - return 1; - } - if (PDCregion_close(region_zz) < 0) { - printf("fail to close region region_zz\n"); - return 1; - } - if (PDCregion_close(region_pxx) < 0) { - printf("fail to close region region_pxx\n"); - return 1; - } - if (PDCregion_close(region_pyy) < 0) { - printf("fail to close region region_pyy\n"); - return 1; + if (PDCprop_close(obj_prop_float) != SUCCEED) { + printf("Fail to close obj_prop_float\n"); + return FAIL; } - if (PDCregion_close(region_pzz) < 0) { - printf("fail to close region region_pzz\n"); - return 1; + if (PDCprop_close(obj_prop_int) != SUCCEED) { + printf("Fail to close obj_prop_int\n"); + return FAIL; } - if (PDCobj_close(region_id11) < 0) { - printf("fail to close region region_id11\n"); - return 1; + if (PDCregion_close(region_local) != SUCCEED) { + printf("fail to close local region \n"); + return FAIL; } - if (PDCobj_close(region_id22) < 0) { - printf("fail to close region region_id22\n"); - return 1; + if (PDCobj_close(region_remote) != SUCCEED) { + printf("fail to close remote region\n"); + return FAIL; } - // close a container - if (PDCcont_close(cont_id) < 0) { - printf("fail to close container c1\n"); - return 1; + if (PDCcont_close(cont_id) != SUCCEED) { + printf("fail to close container\n"); + return FAIL; } - // close a container property - if (PDCprop_close(cont_prop) < 0) { - printf("Fail to close property @ line %d\n", __LINE__); - return 1; + if (PDCprop_close(cont_prop) != SUCCEED) { + printf("Fail to close property\n"); + return FAIL; } - if (PDCclose(pdc_id) < 0) { + if (PDCclose(pdc_id) != SUCCEED) { printf("fail to close PDC\n"); - return 1; + return FAIL; } - free(offset); - free(offset_remote); - free(mysize); free(x); free(y); free(z); diff --git a/src/tests/vpicio_mts_all.c b/src/tests/vpicio_mts_all.c deleted file mode 100644 index 102891ff0..000000000 --- a/src/tests/vpicio_mts_all.c +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright Notice for - * Proactive Data Containers (PDC) Software Library and Utilities - * ----------------------------------------------------------------------------- - - *** Copyright Notice *** - - * Proactive Data Containers (PDC) Copyright (c) 2017, The Regents of the - * University of California, through Lawrence Berkeley National Laboratory, - * UChicago Argonne, LLC, operator of Argonne National Laboratory, and The HDF - * Group (subject to receipt of any required approvals from the U.S. Dept. of - * Energy). All rights reserved. - - * If you have questions about your rights to use or distribute this software, - * please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov. - - * NOTICE. This Software was developed under funding from the U.S. Department of - * Energy and the U.S. Government consequently retains certain rights. As such, the - * U.S. Government has been granted for itself and others acting on its behalf a - * paid-up, nonexclusive, irrevocable, worldwide license in the Software to - * reproduce, distribute copies to the public, prepare derivative works, and - * perform publicly and display publicly, and to permit other to do so. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pdc.h" -#include "pdc_timing.h" - -#define NPARTICLES 8388608 - -double -uniform_random_number() -{ - return (((double)rand()) / ((double)(RAND_MAX))); -} - -void -print_usage() -{ - printf("Usage: srun -n ./vpicio #particles #steps sleep_time(s)\n"); -} - -int -main(int argc, char **argv) -{ - int rank = 0, size = 1; - pdcid_t pdc_id, cont_prop, cont_id, region_local, region_remote; - pdcid_t obj_prop_float, obj_prop_int; - pdcid_t obj_xx, obj_yy, obj_zz, obj_pxx, obj_pyy, obj_pzz, obj_id11, obj_id22; -#ifdef ENABLE_MPI - MPI_Comm comm; -#else - int comm = 1; -#endif - float * x, *y, *z, *px, *py, *pz; - int * id1, *id2; - int x_dim = 64, y_dim = 64, z_dim = 64, ndim = 1, steps = 1, sleeptime = 0; - uint64_t numparticles, dims[1], offset_local[1], offset_remote[1], mysize[1]; - double t0, t1; - char cur_time[64]; - time_t t; - struct tm *tm; - - pdcid_t transfer_request_x, transfer_request_y, transfer_request_z, transfer_request_px, - transfer_request_py, transfer_request_pz, transfer_request_id1, transfer_request_id2; - pdcid_t transfer_requests[8]; - -#ifdef ENABLE_MPI - MPI_Init(&argc, &argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_dup(MPI_COMM_WORLD, &comm); -#endif - - numparticles = NPARTICLES; - if (argc == 4) { - numparticles = atoll(argv[1]); - steps = atoi(argv[2]); - sleeptime = atoi(argv[3]); - } - if (rank == 0) - printf("Writing %" PRIu64 " number of particles for %d steps with %d clients.\n", numparticles, steps, - size); - - dims[0] = numparticles * size; - - x = (float *)malloc(numparticles * sizeof(float)); - y = (float *)malloc(numparticles * sizeof(float)); - z = (float *)malloc(numparticles * sizeof(float)); - px = (float *)malloc(numparticles * sizeof(float)); - py = (float *)malloc(numparticles * sizeof(float)); - pz = (float *)malloc(numparticles * sizeof(float)); - - id1 = (int *)malloc(numparticles * sizeof(int)); - id2 = (int *)malloc(numparticles * sizeof(int)); - - // create a pdc - pdc_id = PDCinit("pdc"); - - // create a container property - cont_prop = PDCprop_create(PDC_CONT_CREATE, pdc_id); - if (cont_prop <= 0) { - printf("Fail to create container property @ line %d!\n", __LINE__); - return FAIL; - } - // create a container - cont_id = PDCcont_create_col("c1", cont_prop); - if (cont_id <= 0) { - printf("Fail to create container @ line %d!\n", __LINE__); - return FAIL; - } - // create an object property - obj_prop_float = PDCprop_create(PDC_OBJ_CREATE, pdc_id); - PDCprop_set_obj_dims(obj_prop_float, 1, dims); - PDCprop_set_obj_type(obj_prop_float, PDC_FLOAT); - PDCprop_set_obj_user_id(obj_prop_float, getuid()); - PDCprop_set_obj_app_name(obj_prop_float, "VPICIO"); - PDCprop_set_obj_tags(obj_prop_float, "tag0=1"); - /* PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_LOCAL); */ - PDCprop_set_obj_transfer_region_type(obj_prop_float, PDC_REGION_STATIC); - - obj_prop_int = PDCprop_obj_dup(obj_prop_float); - PDCprop_set_obj_type(obj_prop_int, PDC_INT); - - for (uint64_t i = 0; i < numparticles; i++) { - id1[i] = i; - id2[i] = i * 2; - x[i] = uniform_random_number() * x_dim; - y[i] = uniform_random_number() * y_dim; - z[i] = ((float)id1[i] / numparticles) * z_dim; - px[i] = uniform_random_number() * x_dim; - py[i] = uniform_random_number() * y_dim; - pz[i] = ((float)id2[i] / numparticles) * z_dim; - } - - offset_local[0] = 0; - offset_remote[0] = rank * numparticles; - mysize[0] = numparticles; - - // create local and remote region - region_local = PDCregion_create(ndim, offset_local, mysize); - region_remote = PDCregion_create(ndim, offset_remote, mysize); - - for (int iter = 0; iter < steps; iter++) { - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("\n[%s] #Step %d\n", cur_time, iter); - t0 = MPI_Wtime(); -#endif - PDCprop_set_obj_time_step(obj_prop_float, iter); - PDCprop_set_obj_time_step(obj_prop_int, iter); - - obj_xx = PDCobj_create_mpi(cont_id, "obj-var-xx", obj_prop_float, 0, comm); - if (obj_xx == 0) { - printf("Error getting an object id of %s from server\n", "x"); - return FAIL; - } - - obj_yy = PDCobj_create_mpi(cont_id, "obj-var-yy", obj_prop_float, 0, comm); - if (obj_yy == 0) { - printf("Error getting an object id of %s from server\n", "y"); - return FAIL; - } - obj_zz = PDCobj_create_mpi(cont_id, "obj-var-zz", obj_prop_float, 0, comm); - if (obj_zz == 0) { - printf("Error getting an object id of %s from server\n", "z"); - return FAIL; - } - obj_pxx = PDCobj_create_mpi(cont_id, "obj-var-pxx", obj_prop_float, 0, comm); - if (obj_pxx == 0) { - printf("Error getting an object id of %s from server\n", "px"); - return FAIL; - } - obj_pyy = PDCobj_create_mpi(cont_id, "obj-var-pyy", obj_prop_float, 0, comm); - if (obj_pyy == 0) { - printf("Error getting an object id of %s from server\n", "py"); - return FAIL; - } - obj_pzz = PDCobj_create_mpi(cont_id, "obj-var-pzz", obj_prop_float, 0, comm); - if (obj_pzz == 0) { - printf("Error getting an object id of %s from server\n", "pz"); - return FAIL; - } - - obj_id11 = PDCobj_create_mpi(cont_id, "id11", obj_prop_int, 0, comm); - if (obj_id11 == 0) { - printf("Error getting an object id of %s from server\n", "id1"); - return FAIL; - } - obj_id22 = PDCobj_create_mpi(cont_id, "id22", obj_prop_int, 0, comm); - if (obj_id22 == 0) { - printf("Error getting an object id of %s from server\n", "id2"); - return FAIL; - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t1 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Obj create time: %.5e\n", cur_time, t1 - t0); -#endif - - transfer_requests[0] = - PDCregion_transfer_create(&x[0], PDC_WRITE, obj_xx, region_local, region_remote); - if (transfer_requests[0] == 0) { - printf("x transfer request creation failed\n"); - return FAIL; - } - transfer_requests[1] = - PDCregion_transfer_create(&y[0], PDC_WRITE, obj_yy, region_local, region_remote); - if (transfer_requests[1] == 0) { - printf("y transfer request creation failed\n"); - return FAIL; - } - transfer_requests[2] = - PDCregion_transfer_create(&z[0], PDC_WRITE, obj_zz, region_local, region_remote); - if (transfer_requests[2] == 0) { - printf("z transfer request creation failed\n"); - return FAIL; - } - transfer_requests[3] = - PDCregion_transfer_create(&px[0], PDC_WRITE, obj_pxx, region_local, region_remote); - if (transfer_requests[3] == 0) { - printf("px transfer request creation failed\n"); - return FAIL; - } - transfer_requests[4] = - PDCregion_transfer_create(&py[0], PDC_WRITE, obj_pyy, region_local, region_remote); - if (transfer_requests[4] == 0) { - printf("py transfer request creation failed\n"); - return FAIL; - } - transfer_requests[5] = - PDCregion_transfer_create(&pz[0], PDC_WRITE, obj_pzz, region_local, region_remote); - if (transfer_requests[5] == 0) { - printf("pz transfer request creation failed\n"); - return FAIL; - } - transfer_requests[6] = - PDCregion_transfer_create(&id1[0], PDC_WRITE, obj_id11, region_local, region_remote); - if (transfer_requests[6] == 0) { - printf("id1 transfer request creation failed\n"); - return FAIL; - } - transfer_requests[7] = - PDCregion_transfer_create(&id2[0], PDC_WRITE, obj_id22, region_local, region_remote); - if (transfer_requests[7] == 0) { - printf("id2 transfer request creation failed\n"); - return FAIL; - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t0 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Transfer create time: %.5e\n", cur_time, t0 - t1); -#endif - - if (PDCregion_transfer_start_all(transfer_requests, 8) != SUCCEED) { - printf("Failed to start transfer requests\n"); - return FAIL; - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t1 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Transfer start time: %.5e\n", cur_time, t1 - t0); -#endif - // Emulate compute with sleep - if (iter != steps - 1) { - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Sleep start: %llu.00\n", cur_time, sleeptime); - sleep(sleeptime); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Sleep end: %llu.00\n", cur_time, sleeptime); - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t0 = MPI_Wtime(); -#endif - - if (PDCregion_transfer_wait_all(transfer_requests, 8) != SUCCEED) { - printf("Failed to transfer wait all\n"); - return FAIL; - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t1 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Transfer wait time: %.5e\n", cur_time, t1 - t0); -#endif - - for (int j = 0; j < 8; j++) { - if (PDCregion_transfer_close(transfer_requests[j]) != SUCCEED) { - printf("region transfer close failed\n"); - return FAIL; - } - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t0 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Transfer close time: %.5e\n", cur_time, t0 - t1); -#endif - - if (PDCobj_close(obj_xx) != SUCCEED) { - printf("fail to close obj_xx\n"); - return FAIL; - } - if (PDCobj_close(obj_yy) != SUCCEED) { - printf("fail to close object obj_yy\n"); - return FAIL; - } - if (PDCobj_close(obj_zz) != SUCCEED) { - printf("fail to close object obj_zz\n"); - return FAIL; - } - if (PDCobj_close(obj_pxx) != SUCCEED) { - printf("fail to close object obj_pxx\n"); - return FAIL; - } - if (PDCobj_close(obj_pyy) != SUCCEED) { - printf("fail to close object obj_pyy\n"); - return FAIL; - } - if (PDCobj_close(obj_pzz) != SUCCEED) { - printf("fail to close object obj_pzz\n"); - return FAIL; - } - if (PDCobj_close(obj_id11) != SUCCEED) { - printf("fail to close object obj_id11\n"); - return FAIL; - } - if (PDCobj_close(obj_id22) != SUCCEED) { - printf("fail to close object obj_id22\n"); - return FAIL; - } - -#ifdef ENABLE_MPI - MPI_Barrier(MPI_COMM_WORLD); - t1 = MPI_Wtime(); - PDC_get_time_str(cur_time); - if (rank == 0) - printf("[%s] Obj close time: %.5e\n", cur_time, t1 - t0); -#endif - } // End for steps - - PDC_timing_report("write"); - - if (PDCprop_close(obj_prop_float) != SUCCEED) { - printf("Fail to close obj_prop_float\n"); - return FAIL; - } - if (PDCprop_close(obj_prop_int) != SUCCEED) { - printf("Fail to close obj_prop_int\n"); - return FAIL; - } - if (PDCregion_close(region_local) != SUCCEED) { - printf("fail to close local region \n"); - return FAIL; - } - if (PDCobj_close(region_remote) != SUCCEED) { - printf("fail to close remote region\n"); - return FAIL; - } - if (PDCcont_close(cont_id) != SUCCEED) { - printf("fail to close container\n"); - return FAIL; - } - if (PDCprop_close(cont_prop) != SUCCEED) { - printf("Fail to close property\n"); - return FAIL; - } - if (PDCclose(pdc_id) != SUCCEED) { - printf("fail to close PDC\n"); - return FAIL; - } - free(x); - free(y); - free(z); - free(px); - free(py); - free(pz); - free(id1); - free(id2); -#ifdef ENABLE_MPI - MPI_Finalize(); -#endif - - return 0; -}