~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/global/testing/unit-tests/ga_copypatch2.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_Copy_patch (is a collective operation)
 
4
 * GA_Create -- used to create a global array using handles like 'g_A'
 
5
 * GA_Duplicate --used to duplicate and generate one more global array.., handle 'g_A' to 'g_B'
 
6
 * GA_Copy -- is used to transfer the data from one array to other.., ie) from g_A to g_B
 
7
 * GA_Copy_patch -- is used  to copy only certain patch of one array to another
 
8
 */
 
9
 
 
10
#include<stdio.h>
 
11
 
 
12
#include"mpi.h"
 
13
#include"ga.h"
 
14
#include"macdecls.h"
 
15
#include"ga_unit.h"
 
16
 
 
17
#define DIM 2
 
18
#define SIZE 5
 
19
 
 
20
main(int argc, char **argv)
 
21
{
 
22
  int rank, nprocs, i, j;
 
23
  int g_A, g_B, local_A[SIZE][SIZE]; 
 
24
  int dims[DIM]={SIZE,SIZE}, alo[DIM]={0,0}, ahi[DIM]={3,3}, blo[DIM]={0,0}, bhi[DIM]={3,3}, ld=5;
 
25
  int value=5, val2=4;
 
26
 
 
27
  MPI_Init(&argc, &argv);
 
28
 
 
29
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
30
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
 
31
 
 
32
  MA_init(C_INT, 1000, 1000);
 
33
 
 
34
  GA_Initialize();
 
35
  
 
36
  g_A = NGA_Create(C_INT, DIM, dims, "array_A", NULL);
 
37
  GA_Fill(g_A, &value);
 
38
 
 
39
  g_B = GA_Duplicate(g_A, "array_B");
 
40
  GA_Print(g_A);
 
41
  GA_Fill(g_B, &val2);
 
42
  GA_Sync();
 
43
  NGA_Copy_patch('N', g_A, alo, ahi, g_B, blo, bhi);
 
44
  GA_Print(g_B);
 
45
 
 
46
  NGA_Get(g_B, blo, bhi, local_A, &ld);
 
47
 
 
48
  if(rank==0)
 
49
    {
 
50
      for(i=0; i<3; i++)
 
51
        {
 
52
          for(j=0; j<3; j++) printf("%d ", local_A[i][j]);
 
53
          printf("\n");
 
54
        }
 
55
      printf("\n");
 
56
 
 
57
      for(i=0; i<3; i++)
 
58
        {
 
59
          for(j=0; j<3; j++)
 
60
            if( local_A[i][j]!=value) printf("ERROR : \n");
 
61
        }
 
62
 
 
63
    }
 
64
  
 
65
 
 
66
  // The process is confirmed and verified by printing the array in OP-scr
 
67
  /*
 
68
  if(rank==0)
 
69
    if(content(g_A) != content(g_B))printf("ERROE : \n");
 
70
  */
 
71
 
 
72
  if(rank == 0)
 
73
    printf("Test Completed \n");
 
74
  GA_Terminate();
 
75
  MPI_Finalize();
 
76
 
 
77
  
 
78
}