Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
wrapper.cpp File Reference
#include "shambase/profiling/profiling.hpp"
#include "shambase/stacktrace.hpp"
#include "shambase/time.hpp"
#include "shamcomm/mpiErrorCheck.hpp"
#include "shamcomm/worldInfo.hpp"
#include "shamcomm/wrapper.hpp"
#include <unordered_map>
#include <array>
+ Include dependency graph for wrapper.cpp:

Go to the source code of this file.

Namespaces

namespace  shamcomm
 namespace for communication related stuff
 

Functions

void shamcomm::mpi::register_time (std::string timername, f64 time)
 Register a timer value.
 
f64 shamcomm::mpi::get_timer (std::string timername)
 get a timer value
 
const std::unordered_map< std::string, f64 > & shamcomm::mpi::get_timers ()
 return all internal timers
 
const std::vector< std::string > & shamcomm::mpi::get_possible_keys ()
 return all possible keys for the internal timers
 
void shamcomm::mpi::check_tag_value (i32 tag)
 
void shamcomm::mpi::Isend (const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request)
 MPI wrapper for MPI_Isend.
 
void shamcomm::mpi::Irecv (void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request)
 MPI wrapper for MPI_Irecv.
 
void shamcomm::mpi::Allreduce (const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 MPI wrapper for MPI_Allreduce.
 
void shamcomm::mpi::Allgather (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 MPI wrapper for MPI_Allgather.
 
void shamcomm::mpi::Allgatherv (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm)
 MPI wrapper for MPI_Allgatherv.
 
void shamcomm::mpi::Exscan (const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 MPI wrapper for MPI_Exscan.
 
void shamcomm::mpi::Wait (MPI_Request *request, MPI_Status *status)
 MPI wrapper for MPI_Wait.
 
void shamcomm::mpi::Waitall (int count, MPI_Request array_of_requests[], MPI_Status *array_of_statuses)
 MPI wrapper for MPI_Waitall.
 
void shamcomm::mpi::Barrier (MPI_Comm comm)
 MPI wrapper for MPI_Barrier.
 
void shamcomm::mpi::Probe (int source, int tag, MPI_Comm comm, MPI_Status *status)
 MPI wrapper for MPI_Probe.
 
void shamcomm::mpi::Recv (void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)
 MPI wrapper for MPI_Recv.
 
void shamcomm::mpi::Get_count (const MPI_Status *status, MPI_Datatype datatype, int *count)
 MPI wrapper for MPI_Get_count.
 
void shamcomm::mpi::Send (const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)
 MPI wrapper for MPI_Send.
 
void shamcomm::mpi::File_set_view (MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char *datarep, MPI_Info info)
 MPI wrapper for MPI_File_set_view.
 
void shamcomm::mpi::Type_size (MPI_Datatype type, int *size)
 MPI wrapper for MPI_Type_size.
 
void shamcomm::mpi::File_write_all (MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
 MPI wrapper for MPI_File_write_all.
 
void shamcomm::mpi::File_write (MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
 MPI wrapper for MPI_File_write.
 
void shamcomm::mpi::File_read (MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
 MPI wrapper for MPI_File_read.
 
void shamcomm::mpi::File_write_at (MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
 MPI wrapper for MPI_File_write_at.
 
void shamcomm::mpi::File_read_at (MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
 MPI wrapper for MPI_File_read_at.
 
void shamcomm::mpi::File_close (MPI_File *fh)
 MPI wrapper for MPI_File_close.
 
void shamcomm::mpi::File_open (MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh)
 MPI wrapper for MPI_File_open.
 
void shamcomm::mpi::Test (MPI_Request *request, int *flag, MPI_Status *status)
 MPI wrapper for MPI_Test.
 
void shamcomm::mpi::Gather (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
 MPI wrapper for MPI_Gather.
 
void shamcomm::mpi::Gatherv (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm)
 MPI wrapper for MPI_Gatherv.
 

Variables

std::vector< std::string > shamcomm::mpi::possible_keys
 

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 wrapper.cpp.

Function Documentation

◆ Allgather()

void shamcomm::mpi::Allgather ( const void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
MPI_Comm  comm 
)

MPI wrapper for MPI_Allgather.

Definition at line 133 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Allgatherv()

void shamcomm::mpi::Allgatherv ( const void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
const int  recvcounts[],
const int  displs[],
MPI_Datatype  recvtype,
MPI_Comm  comm 
)

MPI wrapper for MPI_Allgatherv.

Definition at line 149 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Allreduce()

void shamcomm::mpi::Allreduce ( const void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
MPI_Comm  comm 
)

MPI wrapper for MPI_Allreduce.

Definition at line 119 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Barrier()

void shamcomm::mpi::Barrier ( MPI_Comm  comm)

MPI wrapper for MPI_Barrier.

Definition at line 194 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ check_tag_value()

void shamcomm::mpi::check_tag_value ( i32  tag)

Definition at line 78 of file wrapper.cpp.

◆ Exscan()

void shamcomm::mpi::Exscan ( const void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
MPI_Comm  comm 
)

MPI wrapper for MPI_Exscan.

Definition at line 166 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_close()

void shamcomm::mpi::File_close ( MPI_File *  fh)

MPI wrapper for MPI_File_close.

Definition at line 305 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_open()

void shamcomm::mpi::File_open ( MPI_Comm  comm,
const char *  filename,
int  amode,
MPI_Info  info,
MPI_File *  fh 
)

MPI wrapper for MPI_File_open.

Definition at line 312 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_read()

void shamcomm::mpi::File_read ( MPI_File  fh,
void *  buf,
int  count,
MPI_Datatype  datatype,
MPI_Status *  status 
)

MPI wrapper for MPI_File_read.

Definition at line 272 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_read_at()

void shamcomm::mpi::File_read_at ( MPI_File  fh,
MPI_Offset  offset,
void *  buf,
int  count,
MPI_Datatype  datatype,
MPI_Status *  status 
)

MPI wrapper for MPI_File_read_at.

Definition at line 292 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_set_view()

void shamcomm::mpi::File_set_view ( MPI_File  fh,
MPI_Offset  disp,
MPI_Datatype  etype,
MPI_Datatype  filetype,
const char *  datarep,
MPI_Info  info 
)

MPI wrapper for MPI_File_set_view.

Definition at line 236 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_write()

void shamcomm::mpi::File_write ( MPI_File  fh,
const void *  buf,
int  count,
MPI_Datatype  datatype,
MPI_Status *  status 
)

MPI wrapper for MPI_File_write.

Definition at line 264 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_write_all()

void shamcomm::mpi::File_write_all ( MPI_File  fh,
const void *  buf,
int  count,
MPI_Datatype  datatype,
MPI_Status *  status 
)

MPI wrapper for MPI_File_write_all.

Definition at line 256 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ File_write_at()

void shamcomm::mpi::File_write_at ( MPI_File  fh,
MPI_Offset  offset,
const void *  buf,
int  count,
MPI_Datatype  datatype,
MPI_Status *  status 
)

MPI wrapper for MPI_File_write_at.

Definition at line 279 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Gather()

void shamcomm::mpi::Gather ( const void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

MPI wrapper for MPI_Gather.

Definition at line 326 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Gatherv()

void shamcomm::mpi::Gatherv ( const void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
const int  recvcounts[],
const int  displs[],
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

MPI wrapper for MPI_Gatherv.

Definition at line 342 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Get_count()

void shamcomm::mpi::Get_count ( const MPI_Status *  status,
MPI_Datatype  datatype,
int *  count 
)

MPI wrapper for MPI_Get_count.

Definition at line 222 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ get_possible_keys()

const std::vector< std::string > & shamcomm::mpi::get_possible_keys ( )

return all possible keys for the internal timers

Definition at line 60 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ get_timer()

f64 shamcomm::mpi::get_timer ( std::string  timername)

get a timer value

Definition at line 44 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ get_timers()

const std::unordered_map< std::string, f64 > & shamcomm::mpi::get_timers ( )

return all internal timers

Definition at line 46 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Irecv()

void shamcomm::mpi::Irecv ( void *  buf,
int  count,
MPI_Datatype  datatype,
int  source,
int  tag,
MPI_Comm  comm,
MPI_Request *  request 
)

MPI wrapper for MPI_Irecv.

Definition at line 102 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Isend()

void shamcomm::mpi::Isend ( const void *  buf,
int  count,
MPI_Datatype  datatype,
int  dest,
int  tag,
MPI_Comm  comm,
MPI_Request *  request 
)

MPI wrapper for MPI_Isend.

Definition at line 85 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Probe()

void shamcomm::mpi::Probe ( int  source,
int  tag,
MPI_Comm  comm,
MPI_Status *  status 
)

MPI wrapper for MPI_Probe.

Definition at line 201 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Recv()

void shamcomm::mpi::Recv ( void *  buf,
int  count,
MPI_Datatype  datatype,
int  source,
int  tag,
MPI_Comm  comm,
MPI_Status *  status 
)

MPI wrapper for MPI_Recv.

Definition at line 208 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ register_time()

void shamcomm::mpi::register_time ( std::string  timername,
f64  time 
)

Register a timer value.

Definition at line 33 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Send()

void shamcomm::mpi::Send ( const void *  buf,
int  count,
MPI_Datatype  datatype,
int  dest,
int  tag,
MPI_Comm  comm 
)

MPI wrapper for MPI_Send.

Definition at line 229 of file wrapper.cpp.

◆ Test()

void shamcomm::mpi::Test ( MPI_Request *  request,
int *  flag,
MPI_Status *  status 
)

MPI wrapper for MPI_Test.

Definition at line 319 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Type_size()

void shamcomm::mpi::Type_size ( MPI_Datatype  type,
int *  size 
)

MPI wrapper for MPI_Type_size.

Definition at line 249 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Wait()

void shamcomm::mpi::Wait ( MPI_Request *  request,
MPI_Status *  status 
)

MPI wrapper for MPI_Wait.

Definition at line 180 of file wrapper.cpp.

+ Here is the call graph for this function:

◆ Waitall()

void shamcomm::mpi::Waitall ( int  count,
MPI_Request  array_of_requests[],
MPI_Status *  array_of_statuses 
)

MPI wrapper for MPI_Waitall.

Definition at line 187 of file wrapper.cpp.

+ Here is the call graph for this function:

Variable Documentation

◆ possible_keys

std::vector<std::string> shamcomm::mpi::possible_keys
Initial value:
{
"total", "MPI_Isend", "MPI_Irecv",
"MPI_Allreduce", "MPI_Allgather", "MPI_Allgatherv",
"MPI_Exscan", "MPI_Wait", "MPI_Waitall",
"MPI_Barrier", "MPI_Probe", "MPI_Recv",
"MPI_Get_count", "MPI_Send", "MPI_File_set_view",
"MPI_Type_size", "MPI_File_write_all", "MPI_File_write",
"MPI_File_read", "MPI_File_write_at", "MPI_File_read_at",
"MPI_File_close", "MPI_File_open", "MPI_Test",
"MPI_Gather", "MPI_Gatherv",
}

Definition at line 48 of file wrapper.cpp.