36#include <pybind11/embed.h>
45int main(
int argc,
char *argv[]) {
47 opts::register_opt(
"--sycl-cfg",
"(idcomp:idalt) ",
"specify the compute & alt queue index");
50 "--smi", {},
"print information about all available SYCL devices in the cluster");
52 "--smi-full", {},
"print information about EVERY available SYCL devices in the cluster");
70 opts::register_opt(
"--pypath-from-bin",
"(python binary)",
"set sys.path from python binary");
85 "SHAM_PROF_USE_COMPLETE_EVENT",
86 "Use complete event instead of begin end for chrome tracing");
88 "SHAM_PROF_EVENT_RECORD_THRES",
"Change the event recording threshold");
113 i32 a = atoi(level.c_str());
116 logger::err_ln(
"Cmd OPT",
"you must select a loglevel in a 8bit integer range");
118 "you must select a loglevel in a 8bit integer range");
127 using namespace shamsys::instance;
131 "Init",
"No kernel can be run without a sycl configuration (--sycl-cfg x:x)");
142 shamsys::instance::print_mpi_comm_info();
145 " - MPI & SYCL init :",
148 shamsys::instance::print_mpi_capabilities();
153 shamsys::instance::check_dgpu_available();
154 auto sptr = shamsys::instance::get_compute_scheduler_ptr();
155 shamcomm::validate_comm(sptr);
166 if (is_smi || is_smi_full) {
182 "--benchmark-mpi can't be run without a sycl configuration (--sycl-cfg x:x)");
198 shamsys::register_signals();
235 "Init",
"No sycl configuration (--sycl-cfg x:x) has been set, early exit");
Shamrock communication buffers.
Header file describing a Node Instance.
void start_mpi(MPIInitInfo mpi_info)
Start MPI.
bool is_initialized()
to check whether the NodeInstance is initialized
void init(int argc, char *argv[])
initialize the NodeInstance from command line args in the main
void close_mpi()
Finalize MPI.
std::int8_t i8
8 bit integer
std::int32_t i32
32 bit integer
This header file contains utility functions related to exception handling in the code.
PYBIND11_EMBEDDED_MODULE(pyshamrock, m)
Call bindings init for the shamrock python module.
void enable_fpe_exceptions()
Enable floating point exceptions.
void set_loglevel(i8 val)
Set the global log level.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
bool is_help_mode()
Check if the help mode is enabled.
bool has_option(const std::string_view &option_name)
Check if an option is present.
std::string_view get_option(const std::string_view &option_name)
Get the value of an option.
char ** get_argv()
Get the command line arguments.
int get_argc()
Get the number of command line arguments.
void init(int argc, char *argv[])
Initialize the command line option parser. We also process generic options in this call (color detect...
void register_env_var_doc(std::string env_var, std::string desc)
Register the documentation of an environment variable.
void print_completion_zsh()
print zsh completion script to be sourced
void register_opt(std::string name, std::optional< std::string > args, std::string description)
Register a command line option.
void print_help()
Print the help message.
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
void run_micro_benchmark()
Run latency & bandwidth benchmark those benchmark where adapted from osu_microbenchmark.
void shamrock_smi(bool list_all_devices)
Print information about all available SYCL devices in the cluster.
void gen_test_list(std::string_view outfile)
output test list to a file
int run_all_tests(int argc, char *argv[], TestConfig cfg)
run all the tests
void init_embed(py::module &m, bool hook_stdout=true)
Init python bindings and register them to Python API.
void print_active_level()
Prints the active log levels.
void code_init_done_log()
Indicates that the code initialization is complete through various means ;).
void raw_ln(Types... var2)
Prints a log message with multiple arguments followed by a newline.
void print_faint_row()
Prints a faint separator line to the log.
void warn_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
void err_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
main include file for testing
void setpypath_from_binary(std::string binary_path)
set the value of sys.path before init from the supplied binary
void setpypath(std::string path)
set the value of sys.path before init
Struct containing MPI Init informations Usage.
Configuration of the test runner.
std::optional< std::string > run_only
Run only regex to select tests.
bool run_long_tests
run also long tests
bool run_benchmark
run benchmarks
bool output_tex
Should output a tex report.
bool run_unittest
run unittests
bool full_output
Should display all logs including all asserts.
std::optional< std::string > json_output
Should output a json report.
bool print_test_list_exit
Should print test list and then exit.
bool run_validation
run validation tests
const std::string reset()
Get the reset terminal escape char.
const std::string col8b_green()
Get the green terminal escape char.
Functions related to the MPI communicator.