~ubuntu-branches/ubuntu/saucy/nwchem/saucy

« back to all changes in this revision

Viewing changes to src/tools/ga-4-3/global/src/matmul.h

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2012-02-09 20:02:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120209200241-jgk03qfsphal4ug2
Tags: 6.1-1
* New upstream release.

[ Michael Banck ]
* debian/patches/02_makefile_flags.patch: Updated.
* debian/patches/02_makefile_flags.patch: Use internal blas and lapack code.
* debian/patches/02_makefile_flags.patch: Define GCC4 for LINUX and LINUX64
  (Closes: #632611 and LP: #791308).
* debian/control (Build-Depends): Added openssh-client.
* debian/rules (USE_SCALAPACK, SCALAPACK): Removed variables (Closes:
  #654658).
* debian/rules (LIBDIR, USE_MPIF4, ARMCI_NETWORK): New variables.
* debian/TODO: New file.
* debian/control (Build-Depends): Removed libblas-dev, liblapack-dev and
  libscalapack-mpi-dev.
* debian/patches/04_show_testsuite_diff_output.patch: New patch, shows the
  diff output for failed tests.
* debian/patches/series: Adjusted.
* debian/testsuite: Optionally run all tests if "all" is passed as option.
* debian/rules: Run debian/testsuite with "all" if DEB_BUILD_OPTIONS
  contains "checkall".

[ Daniel Leidert ]
* debian/control: Used wrap-and-sort. Added Vcs-Svn and Vcs-Browser fields.
  (Priority): Moved to extra according to policy section 2.5.
  (Standards-Version): Bumped to 3.9.2.
  (Description): Fixed a typo.
* debian/watch: Added.
* debian/patches/03_hurd-i386_define_path_max.patch: Added.
  - Define MAX_PATH if not defines to fix FTBFS on hurd.
* debian/patches/series: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: matmul.h,v 1.15.4.1 2006-12-22 13:05:22 manoj Exp $ */
 
2
#ifndef _MATMUL_H_
 
3
#define _MATMUL_H_
 
4
 
 
5
#include "ga.h"
 
6
#include "global.h"
 
7
#include "globalp.h"
 
8
#include "message.h"
 
9
#include "base.h"
 
10
 
 
11
#include <math.h>
 
12
#include "armci.h"
 
13
 
 
14
#ifdef KSR
 
15
#  define dgemm_ sgemm_
 
16
#  define zgemm_ cgemm_
 
17
#endif
 
18
 
 
19
#ifdef CRAY
 
20
#      include <fortran.h>
 
21
#      define  DGEMM SGEMM
 
22
#      define  ZGEMM CGEMM
 
23
#      define  CGEMM CGEMM
 
24
#elif defined(WIN32)
 
25
extern void FATR DGEMM(char*,int, char*,int, Integer*, Integer*, Integer*,
 
26
                       void*, void*, Integer*, void*, Integer*, void*,
 
27
                       void*, Integer*);
 
28
extern void FATR ZGEMM(char*,int, char*,int, Integer*, Integer*, Integer*,
 
29
                       DoubleComplex*, DoubleComplex*, Integer*,DoubleComplex*,
 
30
                       Integer*, DoubleComplex*, DoubleComplex*, Integer*);
 
31
extern void FATR CGEMM(char*,int, char*,int, Integer*, Integer*, Integer*,
 
32
                       SingleComplex*, SingleComplex*, Integer*,SingleComplex*,
 
33
                       Integer*, SingleComplex*, SingleComplex*, Integer*);
 
34
#elif defined(F2C2__)
 
35
#      define DGEMM dgemm__
 
36
#      define ZGEMM zgemm__
 
37
#      define CGEMM cgemm__
 
38
#elif defined(HITACHI)
 
39
#      define dgemm_ DGEMM
 
40
#      define zgemm_ ZGEMM
 
41
#      define cgemm_ CGEMM
 
42
#endif
 
43
 
 
44
#if defined(CRAY) || defined(WIN32)
 
45
#   define cptofcd(fcd)  _cptofcd((fcd),1)
 
46
#else
 
47
#      define cptofcd(fcd) (fcd)
 
48
#endif
 
49
 
 
50
/* min acceptable amount of memory (in elements) and default chunk size */
 
51
#  define MINMEM 64
 
52
#  define CHUNK_SIZE 256
 
53
#  define MAX_CHUNKS 1024
 
54
#  define BLOCK_SIZE 1024 /* temp buf size for pinning */
 
55
#  define GA_ASPECT_RATIO 3
 
56
#  define NUM_MATS 3 
 
57
#  define MINTASKS 10 /* increase this if there is high load imbalance */
 
58
#  define EXTRA 4
 
59
 
 
60
#define MIN_CHUNK_SIZE 256
 
61
 
 
62
#define SET   1
 
63
#define UNSET 0
 
64
 
 
65
static int _gai_matmul_patch_flag = 0; 
 
66
Integer gNbhdlA[2], gNbhdlB[2], gNbhdlC[2];/* for A and B matrix */
 
67
typedef struct {
 
68
  int lo[2]; /* 2 elements: ilo and klo */
 
69
  int hi[2];
 
70
  int dim[2];
 
71
  int chunkBId;
 
72
  short int do_put;
 
73
}task_list_t;
 
74
 
 
75
extern void FATR  ga_nbget_(Integer *g_a, Integer *ilo, Integer *ihi, 
 
76
                            Integer *jlo, Integer *jhi, Void *buf, 
 
77
                            Integer *ld, Integer *nbhdl);
 
78
 
 
79
extern logical ngai_patch_intersect(Integer *lo, Integer *hi,
 
80
                                    Integer *lop, Integer *hip, Integer ndim);
 
81
    
 
82
#define VECTORCHECK(rank,dims,dim1,dim2, ilo, ihi, jlo, jhi) \
 
83
  if(rank>2)  ga_error("rank is greater than 2",rank); \
 
84
  else if(rank==2) {dim1=dims[0]; dim2=dims[1];} \
 
85
  else if(rank==1) {if((ihi-ilo)>0) { dim1=dims[0]; dim2=1;} \
 
86
                    else { dim1=1; dim2=dims[0];}} \
 
87
  else ga_error("rank must be atleast 1",rank);
 
88
 
 
89
#define WAIT_GET_BLOCK(nbhdl) ga_nbwait_(nbhdl)
 
90
 
 
91
#endif /* _MATMUL_H_ */