~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/global/testing/unit-tests/ga_ndim.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Test Program for GA
 
3
 * This is to test GA_Ndim (is a local operation)
 
4
 * verifing GA_Ndim -- which returns dimension of the g_A 
 
5
 */
 
6
 
 
7
#include<stdio.h>
 
8
 
 
9
#include"mpi.h"
 
10
#include"ga.h"
 
11
#include"macdecls.h"
 
12
 
 
13
#define SIZE 5
 
14
#define ONE_DIM 1
 
15
#define TWO_DIM 2
 
16
#define THREE_DIM 3
 
17
 
 
18
one_dimension()
 
19
{
 
20
  int g_A, dims[ONE_DIM]={SIZE};
 
21
 
 
22
  g_A = NGA_Create(C_INT, ONE_DIM, dims, "array_A", NULL);
 
23
 
 
24
  if(GA_Ndim(g_A) != ONE_DIM)
 
25
    printf("ERROR: GA_Ndim didnt return nDimension after GA_Initialize \n");
 
26
 
 
27
  GA_Destroy(g_A);
 
28
}
 
29
 
 
30
two_dimension()
 
31
{
 
32
  int g_A, dims[TWO_DIM]={SIZE,SIZE};
 
33
 
 
34
  g_A = NGA_Create(C_INT, TWO_DIM, dims, "array_A", NULL);
 
35
 
 
36
  if(GA_Ndim(g_A) != TWO_DIM)
 
37
    printf("ERROR: GA_Ndim didnt return nDimension after GA_Initialize \n");
 
38
 
 
39
  GA_Destroy(g_A);
 
40
}
 
41
 
 
42
three_dimension()
 
43
{
 
44
  int g_A, dims[THREE_DIM]={SIZE,SIZE,SIZE};
 
45
 
 
46
  g_A = NGA_Create(C_INT, THREE_DIM, dims, "array_A", NULL);
 
47
 
 
48
  if(GA_Ndim(g_A) != THREE_DIM)
 
49
    printf("ERROR: GA_Ndim didnt return nDimension after GA_Initialize \n");
 
50
 
 
51
  GA_Destroy(g_A);
 
52
}
 
53
 
 
54
int main(int argc, char **argv)
 
55
{
 
56
  int rank, nprocs, n=1, temp=0;
 
57
 
 
58
  MPI_Init(&argc, &argv);
 
59
 
 
60
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
61
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
 
62
 
 
63
  MA_init(C_INT, 1000, 1000);
 
64
 
 
65
  GA_Initialize();
 
66
  
 
67
  one_dimension();
 
68
  two_dimension();
 
69
  three_dimension();
 
70
 
 
71
  GA_Sync();
 
72
  if(rank == 0)
 
73
    printf("Test Completed \n");
 
74
 
 
75
  GA_Terminate();
 
76
  MPI_Finalize();
 
77
 
 
78
  return 0;
 
79
}