test_dvs_client_cxx.cpp
Last update: 17.04.2023
Go to the documentation of this file.
210 fprintf(stderr, "Usage: %s [-p port] [-h host] [-d msec_delay] [-t num_timesteps] [-s dx dy dz] [-noghost] [-nowait] [-start t]\n", argv[0]);
216 fprintf(stderr, " -d delay Number of milliseconds to delay between timestep pushes. Default: %u\n", msec_delay);
217 fprintf(stderr, " -s dx dy dz Size of 3D hex grid (width height depth) Default: %u %u %u\n", width, height, depth);
218 fprintf(stderr, " -r x y Rank information x=current rank (0 based), y=total number of ranks. Default: %u %u\n", current_rank, total_ranks);
222 fprintf(stderr, " -nodedup Do not de-duplicate data on the client side Default: deduplicate\n");
224 fprintf(stderr, " -secret string Shared secret to use when talking with server Default: no shared secret\n");
225 fprintf(stderr, " -case_constants Turn on sending case constants Defaults: Don't send case constants\n");
226 fprintf(stderr, " -structured Turn on sending structured part data Default: Don't send structured part data\n");
227 fprintf(stderr, " -plot_rank Set the rank which should send plot data to EnSight (zero based) Default: %u\n", plot_rank);
228 fprintf(stderr, " -server n r v Start a server using server number [n], expecting [r] local ranks for DVS connections to connect to with verbosity [v]. Local Rank Min/Max: 1/1000\n");
229 fprintf(stderr, " -cache_uri str The URI for the server to use for the cache. Default: No cache\n");
230 fprintf(stderr, " -all_defs Send all part/var definitions no matter the current rank. Default: No\n");
231 fprintf(stderr, " -log_all Print out all client logging information\n. Default: No client logs");
233 fprintf(stderr, " -test_delete Test deleting all timesteps before each update Default: Do not test\n");
263 if (block_for_server) flags = static_cast<dvs_client_flags>(flags | dvs_client_flags::BLOCK_FOR_SERVER);
266 fprintf(stderr, "Client Flags: Blocking: %d, Dedup: %u\n", (BLOCK_FOR_SERVER & flags) > 0, (DEDUP & flags) > 0);
296 fprintf(stderr, "This pseudo client code relies on part infos == 7 and var infos == 7, needs modified otherwise\n");
310 //If one rank or two ranks and first rank send everything (tests second rank having no definitions)
388 fprintf(stderr, "Rank: %i of %i Sending Timestep: %i of %i\n", (current_rank+1), total_ranks, (i+1), max_timesteps);
426 if (send_hex_elems) client->update_nodes(test.parts[0]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
427 if (send_pnt_elems) client->update_nodes(test.parts[1]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
428 if (send_nfaced_elems) client->update_nodes(test.parts[2]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
429 if (send_tri_quad_elems) client->update_nodes(test.parts[3]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
430 if (send_nsided_elems) client->update_nodes(test.parts[4]._id, test.polymesh_x_coords, test.polymesh_y_coords, test.polymesh_z_coords, test.polymesh_coords_size);
436 client->update_elements(test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_coords, test.mesh_hex_elem_coords_size);
439 client->update_elements(test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_coords, test.mesh_hex_ghost_elem_coords_size);
487 if (send_pnt_elems) client->update_elements(test.parts[1]._id, PNT, test.mesh_point_elem_coords, test.mesh_point_elem_coords_size);
491 client->update_elements(test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_coords, test.mesh_quad_elem_coords_size);
492 client->update_elements(test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_coords, test.mesh_tri_elem_coords_size);
499 if (send_case_vars) client->update_var_case(dvs_var_type::SCALAR, test.vars[6]._id, &test.case_var_value, 1);
500 client->update_var_part(dvs_var_type::SCALAR, test.vars[4]._id, test.parts[0]._id, &test.part_scalar[0], 1);
501 client->update_var_part(dvs_var_type::SCALAR, test.vars[4]._id, test.parts[1]._id, &test.part_scalar[1], 1);
502 if (send_hex_elems) client->update_var_element(HEXAHEDRON, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[0]._id, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
503 if (send_hex_elems) client->update_var_element(HEXAHEDRON, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[0]._id, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
506 if (send_nfaced_elems) client->update_var_element(CONVEX_POLYHEDRON, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[2]._id, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
507 if (send_nfaced_elems) client->update_var_element(CONVEX_POLYHEDRON, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[2]._id, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
511 client->update_var_element(STRUCTURED, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[5]._id, test.structured_elem_var_scalar, test.structured_elem_var_scalar_size);
512 client->update_var_element(STRUCTURED, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[5]._id, test.structured_elem_var_scalar_rank, test.structured_elem_var_scalar_rank_size);
514 client->update_var_element(STRUCTURED, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[6]._id, test.structured_elem_var_scalar, test.structured_elem_var_scalar_size);
515 client->update_var_element(STRUCTURED, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[6]._id, test.structured_elem_var_scalar_rank, test.structured_elem_var_scalar_rank_size);
520 if (send_hex_elems) client->update_var_element(HEXAHEDRON_GHOST, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[0]._id, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
522 if (send_nfaced_elems) client->update_var_element(CONVEX_POLYHEDRON_GHOST, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[2]._id, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
526 if (send_hex_elems) client->update_var_element(HEXAHEDRON_GHOST, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[0]._id, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
528 if (send_nfaced_elems) client->update_var_element(CONVEX_POLYHEDRON_GHOST, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[2]._id, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
531 if (send_pnt_elems) client->update_var_element(PNT, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[1]._id, test.mesh_point_elem_var_rank_scalar, test.mesh_point_elem_var_rank_scalar_size);
533 if (send_nfaced_elems) client->update_var_element(HEXAHEDRON, dvs_var_type::VECTOR, test.vars[3]._id, test.parts[0]._id, test.mesh_hex_elem_var_vector, test.mesh_hex_elem_var_vector_size);
536 if (send_nfaced_elems) client->update_var_element(HEXAHEDRON_GHOST, dvs_var_type::VECTOR, test.vars[3]._id, test.parts[0]._id, test.mesh_hex_ghost_elem_var_vector, test.mesh_hex_ghost_elem_var_vector_size);
541 client->update_var_element(QUADRANGLE, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[3]._id, test.mesh_quad_elem_var_scalar, test.mesh_quad_elem_var_scalar_size);
542 client->update_var_element(QUADRANGLE, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[3]._id, test.mesh_quad_elem_var_rank_scalar, test.mesh_quad_elem_var_rank_scalar_size);
543 client->update_var_element(TRIANGLE, dvs_var_type::SCALAR, test.vars[2]._id, test.parts[3]._id, test.mesh_tri_elem_var_scalar, test.mesh_tri_elem_var_scalar_size);
544 client->update_var_element(TRIANGLE, dvs_var_type::SCALAR, test.vars[5]._id, test.parts[3]._id, test.mesh_tri_elem_var_rank_scalar, test.mesh_tri_elem_var_rank_scalar_size);
547 client->update_var_node(dvs_var_type::SCALAR, test.vars[0]._id, test.parts[0]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
548 client->update_var_node(dvs_var_type::VECTOR, test.vars[1]._id, test.parts[0]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
549 client->update_var_node(dvs_var_type::SCALAR, test.vars[0]._id, test.parts[2]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
550 client->update_var_node(dvs_var_type::VECTOR, test.vars[1]._id, test.parts[2]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
554 client->update_var_node(dvs_var_type::SCALAR, test.vars[0]._id, test.parts[5]._id, test.structured_nodal_scalar, test.structured_nodal_scalar_size);
555 client->update_var_node(dvs_var_type::SCALAR, test.vars[0]._id, test.parts[6]._id, test.structured_nodal_scalar, test.structured_nodal_scalar_size);
561 client->update_plot(test.plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
562 client->update_plot(test.plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
563 client->update_plot(test.plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
573 //If we started our own server wait for the pending timesteps to clear before tearing everything down
API for solvers to use to send data to EnSight servers.
Definition: dvs_client_interface.h:81
virtual dvs_ret update_nodes_structured(uint32_t part_id, const uint32_t global_ijk_max[3], const uint32_t local_ijk_min[3], const uint32_t local_ijk_max[3], const float origin[3], const float dir_i[3], const float dir_j[3], const float dir_k[3], const float *i_vals, const float *j_vals, const float *k_vals)=0
Update the nodes for a parallelepiped structured part.
virtual dvs_ret add_plot_info(const dvs_plot_info *plot_info, uint32_t num_plots)=0
Add plot information for session.
virtual dvs_ret set_unit_system(const char *system)=0
Set the unit system we are using for this session (optional)
virtual dvs_ret update_elements(uint32_t part_id, dvs_element_type type, const uint32_t *indices, uint32_t num_indices)=0
Update elements for a specific part and element type.
virtual dvs_ret delete_item(uint32_t update_num, uint32_t rank, const char *filter)=0
Delete an item.
virtual dvs_ret add_part_info(const dvs_part_info *part_info, uint32_t num_parts)=0
Add part information for session.
virtual dvs_ret end_update()=0
Call to end the update for this timestep/rank/chunk.
virtual dvs_ret update_elements_polyhedral(uint32_t part_id, dvs_element_type type, const uint32_t *faces_per_element, uint32_t faces_per_element_size, const uint32_t *nodes_per_face, uint32_t nodes_per_face_size, const uint32_t *indices, uint32_t indices_size)=0
Update N-FACED Elements.
virtual dvs_ret add_var_info(const dvs_var_info *var_info, uint32_t num_vars)=0
Add variable information for session.
virtual dvs_ret update_nodes(uint32_t part_id, const float *x, const float *y, const float *z, uint32_t num_values)=0
Update nodes for a specific part.
virtual dvs_ret update_var_case(dvs_var_type var_type, uint32_t var_id, const float *values, uint32_t num_values)=0
Update case variable.
virtual dvs_ret update_var_part(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update part vector variable.
virtual dvs_ret add_metadata(const char *const keys[], const char *const vals[], uint32_t num_metadata_pairs)=0
Add metadata for the current dataset.
virtual dvs_ret begin_update(uint32_t update_num, uint32_t rank, uint32_t chunk, float time)=0
Method to begin an update.
virtual dvs_ret update_elements_polygon(uint32_t part_id, dvs_element_type type, const uint32_t *nodes_per_polygon, uint32_t nodes_per_polygon_size, const uint32_t *indices, uint32_t indices_size)=0
Update N-SIDED elements.
virtual dvs_ret update_var_node(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update nodal variable values.
virtual dvs_ret update_var_element(dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update elemental scalar variable values.
virtual dvs_ret update_plot(uint32_t plot_id, const float *x_values, const float *y_values, uint32_t num_values)=0
Update plot data for plot.
virtual dvs_ret begin_init(const char *dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks)=0
Begins initialization for this rank.
Interface class used to run a dynamic data server in a thread accepting incoming client connections.
Definition: dvs_server_interface.h:57
virtual void set_option(const char *key, const char *value)=0
Set a specific option on the server, these are used during startup See See Server Options.
virtual dvs_ret startup(uint32_t server_number, uint32_t local_ranks)=0
Start the server.
virtual dvs_ret get_timestep_count(uint32_t &num_pending, uint32_t &num_complete) const =0
return the current number of pending and complete timesteps in the server
C++ Client API for using the Dynamic Visualization Store.
C++ Server API for using Dynamic Visualization Store Server.
Contains enums used in C/C++ API.
@ LOG_UPDATE_BEG_END
Log messages related to begin and end of updates.
Definition: dynamic_visualization_store_enums.h:71
@ BLOCK_FOR_SERVER
Clients should block for servers to be initialized before sending data.
Definition: dynamic_visualization_store_enums.h:57
int32_t dvs_ret
Return value of methods, TODO.
Definition: dynamic_visualization_store_error_codes.h:17
#define DVS_NONE
No detected error has occurred.
Definition: dynamic_visualization_store_error_codes.h:81
int main(int argc, char **argv)
Main method of test client application.
Definition: test_dvs_client_cxx.cpp:56