40#include <pybind11/embed.h>
50int main(
int argc,
char *argv[]) {
55 "--smi", {},
"print information about available SYCL devices in the cluster");
57 "--smi-full", {},
"print information about EVERY available SYCL devices in the cluster");
61 opts::register_opt(
"--sycl-cfg",
"(idcomp:idalt) ",
"specify the compute & alt queue index");
70 opts::register_opt(
"--pypath-from-bin",
"(python binary)",
"set sys.path from python binary");
81 "SHAM_PROF_USE_COMPLETE_EVENT",
82 "Use complete event instead of begin end for chrome tracing");
84 "SHAM_PROF_EVENT_RECORD_THRES",
"Change the event recording threshold");
104 i32 a = atoi(level.c_str());
107 logger::err_ln(
"Cmd OPT",
"you must select a loglevel in a 8bit integer range");
109 "you must select a loglevel in a 8bit integer range");
118 using namespace shamsys::instance;
122 "Init",
"No kernel can be run without a sycl configuration (--sycl-cfg x:x)");
133 shamsys::instance::print_mpi_comm_info();
136 " - MPI & SYCL init :",
139 shamsys::instance::print_mpi_capabilities();
144 shamsys::instance::check_dgpu_available();
145 auto sptr = shamsys::instance::get_compute_scheduler_ptr();
146 shamcomm::validate_comm(sptr);
157 if (is_smi || is_smi_full) {
173 "--benchmark-mpi can't be run without a sycl configuration (--sycl-cfg x:x)");
190 shamsys::register_signals();
198 "cannot run ipython mode with > 1 processes");
221 "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()
close the NodeInstance Aka : Finalize both MPI & SYCL
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.
ExcptTypes make_except_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Create an exception with a message and a location.
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.
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
i32 world_size()
Gives the size of the MPI communicator.
bool are_experimental_features_allowed()
Allow the use of experimental features.
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 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.
This file contains the definition for the stacktrace related functionality.
#define __shamrock_stack_entry()
Macro to create a stack entry.
void setpypath_from_binary(std::string binary_path)
set the value of sys.path before init from the supplied binary
void start_ipython(bool do_print, int argc, char *argv[])
Start shamrock embded ipython interpreter.
void setpypath(std::string path)
set the value of sys.path before init
void run_py_file(std::string file_path, bool do_print, int argc, char *argv[])
run python runscript
Struct containing MPI Init informations Usage.
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.