-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOmnet_Generations.txt
155 lines (115 loc) · 5.65 KB
/
Omnet_Generations.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
C++ version used by Omnet
//////////////////////////
echo "-std=c++20" >> configure.user
echo "-std=c++20" >> $OMNET_DIR/configure.user
to use the fmt package (e.g., #include <fmt/core.h>): apt-get innstall -y libfmt-dev
Omnet Make:
///////////////////////////
c; opp_makemake -u cmdenv -f -deep; make
where -u Cmdenv dismisses the GUI
The resulting exe file may be written to /out/clang-release. Also, make may gengerate in the current dir an additional exe, which is merely a hard-link to the .exe file in /out/clang-release.
The -deep flag means: search for source files also in all sub-dirs.
Omnet Run:
///////////////////////////
c; Distributed_SFC_migration.exe -f omnetpp.ini -u Cmdenv
When running with Cmdenv, one should change in omnetpp.ini to:
[General]
cmdenv-config-name = Dummy
Run, while including sub-dirs:
c; Distributed_SFC_migration.exe -u Cmdenv -f & C:/omnetpp-5.7/ofanan/Distributed_SFC_migration/omnetpp.ini
Git:
///////////////////////////
git push -f https://github.com/ofanan/Distributed_SFC_migration.git HEAD:master
In Paolo's server:
///////////////////////////
./configure WITH_TKENV=no WITH_QTEVN=no WITH_OSG=no
Push to Paolo's server:
scp c:/omnetpp-5.7/ofanan/CmdenvChecker/*.ini itamar@130.192.9.117:/home/itamar/omnetpp-5.7/CmdenvChecker
Pull from Paolo's server:
scp itamar@130.192.9.117:/home/itamar/omnetpp-5.7/CmdenvChecker/CmdenvChecker c:/omnetpp-5.7/ofanan/CmdenvChecker/
Compiling in Paolo's server:
c; opp_makemake -u cmdenv -f -deep; make
c; ./CmdenvChecker -u Cmdenv -f omnetpp.ini
Building container
///////////////////
First, have to build (and locally check) a docker container.
When this works, convert the docker container to a singularity container.
Docker
///////////////////
within /home/ofanan/containers, run:
docker build . -t omnetpp-5.6.2
For the gui version, within /home/ofanan/containers/containuers_gui, run:
docker build . -t omnetpp-5.6.2-gui
However, this results in a docker for which trying to run:
> omnetpp
results in "ide is not installed" error. Indeed no subdirectory of omnetpp-5.6.2 is found.
May try to solve it by installing it in ubuntu u18.04, as requested (my ubunto is 20.04).
docker login
docker tag omnetpp-5.6.2 ofanan/omnetpp-5.6.2
docker push ofanan/omnetpp-5.6.2
docker push ofanan/omnetpp-5.6.2-gui
docker run -it ofanan/omnetpp-5.6.2-gui
// -i: interactively. -t: terminal
For getting a shell, may have to run:
docker run -it ofanan/omnetpp-5.6.2 /bin/sh
docker run --rm -it ofanan/omnetpp-5.6.2 /bin/sh # --rm deletes the container upon exiting it
find container's id:
docker ps
Run a command within a running container:
docker exec <container-id> cat /data.txt
docker stop <container-id>
To solve annoying "perl" problem within singularity shell:
LANG = C
scp /containers/omnetpp-5.6.2.img icohen@legionlogin.polito.it:/home/icohen/dist_SFC_migration
sudo singularity run -B /home/ofanan/omnetpp-5.6.2/ofanan/Distributed_SFC_migration/ omnetpp-5.6.2.img
Cleaning unused images
docker image prune // remove ALL currently not-running containers.
Or...
docker images
docker rmi -f <docker_id>
SINGULARITY
////////////////////////
Need to use exactly the same version as in the cloud. Polito's HPC uses singularity-3.2.1.
Need to run singularity using my own user (NOT ROOT), but by using sudo (when called locally; not on the cloud).
Given my docker image ofanan/omnetpp-5.6.2 found in dockerHub, the command to generate singularity from it is:
sudo singularity build omnetpp-5.6.2.img docker://ofanan/omnetpp-5.6.2
To build from a .def (".recipe") file:
sudo singularity build omnet-5.6.2.img my_def_file.def
Can check the container by:
sudo singularity shell omnetpp.img
For binding a directory (may be helpful if calling sinularity as root), use
> singularity shell -B /home/ofanan omnetpp.img
Can't find a source file at "/build/glibc-SzIz7B/glibc-2.31/stdio-common/snprintf.c"
Locate the file or edit the source lookup path to include its location.
ln: failed to create hard link 'Distributed_SFC_migration' => 'out/clang-release//Distributed_SFC_migration': Operation not permitted
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
A mitigation: scp the exe file to HPC. However, this requires scp-ing the exe upon each change in the code.
Need to run the container from /Distributed_SFC_migration, while the omnet.img file is found 1 dir up, e.g.:
[Distributed_SFC_migration]icohen@legionlogin$ singularity exec ../omnetpp-5.6.2.img bash -c './Tree_runner.sh'
However, this still doesn't solve the prob'.
-- Found out the can "make" the file locally, and then git it to the dest. The size of the exe file is only 320K.
Prob' of not updated cpu cap at leaf:
The header is not compiled again each time an exe is created (unless deleting the old exe).
A possible sol: declare nonAugmentedCpuAtLeaf in MyConfig.h, but set it in MyConfig.cc:
scp Distributed_SFC_migration . icohen@legionlogin.polito.it:/home/icohen/dist_SFC_migration/Distributed_SFC_migration
scp icohen@legionlogin.polito.it:/home/icohen/dist_SFC_migration/Distributed_SFC_migration/res/poa_files/Monaco_0730_0830_1secs_Telecom.poa res/poa_files
normalized=1.3, abs=1092
normalized=1.4, abs=1176
normalized=1.5, abs=1260
normalized=1.5797619047619047, abs=1327
normalized=1.582142857142857, abs=1329
normalized=1.6, abs=1344
normalized=1.7, abs=1428
normalized=1.8, abs=1512
normalized=1.9, abs=1596
normalized=2.0, abs=1680
normalized=2.1, abs=1764
normalized=2.2, abs=1848
normalized=2.3, abs=1932
normalized=2.4, abs=2016
normalized=2.5, abs=2100
normalized=2.6, abs=2184
normalized=2.7, abs=2268
normalized=2.8, abs=2352
normalized=2.9, abs=2436
normalized=3.0, abs=2520