Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hpc-team/HPCasCode
  • chines/ansible_cluster_in_a_box
2 results
Show changes
Showing
with 296 additions and 0 deletions
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#include <stdio.h>
#include <gmp.h>
#include <mpfr.h>
int main (void)
{
unsigned int i;
mpfr_t s, t, u;
mpfr_init2 (t, 200);
mpfr_set_d (t, 1.0, MPFR_RNDD);
mpfr_init2 (s, 200);
mpfr_set_d (s, 1.0, MPFR_RNDD);
mpfr_init2 (u, 200);
for (i = 1; i <= 100; i++)
{
mpfr_mul_ui (t, t, i, MPFR_RNDU);
mpfr_set_d (u, 1.0, MPFR_RNDD);
mpfr_div (u, u, t, MPFR_RNDD);
mpfr_add (s, s, u, MPFR_RNDD);
}
printf ("Sum is ");
mpfr_out_str (stdout, 10, 0, s, MPFR_RNDD);
putchar ('\n');
mpfr_clear (s);
mpfr_clear (t);
mpfr_clear (u);
mpfr_free_cache ();
return 0;
}
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
#https://github.com/xianyi/OpenBLAS/wiki/User-Manual#code-examples
gcc test_cblas_dgemm.c -o test_cblas_open $CPPFLAGS $LDFLAGS -lopenblas
gcc -o time_dgemm time_dgemm.c $CPPFLAGS $LDFLAGS -lopenblas
./test_cblas_open && ./time_dgemm 10 10 10
EXITCODE=$?
rm -f time_dgemm timeDGEMM.txt test_cblas_open
[ $EXITCODE == '10' ]
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#include <cblas.h>
#include <stdio.h>
void main()
{
int i=0;
double A[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double B[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double C[9] = {.5,.5,.5,.5,.5,.5,.5,.5,.5};
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,3,3,2,1,A, 3, B, 3,2,C,3);
for(i=0; i<9; i++)
printf("%lf ", C[i]);
printf("\n");
}
#include "stdio.h"
#include "stdlib.h"
#include "sys/time.h"
#include "time.h"
extern void dgemm_(char*, char*, int*, int*,int*, double*, double*, int*, double*, int*, double*, double*, int*);
int main(int argc, char* argv[])
{
int i;
printf("test!\n");
if(argc<4){
printf("Input Error\n");
return 1;
}
int m = atoi(argv[1]);
int n = atoi(argv[2]);
int k = atoi(argv[3]);
int sizeofa = m * k;
int sizeofb = k * n;
int sizeofc = m * n;
char ta = 'N';
char tb = 'N';
double alpha = 1.2;
double beta = 0.001;
struct timeval start,finish;
double duration;
double* A = (double*)malloc(sizeof(double) * sizeofa);
double* B = (double*)malloc(sizeof(double) * sizeofb);
double* C = (double*)malloc(sizeof(double) * sizeofc);
srand((unsigned)time(NULL));
for (i=0; i<sizeofa; i++)
A[i] = i%3+1;//(rand()%100)/10.0;
for (i=0; i<sizeofb; i++)
B[i] = i%3+1;//(rand()%100)/10.0;
for (i=0; i<sizeofc; i++)
C[i] = i%3+1;//(rand()%100)/10.0;
//#if 0
printf("m=%d,n=%d,k=%d,alpha=%lf,beta=%lf,sizeofc=%d\n",m,n,k,alpha,beta,sizeofc);
gettimeofday(&start, NULL);
dgemm_(&ta, &tb, &m, &n, &k, &alpha, A, &m, B, &k, &beta, C, &m);
gettimeofday(&finish, NULL);
duration = ((double)(finish.tv_sec-start.tv_sec)*1000000 + (double)(finish.tv_usec-start.tv_usec)) / 1000000;
double gflops = 2.0 * m *n*k;
gflops = gflops/duration*1.0e-6;
FILE *fp;
fp = fopen("timeDGEMM.txt", "a");
fprintf(fp, "%dx%dx%d\t%lf s\t%lf MFLOPS\n", m, n, k, duration, gflops);
fclose(fp);
free(A);
free(B);
free(C);
return 0;
}
#!/bin/bash
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/usr/bin/env python
import sys
import os
#!/usr/bin/env python
import torch
print(torch.__version__)
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done
#!/usr/bin/env python
import tensorflow as tf
print(tf.__version__)
#!/bin/bash
vncconfig --version
vncpasswd --version
#!/bin/bash
name=$( realpath $0 | xargs dirname | xargs basename )
ver=${1:-"default"}
bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p")
NAME_EXEC_EXIST=false
for bin in $bin_dirs; do
for i in $(find $bin -maxdepth 1 -executable -type f ); do
if [[ $(basename $i) == $name ]]; then
$i --version;
exit $?
fi
done
done