Skip to content

Commit

Permalink
added dockerfile for unidad_4 and completed some other stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
SuichiM committed Sep 3, 2020
1 parent 170a323 commit 0ef5393
Show file tree
Hide file tree
Showing 17 changed files with 203 additions and 17 deletions.
30 changes: 30 additions & 0 deletions Dockerfile.haskell_prolog
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:latest

ARG home_dir=/home

ENV WEB_DOCUMENT_ROOT=$home_dir

ENV TERM=xterm\
TZ=America/Argentina/Cordoba\
DEBIAN_FRONTEND=noninteractive

WORKDIR $home_dir

RUN apt-get update

RUN apt-get install -y \
curl\
hugs\
swi-prolog


# Instalando node
RUN curl --silent --location https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install --yes nodejs \
&& apt-get install --yes build-essential


# RUN groupadd -r curso && useradd --no-log-init -r -g curso curso
# USER curso

ENTRYPOINT ["tail", "-f", "/dev/null"]
20 changes: 13 additions & 7 deletions Dockerfile.mpi_openmp
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM ubuntu:latest

RUN groupadd -r curso --gid=999 && useradd -r -g curso -p curso --uid=999 curso
ARG home_dir=/home
ENV WEB_DOCUMENT_ROOT=$home_dir

ARG web_document_root=/home/curso
ENV WEB_DOCUMENT_ROOT=$web_document_root
WORKDIR $home_dir

WORKDIR $web_document_root
ENV TERM=xterm\
TZ=America/Argentina/Cordoba\
DEBIAN_FRONTEND=noninteractive

RUN apt-get --yes -qq update \
&& apt-get --yes -qq upgrade \
RUN apt-get update -y

RUN apt-get install -y \
bzip2 \
cmake \
cpio \
Expand All @@ -26,8 +29,11 @@ RUN apt-get --yes -qq update \
python3-pip \
virtualenv \
wget \
zlib1g-dev \
vim \
htop

# RUN groupadd -r curso && useradd --no-log-init -r -d ${home_dir} -g curso curso
# RUN chmod 777 -R ${home_dir}
# USER curso

ENTRYPOINT ["tail", "-f", "/dev/null"]
10 changes: 4 additions & 6 deletions Dockerfile.pascalfc
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM ubuntu:latest

RUN groupadd -r curso --gid=999 && useradd -r -g curso -p curso --uid=999 curso

ARG web_document_root=/home/curso
ARG web_document_root=/home

ENV WEB_DOCUMENT_ROOT=$web_document_root

WORKDIR $web_document_root

RUN apt-get --yes -qq update \
&& apt-get --yes -qq upgrade
RUN apt-get update -y

COPY /bin/pfc2-0.9.40.x86_64.tar.gz /usr/local/bin

RUN tar -xvf /usr/local/bin/pfc2-0.9.40.x86_64.tar.gz -C /usr/local/bin/

RUN su - curso
# RUN groupadd -r curso && useradd --no-log-init -r -g curso curso
# USER curso

ENTRYPOINT ["tail", "-f", "/dev/null"]
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ services:
context: .
dockerfile: Dockerfile.pascalfc
volumes:
- ./unidad_1:/home/curso
- ./unidad_1:/home
mpi_openmp:
build:
context: .
dockerfile: Dockerfile.mpi_openmp
volumes:
- ./unidad_3:/home/curso
- ./unidad_3:/home
haskell_prolog:
build:
context: .
dockerfile: Dockerfile.haskell_prolog
volumes:
- ./unidad_4:/home
4 changes: 4 additions & 0 deletions unidad_0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ Si siguó las recomendaciones e instalo en linux y con el repositorio. revisar e
en una terminal desde la raiz de este repo ejecutar:

```bash
# para levantar los containers
$ docker-compose up

# para parar los containers
docker-compose stop
```
6 changes: 5 additions & 1 deletion unidad_1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ este proceso genera un archivo con extensión
- `myFile.lst` que contendrá los errores de compilacion si los hubiera.
- `myFile.obj` que es el ejecutable.

## ejecutando los programas
## Ejecutando los programas

Para ejecutar los programas debe correr el siguiente comando:

```sh
pfc2int <myFile.obj>
```

## Escribiendo codigo

[Referencias rapidas](./RESUMEN.MD)
59 changes: 59 additions & 0 deletions unidad_1/RESUMEN.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Referencias Rapidas

Esta es una referencia ultra liviana de los componentes principales de PascalFC debe descartarse como referencia principal para cualquier busqueda profunda referirse a:
- [Manual del Lenguaje](./docs/)
- [Guía de Usuario](./docs/)

# Ciclo de vida de un proceso

![](./img/process_lifecycle.png)

## creación

un proceso se crea con su definicion formal.

```pascal
// sintaxix de la definicion de un proceso
process type <nombre>[argumentos];
begin
secuencia de instrucciones
end;
// ejemplo
process type proceso;
begin
writeln('soy un proceso');
end;
```

## ejecución

un proceso entra en estado ejecutable cuando se hace define una variable y se realiza la invocación de la misma.

```pascal
// programa principal
var
proceso_1 : proceso;
begin
cobegin
proceso_1;
coend;
end;
```

# Semaforos

## Declaracion e Inicializacion

## Utilizacion

# Otras Referencias rapidas

```pascal
// declaracion de un array
// array index_type{index_type} of type
var p: array[1..max] of proc;
```
Binary file added unidad_1/docs/pascal-fc_guiaUsuario.pdf
Binary file not shown.
Binary file added unidad_1/docs/pascal-fc_manualdelenguaje.pdf
Binary file not shown.
Binary file added unidad_1/img/process_lifecycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion unidad_3/mpi/README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ para compilar el archivo fuente `.cpp` debe ejecutar con la opcion `-o` le damos

Para ejecutar los programas es necesario correr:

mpirun -np <nro_tareas> <archivo_executable>
```sh
mpirun -np <nro_tareas> <archivo_executable>
```
Empty file modified unidad_3/mpi/ejercicio_1/README.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions unidad_3/mpi/ejercicio_1/ejercicio_1.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ int main(int argc, char *argv[])
// de codigo despues de "Finalize", es conveniente asegurarnos con una
// condicion si vamos a ejecutar mas codigo (Por ejemplo, con "if(rank==0)".
MPI_Finalize();

return 0;
}
34 changes: 34 additions & 0 deletions unidad_3/openmp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# OpenMP

es un ...

## Componentes del estandar

## Funciones


## Tipos de datos


## Constantes


## compilando los archivos

para compilar el archivo fuente `.cpp` se debe ejecutar el comando `mpicxx`.

debemos usar la opcion `-fopenmp` para indicarle que es un archivo que usa `OpenMP`

con la opcion `-o` le damos el nombre que queremos al ejecutable.

```sh
mpicxx -fopenmp <archivo_fuente.cpp> -o <archivo_ejecutable>
```

## Ejecutando los archivos

Para ejecutar los programas corremos :

```sh
./<nombre_archivo>
```
22 changes: 22 additions & 0 deletions unidad_3/openmp/ejercicio_1/ejercicio_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <omp.h>
#include <iostream>

int main (){

int nthreads;
int thread;
int NuevoValor = 222;

omp_set_num_threads(10);
#pragma omp parallel private(nthreads, thread) firstprivate(NuevoValor)
{

thread = omp_get_thread_num();

nthreads = omp_get_num_threads();

std::cout<<"Hola Mundo soy la hebra ="<< thread <<" de "<<nthreads<<" que somos"<< " Esta es la variable nueva = "<<NuevoValor<<std::endl;

}

}
1 change: 1 addition & 0 deletions unidad_4/javascript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("hola desde nodeJS");
19 changes: 19 additions & 0 deletions unidad_4/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "pylp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SuichiM/PYLP.git"
},
"author": "SuichiM",
"license": "ISC",
"bugs": {
"url": "https://github.com/SuichiM/PYLP/issues"
},
"homepage": "https://github.com/SuichiM/PYLP#readme"
}

0 comments on commit 0ef5393

Please sign in to comment.