libmuscle.profiling module

class libmuscle.profiling.ProfileEvent(instance_id: ymmsl.identity.Reference, start_time: libmuscle.timestamp.Timestamp, stop_time: libmuscle.timestamp.Timestamp, event_type: libmuscle.profiling.ProfileEventType, port: Optional[ymmsl.component.Port] = None, port_length: Optional[int] = None, slot: Optional[int] = None, message_size: Optional[int] = None)[source]

Bases: object

A profile event as used by MUSCLE3.

This represents a single measurement of the timing of some event that occurred while executing the simulation.

Parameters
  • instance_id – The identifier of the instance that generated this message.

  • start_time – When the event started (real-world, not simulation time).

  • stop_time – When the event ended (real-world, not simulation time).

  • event_type – Type of event that was measured.

  • port – Port used for sending or receiving, if applicable.

  • port_length – Length of that port, if a vector.

  • slot – Slot that was sent or received on, if applicable.

  • message_size – Size of the message involved, if applicable.

instance_id

The identifier of the instance that generated this message.

start_time

When the event started (real-world, not simulation time).

stop_time

When the event ended (real-world, not simulation time).

event_type

Type of event that was measured.

port

Port used for sending or receiving, if applicable.

port_length

Length of that port, if a vector.

slot

Slot that was sent or received on, if applicable.

message_size

Size of the message involved, if applicable.

stop() None[source]

Sets stop_time to the current time.

class libmuscle.profiling.ProfileEventType(value)[source]

Bases: enum.Enum

Profiling event types for MUSCLE3.

These match the types in the MUSCLE Manager Protocol, and should be kept identical to those.

CONNECT = 4
DEREGISTER = 1
RECEIVE = 3
REGISTER = 0
SEND = 2