~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_pgroup_create2.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_PGroup_create (is a collective operation)                                                 
 
4
 * _pgroup_create -- helps to create different sized group from the given processes and helps to alocate different    job for diffferent group 
 
5
 * groups are identified using the group handle
 
6
 */
 
7
 
 
8
#include<stdio.h>
 
9
#include<stdlib.h>
 
10
 
 
11
#include"mpi.h"
 
12
#include"ga.h"
 
13
#include"macdecls.h"
 
14
#include"ga_unit.h"
 
15
 
 
16
main(int argc, char **argv)
 
17
{
 
18
  int rank, nprocs, i, j;
 
19
  int p_Geven, p_Godd, p_size, mod, p_size_mod, *list_even=NULL, *list_odd=NULL;
 
20
  
 
21
  MPI_Init(&argc, &argv);
 
22
  
 
23
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
24
  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
 
25
 
 
26
  MA_init(C_INT, 1000, 1000);
 
27
 
 
28
  GA_Initialize();
 
29
  
 
30
  p_size=nprocs/2;
 
31
  mod=nprocs%2;
 
32
  p_size_mod=p_size+mod;
 
33
  list_even = (int*)malloc(p_size*sizeof(int));
 
34
  list_odd = (int*)malloc(p_size*sizeof(int));
 
35
  
 
36
  j=0;
 
37
  for(i=0; i<nprocs; i++)
 
38
    {
 
39
      if(i%2==0)
 
40
        {
 
41
          list_even[j]=i;
 
42
          j++;
 
43
        }
 
44
    }
 
45
  j=0;
 
46
  for(i=0; i<nprocs; i++)
 
47
    {
 
48
      if(i%2==1)
 
49
        {
 
50
          list_odd[j]=i;
 
51
          j++;
 
52
        }
 
53
    }
 
54
  /*
 
55
  if(rank==0)
 
56
    {    
 
57
      for(i=0; i<p_size; i++)
 
58
        printf(" %d--> %d --:: -- %d\n", i, list_even[i], list_odd[i]);
 
59
    }
 
60
  */
 
61
  GA_Sync();
 
62
  printf("%d: My ID is %d :: %d --- nodeid & nnodes for GA \n", rank, GA_Nodeid(), GA_Nnodes());
 
63
  
 
64
  p_Geven=GA_Pgroup_create(list_even, p_size_mod);
 
65
  p_Godd=GA_Pgroup_create(list_odd, p_size);
 
66
  GA_Sync();
 
67
  if(rank%2==0)
 
68
    printf("%d: My ID is %d :: %d -- even \n", rank, GA_Pgroup_nodeid(p_Geven), GA_Pgroup_nnodes(p_Geven));
 
69
  else
 
70
    printf("%d: My ID is %d :: %d --- odd\n", rank, GA_Pgroup_nodeid(p_Godd), GA_Pgroup_nnodes(p_Godd));
 
71
  
 
72
  GA_Sync();
 
73
  if(rank==0)
 
74
    GA_PRINT_MSG();
 
75
  
 
76
   GA_Terminate();
 
77
  MPI_Finalize();
 
78
}