test_dvs_client.c
Last update: 17.04.2023
Go to the documentation of this file.
250 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]);
256 fprintf(stderr, " -d delay Number of milliseconds to delay between timestep pushes. Default: %u\n", msec_delay);
257 fprintf(stderr, " -s dx dy dz Size of 3D hex grid (width height depth) Default: %u %u %u\n", width, height, depth);
258 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);
262 fprintf(stderr, " -nodedup Do not de-duplicate data on the client side Default: deduplicate\n");
264 fprintf(stderr, " -secret string Shared secret to use when talking with server Default: no shared secret\n");
265 fprintf(stderr, " -case_constants Turn on sending case constants Defaults: Don't send case constants\n");
266 fprintf(stderr, " -structured Turn on sending structured part data Default: Don't send structured part data\n");
267 fprintf(stderr, " -plot_rank Set the rank which should send plot data to EnSight (zero based) Default: %u\n", plot_rank);
268 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");
269 fprintf(stderr, " -cache_uri str The URI for the server to use for the cache. Default: No cache\n");
270 fprintf(stderr, " -all_defs Send all part/var definitions no matter the current rank. Default: No\n");
271 fprintf(stderr, " -log_all Print out all client logging information\n. Default: No client logs");
279 fprintf(stderr, " -test_delete Test deleting all timesteps before each update Default: Do not test\n");
314 fprintf(stderr, "Client Flags: Blocking: %d, Dedup: %u\n", (BLOCK_FOR_SERVER & flags) > 0, (DEDUP & flags) > 0);
325 if (strlen(dvs_file_loc) > 0) dvs_server_set_option(server_id, "DVS_FILE_LOCATION", dvs_file_loc);
348 fprintf(stderr, "This pseudo client code relies on part infos == 7 and var infos == 7, needs modified otherwise\n");
359 if (send_plots && current_rank == plot_rank) dvs_add_plot_info(session_id, test.plots, plot_info_num);
363 //If one rank or two ranks and first rank send everything (tests second rank having no definitions)
465 fprintf(stderr, "Rank: %i of %i Sending Timestep: %i of %i\n", (current_rank), total_ranks, (i), max_timesteps-1);
509 if (send_hex_elems) dvs_update_nodes(session_id, test.parts[0]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
510 if (send_pnt_elems) dvs_update_nodes(session_id, test.parts[1]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
511 if (send_nfaced_elems) dvs_update_nodes(session_id, test.parts[2]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
512 if (send_tri_quad_elems) dvs_update_nodes(session_id, test.parts[3]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
513 if (send_nsided_elems) dvs_update_nodes(session_id, test.parts[4]._id, test.polymesh_x_coords, test.polymesh_y_coords, test.polymesh_z_coords, test.polymesh_coords_size);
519 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_coords, test.mesh_hex_elem_coords_size);
522 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_coords, test.mesh_hex_ghost_elem_coords_size);
573 if (send_pnt_elems) dvs_update_elements(session_id, test.parts[1]._id, PNT, test.mesh_point_elem_coords, test.mesh_point_elem_coords_size);
577 dvs_update_elements(session_id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_coords, test.mesh_quad_elem_coords_size);
578 dvs_update_elements(session_id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_coords, test.mesh_tri_elem_coords_size);
585 if (send_case_vars) dvs_update_var_case_scalar(session_id, test.vars[6]._id, test.case_var_value);
586 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[0]._id, test.part_scalar[0]);
587 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[1]._id, test.part_scalar[1]);
588 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
589 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
592 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
593 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
597 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[5]._id, STRUCTURED, test.structured_elem_var_scalar, test.structured_elem_var_scalar_size);
598 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[5]._id, STRUCTURED, test.structured_elem_var_scalar_rank, test.structured_elem_var_scalar_rank_size);
600 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[6]._id, STRUCTURED, test.structured_elem_var_scalar, test.structured_elem_var_scalar_size);
601 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[6]._id, STRUCTURED, test.structured_elem_var_scalar_rank, test.structured_elem_var_scalar_rank_size);
605 dvs_update_var_element_scalar(session_id, DVS_STRUCTURED_GHOST_ELEMENTS, test.parts[5]._id, STRUCTURED, test.structured_elem_ghosts, test.structured_elem_ghosts_size);
606 dvs_update_var_element_scalar(session_id, DVS_STRUCTURED_GHOST_ELEMENTS, test.parts[6]._id, STRUCTURED, test.structured_elem_ghosts, test.structured_elem_ghosts_size);
612 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
614 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
618 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
620 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
623 if (send_pnt_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[1]._id, PNT, test.mesh_point_elem_var_rank_scalar, test.mesh_point_elem_var_rank_scalar_size);
625 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_vector, test.mesh_hex_elem_var_vector_size);
628 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_vector, test.mesh_hex_ghost_elem_var_vector_size);
633 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_scalar, test.mesh_quad_elem_var_scalar_size);
634 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_rank_scalar, test.mesh_quad_elem_var_rank_scalar_size);
635 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_scalar, test.mesh_tri_elem_var_scalar_size);
636 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_rank_scalar, test.mesh_tri_elem_var_rank_scalar_size);
639 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[0]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
640 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[0]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
641 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[2]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
642 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[2]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
646 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[5]._id, test.structured_nodal_scalar, test.structured_nodal_scalar_size);
647 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[6]._id, test.structured_nodal_scalar, test.structured_nodal_scalar_size);
650 dvs_update_var_node_scalar(session_id, DVS_STRUCTURED_IBLANKED_NODES, test.parts[5]._id, test.structured_nodal_iblanked, test.structured_nodal_iblanked_size);
651 dvs_update_var_node_scalar(session_id, DVS_STRUCTURED_IBLANKED_NODES, test.parts[6]._id, test.structured_nodal_iblanked, test.structured_nodal_iblanked_size);
658 dvs_update_plot(session_id, test.plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
659 dvs_update_plot(session_id, test.plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
660 dvs_update_plot(session_id, test.plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
679 if (send_plots && current_rank == plot_rank) dvs_add_plot_info(session_id, test.plots, plot_info_num);
680 if (send_plots && current_rank == plot_rank && reinit_plots) dvs_add_plot_info(session_id, test.reinit_plots, reinit_iter+1);
686 //If one rank or two ranks and first rank send everything (tests second rank having no definitions)
693 if (send_case_vars && reinit_vars) dvs_add_var_info(session_id, test.reinit_case_vars, reinit_iter+1);
694 if (send_vars && reinit_vars) dvs_add_var_info(session_id, test.reinit_part_vars, reinit_iter+1);
719 if (send_case_vars && reinit_vars) dvs_add_var_info(session_id, test.reinit_case_vars, reinit_iter+2);
720 if (send_vars && reinit_vars) dvs_add_var_info(session_id, test.reinit_part_vars, reinit_iter+1);
735 if (send_vars && reinit_vars && reinit_iter >= 0) dvs_add_var_info(session_id, &test.reinit_part_vars[0], 1);
745 if (send_vars && reinit_vars && reinit_iter >= 1) dvs_add_var_info(session_id, &test.reinit_part_vars[1], 1);
754 if (send_case_vars && reinit_vars) dvs_add_var_info(session_id, test.reinit_case_vars, reinit_iter+1);
755 if (send_vars && reinit_vars && reinit_iter >= 2) dvs_add_var_info(session_id, &test.reinit_part_vars[2], 1);
767 for (uint32_t i = max_timesteps + (reinit_iter * reinit_num_timesteps); i < max_timesteps + ((reinit_iter+1) * reinit_num_timesteps); i++)
794 if (send_hex_elems) dvs_update_nodes(session_id, test.parts[0]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
795 if (send_pnt_elems) dvs_update_nodes(session_id, test.parts[1]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
796 if (send_nfaced_elems) dvs_update_nodes(session_id, test.parts[2]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
797 if (send_tri_quad_elems) dvs_update_nodes(session_id, test.parts[3]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
798 if (send_nsided_elems) dvs_update_nodes(session_id, test.parts[4]._id, test.polymesh_x_coords, test.polymesh_y_coords, test.polymesh_z_coords, test.polymesh_coords_size);
804 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_coords, test.mesh_hex_elem_coords_size);
807 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_coords, test.mesh_hex_ghost_elem_coords_size);
858 if (send_pnt_elems) dvs_update_elements(session_id, test.parts[1]._id, PNT, test.mesh_point_elem_coords, test.mesh_point_elem_coords_size);
862 dvs_update_elements(session_id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_coords, test.mesh_quad_elem_coords_size);
863 dvs_update_elements(session_id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_coords, test.mesh_tri_elem_coords_size);
870 if (send_case_vars) dvs_update_var_case_scalar(session_id, test.vars[6]._id, test.case_var_value);
871 if (send_case_vars && reinit_vars && reinit_iter >= 0) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[0]._id, (test.case_var_value*-1.f));
872 if (send_case_vars && reinit_vars && reinit_iter >= 1) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[1]._id, (test.case_var_value*-1.f)-10.f);
873 if (send_case_vars && reinit_vars && reinit_iter >= 2) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[2]._id, (test.case_var_value*-1.f)-20.f);
874 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[0]._id, test.part_scalar[0]);
875 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[1]._id, test.part_scalar[1]);
876 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
877 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
880 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
881 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
885 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
887 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
891 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
893 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
896 if (send_pnt_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[1]._id, PNT, test.mesh_point_elem_var_rank_scalar, test.mesh_point_elem_var_rank_scalar_size);
898 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_vector, test.mesh_hex_elem_var_vector_size);
901 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_vector, test.mesh_hex_ghost_elem_var_vector_size);
906 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_scalar, test.mesh_quad_elem_var_scalar_size);
907 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_rank_scalar, test.mesh_quad_elem_var_rank_scalar_size);
908 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_scalar, test.mesh_tri_elem_var_scalar_size);
909 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_rank_scalar, test.mesh_tri_elem_var_rank_scalar_size);
912 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[0]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
913 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[0]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
914 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[2]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
915 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[2]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
920 dvs_update_plot(session_id, test.plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
921 dvs_update_plot(session_id, test.plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
922 dvs_update_plot(session_id, test.plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
923 if (reinit_plots && reinit_iter >= 0) dvs_update_plot(session_id, test.reinit_plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
924 if (reinit_plots && reinit_iter >= 1) dvs_update_plot(session_id, test.reinit_plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
925 if (reinit_plots && reinit_iter >= 2) dvs_update_plot(session_id, test.reinit_plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
992 for (uint32_t i = max_timesteps + (reinit_iter * reinit_num_timesteps); i < max_timesteps + ((reinit_iter+1) * reinit_num_timesteps); i++)
1019 if (send_hex_elems) dvs_update_nodes(session_id, test.parts[0]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
1020 if (send_pnt_elems) dvs_update_nodes(session_id, test.parts[1]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
1021 if (send_nfaced_elems) dvs_update_nodes(session_id, test.parts[2]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
1022 if (send_tri_quad_elems) dvs_update_nodes(session_id, test.parts[3]._id, test.mesh_x_coords, test.mesh_y_coords, test.mesh_z_coords, test.mesh_coords_size);
1023 if (send_nsided_elems) dvs_update_nodes(session_id, test.parts[4]._id, test.polymesh_x_coords, test.polymesh_y_coords, test.polymesh_z_coords, test.polymesh_coords_size);
1029 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_coords, test.mesh_hex_elem_coords_size);
1032 dvs_update_elements(session_id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_coords, test.mesh_hex_ghost_elem_coords_size);
1083 if (send_pnt_elems) dvs_update_elements(session_id, test.parts[1]._id, PNT, test.mesh_point_elem_coords, test.mesh_point_elem_coords_size);
1087 dvs_update_elements(session_id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_coords, test.mesh_quad_elem_coords_size);
1088 dvs_update_elements(session_id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_coords, test.mesh_tri_elem_coords_size);
1095 if (send_case_vars) dvs_update_var_case_scalar(session_id, test.vars[6]._id, test.case_var_value);
1096 if (send_case_vars && reinit_vars && reinit_iter >= 0) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[0]._id, (test.case_var_value*-1.f));
1097 if (send_case_vars && reinit_vars && reinit_iter >= 1) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[1]._id, (test.case_var_value*-1.f)-10.f);
1098 if (send_case_vars && reinit_vars && reinit_iter >= 2) dvs_update_var_case_scalar(session_id, test.reinit_case_vars[2]._id, (test.case_var_value*-1.f)-20.f);
1099 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[0]._id, test.part_scalar[0]);
1100 dvs_update_var_part_scalar(session_id, test.vars[4]._id, test.parts[1]._id, test.part_scalar[1]);
1101 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
1102 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
1105 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_scalar, test.mesh_hex_elem_var_scalar_size);
1106 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON, test.mesh_hex_elem_var_rank_scalar, test.mesh_hex_elem_var_rank_scalar_size);
1110 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
1112 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_scalar, test.mesh_hex_ghost_elem_var_scalar_size);
1116 if (send_hex_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
1118 if (send_nfaced_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[2]._id, CONVEX_POLYHEDRON_GHOST, test.mesh_hex_ghost_elem_var_rank_scalar, test.mesh_hex_ghost_elem_var_rank_scalar_size);
1121 if (send_pnt_elems) dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[1]._id, PNT, test.mesh_point_elem_var_rank_scalar, test.mesh_point_elem_var_rank_scalar_size);
1123 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON, test.mesh_hex_elem_var_vector, test.mesh_hex_elem_var_vector_size);
1126 if (send_nfaced_elems) dvs_update_var_element_vector(session_id, test.vars[3]._id, test.parts[0]._id, HEXAHEDRON_GHOST, test.mesh_hex_ghost_elem_var_vector, test.mesh_hex_ghost_elem_var_vector_size);
1131 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_scalar, test.mesh_quad_elem_var_scalar_size);
1132 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, QUADRANGLE, test.mesh_quad_elem_var_rank_scalar, test.mesh_quad_elem_var_rank_scalar_size);
1133 dvs_update_var_element_scalar(session_id, test.vars[2]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_scalar, test.mesh_tri_elem_var_scalar_size);
1134 dvs_update_var_element_scalar(session_id, test.vars[5]._id, test.parts[3]._id, TRIANGLE, test.mesh_tri_elem_var_rank_scalar, test.mesh_tri_elem_var_rank_scalar_size);
1137 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[0]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
1138 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[0]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
1139 dvs_update_var_node_scalar(session_id, test.vars[0]._id, test.parts[2]._id, test.mesh_node_var_scalar, test.mesh_node_var_scalar_size);
1140 dvs_update_var_node_vector(session_id, test.vars[1]._id, test.parts[2]._id, test.mesh_node_var_vector, test.mesh_node_var_vector_size);
1145 dvs_update_plot(session_id, test.plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
1146 dvs_update_plot(session_id, test.plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
1147 dvs_update_plot(session_id, test.plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
1148 if (reinit_plots && reinit_iter >= 0) dvs_update_plot(session_id, test.reinit_plots[0]._id, test.plot_x_values[0], test.plot_y_values[0], test.plot_num_values);
1149 if (reinit_plots && reinit_iter >= 1) dvs_update_plot(session_id, test.reinit_plots[1]._id, test.plot_x_values[1], test.plot_y_values[1], test.plot_num_values);
1150 if (reinit_plots && reinit_iter >= 2) dvs_update_plot(session_id, test.reinit_plots[2]._id, test.plot_x_values[2], test.plot_y_values[2], test.plot_num_values);
1161 //If we started our own server wait for the pending timesteps to clear before tearing everything down
C API for using Dynamic Visualization Store.
DVS_DLL_EXPORT const struct dvs_var_info * dvs_get_var_info(int32_t session_id, uint32_t index)
Get the dvs_var_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_update_elements(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t *indices, uint32_t num_indices)
Update elements for a specific part and element type.
DVS_DLL_EXPORT dvs_ret dvs_server_create(const char *server_uri, int32_t *server_id)
Create a Dynamic Visualization Store server instance for the client to connect.
DVS_DLL_EXPORT dvs_ret dvs_add_var_info(int32_t session_id, const struct dvs_var_info *vars, uint32_t num_vars)
Add var info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes_parallelepiped(int32_t session_id, 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)
Update the nodes for a parallelepiped structured part.
DVS_DLL_EXPORT const struct dvs_plot_info * dvs_get_plot_info(int32_t session_id, uint32_t index)
Get the dvs_plot_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_set_unit_system(int32_t session_id, const char *system)
Set a unit system (optional but recommended)
DVS_DLL_EXPORT const char * dvs_get_version()
Get the current version of the built library.
DVS_DLL_EXPORT dvs_ret dvs_print_stats(int32_t session_id)
This will be deprecated, just placeholder for printing out stats that the client is collecting for pr...
DVS_DLL_EXPORT dvs_ret dvs_begin_init(int32_t session_id, const char *dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks)
begin setup of rank
DVS_DLL_EXPORT dvs_ret dvs_update_plot(int32_t session_id, uint32_t plot_id, const float *x_values, const float *y_values, uint32_t num_values)
Update the data for a plot.
DVS_DLL_EXPORT dvs_ret dvs_add_part_info(int32_t session_id, const struct dvs_part_info *parts, uint32_t num_parts)
Add part info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_delete_item(int32_t session_id, uint32_t update_num, uint32_t rank, const char *filter)
Delete an item.
DVS_DLL_EXPORT uint32_t dvs_get_num_part_info(int32_t session_id)
Get the number of dvs_part_info objects for this client session.
DVS_DLL_EXPORT dvs_ret dvs_update_elements_polygon(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t *nodes_per_polygon, uint32_t nodes_per_polygon_size, const uint32_t *indices, uint32_t indices_size)
Update N-SIDED elements.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes(int32_t session_id, uint32_t part_id, const float *x, const float *y, const float *z, uint32_t num_values)
Update nodes for a specific part.
DVS_DLL_EXPORT void dvs_shutdown()
Shuts down the api, performing any necessary cleanup, also calls dvs_server_shutdown_all() if any ser...
DVS_DLL_EXPORT dvs_ret dvs_update_var_part_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, float scalar)
Update value of part scalar.
DVS_DLL_EXPORT dvs_ret dvs_update_var_node_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)
Update a field of vectors on nodes.
DVS_DLL_EXPORT uint32_t dvs_get_num_plot_info(int32_t session_id)
Get the number of dvs_plot_info objects for this client session.
DVS_DLL_EXPORT dvs_ret dvs_server_start(int32_t server_id, uint32_t server_number, uint32_t local_ranks)
Start a Dynamic Visualization Store server in a separate thread to receive data from solver node.
DVS_DLL_EXPORT dvs_ret dvs_begin_update(int32_t session_id, uint32_t update_num, uint32_t rank, uint32_t chunk, float time)
Method to begin an update.
DVS_DLL_EXPORT dvs_ret dvs_update_var_element_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float *scalars, uint32_t num_vals)
Update a field of scalars on elements.
DVS_DLL_EXPORT const struct dvs_part_info * dvs_get_part_info(int32_t session_id, uint32_t index)
Get the dvs_part_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_connect(int32_t server_id, enum dvs_client_flags flags, const char *secret, int32_t *session_id)
Connect to dvs server.
DVS_DLL_EXPORT dvs_ret dvs_end_init(int32_t session_id)
end the initialization of the rank
DVS_DLL_EXPORT dvs_ret dvs_add_metadata(int32_t session_id, const char *const metadata_keys[], const char *const metadata_vals[], uint32_t num_metadata_pairs)
Add metadata for the current dataset.
DVS_DLL_EXPORT uint32_t dvs_get_num_var_info(int32_t session_id)
Get the number of dvs_var_info objects for this client session.
DVS_DLL_EXPORT dvs_ret dvs_update_var_case_scalar(int32_t session_id, uint32_t var_id, float scalar)
Update value of case scalar.
DVS_DLL_EXPORT dvs_ret dvs_server_timestep_count(int32_t server_id, uint32_t *num_pending, uint32_t *num_complete)
Query a Dynamic Visualization Store server as to the number of timesteps it contains.
DVS_DLL_EXPORT dvs_ret dvs_register_log_func(int32_t session_id, void *user_data, dvs_log_func func, enum dvs_log_flags flags)
Register logging function for client to call (optional but recommended)
DVS_DLL_EXPORT dvs_ret dvs_end_update(int32_t session_id)
Call to end the update for this timestep/rank/chunk.
DVS_DLL_EXPORT dvs_ret dvs_server_set_option(int32_t server_id, const char *key, const char *value)
Add an option to the server.
DVS_DLL_EXPORT dvs_ret dvs_update_var_node_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, const float *scalars, uint32_t num_vals)
Update a field of scalars on nodes.
DVS_DLL_EXPORT dvs_ret dvs_update_var_element_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float *values, uint32_t num_values)
Update a field of vectors on elements.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes_curvilinear(int32_t session_id, 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 *x_vals, const float *y_vals, const float *z_vals)
Update the nodes for a curvilinear structured part.
DVS_DLL_EXPORT dvs_ret dvs_add_plot_info(int32_t session_id, const struct dvs_plot_info *plots, uint32_t num_plots)
Add plot info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_update_elements_polyhedral(int32_t session_id, uint32_t part_id, enum 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)
Update N-FACED Elements.
Contains enums used in C/C++ API.
#define DVS_STRUCTURED_GHOST_ELEMENTS
Definition: dynamic_visualization_store_enums.h:117
@ LOG_UPDATE_BEG_END
Log messages related to begin and end of updates.
Definition: dynamic_visualization_store_enums.h:71
#define DVS_STRUCTURED_IBLANKED_NODES
Definition: dynamic_visualization_store_enums.h:115
@ BEGIN_INIT_WAIT_ON_REINIT
Blocking wait on reinitialization to complete before reinitializing again.
Definition: dynamic_visualization_store_enums.h:59
@ 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
Struct holding information for a part's definition.
Definition: dynamic_visualization_store_api.h:77
char * _name
UTF-8 Compatible name of part [null terminated], max name length visible in GUI == 79,...
Definition: dynamic_visualization_store_api.h:79
uint32_t _id
Unique identifier for part, MUST BE > 0.
Definition: dynamic_visualization_store_api.h:78
Struct holding information for a plot's definition.
Definition: dynamic_visualization_store_api.h:109
char * _name
UTF-8 Compatible name for plot, must be unique from other plot names.
Definition: dynamic_visualization_store_api.h:111
Struct holding information for a variable's definiton.
Definition: dynamic_visualization_store_api.h:92
char * _name
UTF-8 Compatible name of variable [null terminated], max name length visible in the GUI == 49,...
Definition: dynamic_visualization_store_api.h:94
int main(int argc, char **argv)
Main method of test client application.
Definition: test_dvs_client.c:52