Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Parlab
/
burglar
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
60df5744
authored
May 05, 2019
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1
parent
addf5f4d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
57 deletions
+32
-57
client/README
+0
-52
client/burglar.log
+0
-1
client/mpitest.sh
+22
-2
client/test.sh
+10
-2
No files found.
client/README
deleted
100644 → 0
View file @
addf5f4d
####
Dummy palyaers for labs
####
player.h, player.cpp :
* Player's basic class. Implementing the server communication.
main.cpp :
* Implements a simple burglar and cop players.
* They are moving randomly and create log messages in *.log files.
test.sh :
* Test script for the simple players version.
mpimain.cpp :
* Simple MPI communication example.
* The silly policeman moving randomly and shouting to his radio, if
he sees the robber.
* The others can hear this, but they don't know where the robber is.
mptest.sh :
* Test script for the MPI version. Starts a burglar, and starts the
MPI processes.
Compile:
module load mpi
make
Starting the clients:
Futtatas:
Feltetelezzuk, hogy a laborgepen, amin dolgozunk a szervert elinditottuk. (szerver.bat)
A szerver fixen a 15623-as porton hallgat. Ide kell tunnelezni a klinenseket.
Hogy ne legyen portutkozes, az a javaslat hogy mindeki egyedi portot (RABLO_PORT) hasznaljon.
RABLO_PORT=15000+UID, ahol UID az adott felhasznalo UID-je (id -u)
let RABLO_PORT=15000+`id -u`
export RABLO_PORT
A laborgepet es a jatekosokat futtato gepet (pl. ural2) ssh tunnelen keresztuk kapcsoljuk ossze.
(putty:
Session->SSH->Tunnels
X Local ports accept connection from othrer hosts
Source port: RABLO_PORT_ERTEKE
Destination: localhost:15623
X Remote
X Ipv4
Add
)
Ha a javas server fut indithato a test.sh, vagy az mpitest.sh
A *.log-okban lathato a kommunikacio.
client/burglar.log
deleted
100644 → 0
View file @
addf5f4d
./test.sh: line 20: ./main: No such file or directory
client/mpitest.sh
View file @
60df5744
...
@@ -6,12 +6,32 @@ cleanup() {
...
@@ -6,12 +6,32 @@ cleanup() {
trap
"cleanup"
EXIT
trap
"cleanup"
EXIT
# Computes the uniq port number for communication
if
[
!
-x
main
]
;
then
echo
"*** main does not exist or not executable ***"
exit
1
fi
if
[
!
-x
mpimain
]
;
then
echo
"*** mpimain does not exist or not executable ***"
exit
1
fi
if
!
type
mpirun &> /dev/null
;
then
echo
"No mpirun command found"
echo
"Set up the MPI runtime environment first"
exit
1
fi
# Computes the unique port number for communication
# Computes the unique port number for communication
if
[
x
$PORT
=
x
]
;
then
if
[
x
$PORT
=
x
]
;
then
let
PORT
=
15000+
`
id
-u
`
let
PORT
=
15000+
`
id
-u
`
fi
fi
echo
PORT:
$PORT
echo
""
echo
"PORT:
$PORT
Use this as remote port in the tunnel configuration."
echo
""
PORT
=
$PORT
PORT
=
$PORT
HOST
=
localhost
HOST
=
localhost
COPS
=
5
# The number of cops
COPS
=
5
# The number of cops
...
...
client/test.sh
View file @
60df5744
...
@@ -6,12 +6,20 @@ cleanup() {
...
@@ -6,12 +6,20 @@ cleanup() {
trap
"cleanup"
EXIT
trap
"cleanup"
EXIT
# Cumoutes the uniq port number for communication
if
[
!
-x
main
]
;
then
echo
"*** main does not exist or not executable ***"
exit
1
fi
# Computes the unique port number for communication
if
[
x
$PORT
=
x
]
;
then
if
[
x
$PORT
=
x
]
;
then
let
PORT
=
15000+
`
id
-u
`
let
PORT
=
15000+
`
id
-u
`
fi
fi
echo
PORT:
$PORT
echo
""
echo
"PORT:
$PORT
Use this as remote port in the tunnel configuration."
echo
""
PORT
=
$PORT
PORT
=
$PORT
HOST
=
localhost
HOST
=
localhost
COPS
=
5
# The number of cops
COPS
=
5
# The number of cops
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment