View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

messages.h
Go to the documentation of this file.
1#ifndef MESSAGES_H
2#define MESSAGES_H
3
4#include <string>
5#include <array>
6
7#include <boost/asio/ip/address.hpp>
8#include <boost/asio/ip/address_v6.hpp>
9#include <boost/asio/ip/address_v4.hpp>
10
11#include <vistle/util/enum.h>
12#include "archives_config.h"
13#include "export.h"
14#include "message.h"
15#include "object.h"
16#include "parameter.h"
17#include "paramvector.h"
18#include "scalar.h"
19#include "shmname.h"
20#include "uuid.h"
21
22#pragma pack(push)
23#pragma pack(1)
24
25namespace vistle {
26
27class Communicator;
28class Parameter;
29class Port;
30class AvailableModuleBase;
31namespace message {
32
34class V_COREEXPORT Identify: public MessageBase<Identify, IDENTIFY> {
35public:
37 (UNKNOWN)(REQUEST) //< request receiver to send its identity
38 (UI) //< user interface
39 (MANAGER) //< cluster manager
40 (HUB) //< master hub
41 (SLAVEHUB) //< slave hub
42 (LOCALBULKDATA) //< bulk data transfer to local MPI ranks
43 (REMOTEBULKDATA) //< bulk data transfer to remote hubs
44 (RENDERSERVER) //< remote render server
45 (RENDERCLIENT) //< remote render client
46 )
47
48 typedef std::array<char, 32> mac_t;
49 typedef std::array<char, 64> session_data_t;
50
51 Identify(const std::string &name = ""); //< request identity
52 Identify(const Identify &request, Identity id, const std::string &name = ""); //< answer identification request
53 Identify(const Identify &request, Identity id, int rank);
54 Identity identity() const;
55 const char *name() const;
56 int rank() const;
57 int numRanks() const;
58 int boost_archive_version() const;
59
60 void setNumRanks(int size);
61
62 void computeMac();
63 bool verifyMac(bool compareSessionData = true) const;
64
65private:
66 Identity m_identity;
67 description_t m_name;
68 int m_numRanks;
69 int m_rank;
70 int m_boost_archive_version;
71 session_data_t m_session_data;
72 mac_t m_mac;
73};
75
76
77class V_COREEXPORT AddHub: public MessageBase<AddHub, ADDHUB> {
78 DEFINE_ENUM_WITH_STRING_CONVERSIONS(AddressType, (Hostname)(IPv4)(IPv6)(Unspecified))
79
80public:
81 AddHub(int id, const std::string &name);
82 int id() const;
83 const char *name() const;
84 const char *loginName() const;
85 const char *realName() const;
86 int numRanks() const;
87 unsigned short port() const;
88 unsigned short dataPort() const;
89 AddressType addressType() const;
90 bool hasAddress() const;
91 std::string host() const;
92 boost::asio::ip::address address() const;
93 boost::asio::ip::address_v6 addressV6() const;
94 boost::asio::ip::address_v4 addressV4() const;
95
96 void setNumRanks(int size);
97 void setPort(unsigned short port);
98 void setDataPort(unsigned short port);
99 void setAddress(boost::asio::ip::address addr);
100 void setAddress(boost::asio::ip::address_v6 addr);
101 void setAddress(boost::asio::ip::address_v4 addr);
102
103 void setLoginName(const std::string &login);
104 void setRealName(const std::string &real);
105
106 bool hasUserInterface() const;
107 void setHasUserInterface(bool ui);
108
109private:
110 int m_id;
111 address_t m_name;
112 address_t m_loginName;
113 address_t m_realName;
114
115 int m_numRanks;
116 unsigned short m_port;
117 unsigned short m_dataPort;
118 AddressType m_addrType;
119 address_t m_address;
120 bool m_hasUserInterface;
121};
122
124class V_COREEXPORT RemoveHub: public MessageBase<RemoveHub, REMOVEHUB> {
125public:
126 RemoveHub(int id);
127 int id() const;
128
129private:
130 int m_id;
131};
132
134class V_COREEXPORT Ping: public MessageBase<Ping, PING> {
135public:
136 Ping(const char c);
137
138 char getCharacter() const;
139
140private:
141 const char character;
142};
143
145class V_COREEXPORT Pong: public MessageBase<Pong, PONG> {
146public:
147 Pong(const Ping &ping);
148
149 char getCharacter() const;
150 int getDestination() const;
151
152private:
153 const char character;
154 int module;
155};
156
158class V_COREEXPORT Spawn: public MessageBase<Spawn, SPAWN> {
159public:
160 Spawn(int hubId, const std::string &name, int size = -1, int baserank = -1, int rankskip = -1);
161
162 void setMigrateId(int id);
163 int migrateId() const;
164 void setMirroringId(int id);
165 int mirroringId() const;
166 int hubId() const;
167 void setHubId(int id);
168 int spawnId() const;
169 void setSpawnId(int id);
170 const char *getName() const;
171 int getMpiSize() const;
172 int getBaseRank() const;
173 int getRankSkip() const;
174
175private:
177 int m_hub;
179 int m_spawnId;
181 int mpiSize;
183 int baseRank;
185 int rankSkip;
187 int m_migrateId = Id::Invalid;
189 int m_mirroringId = Id::Invalid;
191 module_name_t name;
192};
193
195class V_COREEXPORT SpawnPrepared: public MessageBase<SpawnPrepared, SPAWNPREPARED> {
196public:
197 SpawnPrepared(const Spawn &spawn);
198
199 int hubId() const;
200 int spawnId() const;
201 void setSpawnId(int id);
202 const char *getName() const;
203
204private:
206 int m_hub;
208 int m_spawnId;
210 module_name_t name;
211};
212
214class V_COREEXPORT Started: public MessageBase<Started, STARTED> {
215public:
216 Started(const std::string &name);
217
218 const char *getName() const;
219
220private:
222 module_name_t name;
223};
224
226class V_COREEXPORT Kill: public MessageBase<Kill, KILL> {
227public:
228 Kill(const int module);
229
230 int getModule() const;
231
232private:
234 const int module;
235};
236
238class V_COREEXPORT Quit: public MessageBase<Quit, QUIT> {
239public:
240 Quit(int id = Id::Broadcast);
241 int id() const;
242
243private:
244 const int m_id;
245};
246
248class V_COREEXPORT Debug: public MessageBase<Debug, DEBUG> {
249public:
250 Debug(const int module);
251
252 int getModule() const;
253
254private:
256 const int module;
257};
258
260class V_COREEXPORT ModuleExit: public MessageBase<ModuleExit, MODULEEXIT> {
261public:
262 ModuleExit();
263 void setForwarded();
264 bool isForwarded() const;
265
266private:
267 bool forwarded;
268};
269
271class V_COREEXPORT Execute: public MessageBase<Execute, EXECUTE> {
272public:
274 (Prepare) // call prepare()
275 (ComputeExecute) // call compute() - because this module was executed
276 (ComputeObject) // call compute() - because objects have been received
277 (Reduce) // call reduce()
278 )
279
280 Execute(What what = Execute::ComputeExecute, int module = Id::Broadcast, int count = -1);
281 Execute(int module, double realtime, double step = 0.);
282
283 void setModule(int);
284 int getModule() const;
285 void setExecutionCount(int count);
286 int getExecutionCount() const;
287
288 bool allRanks() const;
289 void setAllRanks(bool allRanks);
290
291 What what() const;
292 void setWhat(What r);
293
294 double animationRealTime() const;
295 double animationStepDuration() const;
296
297private:
298 bool m_allRanks;
299 int module;
300 int executionCount;
301 What m_what;
302 double m_realtime;
303 double m_animationStepDuration;
304};
306
309public:
310 CancelExecute(const int module);
311 int getModule() const;
312
313private:
314 int m_module;
315};
316
318class V_COREEXPORT Busy: public MessageBase<Busy, BUSY> {
319public:
320 Busy();
321
322private:
323};
324
326class V_COREEXPORT Idle: public MessageBase<Idle, IDLE> {
327public:
328 Idle();
329
330private:
331};
332
334class V_COREEXPORT AddPort: public MessageBase<AddPort, ADDPORT> {
335public:
336 AddPort(const Port &port);
337 Port getPort() const;
338
339private:
340 port_name_t m_name;
341 description_t m_description;
342 int m_porttype;
343 int m_flags;
344};
345
347class V_COREEXPORT RemovePort: public MessageBase<RemovePort, REMOVEPORT> {
348public:
349 RemovePort(const Port &port);
350 Port getPort() const;
351
352private:
353 port_name_t m_name;
354};
355
357
359class V_COREEXPORT AddObject: public MessageBase<AddObject, ADDOBJECT> {
360public:
361 AddObject(const std::string &senderPort, vistle::Object::const_ptr obj, const std::string &destPort = "");
362 AddObject(const AddObject &other);
363 AddObject(const AddObjectCompleted &complete);
365
366 bool operator<(const AddObject &other) const;
367
368 void setSenderPort(const std::string &sendPort);
369 const char *getSenderPort() const;
370 void setDestPort(const std::string &destPort);
371 const char *getDestPort() const;
372 const char *objectName() const;
373 void setObject(Object::const_ptr obj);
374 Object::const_ptr takeObject() const;
375 Object::const_ptr getObject() const;
376 bool ref() const;
377 const Meta &meta() const;
378 Object::Type objectType() const;
379 const shm_handle_t &getHandle() const;
380 bool handleValid() const;
381
382 void setBlocker();
383 bool isBlocker() const;
384 void setUnblocking();
385 bool isUnblocking() const;
386
387private:
388 port_name_t senderPort;
389 port_name_t destPort;
390 shm_name_t m_name;
391 shmsegname_t m_shmname;
392 Meta m_meta;
393 int m_objectType = Object::UNKNOWN;
394 shm_handle_t handle = 0;
395 mutable bool m_handleValid = false;
396 bool m_blocker = false;
397 bool m_unblock = false;
398};
399
400class V_COREEXPORT AddObjectCompleted: public MessageBase<AddObjectCompleted, ADDOBJECTCOMPLETED> {
401public:
402 AddObjectCompleted(const AddObject &msg);
403 const char *objectName() const;
404 int originalDestination() const;
405 const char *originalDestPort() const;
406
407private:
408 shm_name_t m_name;
409 int m_orgDestId;
410 port_name_t m_orgDestPort;
411};
412
414class V_COREEXPORT Connect: public MessageBase<Connect, CONNECT> {
415public:
416 Connect(const int moduleIDA, const std::string &portA, const int moduleIDB, const std::string &portB);
417
418 const char *getPortAName() const;
419 const char *getPortBName() const;
420
421 void setModuleA(int id);
422 int getModuleA() const;
423 void setModuleB(int id);
424 int getModuleB() const;
425
426 void reverse();
427
428private:
429 port_name_t portAName;
430 port_name_t portBName;
431
432 int moduleA;
433 int moduleB;
434};
435
437class V_COREEXPORT Disconnect: public MessageBase<Disconnect, DISCONNECT> {
438public:
439 Disconnect(const int moduleIDA, const std::string &portA, const int moduleIDB, const std::string &portB);
440
441 const char *getPortAName() const;
442 const char *getPortBName() const;
443
444 void setModuleA(int id);
445 int getModuleA() const;
446 void setModuleB(int id);
447 int getModuleB() const;
448
449 void reverse();
450
451private:
452 port_name_t portAName;
453 port_name_t portBName;
454
455 int moduleA;
456 int moduleB;
457};
458
460class V_COREEXPORT AddParameter: public MessageBase<AddParameter, ADDPARAMETER> {
461public:
462 AddParameter(const Parameter &param, const std::string &moduleName);
463
464 const char *getName() const;
465 const char *moduleName() const;
466 const char *description() const;
467 const char *group() const;
468 int getParameterType() const;
469 int getPresentation() const;
470 std::shared_ptr<Parameter>
471 getParameter() const; //< allocates a new Parameter object, caller is responsible for deletion
472
473private:
474 param_name_t name;
475 param_name_t m_group;
477 description_t m_description;
478 int paramtype;
479 int presentation;
480};
481
483class V_COREEXPORT RemoveParameter: public MessageBase<RemoveParameter, REMOVEPARAMETER> {
484public:
485 RemoveParameter(const Parameter &param, const std::string &moduleName);
486
487 const char *getName() const;
488 const char *moduleName() const;
489 int getParameterType() const;
490 std::shared_ptr<Parameter>
491 getParameter() const; //< allocates a new Parameter object, caller is responsible for deletion
492
493private:
494 param_name_t name;
495 param_name_t m_group;
497 int paramtype;
498};
499
501class V_COREEXPORT SetParameter: public MessageBase<SetParameter, SETPARAMETER> {
502public:
503 explicit SetParameter(int module); //<! apply delayed parameter changes
504 SetParameter(int module, const std::string &name, const std::shared_ptr<Parameter> param,
505 Parameter::RangeType rt = Parameter::Value, bool defaultValue = false);
506 SetParameter(int module, const std::string &name, const Integer value);
507 SetParameter(int module, const std::string &name, const Float value);
508 SetParameter(int module, const std::string &name, const ParamVector &value);
509 SetParameter(int module, const std::string &name, const IntParamVector &value);
510 SetParameter(int module, const std::string &name, const std::string &value);
511
512 void setInit();
513 bool isInitialization() const;
514 void setDelayed();
515 bool isDelayed() const;
516 void setModule(int);
517 int getModule() const;
518 bool setType(int type);
519
520 void setRangeType(int rt);
521 int rangeType() const;
522
523 const char *getName() const;
524 int getParameterType() const;
525
526 Integer getInteger() const;
527 std::string getString() const;
528 Float getFloat() const;
529 ParamVector getVector() const;
530 IntParamVector getIntVector() const;
531
532 bool apply(std::shared_ptr<Parameter> param) const;
533
534private:
535 int m_module;
536 param_name_t name;
537 int paramtype;
538 int dim;
539 bool initialize;
540 bool delayed;
541 bool reply;
542 int rangetype;
543 union {
544 Integer v_int;
545 Float v_scalar;
546 Float v_vector[MaxDimension];
547 Integer v_ivector[MaxDimension];
548 param_value_t v_string;
549 };
550};
551
553class V_COREEXPORT SetParameterChoices: public MessageBase<SetParameterChoices, SETPARAMETERCHOICES> {
554public:
555 struct Payload {
557 Payload(const std::vector<std::string> &choices);
558
559 std::vector<std::string> choices;
560
562 template<class Archive>
563 void serialize(Archive &ar)
564 {
565 ar &choices;
566 }
567 };
568
569 SetParameterChoices(const std::string &name, unsigned numChoices);
570
571 const char *getName() const;
572 int getNumChoices() const;
573
574 bool apply(std::shared_ptr<Parameter> param, const Payload &payload) const;
575
576private:
577 int numChoices;
578 param_name_t name;
579};
580
581class V_COREEXPORT Barrier: public MessageBase<Barrier, BARRIER> {
582public:
583 Barrier();
584};
585
586class V_COREEXPORT BarrierReached: public MessageBase<BarrierReached, BARRIERREACHED> {
587public:
588 BarrierReached(const uuid_t &uuid);
589};
590
591class V_COREEXPORT SetId: public MessageBase<SetId, SETID> {
592public:
593 SetId(const int id);
594
595 int getId() const;
596
597private:
598 const int m_id;
599};
600
601class V_COREEXPORT ReplayFinished: public MessageBase<ReplayFinished, REPLAYFINISHED> {
602public:
604};
605
607class V_COREEXPORT SendText: public MessageBase<SendText, SENDTEXT> {
608public:
609 DEFINE_ENUM_WITH_STRING_CONVERSIONS(TextType, (Cout)(Cerr)(Clog)(Info)(Warning)(Error))
610
611 struct V_COREEXPORT Payload {
612 Payload();
613 Payload(const std::string &text);
614
615 std::string text;
616
618 template<class Archive>
619 void serialize(Archive &ar)
620 {
621 ar &text;
622 }
623 };
624
626 SendText(const Message &inResponseTo);
627 SendText(TextType type);
628
629 TextType textType() const;
630 Type referenceType() const;
631 uuid_t referenceUuid() const;
632
633private:
635 TextType m_textType;
637 uuid_t m_referenceUuid;
639 Type m_referenceType;
640};
641V_ENUM_OUTPUT_OP(TextType, SendText)
642
643
644class V_COREEXPORT UpdateStatus: public MessageBase<UpdateStatus, UPDATESTATUS> {
645public:
646 DEFINE_ENUM_WITH_STRING_CONVERSIONS(Importance, (Bulk)(Low)(Medium)(High))
647 DEFINE_ENUM_WITH_STRING_CONVERSIONS(Type, (Text)(LoadedFile)(SessionUrl))
648
649 struct Payload {
650 Payload();
651 Payload(const std::string &status);
652
653 std::string status;
654
656 template<class Archive>
657 void serialize(Archive &ar)
658 {
659 ar &status;
660 }
661 };
662
663 UpdateStatus(const std::string &text, Importance prio = Low);
664 UpdateStatus(Type type, const std::string &text);
665 const char *text() const;
666
667 Importance importance() const;
668 Type statusType() const;
669
670private:
672 description_t m_text;
674 Importance m_importance;
676 Type m_statusType;
677};
679
680
681
683public:
684 DEFINE_ENUM_WITH_STRING_CONVERSIONS(Policy, (Local)(Master)(Distribute))
685 ObjectReceivePolicy(Policy pol);
686 Policy policy() const;
687
688private:
689 Policy m_policy;
690};
692
694public:
696 Schedule,
697 (Ignore) //< prepare/compute/reduce not called at all (e.g. for renderers)
698 (Single) //< compute called on each rank individually once per received object
699 (Gang) //< compute called on all ranks together once per received object
700 (LazyGang) //< compute called on all ranks together, but not necessarily for each received object
701 )
702 SchedulingPolicy(Schedule pol);
703 Schedule policy() const;
704
705private:
706 Schedule m_policy;
707};
709
710
711class V_COREEXPORT ReducePolicy: public MessageBase<ReducePolicy, REDUCEPOLICY> {
712public:
714 Reduce,
715 (Never) //< module's prepare()/reduce() methods will never be called - only for modules with COMBINE port (renderers)
716 (Locally) //< module's prepare()/reduce() methods will be called once unsynchronized on each rank
717 (PerTimestep) //< module's reduce() method will be called on all ranks together once per timestep
718 (PerTimestepOrdered) //< module's reduce() method will be called on all ranks together once per timestep in ascending order
719 (PerTimestepZeroFirst) //< module's reduce() method will be called on all ranks together once per timestep in arbitrary order, but zero first
720 (OverAll) //< module's prepare()/reduce() method will be called on all ranks together after all timesteps have been received
721 )
722 ReducePolicy(Reduce red);
723 Reduce policy() const;
724
725private:
726 Reduce m_reduce;
727};
729
730
737public:
739 (Start) //< execution starts - if applicable, prepare() will be invoked
740 (Finish) //< execution finishes - if applicable, reduce() has finished
741 )
742 ExecutionProgress(Progress stage, int count);
743 Progress stage() const;
744 void setStage(Progress stage);
745 void setExecutionCount(int count);
746 int getExecutionCount() const;
747
748private:
749 Progress m_stage;
750 int m_executionCount;
751};
753
755class V_COREEXPORT Trace: public MessageBase<Trace, TRACE> {
756public:
757 Trace(int module, Type type, bool onoff);
758 int module() const;
759 Type messageType() const;
760 bool on() const;
761
762private:
763 int m_module;
764 Type m_messageType;
765 bool m_on;
766};
767
768
770public:
772 const char *name() const;
773 const char *path() const;
774 int hub() const;
775
776private:
777 int m_hub;
778 module_name_t m_name;
779 path_t m_path;
780};
781
783class V_COREEXPORT ModuleAvailable: public MessageBase<ModuleAvailable, MODULEAVAILABLE>, public ModuleBaseMessage {
785};
786
787static_assert(sizeof(ModuleAvailable) <= Message::MESSAGE_SIZE, "message too large");
788
789class V_COREEXPORT CreateModuleCompound: public MessageBase<CreateModuleCompound, CREATEMODULECOMPOUND>,
790 public ModuleBaseMessage {
792};
793
794static_assert(sizeof(CreateModuleCompound) <= Message::MESSAGE_SIZE, "message too large");
795
797class V_COREEXPORT LockUi: public MessageBase<LockUi, LOCKUI> {
798public:
799 LockUi(bool locked);
800 bool locked() const;
801
802private:
803 bool m_locked;
804};
805
807class V_COREEXPORT RequestTunnel: public MessageBase<RequestTunnel, REQUESTTUNNEL> {
808public:
809 DEFINE_ENUM_WITH_STRING_CONVERSIONS(AddressType, (Hostname)(IPv4)(IPv6)(Unspecified))
811 RequestTunnel(unsigned short srcPort, const std::string &destHost, unsigned short destPort);
813 RequestTunnel(unsigned short srcPort, const boost::asio::ip::address_v4 destHost, unsigned short destPort);
815 RequestTunnel(unsigned short srcPort, const boost::asio::ip::address_v6 destHost, unsigned short destPort);
817 RequestTunnel(unsigned short srcPort, unsigned short destPort);
819 RequestTunnel(unsigned short srcPort);
820
821 void setDestAddr(boost::asio::ip::address_v6 addr);
822 void setDestAddr(boost::asio::ip::address_v4 addr);
823 unsigned short srcPort() const;
824 unsigned short destPort() const;
825 AddressType destType() const;
826 bool destIsAddress() const;
827 std::string destHost() const;
828 boost::asio::ip::address destAddr() const;
829 boost::asio::ip::address_v6 destAddrV6() const;
830 boost::asio::ip::address_v4 destAddrV4() const;
831 bool remove() const;
832
833private:
834 unsigned short m_srcPort;
835 AddressType m_destType;
836 address_t m_destAddr;
837 unsigned short m_destPort;
838 bool m_remove;
839};
840
843public:
844 RequestObject(const AddObject &add, const std::string &objId, const std::string &referrer = "");
845 RequestObject(int destId, int destRank, const std::string &objId, const std::string &referrer);
846 RequestObject(int destId, int destRank, const std::string &arrayId, int type, const std::string &referrer);
847 const char *objectId() const;
848 const char *referrer() const;
849 bool isArray() const;
850 int arrayType() const;
851
852private:
853 shm_name_t m_objectId;
854 shm_name_t m_referrer;
855 bool m_array;
856 int m_arrayType;
857};
858
860class V_COREEXPORT SendObject: public MessageBase<SendObject, SENDOBJECT> {
861public:
862 SendObject(const RequestObject &request, vistle::Object::const_ptr obj, size_t payloadSize);
863 SendObject(const RequestObject &request, size_t payloadSize);
864 const char *objectId() const;
865 const char *referrer() const;
866 const Meta &meta() const;
867 Object::Type objectType() const;
868 Meta objectMeta() const;
869 bool isArray() const;
870
871private:
872 bool m_array;
873 shm_name_t m_objectId;
874 shm_name_t m_referrer;
875 int m_objectType;
876 Meta m_meta;
877 int32_t m_block, m_numBlocks;
878 int32_t m_timestep, m_numTimesteps;
879 int32_t m_animationstep, m_numAnimationsteps;
880 int32_t m_iteration;
881 int32_t m_executionCount;
882 int32_t m_creator;
883 double m_realtime;
884};
885
886class V_COREEXPORT FileQuery: public MessageBase<FileQuery, FILEQUERY> {
887 friend class FileQueryResult;
888
889public:
890 DEFINE_ENUM_WITH_STRING_CONVERSIONS(Command, (SystemInfo)(LookUpFiles)(ReadDirectory)(MakeDirectory))
891 FileQuery(int moduleId, const std::string &path, Command cmd, size_t payloadsize = 0);
892 Command command() const;
893 int moduleId() const;
894 const char *path() const;
895 void setFilebrowserId(int id);
896 int filebrowserId() const;
897
898private:
899 int m_command;
900 int m_moduleId;
901 int m_filebrowser = -1;
902 path_t m_path;
903};
904
905class V_COREEXPORT FileQueryResult: public MessageBase<FileQuery, FILEQUERYRESULT> {
906public:
907 DEFINE_ENUM_WITH_STRING_CONVERSIONS(Status, (Ok)(Error)(DoesNotExist)(NoPermission))
908 FileQueryResult(const FileQuery &request, Status status, size_t payloadsize);
909 const char *path() const;
910 FileQuery::Command command() const;
911 Status status() const;
912 int filebrowserId() const;
913
914private:
915 int m_command;
916 int m_status;
917 int m_filebrowser;
918 path_t m_path;
919};
920
922public:
923 DataTransferState(size_t numTransferring);
924 size_t numTransferring() const;
925
926private:
927 long m_numTransferring;
928};
929
931class V_COREEXPORT Cover: public MessageBase<Cover, COVER> {
932public:
933 Cover(int mirror, int subtype);
934
935 int subtype() const;
936 int mirrorId() const;
937
938private:
939 int m_mirrorId;
940 int m_subtype;
941};
942
943
944template<class Payload>
945extern V_COREEXPORT buffer addPayload(Message &message, const Payload &payload);
946template<class Payload>
947extern V_COREEXPORT Payload getPayload(const buffer &data);
948
949extern template V_COREEXPORT buffer addPayload<std::string>(Message &message, const std::string &payload);
950extern template V_COREEXPORT buffer addPayload<SendText::Payload>(Message &message, const SendText::Payload &payload);
951extern template V_COREEXPORT buffer
952addPayload<SetParameterChoices::Payload>(Message &message, const SetParameterChoices::Payload &payload);
953
954extern template V_COREEXPORT std::string getPayload(const buffer &data);
955extern template V_COREEXPORT SendText::Payload getPayload(const buffer &data);
957
958V_COREEXPORT std::ostream &operator<<(std::ostream &s, const Message &msg);
959
962public:
963 CloseConnection(const std::string &reason);
964 const char *reason() const;
965
966private:
967 description_t m_reason;
968};
969
970} // namespace message
971} // namespace vistle
972
973#pragma pack(pop)
974#endif
#define ARCHIVE_ACCESS
Definition: archives_config.h:465
Definition: availablemodule.h:19
Definition: objectmeta.h:16
std::shared_ptr< const Object > const_ptr
Definition: object.h:68
Type
Definition: object.h:84
@ UNKNOWN
Definition: object.h:89
Definition: paramvector.h:18
Definition: parameter.h:26
Minimum() Value(Maximum)) Parameter(int moduleId
Definition: port.h:29
announce that a (slave) hub has connected
Definition: messages.h:77
Definition: messages.h:400
add an object to the input queue of an input port
Definition: messages.h:359
notification that a module has created a parameter
Definition: messages.h:460
notification that a module has created an input/output port
Definition: messages.h:334
Definition: messages.h:586
Definition: messages.h:581
indicate that a module has started computing
Definition: messages.h:318
trigger execution of a module function
Definition: messages.h:308
terminate a socket connection
Definition: messages.h:961
connect an output port to an input port of another module
Definition: messages.h:414
wrap a COVISE message sent by COVER
Definition: messages.h:931
Definition: messages.h:790
Definition: messages.h:921
request a module to quit
Definition: messages.h:248
disconnect an output port from an input port of another module
Definition: messages.h:437
trigger execution of a module function
Definition: messages.h:271
DEFINE_ENUM_WITH_STRING_CONVERSIONS(What,(Prepare)(ComputeExecute)(ComputeObject)(Reduce)) Execute(What what
steer execution stages
Definition: messages.h:736
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Progress,(Start)(Finish)) ExecutionProgress(Progress stage
Definition: messages.h:905
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Status,(Ok)(Error)(DoesNotExist)(NoPermission)) FileQueryResult(const FileQuery &request
Definition: messages.h:886
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Command,(SystemInfo)(LookUpFiles)(ReadDirectory)(MakeDirectory)) FileQuery(int moduleId
indicate the kind of a communication partner
Definition: messages.h:34
Identify(const Identify &request, Identity id, const std::string &name="")
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Identity,(UNKNOWN)(REQUEST)(UI)(MANAGER)(HUB)(SLAVEHUB)(LOCALBULKDATA)(REMOTEBULKDATA)(RENDERSERVER)(RENDERCLIENT)) typedef std typedef std::array< char, 64 > session_data_t
Definition: messages.h:36
indicate that a module has finished computing
Definition: messages.h:326
request a module to quit
Definition: messages.h:226
lock UI (block user interaction)
Definition: messages.h:797
Definition: message.h:327
Definition: message.h:157
static const size_t MESSAGE_SIZE
Definition: message.h:161
announce availability of a module to UI
Definition: messages.h:783
notify that a module has quit
Definition: messages.h:260
control where AddObject messages are sent
Definition: messages.h:682
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Policy,(Local)(Master)(Distribute)) ObjectReceivePolicy(Policy pol)
debug: request a reply containing character 'c'
Definition: messages.h:134
debug: reply to pong
Definition: messages.h:145
request all modules to quit for terminating the session
Definition: messages.h:238
control whether/when prepare() and reduce() are called
Definition: messages.h:711
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Reduce,(Never)(Locally)(PerTimestep)(PerTimestepOrdered)(PerTimestepZeroFirst)(OverAll)) ReducePolicy(Reduce red)
request that a slave hub be deleted
Definition: messages.h:124
notification that a module has removed a parameter
Definition: messages.h:483
notification that a module has destroyed an input/output port
Definition: messages.h:347
Definition: messages.h:601
request remote data object
Definition: messages.h:842
request hub to listen on TCP port and forward incoming connections
Definition: messages.h:807
DEFINE_ENUM_WITH_STRING_CONVERSIONS(AddressType,(Hostname)(IPv4)(IPv6)(Unspecified)) RequestTunnel(unsigned short srcPort
establish tunnel - let hub forward incoming connections to srcPort to destHost::destPort
Definition: messages.h:693
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Schedule,(Ignore)(Single)(Gang)(LazyGang)) SchedulingPolicy(Schedule pol)
header for data object transmission
Definition: messages.h:860
send text messages to user interfaces
Definition: messages.h:607
DEFINE_ENUM_WITH_STRING_CONVERSIONS(TextType,(Cout)(Cerr)(Clog)(Info)(Warning)(Error)) struct V_COREEXPORT Payload
Definition: messages.h:609
Definition: messages.h:591
set list of choice descriptions for a choice parameter
Definition: messages.h:553
request parameter value update or notify that a parameter value has been changed
Definition: messages.h:501
notification of manager that spawning is possible (i.e. shmem has been set up)
Definition: messages.h:195
spawn a module
Definition: messages.h:158
acknowledge that a module has been spawned
Definition: messages.h:214
enable/disable message tracing for a module
Definition: messages.h:755
update status of a module (or other entity)
Definition: messages.h:644
UpdateStatus(const std::string &text, Importance prio=Low)
UpdateStatus(Type type, const std::string &text)
DEFINE_ENUM_WITH_STRING_CONVERSIONS(Importance,(Bulk)(Low)(Medium)(High)) DEFINE_ENUM_WITH_STRING_CONVERSIONS(Type
#define V_COREEXPORT
Definition: export.h:9
#define V_ENUM_OUTPUT_OP(name, scope)
Definition: enum.h:72
void serialize(Archive &ar, vistle::Vector1 &v, const unsigned int version)
Definition: vector.h:105
Definition: serialize.h:35
bool initialize(size_t secret_size)
Definition: crypto.cpp:40
std::string module(const std::string &prefix)
Definition: directory.cpp:61
std::array< char, 350 > description_t
Definition: message.h:150
std::array< char, 500 > path_t
Definition: message.h:152
std::array< char, 200 > address_t
Definition: message.h:151
@ Broadcast
Definition: messagerouter.h:36
V_COREEXPORT std::ostream & operator<<(std::ostream &s, const Message &msg)
Definition: messages.cpp:1718
boost::uuids::uuid uuid_t
Definition: message.h:154
buffer addPayload(Message &message, const Payload &payload)
Definition: messagepayloadtemplates.h:9
std::array< char, 32 > param_name_t
Definition: message.h:146
std::array< char, 256 > param_value_t
Definition: message.h:147
Payload getPayload(const buffer &data)
Definition: messagepayloadtemplates.h:38
std::array< char, ModuleNameLength > module_name_t
Definition: message.h:144
std::array< char, 300 > shmsegname_t
Definition: message.h:149
std::array< char, 32 > port_name_t
Definition: message.h:145
DEFINE_ENUM_WITH_STRING_CONVERSIONS(CompressionMode,(CompressionNone)(CompressionLz4)(CompressionZstd)(CompressionSnappy)) DEFINE_ENUM_WITH_STRING_CONVERSIONS(Type
Definition: allobjects.cpp:30
std::vector< char, allocator< char > > buffer
Definition: buffer.h:9
double Float
Definition: scalar.h:18
const int MaxDimension
Definition: dimensions.h:11
managed_shm::handle_t shm_handle_t
Definition: object.h:40
bool operator<(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:243
int64_t Integer
Definition: scalar.h:19
Definition: filequery.h:15
Definition: messages.h:769
ModuleBaseMessage(const AvailableModuleBase &mod)
Definition: messages.cpp:1408
std::vector< std::string > choices
Definition: messages.h:559
ARCHIVE_ACCESS void serialize(Archive &ar)
Definition: messages.h:563
Definition: shmname.h:11