antecedentes
pgmRT es el principal responsable de la transferencia suave de datos en tiempo real en forma de gráficos.Para ser precisos, una unidad es un nodo y un nodo tiene bordes de entrada y salida y realiza E / S de datos.
Para instalar pgmRT, primero instale litmusRT, liblitmus y boot1.73
paso
Entorno de instalación
Compile e instale litmusRT, liblitmus y boot1.73 de acuerdo con el artículo compile e instale los problemas encontrados en LitmusRT y la instalación y depuración de la biblioteca de aprendizaje de la biblioteca dinámica de gráficos de conocimiento DynGEM.
Copiar archivos de biblioteca
Busque el archivo de encabezado asm / unistd_64_x32.hy cópielo en el directorio / usr / local
Este paso no es necesario, pero si compila mal pgm, debe continuar
(base) root@ubuntu:/home/szc# locate asm/unistd_64_x32.h
(base) root@ubuntu:/home/szc# mkdir /usr/include/asm && chmod 777 /usr/include/asm
(base) root@ubuntu:/home/szc/pgm# cp /usr/src/linux-headers-4.4.0-31-generic/arch/x86/include/generated/asm/unistd_64_x32.h /usr/include/asm
(base) root@ubuntu:/home/szc# export LD_LIBRARY_PATH=/usr/local/lib
Clonar el código fuente
Clone el código fuente de pgm y córtelo en el directorio
(base) root@ubuntu:/home/szc# git clone https://github.com/GElliott/pgm.git
(base) root@ubuntu:/home/szc# cd pgm
Modificar el archivo fuente
Modificar algunos archivos fuente
Makefile
Habilitar tornasol, especificar ruta liblitmus
# LIBLITMUS -- where to find liblitmus?
LIBLITMUS ?= /home/szc/litmus/liblitmus/
.....
# Comment out 'flags-litmus' to disable Litmus support 取消注释
flags-litmus = -D_USE_LITMUS
herramientas / pgmrt.h
Algunas cosas no definidas se utilizan en el código. Después de comunicarse con el autor, coméntelo temporalmente
La primera son estas dos macrodefiniciones y su uso. Ahora no me importa si se ejecuta correctamente, y lo diremos después de que se pase la compilación.
/*#define litmus_pgm_wait(statements) \
enter_pgm_wait(); \
statements \
exit_pgm_wait();*/
// signalling task's priority is unconditionally boosted,
// so just enter a non-preemptive section.
/*#define litmus_pgm_complete(statements) \
enter_pgm_send(); \
statements \
exit_pgm_send();*/
.....
// litmus_pgm_wait(ret = pgm_wait(cfg.node););
....
// litmus_pgm_complete(CheckError(pgm_complete(cfg.node)););
Luego están estos campos, que no están definidos en absoluto en la estructura rt_task de tornasol-4.9.30
// param.phase = cfg.phase_ns;
....
// param.split = cfg.split_factor;
.....
/* if (isSrc && isSink)
param.pgm_type = PGM_SRC_SINK;
else if(isSrc)
param.pgm_type = PGM_SRC;
else if(isSink)
param.pgm_type = PGM_SINK;
else
param.pgm_type = PGM_INTERNAL;
param.pgm_expected_etoe = cfg.expected_etoe;*/
Finalmente, las siguientes macros se mueven fuera del juicio de macros de #ifdef _USE_LITMUS, porque se usan en el código y estos campos no están definidos en el archivo de encabezado litmus.h.
#define s2ns(s) ((s)*1000000000LL)
#define s2us(s) ((s)*1000000LL)
#define s2ms(s) ((s)*1000LL)
#define ms2ns(ms) ((ms)*1000000LL)
#define ms2us(ms) ((ms)*1000LL)
#define us2ns(us) ((us)*1000LL)
#define ns2s(ns) ((ns)/1000000000LL)
#define ns2ms(ns) ((ns)/1000000LL)
#define ns2us(ns) ((ns)/1000LL)
#define us2ms(us) ((us)/1000LL)
#define us2s(us) ((us)/1000000LL)
#define ms2s(ms) ((ms)/1000LL)
src / pgm.cpp
Eliminar nothrow en el siguiente código
gGraphs = new (nothrow) struct pgm_graph[PGM_MAX_GRAPHS];
Compilar y probar
(base) root@ubuntu:/home/szc/pgm# make lib all
Luego, en el directorio actual, habrá algunos archivos ejecutables
(base) root@ubuntu:/home/szc/pgm# ll
total 1984
drwxrwxrwx 6 root root 4096 Oct 15 19:20 ./
drwxr-xr-x 19 szc szc 4096 Oct 15 18:37 ../
-rwxr-xr-x 1 root root 37088 Oct 15 19:20 ancestortest*
-rw-r--r-- 1 root root 86 Oct 15 19:20 ancestortest.d
-rw-r--r-- 1 root root 18432 Oct 15 19:20 ancestortest.o
-rwxr-xr-x 1 root root 34448 Oct 15 19:20 backedgetest*
-rw-r--r-- 1 root root 86 Oct 15 19:20 backedgetest.d
-rw-r--r-- 1 root root 13768 Oct 15 19:20 backedgetest.o
-rwxr-xr-x 1 root root 37816 Oct 15 19:20 basictest*
-rw-r--r-- 1 root root 77 Oct 15 19:20 basictest.d
-rw-r--r-- 1 root root 19952 Oct 15 19:20 basictest.o
-rwxr-xr-x 1 root root 33760 Oct 15 19:20 cvtest*
-rw-r--r-- 1 root root 68 Oct 15 19:20 cvtest.d
-rw-r--r-- 1 root root 11488 Oct 15 19:20 cvtest.o
-rwxr-xr-x 1 root root 38624 Oct 15 19:20 datapassingtest*
-rw-r--r-- 1 root root 98 Oct 15 19:20 datapassingtest.d
-rw-r--r-- 1 root root 16768 Oct 15 19:20 datapassingtest.o
-rwxr-xr-x 1 root root 39088 Oct 15 19:20 depthtest*
-rw-r--r-- 1 root root 77 Oct 15 19:20 depthtest.d
-rw-r--r-- 1 root root 27216 Oct 15 19:20 depthtest.o
-rwxr-xr-x 1 root root 33040 Oct 15 19:20 dottest*
-rw-r--r-- 1 root root 71 Oct 15 19:20 dottest.d
-rw-r--r-- 1 root root 16496 Oct 15 19:20 dottest.o
drwxrwxrwx 8 root root 4096 Oct 15 18:23 .git/
-rwxrwxrwx 1 root root 222 Oct 15 18:23 .gitignore*
drwxrwxrwx 2 root root 4096 Oct 15 18:23 include/
-rwxr-xr-x 1 root root 151512 Oct 15 19:20 libpgm.so*
-rwxrwxrwx 1 root root 6188 Oct 15 18:34 Makefile*
-rw-r--r-- 1 root root 502 Oct 15 19:20 pgm.d
-rw-r--r-- 1 root root 196984 Oct 15 19:20 pgm.o
-rwxr-xr-x 1 root root 274584 Oct 15 19:20 pgmrt*
-rw-r--r-- 1 root root 396 Oct 15 19:20 pgmrt.d
-rw-r--r-- 1 root root 426528 Oct 15 19:20 pgmrt.o
-rwxr-xr-x 1 root root 116008 Oct 15 19:20 pingpong*
-rw-r--r-- 1 root root 43 Oct 15 19:20 pingpong.d
-rw-r--r-- 1 root root 238408 Oct 15 19:20 pingpong.o
-rwxrwxrwx 1 root root 4224 Oct 15 18:23 README.md*
-rwxr-xr-x 1 root root 34096 Oct 15 19:20 ringtest*
-rw-r--r-- 1 root root 74 Oct 15 19:20 ringtest.d
-rw-r--r-- 1 root root 12440 Oct 15 19:20 ringtest.o
-rwxr-xr-x 1 root root 33768 Oct 15 19:20 sockstreamtest*
-rw-r--r-- 1 root root 92 Oct 15 19:20 sockstreamtest.d
-rw-r--r-- 1 root root 11592 Oct 15 19:20 sockstreamtest.o
drwxrwxrwx 2 root root 4096 Oct 15 18:23 src/
drwxrwxrwx 2 root root 4096 Oct 15 18:23 tools/
(base) root@ubuntu:/home/szc/pgm#
Ejecute una o dos de las pruebas
Si se informa un error que indica que no se puede encontrar la biblioteca pgm, coloque el directorio pgm actual en la variable LD_LIBRARY_PATH (porque libpgm.so acaba de ser compilado en el directorio pgm por nosotros)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/szc/pgm/
Conclusión
Esta biblioteca es un requisito previo para ejecutar un experimento de CPU y GPU basado en cerdo basado en RTSS https://github.com/Yougmark/opencv.git hog , actualizaré mis notas sobre la reproducción y el análisis de este experimento en el futuro