Skip to content

Commit 08caee4

Browse files
authored
Merge pull request #58 from ComputationalRadiationPhysics/dev
Merging lasting changes about versioning and splitting server and library code
2 parents 93335ff + dcf4a0f commit 08caee4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+727
-261
lines changed

CMakeLists.txt

Lines changed: 0 additions & 111 deletions
This file was deleted.

INSTALL.md

Lines changed: 104 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -89,45 +89,6 @@ be built yourself nevertheless or the distribution versions are outdated.
8989
`-DBoost_DIR=$BOOST/install`, where `$BOOST` is
9090
the path of the boost_1_56_0 directory.
9191

92-
### Requirements for the server only
93-
94-
* __libwebsockets__ for the connection between server and an HTML5 client.
95-
It is in steady development and the most recent version should be used:
96-
* _From Source_:
97-
* `git clone https://github.com/warmcat/libwebsockets.git`
98-
* `cd libwebsockets`
99-
* `mkdir build`
100-
* With admin rights and no other version of libwebsockets installed:
101-
* `cd build`
102-
* `cmake ..`
103-
* `cmake ..` may fail if OpenSSL is not available. ISAAC itself does
104-
not support HTTPS connections at the moment anyway, thus it can be
105-
disabled with: `cmake -DLWS_WITH_SSL=OFF ..`
106-
* `make`
107-
* `sudo make install`
108-
* Otherwise:
109-
* `mkdir install`
110-
* `cd build`
111-
* `cmake -DCMAKE_INSTALL_PREFIX=../install ..`
112-
* `cmake -DCMAKE_INSTALL_PREFIX=../install ..` may fail if OpenSSL
113-
is not available. ISAAC itself does not support HTTPS connections at
114-
the moment anyway, thus it can be disabled with:
115-
`cmake -DLWS_WITH_SSL=OFF -DCMAKE_INSTALL_PREFIX=../install ..`
116-
* `make install`
117-
* Now a local version of libwebsockets is installed in the install
118-
directory in the libwebsockets root folder. Later while compiling the
119-
ISAAC server using libwebsockets add
120-
`-DLibwebsockets_DIR=$LIBWEBSOCKETS/install/lib/cmake/libwebsockets`, where
121-
`$LIBWEBSOCKETS` is the root folder of the libwebsockets source (the directory
122-
`git clone …` created).
123-
* __gStreamer__ is only needed, if streaming over RTP or the Twitch plugin shall
124-
be used. It should be possible to build gStreamer yourself, but it
125-
is strongly adviced - even from the gStreamer team themself - to use
126-
the prebuilt version of your distribution. The HML5 Client can show
127-
streams of a server without gStreamer.
128-
* _Debian/Ubuntu_:
129-
* `sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base0.10-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev`
130-
13192
### Requirements for the in situ library and the examples using it
13293

13394
The ISAACConfig.cmake searches for these requirements. See
@@ -202,23 +163,96 @@ The ISAACConfig.cmake searches for these requirements. See
202163
MPI (including the ISAAC examples) add `$MPI/install` to the
203164
CMake variable `CMAKE_MODULE_PATH` to use this version.
204165

166+
### Requirements for the server only
167+
168+
* __libwebsockets__ for the connection between server and an HTML5 client.
169+
It is in steady development and the most recent version should be used:
170+
* _From Source_:
171+
* `git clone https://github.com/warmcat/libwebsockets.git`
172+
* `cd libwebsockets`
173+
* `mkdir build`
174+
* With admin rights and no other version of libwebsockets installed:
175+
* `cd build`
176+
* `cmake ..`
177+
* `cmake ..` may fail if OpenSSL is not available. ISAAC itself does
178+
not support HTTPS connections at the moment anyway, thus it can be
179+
disabled with: `cmake -DLWS_WITH_SSL=OFF ..`
180+
* `make`
181+
* `sudo make install`
182+
* Otherwise:
183+
* `mkdir install`
184+
* `cd build`
185+
* `cmake -DCMAKE_INSTALL_PREFIX=../install ..`
186+
* `cmake -DCMAKE_INSTALL_PREFIX=../install ..` may fail if OpenSSL
187+
is not available. ISAAC itself does not support HTTPS connections at
188+
the moment anyway, thus it can be disabled with:
189+
`cmake -DLWS_WITH_SSL=OFF -DCMAKE_INSTALL_PREFIX=../install ..`
190+
* `make install`
191+
* Now a local version of libwebsockets is installed in the install
192+
directory in the libwebsockets root folder. Later while compiling the
193+
ISAAC server using libwebsockets add
194+
`-DLibwebsockets_DIR=$LIBWEBSOCKETS/install/lib/cmake/libwebsockets`, where
195+
`$LIBWEBSOCKETS` is the root folder of the libwebsockets source (the directory
196+
`git clone …` created).
197+
* __gStreamer__ is only needed, if streaming over RTP or the Twitch plugin shall
198+
be used. It should be possible to build gStreamer yourself, but it
199+
is strongly adviced - even from the gStreamer team themself - to use
200+
the prebuilt version of your distribution. The HML5 Client can show
201+
streams of a server without gStreamer.
202+
* _Debian/Ubuntu_:
203+
* `sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base0.10-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev`
204+
205205
Building
206206
--------
207207

208-
### The server
208+
### Installing the library
209209

210-
The server uses CMake. Best practice is to create a new directory (like
211-
`build`) in the isaac root directory and change to it:
210+
To install the isaac library to use it in your project
211+
go to directory `lib` inside the isaac root folder, create a folder like
212+
`build` and do the classic cmake magic:
212213

213214
* `git clone https://github.com/ComputationalRadiationPhysics/isaac.git`
214215
* `cd isaac`
216+
* `cd lib`
217+
* `mkdir build`
218+
* `cd build`
219+
* `cmake ..`
220+
* (`sudo`) ` make install`
221+
222+
You don't need to call `make` before `make install` as the template library
223+
does not need to be built until compiling the using application.
224+
225+
### The example
226+
227+
The building of the examples works similar, but the root directory of
228+
the examples is the folder `example`, so after changing directory to
229+
isaac (`cd isaac`) do:
230+
231+
* `cd example`
232+
* `mkdir build`
233+
* `cd build`
234+
* `cmake ..`
235+
* Don't forget the maybe needed `-DLIB_DIR=…` parameters
236+
needed for local installed libraries. E.g.
237+
`cmake -DIceT_DIR=$ICET/install/lib ..`
238+
* `make`
239+
240+
Afterwards you get the executables `example_cuda`, `example_alpaka` or both.
241+
For running these examples you need a running isaac server.
242+
243+
### The server
244+
245+
The server resides in the direcoty `server` and also uses CMake:
246+
247+
* `cd isaac`
248+
* `cd server`
215249
* `mkdir build`
216250
* `cd build`
217251
* `cmake ..`
218252
* Don't forget the maybe needed `-DLIB_DIR=…` parameters
219253
needed for local installed libraries. E.g.
220254
`cmake -DLibwebsockets_DIR=$LIBWEBSOCKETS/install/lib/cmake/libwebsockets ..`
221-
* There are some options to (de)activate features of ISAAC if they are not needed
255+
* There are some options to (de)activate features of the server if they are not needed
222256
or not available on the system (like Gstreamer), which you can change with
223257
theese lines before `..` (in `cmake ..`) or afterwards with `ccmake` or `cmake-gui`:
224258
* `-DISAAC_GST=OFF` → Deactivates GStreamer.
@@ -232,7 +266,10 @@ The server uses CMake. Best practice is to create a new directory (like
232266
* `-DISAAC_ALPAKA=ON` → Activates ALPAKA. The used accelerator of Alpaka can be
233267
changed inside the file `example.cpp`. At default OpenMP version 2 is used as
234268
accelerator. At least CUDA or Alpaka need to be activated.
235-
269+
* `-DISAAC_INSTALL_LIBRARY=OFF` → Does not install the library files while installing
270+
the server. This may be wanted if library and server are not used on the same system.
271+
* `-DISAAC_BUILD_SERVER=OFF` → Does not build nor install the server at all. Use this,
272+
if you want to install the library on a system, but not the server itself.
236273
* `make`
237274

238275
If you want to install the server type
@@ -245,29 +282,13 @@ Change the installation directory with adding
245282

246283
in the initial `cmake ..`
247284

248-
However, ISAAC doesn't need to be installed and can also directly be called with
285+
However, the server doesn't need to be installed and can also directly be called with
249286

250287
* `./isaac`
251288

252289
For more informations about parameters use `./isaac --help` or have
253290
a look in the __[server documentation](http://computationalradiationphysics.github.io/isaac/doc/server/index.html)__.
254291

255-
### The example
256-
257-
The building of the examples works similar, but the root directory of
258-
the examples is the folder `example`, so after changing directory to
259-
isaac (`cd isaac`) do:
260-
261-
* `cd example`
262-
* `mkdir build`
263-
* `cd build`
264-
* `cmake ..` (Don't forget the maybe needed `-DLIB_DIR=…` parameters
265-
needed for local installed libraries. E.g.
266-
`cmake -DIceT_DIR=$ICET/install/lib ..`)
267-
* `make`
268-
269-
Afterwards you get the executables `example_cuda`, `example_alpaka` or both.
270-
271292
### Testing
272293

273294
To test the server and an example, just start the server with `./isaac`,
@@ -278,6 +299,28 @@ observable and steerable. You can run multiple instances of the example with
278299
`mpirun -c N ./example_KIND` with the number of instances `N` and `KIND`
279300
being `cuda` or `alpaka`. To exit the example, use the client or ctrl+C.
280301

302+
### Versions
303+
304+
ISAAC has three different more or less independent (!) version strings.
305+
The server and the library both have versions consisting of the
306+
307+
* major version number which is increased if the API compatibility is
308+
broken to older versions,
309+
* minor version number, which indicates new features, but does not break
310+
code not using these new features, and
311+
* patch version number, which is mostly for small bug fixes, but does not
312+
change much about the behaviour.
313+
314+
These version numbers are important if you want to use the ISAAC library
315+
in your application or you want to extend the server with your own
316+
meta data or image connector.
317+
318+
The last version string of isaac, the protocol version number, does only
319+
consists of two version numbers: major and minor. The major protocol
320+
version number must be the same for server and library. The minor version
321+
number my differ, but in that case not all features of the protocol may
322+
be used.
323+
281324

282325
How to use in an own application
283326
--------------------------------

documentation/tunnel_putty1.png

-30.3 KB
Binary file not shown.

documentation/tunnel_putty2.png

-58.3 KB
Binary file not shown.

documentation/tunnel_putty3.png

-7.71 KB
Binary file not shown.

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ISAAC_DIR})
99
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../alpaka/" CACHE STRING "The location of the alpaka library")
1010
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ALPAKA_ROOT}")
1111

12-
find_package(ISAAC 0.1.0 REQUIRED)
12+
find_package(ISAAC 1.1.0 REQUIRED)
1313

1414
set(ISAAC_DEFINITIONS ${ISAAC_DEFINITIONS} "-DISAAC_MAX_FUNCTORS=3")
1515
set(ISAAC_DEFINITIONS ${ISAAC_DEFINITIONS} "-DISAAC_FUNCTOR_POW_ENABLED=0")

example/example.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ int main(int argc, char **argv)
195195
DevHost devHost (alpaka::pltf::getDevByIdx<PltfHost>(0u));
196196
Stream stream (devAcc);
197197

198-
const alpaka::Vec<SimDim, size_t> global_size(d[0]*VOLUME_X,d[1]*VOLUME_Y,d[2]*VOLUME_Z);
199-
const alpaka::Vec<SimDim, size_t> local_size(size_t(VOLUME_X),size_t(VOLUME_Y),size_t(VOLUME_Z));
200-
const alpaka::Vec<DatDim, size_t> data_size(size_t(VOLUME_X) * size_t(VOLUME_Y) * size_t(VOLUME_Z));
201-
const alpaka::Vec<SimDim, size_t> position(p[0]*VOLUME_X,p[1]*VOLUME_Y,p[2]*VOLUME_Z);
198+
const alpaka::vec::Vec<SimDim, size_t> global_size(d[0]*VOLUME_X,d[1]*VOLUME_Y,d[2]*VOLUME_Z);
199+
const alpaka::vec::Vec<SimDim, size_t> local_size(size_t(VOLUME_X),size_t(VOLUME_Y),size_t(VOLUME_Z));
200+
const alpaka::vec::Vec<DatDim, size_t> data_size(size_t(VOLUME_X) * size_t(VOLUME_Y) * size_t(VOLUME_Z));
201+
const alpaka::vec::Vec<SimDim, size_t> position(p[0]*VOLUME_X,p[1]*VOLUME_Y,p[2]*VOLUME_Z);
202202
#else //CUDA
203203
//////////////////////////////////
204204
// Cuda specific initialization //
@@ -299,7 +299,7 @@ int main(int argc, char **argv)
299299
SimDim, //Dimension of the Simulation. In this case: 3D
300300
SourceList, //The boost::fusion list of Source Types
301301
#if ISAAC_ALPAKA == 1
302-
alpaka::Vec<SimDim, size_t>, //Type of the 3D vectors used later
302+
alpaka::vec::Vec<SimDim, size_t>, //Type of the 3D vectors used later
303303
#else //CUDA
304304
std::vector<size_t>, //Type of the 3D vectors used later
305305
#endif

example/example_details.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void update_data(
6767
alpaka::mem::view::getPtrNative(hostBuffer1)[pos][2] = intensity;
6868
alpaka::mem::view::getPtrNative(hostBuffer2)[pos] = (2.0f - l)*(2.0f - l) / 4.0f;
6969
}
70-
const alpaka::Vec<alpaka::dim::DimInt<1>, size_t> data_size(size_t(local_size[0]) * size_t(local_size[1]) * size_t(local_size[2]));
70+
const alpaka::vec::Vec<alpaka::dim::DimInt<1>, size_t> data_size(size_t(local_size[0]) * size_t(local_size[1]) * size_t(local_size[2]));
7171
alpaka::mem::view::copy(stream, deviceBuffer1, hostBuffer1, data_size);
7272
alpaka::mem::view::copy(stream, deviceBuffer2, hostBuffer2, data_size);
7373
#else
@@ -254,7 +254,7 @@ void read_vtk_to_memory(
254254
}
255255

256256
#if ISAAC_ALPAKA == 1
257-
const alpaka::Vec<alpaka::dim::DimInt<1>, size_t> data_size(size_t(local_size[0]) * size_t(local_size[1]) * size_t(local_size[2]));
257+
const alpaka::vec::Vec<alpaka::dim::DimInt<1>, size_t> data_size(size_t(local_size[0]) * size_t(local_size[1]) * size_t(local_size[2]));
258258
alpaka::mem::view::copy(stream, deviceBuffer2, hostBuffer2, data_size);
259259
#else
260260
cudaMemcpy(deviceBuffer2, hostBuffer2, sizeof(float)*prod, cudaMemcpyHostToDevice);

0 commit comments

Comments
 (0)