23namespace adcHelloWorldMPI {
28int main(
int argc,
char ** argv) {
32 MPI_Init(&argc, &argv);
33 MPI_Comm comm = MPI_COMM_WORLD;
39 std::shared_ptr< adc::builder_api > b = f.
get_builder();
40 b->add_header_section(
"cxx_demo_1");
44 app_data->add(
"hello",
"world");
45 b->add_app_data_section(app_data);
49 b->add_slurm_section();
58 (void)MPI_Comm_rank(comm, &rank);
65 std::string rank_str = std::to_string(rank);
66 setenv(
"ADC_MULTIFILE_PLUGIN_RANK", rank_str.c_str(), 1);
72 int err = mp->publish(b);
74 std::cout <<
"got " << err <<
" publication errors." << std::endl;
80 b->add_exit_data_section(0,
"all good",
nullptr);
81 b->add_header_section(
"cxx_demo_1");
84 std::cout <<
"got " << err <<
" publication errors." << std::endl;
98 auto path = std::getenv(
"ADC_MULTIFILE_PLUGIN_DIRECTORY");
99 auto wfid = std::getenv(
"ADC_WFID");
102 std::vector< std::string > old_paths;
104 if (old_paths.size()) {
105 for (
auto i : old_paths) {
106 std::cout <<
"consolidating from:" << i << std::endl;
108 std::remove(i.c_str());
111 for (
auto i : new_files) {
112 std::cout <<
"consolidated to:" << i << std::endl;
115 std::cout <<
"no consolidation done." << std::endl;
int main(int argc, char **argv)
provides publishers and builders of application metadata.
std::shared_ptr< multi_publisher_api > get_multi_publisher_from_env(const std::string &env_name)
std::shared_ptr< builder_api > get_builder()
version enum_version("1.0.0", {"none"})
the version number of enum scalar_type and object_type
ADC_VISIBLE std::string get_multifile_log_path(string_view dir, string_view wfid)
version publisher_api_version("1.0.0", {"none"})
version builder_api_version("1.0.0", {"none"})
ADC_VISIBLE std::vector< std::string > consolidate_multifile_logs(const std::string &match, std::vector< std::string > &old_paths, bool debug=false)
#define ADC_HS_ALL
all ADC_HS_* optional data included
#define ADC_MPI_LOCAL
include all mpi options that do not require collective work.
int main(int argc, char **argv)
adc c++ hello world without hard-coded publisher choices.