Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3eb8a86a authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Remove lapacke timing

parent f5e4033f
No related branches found
No related tags found
1 merge request!86Integrate dataflush in QR/LQ algorithms
...@@ -229,33 +229,6 @@ endforeach() ...@@ -229,33 +229,6 @@ endforeach()
#-------- Tests --------- #-------- Tests ---------
include(CTestLists.cmake) include(CTestLists.cmake)
# Add BLAS/LAPACK timings
set(ZSRC_LAPACKE
time_zgeqrf_lapacke.c
)
precisions_rules_py(TIMINGS_LAPACKE "${ZSRC_LAPACKE}"
PRECISIONS "${CHAMELEON_PRECISION}")
foreach(_timing ${TIMINGS_LAPACKE})
get_filename_component(_name_exe ${_timing} NAME_WE)
add_executable(${_name_exe} ${_timing})
add_dependencies(${_name_exe} timing_include)
set_property(TARGET ${_name_exe} PROPERTY LINKER_LANGUAGE Fortran)
target_compile_definitions(${_name_exe} PRIVATE TIMING_LAPACKE)
target_link_libraries(${_name_exe}
coreblas
${LAPACKE_LIBRARIES}
${TMG_LIBRARIES}
${CBLAS_LIBRARIES}
${LAPACK_MT_LIBRARIES}
${BLAS_MT_LIBRARIES}
${EXTRA_LIBRARIES}
)
install(TARGETS ${_name_exe}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/chameleon/timing)
endforeach()
### ###
### END CMakeLists.txt ### END CMakeLists.txt
### ###
...@@ -69,6 +69,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_) ...@@ -69,6 +69,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
llvl = iparam[IPARAM_LOWLVL_TREE]; llvl = iparam[IPARAM_LOWLVL_TREE];
qr_a = iparam[IPARAM_RHBLK]; qr_a = iparam[IPARAM_RHBLK];
domino = iparam[IPARAM_QR_DOMINO]; domino = iparam[IPARAM_QR_DOMINO];
libhqr_init_hqr( &qrtree, libhqr_init_hqr( &qrtree,
( M >= N ) ? LIBHQR_QR : LIBHQR_LQ, ( M >= N ) ? LIBHQR_QR : LIBHQR_LQ,
&matrix, llvl, hlvl, qr_a, P, domino, 0); &matrix, llvl, hlvl, qr_a, P, domino, 0);
......
...@@ -73,6 +73,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_) ...@@ -73,6 +73,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
llvl = iparam[IPARAM_LOWLVL_TREE]; llvl = iparam[IPARAM_LOWLVL_TREE];
qr_a = iparam[IPARAM_RHBLK]; qr_a = iparam[IPARAM_RHBLK];
domino = iparam[IPARAM_QR_DOMINO]; domino = iparam[IPARAM_QR_DOMINO];
libhqr_init_hqr( &qrtree, libhqr_init_hqr( &qrtree,
( M >= N ) ? LIBHQR_QR : LIBHQR_LQ, ( M >= N ) ? LIBHQR_QR : LIBHQR_LQ,
&matrix, llvl, hlvl, qr_a, P, domino, 0); &matrix, llvl, hlvl, qr_a, P, domino, 0);
......
/**
*
* @copyright (c) 2009-2014 The University of Tennessee and The University
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2014 Inria. All rights reserved.
* @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* @precisions normal z -> c d s
*
**/
#define _TYPE MORSE_Complex64_t
#define _PREC double
#define _LAMCH LAPACKE_dlamch_work
#define _NAME "MORSE_zgeqrf"
/* See Lawn 41 page 120 */
#define _FMULS FMULS_GEQRF(M, N)
#define _FADDS FADDS_GEQRF(M, N)
#include "./timing.c"
#include "timing_zauxiliary.h"
#if defined( _WIN32 ) || defined( _WIN64 )
#include <windows.h>
#include <time.h>
#include <sys/timeb.h>
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
int gettimeofday(struct timeval* tv, struct timezone* tz)
{
FILETIME ft;
unsigned __int64 tmpres = 0;
static int tzflag;
if (NULL != tv)
{
GetSystemTimeAsFileTime(&ft);
tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;
/*converting file time to unix epoch*/
tmpres /= 10; /*convert into microseconds*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}
if (NULL != tz)
{
if (!tzflag)
{
_tzset();
tzflag++;
}
tz->tz_minuteswest = _timezone / 60;
tz->tz_dsttime = _daylight;
}
return 0;
}
#else /* Non-Windows */
#include <sys/time.h>
#endif
/*
* struct timeval {time_t tv_sec; suseconds_t tv_usec;};
*/
double cWtime(void)
{
struct timeval tp;
gettimeofday( &tp, NULL );
return tp.tv_sec + 1e-6 * tp.tv_usec;
}
static int
RunTest(int *iparam, double *dparam, morse_time_t *t_)
{
MORSE_Complex64_t *tau;
PASTE_CODE_IPARAM_LOCALS( iparam );
if ( M != N && check ) {
fprintf(stderr, "Check cannot be perfomed with M != N\n");
check = 0;
}
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
/* Initialize Data */
CORE_zplrnt(M, N, A, LDA,
M, 0, 0, 3456);
/* Allocate Workspace */
tau = malloc( chameleon_min( M, N ) * sizeof(MORSE_Complex64_t) );
t = - cWtime();
LAPACKE_zgeqrf( LAPACK_COL_MAJOR, M, N, A, LDA, tau );
t += cWtime();
*t_ = t;
/* Check the solution */
if ( check )
{
}
/* Free Workspace */
free( tau );
free( A );
return 0;
}
...@@ -63,10 +63,6 @@ ...@@ -63,10 +63,6 @@
#include <getopt.h> #include <getopt.h>
#endif /* defined(CHAMELEON_HAVE_GETOPT_H) */ #endif /* defined(CHAMELEON_HAVE_GETOPT_H) */
#ifdef TIMING_LAPACKE
int MORSE_My_Mpi_Rank() { return 0; }
#endif
static int RunTest(int *iparam, _PREC *dparam, double *t_); static int RunTest(int *iparam, _PREC *dparam, double *t_);
static inline void* morse_getaddr_null(const MORSE_desc_t *A, int m, int n) static inline void* morse_getaddr_null(const MORSE_desc_t *A, int m, int n)
{ {
...@@ -112,9 +108,7 @@ Test(int64_t n, int *iparam) { ...@@ -112,9 +108,7 @@ Test(int64_t n, int *iparam) {
thrdnbr = iparam[IPARAM_THRDNBR]; thrdnbr = iparam[IPARAM_THRDNBR];
niter = iparam[IPARAM_NITER]; niter = iparam[IPARAM_NITER];
#ifdef TIMING_LAPACKE
thrdnbr = 1; //otherwise the following test is negative and we can't test lapacke
#endif /* TIMING_LAPACKE */
M = iparam[IPARAM_M]; M = iparam[IPARAM_M];
N = iparam[IPARAM_N]; N = iparam[IPARAM_N];
K = iparam[IPARAM_K]; K = iparam[IPARAM_K];
...@@ -204,7 +198,6 @@ Test(int64_t n, int *iparam) { ...@@ -204,7 +198,6 @@ Test(int64_t n, int *iparam) {
} }
gflops = flops / t[iter]; gflops = flops / t[iter];
#ifndef TIMING_LAPACKE
#if defined (CHAMELEON_SCHED_STARPU) #if defined (CHAMELEON_SCHED_STARPU)
/* TODO: create chameleon interface encapsulating this instead */ /* TODO: create chameleon interface encapsulating this instead */
if (iparam[IPARAM_BOUND]) if (iparam[IPARAM_BOUND])
...@@ -216,7 +209,6 @@ Test(int64_t n, int *iparam) { ...@@ -216,7 +209,6 @@ Test(int64_t n, int *iparam) {
upper_gflops = (flops / (tmin / 1000.0)); upper_gflops = (flops / (tmin / 1000.0));
sumgf_upper += upper_gflops; sumgf_upper += upper_gflops;
} }
#endif
#endif #endif
sumt += t[iter]; sumt += t[iter];
sumgf += gflops; sumgf += gflops;
...@@ -504,7 +496,7 @@ set_iparam_default(int *iparam){ ...@@ -504,7 +496,7 @@ set_iparam_default(int *iparam){
iparam[IPARAM_THRDNBR ] = -1; iparam[IPARAM_THRDNBR ] = -1;
iparam[IPARAM_THRDNBR_SUBGRP] = 1; iparam[IPARAM_THRDNBR_SUBGRP] = 1;
iparam[IPARAM_M ] = -1; iparam[IPARAM_M ] = -1;
iparam[IPARAM_N ] = -1; iparam[IPARAM_N ] = 500;
iparam[IPARAM_K ] = 1; iparam[IPARAM_K ] = 1;
iparam[IPARAM_LDA ] = -1; iparam[IPARAM_LDA ] = -1;
iparam[IPARAM_LDB ] = -1; iparam[IPARAM_LDB ] = -1;
...@@ -632,8 +624,7 @@ parse_arguments(int *_argc, char ***_argv, int *iparam, int *start, int *stop, i ...@@ -632,8 +624,7 @@ parse_arguments(int *_argc, char ***_argv, int *iparam, int *start, int *stop, i
int int
main(int argc, char *argv[]) { main(int argc, char *argv[]) {
int i, m, n, mx, nx; int i, m, mx, nx;
int status;
int nbnode = 1; int nbnode = 1;
int start = 500; int start = 500;
int stop = 5000; int stop = 5000;
...@@ -653,12 +644,10 @@ main(int argc, char *argv[]) { ...@@ -653,12 +644,10 @@ main(int argc, char *argv[]) {
} }
#endif #endif
n = iparam[IPARAM_N];
m = iparam[IPARAM_M]; m = iparam[IPARAM_M];
mx = iparam[IPARAM_MX]; mx = iparam[IPARAM_MX];
nx = iparam[IPARAM_NX]; nx = iparam[IPARAM_NX];
#ifndef TIMING_LAPACKE
/* Initialize MORSE */ /* Initialize MORSE */
MORSE_Init( iparam[IPARAM_THRDNBR], MORSE_Init( iparam[IPARAM_THRDNBR],
iparam[IPARAM_NCUDAS] ); iparam[IPARAM_NCUDAS] );
...@@ -720,37 +709,27 @@ main(int argc, char *argv[]) { ...@@ -720,37 +709,27 @@ main(int argc, char *argv[]) {
if (step < 1) step = 1; if (step < 1) step = 1;
status = Test( -1, iparam ); /* print header */ int status = Test( -1, iparam ); /* print header */
if (status != MORSE_SUCCESS) return status; if (status != MORSE_SUCCESS) return status;
if ( n == -1 ){ for (i = start; i <= stop; i += step)
for (i = start; i <= stop; i += step) {
{ if ( nx > 0 ) {
if ( nx > 0 ) { iparam[IPARAM_M] = i;
iparam[IPARAM_M] = i;
iparam[IPARAM_N] = chameleon_max(1, i/nx); iparam[IPARAM_N] = chameleon_max(1, i/nx);
} else if ( mx > 0 ) { } else if ( mx > 0 ) {
iparam[IPARAM_M] = chameleon_max(1, i/mx); iparam[IPARAM_M] = chameleon_max(1, i/mx);
iparam[IPARAM_N] = i; iparam[IPARAM_N] = i;
} else { } else {
if ( m == -1 ) if ( m == -1 )
iparam[IPARAM_M] = i; iparam[IPARAM_M] = i;
iparam[IPARAM_N] = i; iparam[IPARAM_N] = i;
}
status = Test( iparam[IPARAM_N], iparam );
if (status != MORSE_SUCCESS) return status;
success += status;
} }
} else{ int status = Test( iparam[IPARAM_N], iparam );
if ( m == -1 )
iparam[IPARAM_M] = n;
iparam[IPARAM_N] = n;
status = Test( iparam[IPARAM_N], iparam );
if (status != MORSE_SUCCESS) return status; if (status != MORSE_SUCCESS) return status;
success += status; success += status;
} }
#ifndef TIMING_LAPACKE
MORSE_Finalize(); MORSE_Finalize();
#endif
return success; return success;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment