Skip to content

Instantly share code, notes, and snippets.

View santiagopuerta's full-sized avatar
😃

Santiago santiagopuerta

😃
View GitHub Profile
@santiagopuerta
santiagopuerta / setup-mysql.sh
Created April 20, 2016 11:04 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/x-web-app-manifest+json \
application/xhtml+xml \
#!/bin/bash #Se fija a 12 el no de threads máximo (tantos como cores en un nodo)
#Se asigna al trabajo el nombre helloomp export OMP_THREAD_LIMIT=12
#PBS -N helloomp echo "No de threads inicial: $OMP_THREAD_LIMIT"
#Se asigna al trabajo la cola ac #Se ejecuta HelloOMP, que está en el directorio en el que se ha ejecutado qsub
#PBS -q ac for ((P=OMP_THREAD_LIMIT;P>0;P=P/2))
#Se imprime información del trabajo usando variables de entorno de PBS do
echo "Id. usuario del trabajo: $PBS_O_LOGNAME" export OMP_NUM_THREADS=$P
echo "Id. del trabajo: $PBS_JOBID" echo -e "\nPara $OMP_NUM_THREADS threads:"
echo "Nombre del trabajo especificado por usuario: $PBS_JOBNAME" $PBS_O_WORKDIR/HelloOMP
echo "Nodo que ejecuta qsub: $PBS_O_HOST" done
Imagen i2(filas/reduccion,columnas/reduccion);
int fil=filas/reduccion;
int col=columnas/reduccion;
int med=0;
int aux=0;
int aux2=0;
int auxi=0;
int itfil=0;
int itcol=0;
cout << "Reduccion del tipo " << reduccion << "x"<< endl;
for(int i=0; i<fil; i+=reduccion){
for(int j=0; j<col; j+=reduccion){
med = valor_pixel(i,j);
for(int f=i; f<i+reduccion; f++){
for(int c=j; c<j+reduccion; c++){
med = med+valor_pixel(f,c);
}
}
med=med/reduccion;
if(cont2!=col){