Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Build/gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ CXXFLAGS = $(DEPENDENCY_FLAGS) $(INCLUDE_FLAGS) \
-std=c++11 -Wall -fPIC -pthread -pedantic

# Debug target logic.
ifdef ORCHESTRATOR_DEBUG
CXXFLAGS += -g3 -DORCHESTRATOR_DEBUG=1
else
debug: CXXFLAGS += -g3 -DORCHESTRATOR_DEBUG=1
endif
debug: all

# Handy aliases for building executables, scripts, and libraries. Order doesn't
Expand All @@ -104,20 +108,24 @@ ROOT_EXECUTABLE = $(EXECUTABLE_DIR)/root
DUMMY_EXECUTABLE = $(EXECUTABLE_DIR)/dummy
LOGSERVER_EXECUTABLE = $(EXECUTABLE_DIR)/logserver
LOGSERVER_MESSAGE_FILE = $(EXECUTABLE_DIR)/OrchestratorMessages.txt
NAMESERVER_EXECUTABLE = $(EXECUTABLE_DIR)/nameserver
RTCL_EXECUTABLE = $(EXECUTABLE_DIR)/rtcl
INJECTOR_EXECUTABLE = $(EXECUTABLE_DIR)/injector
MOTHERSHIP_EXECUTABLE = $(EXECUTABLE_DIR)/mothership
MOTHERSHIP_DUMMY_EXECUTABLE = $(EXECUTABLE_DIR)/mothershipdummy

all: orchestrate launcher root dummy logserver rtcl injector mothership \
application_staging_environment
all: orchestrate launcher root dummy logserver nameserver rtcl injector \
mothership mothershipdummy application_staging_environment
launcher: $(LAUNCHER_EXECUTABLE)
orchestrate: $(ORCHESTRATE_SCRIPT)
root: $(ROOT_EXECUTABLE)
dummy: $(DUMMY_EXECUTABLE)
logserver: $(LOGSERVER_EXECUTABLE) $(LOGSERVER_MESSAGE_FILE)
nameserver: $(NAMESERVER_EXECUTABLE)
rtcl: $(RTCL_EXECUTABLE)
injector: $(INJECTOR_EXECUTABLE)
mothership: $(MOTHERSHIP_EXECUTABLE)
mothershipdummy: $(MOTHERSHIP_DUMMY_EXECUTABLE)

# Prerequisites (objects) for building executables are defined here:
include Makefile.executable_prerequisites
Expand All @@ -133,7 +141,8 @@ tests: $(ALL_TESTS) $(TEST_SCRIPT)
# Makefile.executable_prerequisites for the prerequisites of these executables
# (obviously...)
$(LAUNCHER_EXECUTABLE) $(ROOT_EXECUTABLE) $(DUMMY_EXECUTABLE) \
$(LOGSERVER_EXECUTABLE) $(RTCL_EXECUTABLE) $(INJECTOR_EXECUTABLE):
$(LOGSERVER_EXECUTABLE) $(NAMESERVER_EXECUTABLE) $(RTCL_EXECUTABLE) \
$(INJECTOR_EXECUTABLE) $(MOTHERSHIP_DUMMY_EXECUTABLE):
@$(shell $(MKDIR) $(EXECUTABLE_DIR))
$(CXX) -pthread -Wl,-rpath-link=$(QT_LIB_DIR) \
-L$(MPICH_LIB_DIR) -L$(QT_LIB_DIR) -L/usr/lib \
Expand Down Expand Up @@ -282,8 +291,8 @@ clean: application_staging_environment_teardown
.PRECIOUS: $(DEPENDENCY_DIR)/%.d

# Non-builtin targets that do not explicitly represent files that are created.
.PHONY: all clean debug tests orchestrate root dummy logserver rtcl injector \
mothership application_staging_environment \
.PHONY: all clean debug tests orchestrate root dummy logserver nameserver rtcl injector \
mothership mothershipdummy application_staging_environment \
application_staging_environment_teardown

# The "all" target should be the default.
Expand Down
64 changes: 57 additions & 7 deletions Build/gcc/Makefile.executable_prerequisites
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ HARDWARE_FILE_READER_SOURCES = $(SOURCE_DIR)/OrchBase/HardwareFileReader/Hardwar
$(GENERICS_DIR)/uif.cpp \
$(HARDWARE_DEPLOYER_SOURCES)

# Sources used by executables that provide POETS name resolution.
NAME_SERVICES_SOURCES = $(SOURCE_DIR)/NameServer/ABDefs.cpp \
$(SOURCE_DIR)/NameServer/ABRecord.cpp \
$(SOURCE_DIR)/NameServer/ABTask.cpp \
$(SOURCE_DIR)/NameServer/AddressBook.cpp \
$(SOURCE_DIR)/NameServer/SBase.cpp \
$(SOURCE_DIR)/OrchBase/CMsg_p.cpp \
$(SOURCE_DIR)/OrchBase/P_addr.cpp

# The orchestrate execution script uses a template.
ORCHESTRATE_TEMPLATE = ./Resources/orchestrate_template.sh

Expand Down Expand Up @@ -125,7 +134,11 @@ ROOT_SOURCES = $(SOURCE_DIR)/Root/RootMain.cpp \
$(GENERICS_DIR)/filename.cpp \
$(GENERICS_DIR)/lex.cpp \
$(GENERICS_DIR)/rand.cpp \
$(SOURCE_DIR)/NameServer/Ns_el.cpp
$(SOURCE_DIR)/Common/Debug.cpp \
$(SOURCE_DIR)/NameServer/ABDefs.cpp \
$(SOURCE_DIR)/NameServer/ABRecord.cpp \
$(SOURCE_DIR)/NameServer/ABTask.cpp \
$(SOURCE_DIR)/NameServer/AddressBook.cpp

ROOT_SOURCES += $(TRULY_COMMON_SOURCES)
ROOT_SOURCES += $(HARDWARE_FILE_READER_SOURCES)
Expand Down Expand Up @@ -178,6 +191,26 @@ LOGSERVER_SOURCES += $(TRULY_COMMON_SOURCES)
# from which the Orchestrator is started.
LOGSERVER_MESSAGE_FILE_ORIGIN = $(SOURCE_DIR)/OrchestratorMessages.txt

# The nameserver component consists of:
#
# - The "main" file (/Source/NameServer/NameServerMain.cpp) and its derived
# class in /Source/NameServer.
#
# - The name services sources in /Source/NameServer.
#
# - The truly common sources.
#
# - The hardware and software address sources.
#
NAMESERVER_SOURCES = $(SOURCE_DIR)/NameServer/NameServerMain.cpp \
$(SOURCE_DIR)/NameServer/NameServer.cpp \
$(SOURCE_DIR)/Common/Debug.cpp

NAMESERVER_SOURCES += $(NAME_SERVICES_SOURCES)
NAMESERVER_SOURCES += $(TRULY_COMMON_SOURCES)
#NAMESERVER_SOURCES += $(SOFTWARE_ADDRESS_SOURCES)
#NAMESERVER_SOURCES += $(HARDWARE_ADDRESS_SOURCES)

# The rtcl (real-time clock) component consists of:
#
# - The "main" file (/Source/RTCL/RTCL.cpp) and its dependencies in
Expand Down Expand Up @@ -220,6 +253,8 @@ INJECTOR_SOURCES += $(TRULY_COMMON_SOURCES)
#
# - An interface source file from the softswitch, in /Source/Softswitch/src.
#
# - The name services sources.
#
# - The truly common sources.
#
# - Some "generics" (/Generics) sources.
Expand All @@ -229,25 +264,40 @@ INJECTOR_SOURCES += $(TRULY_COMMON_SOURCES)
# Hostlink sources are to be compiled separately.
MOTHERSHIP_SOURCES = $(SOURCE_DIR)/Mothership/MothershipMain.cpp \
$(SOURCE_DIR)/Mothership/TaskInfo.cpp \
$(SOURCE_DIR)/Mothership/TMoth.cpp \
$(SOURCE_DIR)/Mothership/Mothership.cpp \
$(SOURCE_DIR)/Softswitch/src/poets_msg.cpp \
$(GENERICS_DIR)/dumpchan.cpp \
$(GENERICS_DIR)/rand.cpp \
$(SOURCE_DIR)/Common/Debug.cpp \
$(SOURCE_DIR)/OrchBase/Bin.cpp \
$(SOURCE_DIR)/OrchBase/build_defs.cpp \
$(SOURCE_DIR)/OrchBase/CFrag.cpp \
$(SOURCE_DIR)/OrchBase/CMsg_p.cpp \
$(SOURCE_DIR)/OrchBase/D_graph.cpp \
$(SOURCE_DIR)/OrchBase/P_addr.cpp \
$(SOURCE_DIR)/OrchBase/P_device.cpp \
$(SOURCE_DIR)/OrchBase/P_message.cpp \
$(SOURCE_DIR)/OrchBase/P_pin.cpp \
$(SOURCE_DIR)/OrchBase/P_task.cpp \
$(SOURCE_DIR)/Common/Debug.cpp \
$(HARDWARE_DEPLOYER_SOURCES)

MOTHERSHIP_SOURCES += $(NAME_SERVICES_SOURCES)
MOTHERSHIP_SOURCES += $(TRULY_COMMON_SOURCES)

# A dummy mothership is an executable to provide mothership-like functionality
# when there is no connected box with a HostLink interface. It consists of:
#
# - The "main" file (/Source/Mothership/MothershipDummyMain.cpp) and its
# dependencies in /Source/Mothership
#
# - The name services sources.
#
# - The truly common sources.
#
MOTHERSHIP_DUMMY_SOURCES = $(SOURCE_DIR)/Mothership/MothershipDummyMain.cpp \
$(SOURCE_DIR)/Mothership/MothershipDummy.cpp

MOTHERSHIP_DUMMY_SOURCES += $(NAME_SERVICES_SOURCES)
MOTHERSHIP_DUMMY_SOURCES += $(TRULY_COMMON_SOURCES)

# Convert these lists of sources into a list of objects to define a dependency
# system for the linker.

Expand Down Expand Up @@ -279,7 +329,7 @@ $(1)_OBJECTS := $(call orch_sources_to_objects, $($(1)_SOURCES))
endef

$(foreach object_set,\
LAUNCHER ROOT INJECTOR DUMMY LOGSERVER RTCL MOTHERSHIP,\
LAUNCHER ROOT INJECTOR DUMMY LOGSERVER NAMESERVER RTCL MOTHERSHIP MOTHERSHIP_DUMMY,\
$(eval $(call OBJECT_TEMPLATE,$(object_set))))

# Define executable prerequisites. RULE_TEMPLATE defines the substitutions made
Expand All @@ -292,5 +342,5 @@ $($(1)_EXECUTABLE): $($(1)_OBJECTS)
endef

$(foreach executable_name,\
LAUNCHER ROOT DUMMY LOGSERVER RTCL INJECTOR MOTHERSHIP,\
LAUNCHER ROOT DUMMY LOGSERVER NAMESERVER RTCL INJECTOR MOTHERSHIP MOTHERSHIP_DUMMY,\
$(eval $(call RULE_TEMPLATE,$(executable_name))))
2 changes: 0 additions & 2 deletions OrchestratorFrontEnd.pro
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ SOURCES += \
./Generics/uif.cpp \
Source/Common/Pglobals.cpp \
Source/OrchBase/P_super.cpp \
Source/NameServer/Ns_el.cpp \
Source/OrchBase/P_owner.cpp \
Source/OrchBase/build_defs.cpp \
Source/OrchBase/CMsg_p.cpp
Expand Down Expand Up @@ -181,7 +180,6 @@ HEADERS += \
./Source/OrchBase/build_defs.h \
Source/OrchBase/P_super.h \
Source/Injector/Injector.h \
Source/NameServer/Ns_el.h \
Source/OrchBase/P_owner.h \
Generics/dumpchan.h \
Source/OrchBase/CMsg_p.h \
Expand Down
1 change: 1 addition & 0 deletions Source/Common/CommonBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <string>
#include <cstring>
using namespace std;
#include "Debug.h"
#include "PMsg_p.hpp"
#include "ProcMap.h"
#include "pthread.h"
Expand Down
4 changes: 4 additions & 0 deletions Source/Common/Decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ DON'T PUT ANY #include IN THIS FILE

It's virtual here because this makes it an invalid translation unit, so if you
try to compile it, the compiler will squeak.

A similar decode exists in SDecode.cpp, intended specifically for classes that
derive from SBase. Do not use this file (Decode.cpp) if you are deriving from
SBase. Similarly, do not use SDecode.cpp if you derive directly from CommonBase.
*/

//==============================================================================
Expand Down
1 change: 1 addition & 0 deletions Source/Common/PMsg_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and when I come across a need.

PMsg_p::PMsg_p(MPI_Comm c):Msg_p(){comm=c;}
PMsg_p::PMsg_p(byte * pb,int l,MPI_Comm c):Msg_p(pb,l){comm=c;}
PMsg_p::PMsg_p(Msg_p & m, MPI_Comm c):Msg_p(m){comm=c;}
PMsg_p::PMsg_p(PMsg_p & r):Msg_p(r){comm=r.comm;}
PMsg_p::~PMsg_p(void){}

Expand Down
1 change: 1 addition & 0 deletions Source/Common/PMsg_p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class PMsg_p : public Msg_p {
public :
PMsg_p(MPI_Comm c=MPI_COMM_NULL);
PMsg_p(byte * pb,int l,MPI_Comm c=MPI_COMM_NULL);
PMsg_p(Msg_p & m, MPI_Comm c=MPI_COMM_NULL);
PMsg_p(PMsg_p & r);
virtual ~ PMsg_p(void);
void Bcast();
Expand Down
45 changes: 43 additions & 2 deletions Source/Common/Pglobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const byte Q::INJCT;
const byte Q::NAME;
const byte Q::SUPR;
const byte Q::TINS;
const byte Q::CANDC;
// Level 1 subkeys
const byte Q::PING;
const byte Q::POST;
Expand All @@ -28,10 +29,16 @@ const byte Q::RUN;
const byte Q::LOAD;
const byte Q::STOP;
const byte Q::TOPO;
const byte Q::DIST;
const byte Q::TDIR;
const byte Q::SHOW;
const byte Q::ACPT;
// Nameserver additions ----------------------------------------------------
const byte Q::SEND;
const byte Q::QRY;
const byte Q::RPLY;
const byte Q::DATA;
const byte Q::CFG;
const byte Q::CMDC;
const byte Q::DUMP;
// temporary use: for MPI testing ------------------------------------------
const byte Q::M0;
const byte Q::M1;
Expand All @@ -41,7 +48,41 @@ const byte Q::MN;
const byte Q::REQ;
const byte Q::ACK;
const byte Q::FWD;
// Nameserver additions ---------------------------------------------------
const byte Q::TASK;
const byte Q::DEVT;
const byte Q::DEVI;
const byte Q::SUPV;
const byte Q::EXTN;
const byte Q::LIST;
const byte Q::BLD;
const byte Q::INTG;
const byte Q::STATE;
// moved from L1 to L2 for Nameserver --------------------------------------
const byte Q::DIST;
const byte Q::RECL;
const byte Q::TDIR;
const byte Q::DEL;
const byte Q::MONI;
const byte Q::LOGN;
const byte Q::DEVE;
// Level 3 subkeys
const byte Q::FALSE;
const byte Q::TRUE;
const byte Q::OFF;
const byte Q::ON;
const byte Q::NF;
const byte Q::TNF;
const byte Q::NM;
const byte Q::ID;
const byte Q::ALL;
const byte Q::NGRP;
const byte Q::IGRP;
const byte Q::NSUP;
const byte Q::ISUP;
const byte Q::IN;
const byte Q::OUT;
const byte Q::ATR;

// Not a value
const byte Q::NAV;
Expand Down
60 changes: 51 additions & 9 deletions Source/Common/Pglobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,63 @@ static const byte RUN = 0x48;
static const byte LOAD = 0x49;
static const byte STOP = 0x4a;
static const byte TOPO = 0x4b;
static const byte DIST = 0x4c;
static const byte RECL = 0x4d;
static const byte TDIR = 0x4e;
static const byte SHOW = 0x4f;
static const byte ACPT = 0x50;
static const byte SHOW = 0x4c;
static const byte ACPT = 0x4d;
// Nameserver additions ----------------------------------------------------
static const byte SEND = 0x4e;
static const byte QRY = 0x4f;
static const byte RPLY = 0x50;
static const byte DATA = 0x51;
static const byte CFG = 0x52;
static const byte CMDC = 0x53;
static const byte DUMP = 0x54;
// temporary use: for MPI testing ------------------------------------------
static const byte M0 = 0x60;
static const byte M1 = 0x61;
static const byte MN = 0x62;
//--------------------------------------------------------------------------
// _________________________________________________________________________
// Level 2 subkeys
static const byte REQ = 0x80;
static const byte ACK = 0x81;
static const byte FWD = 0x82;
// Nameserver additions ---------------------------------------------------
static const byte TASK = 0x83;
static const byte DEVT = 0x84;
static const byte DEVI = 0x85;
static const byte SUPV = 0x86;
static const byte EXTN = 0x87;
static const byte ATTR = 0x88;
static const byte LIST = 0x89;
static const byte BLD = 0x8a;
static const byte INTG = 0x8b;
// moved from L1 to L2 for Nameserver --------------------------------------
static const byte DIST = 0x8c;
static const byte RECL = 0x8d;
static const byte TDIR = 0x8e;
static const byte STATE = 0x8f;
static const byte DEL = 0x90;
static const byte MONI = 0x91;
static const byte LOGN = 0x92;
static const byte DEVE = 0x93;
// _________________________________________________________________________
// Level 3 subkeys

static const byte FALSE = 0xc0;
static const byte TRUE = 0xc1;
static const byte OFF = 0xc2;
static const byte ON = 0xc3;
static const byte NF = 0xc4;
static const byte TNF = 0xc5;
static const byte NM = 0xc6;
static const byte ID = 0xc7;
static const byte ALL = 0xc8;
static const byte NGRP = 0xc9;
static const byte IGRP = 0xca;
static const byte NSUP = 0xcb;
static const byte ISUP = 0xcc;
static const byte IN = 0xcd;
static const byte OUT = 0xce;
static const byte ATR = 0xcf;

// Not a value
static const byte NAV = 0xff;
static const int NAP = -1;
Expand All @@ -156,9 +197,10 @@ static const byte ROOT = 0x00;
#define csLOGSERVERproc "LogServer:CommonBase"
#define csRTCLproc "RTCL:CommonBase"
#define csINJECTORproc "Injector:CommonBase"
#define csNAMESERVERproc "NameServer:CommonBase"
#define csNAMESERVERproc "NameServer:SBase:CommonBase"
#define csMONITORproc "Monitor:CommonBase"
#define csMOTHERSHIPproc "TMoth:CommonBase"
#define csMOTHERSHIPproc "Mothership:SBase:CommonBase"
//#define csMOTHERSHIPproc "TMoth:CommonBase"
#define csMPITESTproc "MPITest:CommonBase"

// tag defined as a directive because MPI libraries are c-based, have no concept
Expand Down
Loading