Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added doc folder and some processing scripts
  • Loading branch information
haitjema committed Nov 19, 2013
1 parent 25d0616 commit 8929147
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 4,133 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -6,7 +6,7 @@
*.exe
*.o
*.so

*.pyc
# Make stuff
*.dep

Expand Down
26 changes: 6 additions & 20 deletions Makefile
Expand Up @@ -2,7 +2,7 @@
# OMNeT++/OMNEST Makefile for DataCenter
#
# This file was generated with the command:
# opp_makemake -f --deep -O out -d src -XBuildFatTree -Xout -Xsimulations -I/opt/local/include -L/opt/local/lib -L../inet/out/$(CONFIGNAME)/src -linet -DINET_IMPORT -KINET_PROJ=../inet
# opp_makemake -f
#

# Name of target to be created (-o option)
Expand All @@ -14,14 +14,13 @@ USERIF_LIBS = $(ALL_ENV_LIBS) # that is, $(TKENV_LIBS) $(CMDENV_LIBS)
#USERIF_LIBS = $(TKENV_LIBS)

# C++ include paths (with -I)
INCLUDE_PATH = -I/opt/local/include -I.
INCLUDE_PATH = -I.

# Additional object and library files to link with
EXTRA_OBJS =

# Additional libraries (-L, -l options)
LIBS = -L/opt/local/lib -L../inet/out/$(CONFIGNAME)/src -linet
LIBS += -Wl,-rpath,`abspath /opt/local/lib` -Wl,-rpath,`abspath ../inet/out/$(CONFIGNAME)/src`
LIBS =

# Output directory
PROJECT_OUTPUT_DIR = out
Expand All @@ -34,9 +33,6 @@ OBJS =
# Message files
MSGFILES =

# Other makefile variables (-K)
INET_PROJ=../inet

#------------------------------------------------------------------------------

# Pull in OMNeT++ configuration (Makefile.inc or configuser.vc)
Expand All @@ -61,7 +57,7 @@ include $(CONFIGFILE)
OMNETPP_LIB_SUBDIR = $(OMNETPP_LIB_DIR)/$(TOOLCHAIN_NAME)
OMNETPP_LIBS = -L"$(OMNETPP_LIB_SUBDIR)" -L"$(OMNETPP_LIB_DIR)" -loppmain$D $(USERIF_LIBS) $(KERNEL_LIBS) $(SYS_LIBS)

COPTS = $(CFLAGS) -DINET_IMPORT $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
COPTS = $(CFLAGS) $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)

# we want to recompile everything if COPTS changes,
Expand All @@ -84,18 +80,12 @@ endif
all: $O/$(TARGET)
$(Q)$(LN) $O/$(TARGET) .

$O/$(TARGET): $(OBJS) submakedirs $(wildcard $(EXTRA_OBJS)) Makefile
$O/$(TARGET): $(OBJS) $(wildcard $(EXTRA_OBJS)) Makefile
@$(MKPATH) $O
@echo Creating executable: $@
$(Q)$(CXX) $(LDFLAGS) -o $O/$(TARGET) $(OBJS) $(EXTRA_OBJS) $(AS_NEEDED_OFF) $(WHOLE_ARCHIVE_ON) $(LIBS) $(WHOLE_ARCHIVE_OFF) $(OMNETPP_LIBS)

submakedirs: src_dir

.PHONY: all clean cleanall depend msgheaders src
src: src_dir

src_dir:
cd src && $(MAKE) all
.PHONY: all clean cleanall depend msgheaders

.SUFFIXES: .cc

Expand All @@ -109,23 +99,19 @@ $O/%.o: %.cc $(COPTS_FILE)
$(Q)$(MSGC) -s _m.cc $(MSGCOPTS) $?

msgheaders: $(MSGFILES:.msg=_m.h)
$(Q)cd src && $(MAKE) msgheaders

clean:
$(qecho) Cleaning...
$(Q)-rm -rf $O
$(Q)-rm -f DataCenter DataCenter.exe libDataCenter.so libDataCenter.a libDataCenter.dll libDataCenter.dylib
$(Q)-rm -f ./*_m.cc ./*_m.h

-$(Q)cd src && $(MAKE) clean

cleanall: clean
$(Q)-rm -rf $(PROJECT_OUTPUT_DIR)

depend:
$(qecho) Creating dependencies...
$(Q)$(MAKEDEPEND) $(INCLUDE_PATH) -f Makefile -P\$$O/ -- $(MSG_CC_FILES) ./*.cc
$(Q)-cd src && if [ -f Makefile ]; then $(MAKE) depend; fi

# DO NOT DELETE THIS LINE -- make depend depends on it.

Binary file added doc/build_instructions.pdf
Binary file not shown.
Empty file added simulations/__init__.py
Empty file.
52 changes: 38 additions & 14 deletions simulations/configurations/LoadBalancing/demo.py
@@ -1,23 +1,47 @@
#!/usr/bin/env python
import logging
import os
import sys

project_path = "../../../"
bin = os.path.join(project_path, "src/DataCenter")
src_path = os.path.join(project_path, "src")
inet_path = "../../../../inet"
inet_lib = os.path.join(inet_path, "src/inet")
src_paths = [src_path, os.path.join(inet_path, "src"),
os.path.join(inet_path, "examples")]
sys.path.append(os.path.abspath("../../../"))
from simulations.run_scripts import run_scripts
from simulations.common.lib_common import check_file

env = "Cmdenv"
run = 4559
ini_file = "Throughput_vs_OfferedLoad.ini"
config = "MPLoadBalancer"
mlog = logging.getLogger('simulations.configurations.loadbalancing')
logging.basicConfig()

ini_file = check_file('demo.ini')
configs, runs = run_scripts.configs_and_runs(ini_file)


run_cmd = "%s -u %s -l %s -n %s " % (bin, env, inet_lib, ":".join(src_paths))
run_cmd += "-c %s -r %s %s" % (config, run, ini_file)
print run_cmd
# Use the # of CPU cores to determine the number of runs to launch in parallel.
parallel = run_scripts.num_cores()

for config in configs:
mlog.info("ini_file='%s', config='%s'",
os.path.basename(ini_file), config)
run_scripts.batch_run_python(ini_file, config, runs, run_offset=0,
result_dir=None, parallel=parallel,
check_output=True, compress_results=False)


# project_path = "../../../"
# bin = os.path.join(project_path, "src/DataCenter")
# src_path = os.path.join(project_path, "src")
# inet_path = "../../../../inet"
# inet_lib = os.path.join(inet_path, "src/inet")
# src_paths = [src_path, os.path.join(inet_path, "src"),
# os.path.join(inet_path, "examples")]

# env = "Cmdenv"
# run = 4559
# ini_file = "Throughput_vs_OfferedLoad.ini"
# config = "MPLoadBalancer"

# repititions = 1


# run_cmd = "%s -u %s -l %s -n %s " % (bin, env, inet_lib, ":".join(src_paths))
# run_cmd += "-c %s -r %s %s" % (config, run, ini_file)
# print run_cmd

Binary file modified simulations/processing_scripts/bash_scripts.pyc
Binary file not shown.

0 comments on commit 8929147

Please sign in to comment.