From b0bfe074c42b612b935591d77cb88e93c7a8f902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9C=D0=B0=D0=BA=D0=B0=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Mon, 4 May 2020 17:38:49 +0700 Subject: [PATCH 1/2] Compile fix --- include/dfm/rope/rope_segment.h | 1 + src/comm/tp/cart_topology.cpp | 4 ++-- src/dfm/dlb/trans/transaction_manager_new.cpp | 4 ---- src/dfm/rope/pathfinders/cartesian_path_finder.cpp | 2 +- src/dfm/rope/pathfinders/hilbert_path_finder.cpp | 6 +++--- src/main/luna_async_test.cpp | 1 - src/main/luna_test.cpp | 1 - src/ucenv/cuda_input_df.cpp | 2 ++ 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/dfm/rope/rope_segment.h b/include/dfm/rope/rope_segment.h index 1c34a38f..4d33c6a2 100644 --- a/include/dfm/rope/rope_segment.h +++ b/include/dfm/rope/rope_segment.h @@ -7,6 +7,7 @@ #include #include +#include namespace luna { diff --git a/src/comm/tp/cart_topology.cpp b/src/comm/tp/cart_topology.cpp index 23290b0c..fb0c6595 100644 --- a/src/comm/tp/cart_topology.cpp +++ b/src/comm/tp/cart_topology.cpp @@ -22,7 +22,7 @@ size_t CartTopology::getNumOfDimensions() const { } int CartTopology::getDimensionSize(int dim, size_t ndims) const { - if (dim >= getNumOfDimensions()) { + if (static_cast(dim) >= getNumOfDimensions()) { return 1; } if (!ndims) { @@ -33,7 +33,7 @@ int CartTopology::getDimensionSize(int dim, size_t ndims) const { } int CartTopology::getNeighbour(int dim, int direction) const { - if (dim >= getNumOfDimensions()) { + if (static_cast(dim) >= getNumOfDimensions()) { return INVALID_NODE_ID; } return cart_tp->getNeighbour(dim, direction); diff --git a/src/dfm/dlb/trans/transaction_manager_new.cpp b/src/dfm/dlb/trans/transaction_manager_new.cpp index 84cfdf4a..aaa35841 100644 --- a/src/dfm/dlb/trans/transaction_manager_new.cpp +++ b/src/dfm/dlb/trans/transaction_manager_new.cpp @@ -17,10 +17,6 @@ namespace { return dynamic_cast(trans.get()); } - RecvTransaction* asRecv(const TransactionPtr &trans) { - return dynamic_cast(trans.get()); - } - enum MessageTags { TRANS_REQUEST = 0, TRANS_ACCEPT, diff --git a/src/dfm/rope/pathfinders/cartesian_path_finder.cpp b/src/dfm/rope/pathfinders/cartesian_path_finder.cpp index c01d0000..003574a2 100644 --- a/src/dfm/rope/pathfinders/cartesian_path_finder.cpp +++ b/src/dfm/rope/pathfinders/cartesian_path_finder.cpp @@ -19,7 +19,7 @@ CartesianPathFinder::CartesianPathFinder(comm::CommService *cs, event::EventMana } bool CartesianPathFinder::isDistributable(const df::DFId &id) const { - return id.getNumOfIndices() >= getNumOfDimensions(); + return static_cast(id.getNumOfIndices()) >= getNumOfDimensions(); } IndexType CartesianPathFinder::idToRopeIndex(const df::DFId &id) const { diff --git a/src/dfm/rope/pathfinders/hilbert_path_finder.cpp b/src/dfm/rope/pathfinders/hilbert_path_finder.cpp index bd0c7fc5..b69885d1 100644 --- a/src/dfm/rope/pathfinders/hilbert_path_finder.cpp +++ b/src/dfm/rope/pathfinders/hilbert_path_finder.cpp @@ -31,14 +31,14 @@ void HilbertPathFinder::precomputeCoordinates() { int last_pos = getNumOfDimensions() - 1; while (last_pos >= 0) { hilbert_coords[coordToArrayIndex(coord)] = Hilbert::getDistance(coord); - if (++coord[last_pos] >= getDimensionSize()) { + if (static_cast(++coord[last_pos]) >= getDimensionSize()) { do { coord[last_pos--] = 0; if (last_pos >= 0) coord[last_pos]++; } - while ((last_pos >= 0) && (coord[last_pos] >= getDimensionSize())); + while ((last_pos >= 0) && (static_cast(coord[last_pos]) >= getDimensionSize())); if (last_pos >= 0) { last_pos = getNumOfDimensions() - 1; } @@ -47,7 +47,7 @@ void HilbertPathFinder::precomputeCoordinates() { } bool HilbertPathFinder::isDistributable(const df::DFId &id) const { - return id.getNumOfIndices() >= getNumOfDimensions(); + return static_cast(id.getNumOfIndices()) >= getNumOfDimensions(); } IndexType HilbertPathFinder::idToRopeIndex(const df::DFId &id) const { diff --git a/src/main/luna_async_test.cpp b/src/main/luna_async_test.cpp index 8a8ecea4..3be4fc29 100644 --- a/src/main/luna_async_test.cpp +++ b/src/main/luna_async_test.cpp @@ -19,7 +19,6 @@ void lunaAsyncTest(int argc, char** argv) { luna::lunaInit(&argc, &argv, conf); const int this_node = luna::lunaRank(); - const int num_of_nodes = luna::lunaSize(); if (this_node == 0) { std::cout << "Running async test" << std::endl; diff --git a/src/main/luna_test.cpp b/src/main/luna_test.cpp index e1c702eb..96acc53f 100644 --- a/src/main/luna_test.cpp +++ b/src/main/luna_test.cpp @@ -59,7 +59,6 @@ void lunaTest(int argc, char** argv) { luna::lunaInit(&argc, &argv, conf); const int this_node = luna::lunaRank(); - const int num_of_nodes = luna::lunaSize(); if (conf.print_options && !this_node) { conf.print(); diff --git a/src/ucenv/cuda_input_df.cpp b/src/ucenv/cuda_input_df.cpp index f99475ad..6ac69a15 100644 --- a/src/ucenv/cuda_input_df.cpp +++ b/src/ucenv/cuda_input_df.cpp @@ -20,7 +20,9 @@ CudaInDf::CudaInDf(const df::DFId &id, const df::DataFragmentPtr &df) { case fa::Value::VT_REAL: CUDA_Copy_input_dval(vdf->getValue().get()); break; + //! \todo: probably it need to be fixed case fa::Value::VT_STRING: + case fa::Value::VT_BOOL: break; } } -- GitLab From 14bbe1c51324e8a2e6c73db5bbd26227b219bd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9C=D0=B0=D0=BA=D0=B0=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Mon, 4 May 2020 20:39:34 +0700 Subject: [PATCH 2/2] Cmake prototype added --- CMakeLists.txt | 662 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 15 ++ 2 files changed, 677 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..1de9d2d3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,662 @@ +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + +project(LUNA) + +option(${PROJECT_NAME}_ENABLE_TESTS "Enable tests build" ON) +option(${PROJECT_NAME}_ENABLE_EXAMPLES "Enable examples build" ON) +option(${PROJECT_NAME}_ENABLE_CUDA "Enable cuda support" OFF) + +if (${PROJECT_NAME}_ENABLE_TESTS) + enable_testing() +endif () + +if(NOT CMAKE_DEBUG_POSTFIX) + set(CMAKE_DEBUG_POSTFIX d) +endif() + +set(lib_headers + include/comm/receiver_id.h + include/comm/communicator.h + include/comm/comm_base.h + include/comm/comm_service.h + include/comm/receiver.h + include/comm/threaded/sender_type.h + include/comm/threaded/threaded_comm_service.h + include/comm/threaded/comm_service_sender.h + include/comm/threaded/comm_service_receiver.h + include/comm/threaded/comm_service_wait_sender.h + include/comm/threaded/comm_service_pack_sender.h + include/comm/receiving_point.h + include/comm/message/message.h + include/comm/message/message_serialize.h + include/comm/message/message_processor.h + include/comm/message/message_ptr.h + include/comm/message/message_storage.h + include/comm/message/message_sender.h + include/comm/message/message_list.h + include/comm/comm_service_base.h + include/comm/sending_point.h + include/comm/receiver_id_maker.h + include/comm/tp/topology.h + include/comm/tp/cart_topology.h + include/comm/tp/topology_type.h + include/comm/comm_environment.h + include/comm/mpi/mpi_communicator.h + include/comm/mpi/mpi_cart_topology.h + include/comm/mpi/mpi_topology.h + include/comm/mpi/mpi_comm_handle.h + include/comm/send_recv_point.h + include/comm/sender.h + + include/luna/luna.h + include/luna/env/luna_environment_config.h + include/luna/env/luna_runner.h + include/luna/env/arg_parser.h + include/luna/env/luna_program.h + include/luna/env/io/formats/input_value.h + include/luna/env/io/formats/input_block_ptr.h + include/luna/env/io/formats/output_vector.h + include/luna/env/io/formats/output_block_ptr.h + include/luna/env/io/formats/input_vector.h + include/luna/env/io/formats/input_block.h + include/luna/env/io/formats/output_value.h + include/luna/env/io/input_formats.h + include/luna/env/io/output_formats.h + include/luna/env/io/input_data_format.h + include/luna/env/io/luna_output.h + include/luna/env/io/output_data_format.h + include/luna/env/io/luna_input.h + include/luna/env/luna_environment.h + include/luna/env/luna_program_config.h + + include/cf/comp_fragment_remote_ptr.h + include/cf/submitter.h + include/cf/cfs/call_cf.h + include/cf/cfs/while_cf.h + include/cf/cfs/call_extern_cf.h + include/cf/cfs/block_cf.h + include/cf/cfs/call_sub_cf.h + include/cf/cfs/for_cf.h + include/cf/cfs/call_cf_with_args.h + include/cf/cfs/if_cf.h + include/cf/cf_context.h + include/cf/cfs.h + include/cf/comp_fragment.h + include/cf/cf_id.h + include/cf/cf_factory.h + include/cf/submit_stage.h + include/cf/cf_factory_impl.h + include/cf/gc_node.h + include/cf/comp_fragment_ptr.h + + include/dfm/df_storage.h + include/dfm/callbacks.h + include/dfm/distributed_df_manager.h + include/dfm/df_manager.h + include/dfm/events.h + include/dfm/track/df_location_transmitter.h + include/dfm/track/df_location_tracker.h + include/dfm/track/df_location_listener.h + include/dfm/track/track_df_manager.h + include/dfm/track/df_location_storage.h + include/dfm/track/df_location_request_manager.h + include/dfm/df_request_manager.h + include/dfm/rope/rope_segment.h + include/dfm/rope/pathfinders/cartesian_path_finder.h + include/dfm/rope/pathfinders/hilbert_path_finder.h + include/dfm/rope/index_type.h + include/dfm/rope/index_range.h + include/dfm/rope/rope_load_balancer.h + include/dfm/rope/rope_update_event.h + include/dfm/rope/rope_path_finder.h + include/dfm/rope/rope_df_manager.h + include/dfm/rope/dlb/load_history.h + include/dfm/rope/dlb/load_segment.h + include/dfm/rope/dlb/load_bin.h + include/dfm/events/df_events.h + include/dfm/events/finished_df_request_event.h + include/dfm/events/df_storage_events.h + include/dfm/events/ready_df_location_request_event.h + include/dfm/patch/coord.h + include/dfm/patch/patch_update_event.h + include/dfm/patch/changeable_patch.h + include/dfm/patch/patch_distributor.h + include/dfm/patch/region.h + include/dfm/patch/patch_df_manager.h + include/dfm/patch/util.h + include/dfm/patch/types.h + include/dfm/patch/patch_load_balancer.h + include/dfm/patch/node/adjacency_update.h + include/dfm/patch/node/patch_proxy_node.h + include/dfm/patch/node/patch_node.h + include/dfm/patch/node/patch_real_node.h + include/dfm/patch/node/patch_node_impl.h + include/dfm/patch/grid/load_grid_ptr.h + include/dfm/patch/grid/load_cell.h + include/dfm/patch/grid/load_cell_ptr.h + include/dfm/patch/grid/load_grid.h + include/dfm/patch/grid/load_cell_group.h + include/dfm/patch/grid/cell_log_events.h + include/dfm/patch/grid/cell_selector.h + include/dfm/patch/trans/patch_transaction_manager.h + include/dfm/patch/trans/patch_send_transaction.h + include/dfm/patch/direction.h + include/dfm/patch/patch_local_load_balancer.h + include/dfm/pathfinder/mappers/index_mapper.h + include/dfm/pathfinder/mappers/mapper.h + include/dfm/pathfinder/pathfinders/single_node_path_finder.h + include/dfm/pathfinder/pathfinders/hash_path_finder.h + include/dfm/pathfinder/pathfinders/rigid_path_finder.h + include/dfm/pathfinder/path_finder_df_manager.h + include/dfm/pathfinder/path_finder.h + include/dfm/df_managers.h + include/dfm/local_df_manager.h + include/dfm/df_transmitter.h + include/dfm/reqs/df_value_request.h + include/dfm/reqs/df_location_request.h + include/dfm/reqs/df_request.h + include/dfm/path_finders.h + include/dfm/dlb/basic_load_balancer.h + include/dfm/dlb/diffuse_load_balancer.h + include/dfm/dlb/load_estimator.h + include/dfm/dlb/size_load_estimator.h + include/dfm/dlb/load_update_event.h + include/dfm/dlb/load_balancer.h + include/dfm/dlb/load_balancer_config.h + include/dfm/dlb/load_integrator.h + include/dfm/dlb/load_balanceable.h + include/dfm/dlb/types.h + include/dfm/dlb/load_comparator.h + include/dfm/dlb/local_load_balancer.h + include/dfm/dlb/node/real_node.h + include/dfm/dlb/node/node_distributor.h + include/dfm/dlb/node/proxy_node.h + include/dfm/dlb/node/node.h + include/dfm/dlb/node/node_local_load_balancer.h + include/dfm/dlb/node/node_impl.h + include/dfm/dlb/node/node_environment.h + include/dfm/dlb/trans/transaction_manager_new.h + include/dfm/dlb/trans/transaction_id.h + include/dfm/dlb/trans/send_transaction.h + include/dfm/dlb/trans/transaction_manager.h + include/dfm/dlb/trans/recv_transaction.h + include/dfm/dlb/trans/transaction.h + include/dfm/dlb/basic_local_load_balancer.h + + include/ucenv/user_code_df.h + include/ucenv/cuda_input_df.h + include/ucenv/input_df.h + include/ucenv/ucenv.h + include/ucenv/output_df.h + include/ucenv/cuda_output_df.h + + include/prof/message_stat_collector.h + include/prof/counters/min_counter.h + include/prof/counters/time_counter.h + include/prof/counters/sum_counter.h + include/prof/counters/counter.h + include/prof/counters/max_counter.h + include/prof/counters/avg_counter.h + include/prof/stat_collector.h + include/prof/mpe/mpe_event.h + include/prof/profiler.h + include/prof/timer.h + include/prof/comm_sends.h + include/prof/evlog/evlog.h + include/prof/evlog/log_event.h + include/prof/evlog/df_log_events.h + include/prof/evlog/comm_log_events.h + include/prof/evlog/cf_log_events.h + include/prof/evlog/event_logger.h + include/prof/evlog/file_log_writer.h + include/prof/evlog/log_writer.h + include/prof/evlog/json_builder.h + include/prof/evlog/log_writer_stub.h + + include/fa/fa_base.h + include/fa/subs/sub.h + include/fa/subs/struct_sub.h + include/fa/subs/extern_sub.h + include/fa/fa.h + include/fa/fa_new.h + include/fa/expr/ternary_op_expr.h + include/fa/expr/value_provider.h + include/fa/expr/id_expr.h + include/fa/expr/value.h + include/fa/expr/value_type_util.h + include/fa/expr/const_expr.h + include/fa/expr/expr_ptr.h + include/fa/expr/cast_expr.h + include/fa/expr/expr.h + include/fa/expr/binary_op_expr.h + include/fa/expr/binary_op.h + include/fa/expr/eval/real_evaluator.h + include/fa/expr/eval/int_evaluator.h + include/fa/expr/eval/evaluators.h + include/fa/expr/eval/string_evaluator.h + include/fa/expr/eval/bool_evaluator.h + include/fa/fa_new_impl.h + include/fa/subs.h + include/fa/items/block_item.h + include/fa/items/exec_item.h + include/fa/items/rule_item.h + include/fa/items/for_item.h + include/fa/items/while_item.h + include/fa/items/if_item.h + include/fa/items/item_with_body.h + include/fa/items/item.h + include/fa/json/json_expr_reader.h + include/fa/json/jsonable.h + include/fa/items.h + include/fa/expressions.h + + include/df/unique_id.h + include/df/df_helpers.h + include/df/df_factory.h + include/df/df_not_found_error.h + include/df/dfs/block_ptr_df.h + include/df/dfs/block_df.h + include/df/dfs/value_df.h + include/df/dfs.h + include/df/data_object.h + include/df/df_id.h + include/df/data_fragment_ptr.h + include/df/data_fragment.h + + include/rts/mpiconfig.h + include/rts/log/log.h + include/rts/log/logger.h + include/rts/buffer_ptr.h + include/rts/id/id.h + include/rts/id/indexed_id.h + include/rts/event/event.h + include/rts/event/event_manager.h + include/rts/event/threaded_event_manager.h + include/rts/event/event_handler.h + include/rts/event/simple_event_manager.h + include/rts/shared_from_this.h + include/rts/json/json_node.h + include/rts/json/json_tree.h + include/rts/growing_buffer_ptr.h + include/rts/thread/async_thread_pool.h + include/rts/thread/threaded_service.h + include/rts/thread/thread_pool.h + include/rts/thread/threaded_worker.h + include/rts/growing_buffer.h + include/rts/buffer.h + include/rts/serialize/serializing_writer_ops.h + include/rts/serialize/serializing_reader.h + include/rts/serialize/readable.h + include/rts/serialize/serializing_ops.h + include/rts/serialize/serializing_writer.h + include/rts/serialize/serializable.h + include/rts/serialize/serializing_reader_ops.h + include/rts/serialize/serialize.h + include/rts/serialize/readable_buffer.h + include/rts/serialize/writable.h + include/rts/service.h + include/rts/growing_buffer_pool.h + include/rts/util/slicer.h + include/rts/util/cuda_util.h + include/rts/util/time.h + include/rts/util/hilbert.h + include/rts/util/string_helper.h + include/rts/singleton.h + + include/cfm/resource.h + include/cfm/distributors/path_finder_cf_distributor.h + include/cfm/distributors/trivial_cf_distributor.h + include/cfm/events.h + include/cfm/cf_pool.h + include/cfm/cf_distributor.h + include/cfm/cf_pipeline.h + include/cfm/cf_entrance.h + include/cfm/events/finished_cf_event.h + include/cfm/smsched.h + include/cfm/cf_finisher.h + include/cfm/cf_transmitter.h + include/cfm/cf_queue.h + + include/cdf/code_library.h + include/cdf/code_fragment.h + include/cdf/code_library_impl.h + include/cdf/code_library_storage.h + include/cdf/external_code_fragment.h + + include/exceptions/exceptions.h + include/exceptions/exception.h + + include/misc/semaphore.h +) + +set(lib_src + src/comm/receiving_point.cpp + src/comm/receiver_id.cpp + src/comm/receiver_id_maker.cpp + src/comm/threaded/comm_service_sender.cpp + src/comm/threaded/comm_service_receiver.cpp + src/comm/threaded/comm_service_pack_sender.cpp + src/comm/threaded/comm_service_wait_sender.cpp + src/comm/threaded/threaded_comm_service.cpp + src/comm/message/message_list.cpp + src/comm/message/message.cpp + src/comm/message/message_processor.cpp + src/comm/message/message_sender.cpp + src/comm/message/message_storage.cpp + src/comm/send_recv_point.cpp + src/comm/comm_service_base.cpp + src/comm/tp/cart_topology.cpp + src/comm/mpi/mpi_communicator.cpp + src/comm/mpi/mpi_comm_handle.cpp + src/comm/mpi/mpi_cart_topology.cpp + + src/luna/env/luna_environment_config.cpp + src/luna/env/luna_environment.cpp + src/luna/env/io/formats/input_block_ptr.cpp + src/luna/env/io/formats/input_block.cpp + src/luna/env/io/formats/input_vector.cpp + src/luna/env/io/formats/output_block_ptr.cpp + src/luna/env/io/formats/output_vector.cpp + src/luna/env/io/luna_output.cpp + src/luna/env/io/luna_input.cpp + src/luna/env/luna_program_config.cpp + src/luna/env/luna_runner.cpp + src/luna/env/arg_parser.cpp + src/luna/env/luna_program.cpp + src/luna/luna.cpp + + src/cf/cf_id.cpp + src/cf/comp_fragment_remote_ptr.cpp + src/cf/cfs/call_cf_with_args.cpp + src/cf/cfs/for_cf.cpp + src/cf/cfs/call_extern_cf.cpp + src/cf/cfs/if_cf.cpp + src/cf/cfs/while_cf.cpp + src/cf/cfs/call_sub_cf.cpp + src/cf/cfs/call_cf.cpp + src/cf/cfs/block_cf.cpp + src/cf/submitter.cpp + src/cf/cf_factory_impl.cpp + src/cf/cf_context.cpp + src/cf/submit_stage.cpp + src/cf/comp_fragment.cpp + src/cf/gc_node.cpp + src/cf/cf_factory.cpp + + src/dfm/df_storage.cpp + src/dfm/mappers/index_mapper.cpp + src/dfm/df_transmitter.cpp + src/dfm/track/df_location_transmitter.cpp + src/dfm/track/df_location_request_manager.cpp + src/dfm/track/track_df_manager.cpp + src/dfm/track/df_location_tracker.cpp + src/dfm/track/df_location_storage.cpp + src/dfm/rope/pathfinders/cartesian_path_finder.cpp + src/dfm/rope/pathfinders/hilbert_path_finder.cpp + src/dfm/rope/rope_path_finder.cpp + src/dfm/rope/rope_segment.cpp + src/dfm/rope/rope_load_balancer.cpp + src/dfm/rope/rope_df_manager.cpp + src/dfm/rope/dlb/load_segment.cpp + src/dfm/rope/dlb/load_history.cpp + src/dfm/rope/dlb/load_bin.cpp + src/dfm/events/df_events.cpp + src/dfm/patch/region.cpp + src/dfm/patch/patch_distributor.cpp + src/dfm/patch/util.cpp + src/dfm/patch/patch_load_balancer.cpp + src/dfm/patch/patch_df_manager.cpp + src/dfm/patch/coord.cpp + src/dfm/patch/node/patch_real_node.cpp + src/dfm/patch/node/patch_proxy_node.cpp + src/dfm/patch/node/patch_node_impl.cpp + src/dfm/patch/node/adjacency_update.cpp + src/dfm/patch/grid/load_cell.cpp + src/dfm/patch/grid/load_cell_group.cpp + src/dfm/patch/grid/load_grid.cpp + src/dfm/patch/grid/cell_selector.cpp + src/dfm/patch/grid/cell_log_events.cpp + src/dfm/patch/trans/patch_transaction_manager.cpp + src/dfm/patch/trans/patch_send_transaction.cpp + src/dfm/patch/direction.cpp + src/dfm/patch/patch_local_load_balancer.cpp + src/dfm/pathfinder/pathfinders/single_node_path_finder.cpp + src/dfm/pathfinder/pathfinders/rigid_path_finder.cpp + src/dfm/pathfinder/pathfinders/hash_path_finder.cpp + src/dfm/pathfinder/path_finder_df_manager.cpp + src/dfm/distributed_df_manager.cpp + src/dfm/reqs/df_value_request.cpp + src/dfm/reqs/df_location_request.cpp + src/dfm/local_df_manager.cpp + src/dfm/df_request_manager.cpp + src/dfm/df_manager.cpp + src/dfm/dlb/size_load_estimator.cpp + src/dfm/dlb/load_comparator.cpp + src/dfm/dlb/load_balancer_config.cpp + src/dfm/dlb/load_integrator.cpp + src/dfm/dlb/basic_local_load_balancer.cpp + src/dfm/dlb/diffuse_load_balancer.cpp + src/dfm/dlb/node/node_distributor.cpp + src/dfm/dlb/node/proxy_node.cpp + src/dfm/dlb/node/node_local_load_balancer.cpp + src/dfm/dlb/node/real_node.cpp + src/dfm/dlb/node/node_impl.cpp + src/dfm/dlb/trans/transaction.cpp + src/dfm/dlb/trans/send_transaction.cpp + src/dfm/dlb/trans/transaction_id.cpp + src/dfm/dlb/trans/transaction_manager.cpp + src/dfm/dlb/trans/transaction_manager_new.cpp + src/dfm/dlb/trans/recv_transaction.cpp + src/dfm/dlb/basic_load_balancer.cpp + src/dfm/dlb/load_update_event.cpp + + src/ucenv/output_df.cpp + src/ucenv/user_code_df.cpp + src/ucenv/cuda_output_df.cpp + src/ucenv/cuda_input_df.cpp + + src/prof/stat_collector.cpp + src/prof/counters/time_counter.cpp + src/prof/message_stat_collector.cpp + src/prof/mpe/mpe_event.cpp + src/prof/timer.cpp + src/prof/evlog/evlog.cpp + src/prof/evlog/event_logger.cpp + src/prof/evlog/comm_log_events.cpp + src/prof/evlog/cf_log_events.cpp + src/prof/evlog/df_log_events.cpp + src/prof/evlog/json_builder.cpp + src/prof/evlog/file_log_writer.cpp + src/prof/comm_sends.cpp + src/prof/profiler.cpp + + src/fa/subs/sub.cpp + src/fa/subs/extern_sub.cpp + src/fa/subs/struct_sub.cpp + src/fa/fa_base.cpp + src/fa/expr/binary_op.cpp + src/fa/expr/value.cpp + src/fa/expr/ternary_op_expr.cpp + src/fa/expr/binary_op_expr.cpp + src/fa/expr/id_expr.cpp + src/fa/expr/eval/string_evaluator.cpp + src/fa/expr/eval/bool_evaluator.cpp + src/fa/expr/eval/int_evaluator.cpp + src/fa/expr/eval/real_evaluator.cpp + src/fa/items/item.cpp + src/fa/items/exec_item.cpp + src/fa/items/while_item.cpp + src/fa/items/if_item.cpp + src/fa/items/item_with_body.cpp + src/fa/items/rule_item.cpp + src/fa/items/for_item.cpp + src/fa/items/block_item.cpp + src/fa/json/json_expr_reader.cpp + src/fa/fa_new_impl.cpp + + src/df/data_object.cpp + src/df/df_factory.cpp + src/df/df_not_found_error.cpp + src/df/data_fragment.cpp + src/df/dfs/block_df.cpp + src/df/dfs/block_ptr_df.cpp + src/df/dfs/value_df.cpp + src/df/df_id.cpp + src/df/unique_id.cpp + + src/rts/log/log.cpp + src/rts/log/logger.cpp + src/rts/growing_buffer_pool.cpp + src/rts/event/event_handler.cpp + src/rts/event/threaded_event_manager.cpp + src/rts/event/simple_event_manager.cpp + src/rts/event/event.cpp + src/rts/json/json_tree.cpp + src/rts/json/json_node.cpp + src/rts/thread/threaded_service.cpp + src/rts/thread/threaded_worker.cpp + src/rts/thread/thread_pool.cpp + src/rts/thread/async_thread_pool.cpp + src/rts/buffer.cpp + src/rts/serialize/serializing_reader.cpp + src/rts/serialize/serializing_reader_ops.cpp + src/rts/serialize/readable_buffer.cpp + src/rts/serialize/serializing_writer.cpp + src/rts/serialize/serializing_writer_ops.cpp + src/rts/growing_buffer.cpp + src/rts/util/string_helper.cpp + src/rts/util/hilbert.cpp + src/rts/util/time.cpp + src/rts/util/slicer.cpp + + src/cfm/resource.cpp + src/cfm/distributors/trivial_cf_distributor.cpp + src/cfm/distributors/path_finder_cf_distributor.cpp + src/cfm/cf_finisher.cpp + src/cfm/cf_pipeline.cpp + src/cfm/cf_pool.cpp + src/cfm/cf_entrance.cpp + src/cfm/cf_transmitter.cpp + src/cfm/smsched.cpp + src/cfm/cf_queue.cpp + + src/cdf/external_code_fragment.cpp + src/cdf/code_library_storage.cpp + src/cdf/code_library_impl.cpp + + src/exceptions/exceptions.cpp + src/exceptions/exception.cpp + ) + +add_library(${PROJECT_NAME}_LIB ${lib_headers} ${lib_src}) + +find_package(MPI REQUIRED) +target_include_directories(${PROJECT_NAME}_LIB PUBLIC include ${MPI_INCLUDE_PATH}) +target_link_libraries(${PROJECT_NAME}_LIB PRIVATE ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES}) +target_compile_options(${PROJECT_NAME}_LIB PRIVATE -fPIC) + +set(rts_headers + include/main/luna_async_test.h + include/main/luna_runner_test.h + include/main/luna_test.h + include/main/mpi_timer.h + include/main/luna_sync_test.h + include/main/luna_comm_test.h + ) + +set(rts_src + src/main/luna_async_test.cpp + src/main/luna_runner_test.cpp + src/main/luna_test.cpp + src/main/main.cpp + src/main/mpi_timer.cpp + src/main/luna_sync_test.cpp + src/main/luna_comm_test.cpp + ) + +find_package (Threads) +find_package(Boost REQUIRED COMPONENTS system thread program_options) +add_executable(${PROJECT_NAME}_RTS ${rts_headers} ${rts_src}) +target_link_libraries(${PROJECT_NAME}_RTS PRIVATE + ${MPI_C_LIBRARIES} + ${MPI_CXX_LIBRARIES} + ${PROJECT_NAME}_LIB + Boost::system + Boost::thread + Boost::program_options + -ldyncall_s + -ldl + -lpthread) +target_include_directories(${PROJECT_NAME}_RTS PRIVATE ${MPI_INCLUDE_PATH}) +set_target_properties(${PROJECT_NAME}_RTS PROPERTIES OUTPUT_NAME luna) + +if (${PROJECT_NAME}_ENABLE_TESTS) + set(utests_src + utests/dfm/df_storage_tests.cpp + utests/fa/eval/string_eval_tests.cpp + utests/fa/eval/int_eval_tests.cpp + utests/fa/eval/bool_eval_tests.cpp + utests/df/value_df_tests.cpp + utests/df/df_id_tests.cpp + utests/rts/serialize_tests.cpp + utests/rts/growing_buffer_tests.cpp + utests/rts/json_tests.cpp + utests/rts/buffer_tests.cpp + ) + + find_package(GTest REQUIRED) + find_package(Boost REQUIRED COMPONENTS system) + + add_executable(${PROJECT_NAME}_UTESTS ${utests_src}) + target_link_libraries(${PROJECT_NAME}_UTESTS PRIVATE GTest::GTest GTest::Main Boost::system ${PROJECT_NAME}_LIB) + add_test(NAME ${PROJECT_NAME}_UTESTS COMMAND ${PROJECT_NAME}_UTESTS) +endif() + +find_package(BISON REQUIRED) +find_package(FLEX REQUIRED) + +flex_target(fscanner util/compiler/lexics.l ${CMAKE_CURRENT_BINARY_DIR}/util/compiler/lex.yy.cpp) +bison_target(bparser util/compiler/grammar.ypp ${CMAKE_CURRENT_BINARY_DIR}/util/compiler/grammar.tab.cpp) +add_flex_bison_dependency(fscanner bparser) +add_executable(parser util/compiler/parser.cpp ${FLEX_fscanner_OUTPUTS} ${BISON_bparser_OUTPUTS}) +target_compile_options(parser PRIVATE -Wno-error=unused-function) +set_target_properties(parser + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/util/compiler + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/util/compiler + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/util/compiler) + +set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}) +install(TARGETS ${PROJECT_NAME}_LIB ${PROJECT_NAME}_RTS + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +file(COPY util/compiler/lunac DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +if (${PROJECT_NAME}_ENABLE_EXAMPLES) + function(add_example name) + + set(tests_src tests/${name}/ucodes.cpp) + add_library(${PROJECT_NAME}_${name}_LIB SHARED ${tests_src}) + target_link_libraries(${PROJECT_NAME}_${name}_LIB PRIVATE ${PROJECT_NAME}_LIB) + set_target_properties(${PROJECT_NAME}_${name}_LIB + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/${name} + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/${name} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/${name}) + + add_custom_target(${PROJECT_NAME}_${name}_GEN) + add_dependencies(${PROJECT_NAME}_${name}_GEN parser) + add_dependencies(${PROJECT_NAME}_${name}_LIB ${PROJECT_NAME}_${name}_GEN) + add_custom_command(TARGET ${PROJECT_NAME}_${name}_GEN + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND LUNA_HOME=${CMAKE_CURRENT_SOURCE_DIR} util/compiler/lunac tests/${name}/${name}.fa tests/${name}/${name}.ja) + endfunction() + + add_example(basic1) + add_example(basic2) + add_example(basic3) + # todo others + +endif() diff --git a/README.md b/README.md index be5eda60..d784f18a 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,21 @@ or After successfull build, `rts` executable will be placed in build directory. LuNA compiler will also be build in `util/compiler`. +1.4. Build Luna from source with CMake +------------------------------------- + +Join Luna root directory. Call for cmake project generation. For an example with **Ninja** generator. + + mkdir build-cmake + cd build-cmake + cmake .. -G Ninja + ninja -j8 + ninja install + +After successfull build, executables (**luna**, **lunad**, **lunac**) will be placed in bin directory. +All libraries will be placed under **lib** directory. +LuNA compiler will also be build in `util/compiler`. + 2. RUNNING TESTS ---------------- -- GitLab