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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/testing/fttest.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
 
#if HAVE_CONFIG_H
2
 
#   include "config.h"
3
 
#endif
4
 
 
5
 
#if HAVE_STDIO_H
6
 
#   include <stdio.h>
7
 
#endif
8
 
#if HAVE_STDLIB_H
9
 
#   include <stdlib.h>
10
 
#endif
11
 
#if HAVE_UNISTD_H
12
 
#   include <unistd.h>
13
 
#endif
14
 
#if HAVE_ASSERT_H
15
 
#   include <assert.h>
16
 
#endif
17
 
 
18
 
#include "armci.h"
19
 
#include "message.h"
20
 
 
21
 
#define MAXPROCS 128
22
 
#define SIZE_    1024
23
 
#define FAILURE_SIZE_    512
24
 
 
25
 
int me, nproc;
26
 
double *ptr_arr[MAXPROCS];
27
 
long size;
28
 
void do_work(int sz)
29
 
{
30
 
  int i;
31
 
  static int d = 1;
32
 
  for (i = 0; i < sz; i++) {
33
 
    *((double *)(ptr_arr[me]) + i) = i + 1.12 * d++;
34
 
  }
35
 
}
36
 
static double time_array[100], time_array1[100], t1;
37
 
int main(int argc, char *argv[])
38
 
{
39
 
  int rc, i, j = 0, rid, ret;
40
 
  armci_ckpt_ds_t ckptds;
41
 
  ARMCI_Group grp;
42
 
 
43
 
  ARMCI_Init_args(&argc, &argv);
44
 
  nproc = armci_msg_nproc();
45
 
  me = armci_msg_me();
46
 
 
47
 
  if (me == 0) {
48
 
    if (nproc > MAXPROCS) {
49
 
      ARMCI_Error("nproc > MAXPROCS", nproc);
50
 
    }
51
 
    else {
52
 
      printf("ARMCI test program (%d processes)\n", nproc);
53
 
      fflush(stdout);
54
 
      sleep(1);
55
 
    }
56
 
 
57
 
  }
58
 
  armci_init_checkpoint2();
59
 
  ARMCI_Group_get_world(&grp);
60
 
  size = SIZE_;
61
 
  rc = ARMCI_Malloc((void **)ptr_arr, size * 8);
62
 
  printf("ARMCI test program (%d processes)\n", nproc);
63
 
  fflush(stdout);
64
 
  for (size = 1; size <= SIZE_; size *= 2) {
65
 
    t1 = MPI_Wtime();
66
 
    for (i = 0; i < 5; i++) {
67
 
      for (rc = 0; rc < 15; rc++) {
68
 
        do_work(size);
69
 
      }
70
 
    }
71
 
    time_array[j++] = MPI_Wtime() - t1;
72
 
    ARMCI_Barrier();
73
 
    printf("%d:done for size %ld\n", me, size);
74
 
    fflush(stdout);
75
 
  }
76
 
 
77
 
  (void)ARMCI_Ckpt_create_ds(&ckptds, 1);
78
 
  ckptds.ptr_arr[0] = ptr_arr[me];
79
 
  ckptds.sz[0] = SIZE_ * 8;
80
 
  rid = ARMCI_Ckpt_init(NULL, &grp, 1, 0, &ckptds);
81
 
  printf("%d: After ARMCI_Ckpt_init(): \n", me);
82
 
 
83
 
  j = 0;
84
 
  for (size = 128; size <= SIZE_; size *= 2) {
85
 
 
86
 
    int rc;
87
 
    int simulate_restart = 1;
88
 
    t1 = MPI_Wtime();
89
 
 
90
 
    ret = ARMCI_Ckpt(rid);
91
 
    if (ret == ARMCI_CKPT) {
92
 
      printf("%d: Performed CHECKPOINT @ size=%ld\n", me, size);
93
 
    }
94
 
    else if (ret == ARMCI_RESTART) {
95
 
      simulate_restart = 0;
96
 
      printf("%d: Performed RESTART @ size=%ld\n", me, size);
97
 
    }
98
 
 
99
 
    for (i = 0; i < 5; i++) {
100
 
      for (rc = 0; rc < 15; rc++)
101
 
        if (i == 3 && rc == 10) {
102
 
        }
103
 
      do_work(size);
104
 
    }
105
 
 
106
 
    time_array1[j++] = MPI_Wtime() - t1;
107
 
    sleep(1);
108
 
 
109
 
    if (simulate_restart && size == FAILURE_SIZE_) {
110
 
      printf("%d: Simulating FAILURE @ size = %d\n", me, size);
111
 
      ARMCI_Restart_simulate(rid, 1);
112
 
    }
113
 
 
114
 
    printf("%d: DONE for size=%ld regular=%f withckpt=%f\n\n",
115
 
           me, size, time_array[j-1], time_array1[j-1]);
116
 
    fflush(stdout);
117
 
 
118
 
  }
119
 
 
120
 
  ARMCI_Ckpt_finalize(rid);
121
 
 
122
 
  printf("Before Finalize()\n");
123
 
  ARMCI_Barrier();
124
 
  ARMCI_Finalize();
125
 
  armci_msg_finalize();
126
 
  return(0);
127
 
}