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

« back to all changes in this revision

Viewing changes to src/tools/ga-4-3/ma/test-inquire.c

  • 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
/*
 
2
 * $Id: test-inquire.c,v 1.1 2002-09-14 05:40:30 d3g001 Exp $
 
3
 */
 
4
 
 
5
#include <stdio.h>
 
6
#include <stdlib.h>
 
7
#include "macdecls.h"
 
8
 
 
9
#define MAXHANDLES 10
 
10
 
 
11
static void print_inquire();
 
12
 
 
13
main()
 
14
{
 
15
    Integer     units_heap;
 
16
    Integer     units_stack;
 
17
    int         howmany;
 
18
    Boolean     ok;
 
19
 
 
20
    Integer     handle[MAXHANDLES];
 
21
    Integer     index[MAXHANDLES];
 
22
 
 
23
    /* set sizes of heap and stack */
 
24
    units_heap = 50000;
 
25
    units_stack = 20000;
 
26
 
 
27
    /* initialize */
 
28
    ok = MA_init(MT_DBL, units_stack, units_heap);
 
29
    if (!ok)
 
30
    {
 
31
        (void)fprintf(stderr, "MA_init failed; punting\n");
 
32
        exit(1);
 
33
    }
 
34
 
 
35
    printf("# initialized heap = %d, stack = %d\n", units_heap, units_stack);
 
36
 
 
37
    printf("# should see roughly the following values:\n");
 
38
    printf("#  MA_inquire_heap(MT_DBL)               = 50K\n");
 
39
    printf("#  MA_inquire_heap_check_stack(MT_DBL)   = 50K\n");
 
40
    printf("#  MA_inquire_heap_no_partition(MT_DBL)  = 70K\n");
 
41
    printf("#  MA_inquire_stack(MT_DBL)              = 20K\n");
 
42
    printf("#  MA_inquire_stack_check_heap(MT_DBL)   = 20K\n");
 
43
    printf("#  MA_inquire_stack_no_partition(MT_DBL) = 70K\n");
 
44
 
 
45
    print_inquire();
 
46
 
 
47
    printf("# allocate 2 heap (10K, 20K), 1 stack (35K)\n");
 
48
    MA_alloc_get(MT_DBL, 10000, "heap0", &handle[0], &index[0]);
 
49
    MA_alloc_get(MT_DBL, 20000, "heap1", &handle[1], &index[1]);
 
50
    MA_push_get(MT_DBL, 35000, "stack0", &handle[2], &index[2]);
 
51
 
 
52
    printf("# free 1 heap (10K)\n");
 
53
    MA_free_heap(handle[0]);
 
54
 
 
55
    printf("# should see roughly the following values:\n");
 
56
    printf("#  MA_inquire_heap(MT_DBL)               = 20K\n");
 
57
    printf("#  MA_inquire_heap_check_stack(MT_DBL)   = 10K\n");
 
58
    printf("#  MA_inquire_heap_no_partition(MT_DBL)  = 10K\n");
 
59
    printf("#  MA_inquire_stack(MT_DBL)              = 0\n");
 
60
    printf("#  MA_inquire_stack_check_heap(MT_DBL)   = 0\n");
 
61
    printf("#  MA_inquire_stack_no_partition(MT_DBL) = 5K\n");
 
62
 
 
63
    print_inquire();
 
64
}
 
65
 
 
66
void print_inquire()
 
67
{
 
68
    int howmany;
 
69
 
 
70
    (void)printf("--------------------------------------------------------\n");
 
71
 
 
72
    howmany = MA_inquire_heap(MT_DBL);
 
73
    (void)printf("MA_inquire_heap(MT_DBL)               = %d\n", howmany);
 
74
    howmany = MA_inquire_heap_check_stack(MT_DBL);
 
75
    (void)printf("MA_inquire_heap_check_stack(MT_DBL)   = %d\n", howmany);
 
76
    howmany = MA_inquire_heap_no_partition(MT_DBL);
 
77
    (void)printf("MA_inquire_heap_no_partition(MT_DBL)  = %d\n", howmany);
 
78
 
 
79
    howmany = MA_inquire_stack(MT_DBL);
 
80
    (void)printf("MA_inquire_stack(MT_DBL)              = %d\n", howmany);
 
81
    howmany = MA_inquire_stack_check_heap(MT_DBL);
 
82
    (void)printf("MA_inquire_stack_check_heap(MT_DBL)   = %d\n", howmany);
 
83
    howmany = MA_inquire_stack_no_partition(MT_DBL);
 
84
    (void)printf("MA_inquire_stack_no_partition(MT_DBL) = %d\n", howmany);
 
85
 
 
86
    (void)printf("--------------------------------------------------------\n");
 
87
}