Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
NodeInstance.cpp File Reference
#include "shambase/SourceLocation.hpp"
#include "shambase/exception.hpp"
#include "shambase/memory.hpp"
#include "shambase/stacktrace.hpp"
#include "shambase/string.hpp"
#include "shamalgs/collective/gather_str.hpp"
#include "shamalgs/collective/reduction.hpp"
#include "shambackends/Device.hpp"
#include "shambackends/DeviceScheduler.hpp"
#include "shambackends/SyclMpiTypes.hpp"
#include "shambackends/comm/CommunicationBuffer.hpp"
#include "shambackends/math.hpp"
#include "shambackends/sycl_utils.hpp"
#include "shambackends/typeAliasVec.hpp"
#include "shamcmdopt/cmdopt.hpp"
#include "shamcmdopt/env.hpp"
#include "shamcmdopt/tty.hpp"
#include "shamcomm/local_rank.hpp"
#include "shamcomm/logs.hpp"
#include "shamcomm/mpi.hpp"
#include "shamcomm/mpiInfo.hpp"
#include "shamcomm/worldInfo.hpp"
#include "shamsys/MpiDataTypeHandler.hpp"
#include "shamsys/MpiWrapper.hpp"
#include "shamsys/NodeInstance.hpp"
#include "shamsys/change_log_format.hpp"
#include "shamsys/device_select.hpp"
#include "shamsys/for_each_device.hpp"
#include "shamsys/legacy/log.hpp"
#include "shamsys/legacy/sycl_mpi_interop.hpp"
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
+ Include dependency graph for NodeInstance.cpp:

Go to the source code of this file.

Namespaces

namespace  shamsys
 namespace for the system handling
 

Functions

void shamsys::instance::details::print_device_list ()
 
std::string syclinit::callback_mem_perf_info ()
 
void syclinit::init_device_scheduling ()
 
void syclinit::init_queues (std::string search_key)
 
void syclinit::finalize ()
 
u32 shamsys::instance::get_compute_queue_eu_count (u32 id=0)
 
bool shamsys::instance::is_initialized ()
 to check whether the NodeInstance is initialized
 
void shamsys::instance::print_queue_map ()
 Print SYCL queue map.
 
void shamsys::instance::tmp::print_device_list_debug ()
 
void shamsys::instance::start_sycl_auto (std::string search_key)
 
void shamsys::instance::start_mpi (MPIInitInfo mpi_info)
 Start MPI.
 
void shamsys::instance::init_sycl_mpi (std::string search_key, MPIInitInfo mpi_info)
 Start SYCL & MPI.
 
void shamsys::instance::init (int argc, char *argv[])
 initialize the NodeInstance from command line args in the main
 
void shamsys::instance::close_mpi ()
 Finalize MPI.
 
void shamsys::instance::close ()
 close the NodeInstance Aka : Finalize both MPI & SYCL
 
sycl::queue & shamsys::instance::get_compute_queue (u32 id=0)
 
sycl::queue & shamsys::instance::get_alt_queue (u32 id=0)
 Get the alternative queue.
 
sham::DeviceSchedulershamsys::instance::get_compute_scheduler ()
 
sham::DeviceSchedulershamsys::instance::get_alt_scheduler ()
 
std::shared_ptr< sham::DeviceSchedulershamsys::instance::get_compute_scheduler_ptr ()
 
std::shared_ptr< sham::DeviceSchedulershamsys::instance::get_alt_scheduler_ptr ()
 
void shamsys::instance::print_device_info (const sycl::device &Device)
 
void shamsys::instance::print_device_list ()
 
void shamsys::instance::print_mpi_capabilities ()
 
void shamsys::instance::print_mpi_comm_info ()
 
void shamsys::instance::check_dgpu_available ()
 

Variables

bool syclinit::initialized = false
 
std::shared_ptr< sham::Devicesyclinit::device_compute
 
std::shared_ptr< sham::Devicesyclinit::device_alt
 
std::shared_ptr< sham::DeviceContextsyclinit::ctx_compute
 
std::shared_ptr< sham::DeviceContextsyclinit::ctx_alt
 
std::shared_ptr< sham::DeviceSchedulersyclinit::sched_compute
 
std::shared_ptr< sham::DeviceSchedulersyclinit::sched_alt
 
u32 shamsys::instance::compute_queue_eu_count = 64
 
auto shamsys::instance::init_strategy
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file NodeInstance.cpp.

Function Documentation

◆ callback_mem_perf_info()

std::string syclinit::callback_mem_perf_info ( )

Definition at line 109 of file NodeInstance.cpp.

◆ check_dgpu_available()

void shamsys::instance::check_dgpu_available ( )

Definition at line 401 of file NodeInstance.cpp.

◆ close()

void shamsys::instance::close ( )

close the NodeInstance Aka : Finalize both MPI & SYCL

Definition at line 359 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ close_mpi()

void shamsys::instance::close_mpi ( )

Finalize MPI.

Definition at line 345 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ finalize()

void syclinit::finalize ( void  )

Definition at line 147 of file NodeInstance.cpp.

◆ get_alt_queue()

sycl::queue & shamsys::instance::get_alt_queue ( u32  id = 0)

Get the alternative queue.

Parameters
id
Returns
sycl::queue& reference to the corresponding queue

Definition at line 372 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ get_alt_scheduler()

sham::DeviceScheduler & shamsys::instance::get_alt_scheduler ( )

Definition at line 376 of file NodeInstance.cpp.

◆ get_alt_scheduler_ptr()

std::shared_ptr< sham::DeviceScheduler > shamsys::instance::get_alt_scheduler_ptr ( )

Definition at line 382 of file NodeInstance.cpp.

◆ get_compute_queue()

sycl::queue & shamsys::instance::get_compute_queue ( u32  id = 0)
Parameters
id
Returns
sycl::queue& reference to the corresponding queue

Definition at line 370 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ get_compute_queue_eu_count()

u32 shamsys::instance::get_compute_queue_eu_count ( u32  id = 0)

Definition at line 165 of file NodeInstance.cpp.

◆ get_compute_scheduler()

sham::DeviceScheduler & shamsys::instance::get_compute_scheduler ( )

Definition at line 374 of file NodeInstance.cpp.

◆ get_compute_scheduler_ptr()

std::shared_ptr< sham::DeviceScheduler > shamsys::instance::get_compute_scheduler_ptr ( )

Definition at line 378 of file NodeInstance.cpp.

◆ init()

void shamsys::instance::init ( int  argc,
char *  argv[] 
)

initialize the NodeInstance from command line args in the main

int main(int argc, char *argv[]){
shamsys::instance::init(argc,argv);
... do stuff ...
shamsys::instance::close();
}

Definition at line 316 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ init_device_scheduling()

void syclinit::init_device_scheduling ( )

Definition at line 116 of file NodeInstance.cpp.

◆ init_queues()

void syclinit::init_queues ( std::string  search_key)

Definition at line 135 of file NodeInstance.cpp.

◆ init_sycl_mpi()

void shamsys::instance::init_sycl_mpi ( std::string  search_key,
MPIInitInfo  mpi_info 
)

Start SYCL & MPI.

Definition at line 300 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ is_initialized()

bool shamsys::instance::is_initialized ( )

to check whether the NodeInstance is initialized

Returns
true NodeInstance is initialized
false NodeInstance is not initialized

Definition at line 167 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ print_device_info()

void shamsys::instance::print_device_info ( const sycl::device &  Device)

Definition at line 384 of file NodeInstance.cpp.

◆ print_device_list() [1/2]

void shamsys::instance::details::print_device_list ( )

Definition at line 53 of file NodeInstance.cpp.

◆ print_device_list() [2/2]

void shamsys::instance::print_device_list ( )

Definition at line 391 of file NodeInstance.cpp.

◆ print_device_list_debug()

void shamsys::instance::tmp::print_device_list_debug ( )

Definition at line 207 of file NodeInstance.cpp.

◆ print_mpi_capabilities()

void shamsys::instance::print_mpi_capabilities ( )

Definition at line 397 of file NodeInstance.cpp.

◆ print_mpi_comm_info()

void shamsys::instance::print_mpi_comm_info ( )

Definition at line 399 of file NodeInstance.cpp.

◆ print_queue_map()

void shamsys::instance::print_queue_map ( )

Print SYCL queue map.

Definition at line 169 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ start_mpi()

void shamsys::instance::start_mpi ( MPIInitInfo  mpi_info)

Start MPI.

Definition at line 245 of file NodeInstance.cpp.

+ Here is the call graph for this function:

◆ start_sycl_auto()

void shamsys::instance::start_sycl_auto ( std::string  search_key)

Definition at line 229 of file NodeInstance.cpp.

Variable Documentation

◆ compute_queue_eu_count

u32 shamsys::instance::compute_queue_eu_count = 64

Definition at line 163 of file NodeInstance.cpp.

◆ ctx_alt

std::shared_ptr<sham::DeviceContext> syclinit::ctx_alt

Definition at line 104 of file NodeInstance.cpp.

◆ ctx_compute

std::shared_ptr<sham::DeviceContext> syclinit::ctx_compute

Definition at line 103 of file NodeInstance.cpp.

◆ device_alt

std::shared_ptr<sham::Device> syclinit::device_alt

Definition at line 101 of file NodeInstance.cpp.

◆ device_compute

std::shared_ptr<sham::Device> syclinit::device_compute

Definition at line 100 of file NodeInstance.cpp.

◆ init_strategy

auto shamsys::instance::init_strategy
Initial value:
"SHAM_MPI_INIT_STRATEGY",
"syclfirst",
"Select the MPI init strategy (mpifirst, syclfirst) [default: syclfirst]")
std::string getenv_str_default_register(const char *env_var, std::string default_val, std::string desc)
Get the content of the environment variable if it exist and register it documentation,...
Definition env.hpp:88

Definition at line 295 of file NodeInstance.cpp.

◆ initialized

bool syclinit::initialized = false

Definition at line 98 of file NodeInstance.cpp.

◆ sched_alt

std::shared_ptr<sham::DeviceScheduler> syclinit::sched_alt

Definition at line 107 of file NodeInstance.cpp.

◆ sched_compute

std::shared_ptr<sham::DeviceScheduler> syclinit::sched_compute

Definition at line 106 of file NodeInstance.cpp.