File: paradisTest.C

package info (click to toggle)
paraview 4.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 526,572 kB
  • sloc: cpp: 2,284,430; ansic: 816,374; python: 239,936; xml: 70,162; tcl: 48,295; fortran: 39,116; yacc: 5,466; java: 3,518; perl: 3,107; lex: 1,620; sh: 1,555; makefile: 932; asm: 471; pascal: 228
file content (61 lines) | stat: -rw-r--r-- 1,563 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* just a file to contain a main() for testing paraDIS library */ 
#include "paradis.h"
#include "RC_c_lib/debugutil.h"
#include "RC_c_lib/args.h"

using namespace std; 

int main(int argc, char *argv[]) {
  long restrictBounds = 0, debugfiles = 0, verbosity=4; 
  long procnum = 0, numprocs = 1; 
  char inputfile[2048]=""; 
  argt args[7] = {
    {BOOL_TYPE, "-restrict", 1, &restrictBounds}, 
    {BOOL_TYPE, "-debugfiles", 1, &debugfiles}, 
    {LONG_TYPE, "-v", 1, &verbosity}, 
    {LONG_TYPE, "-procnum", 1, &procnum}, 
    {LONG_TYPE, "-numprocs", 1, &numprocs}, 
    {LONG_TYPE, "-verbose", 1, &verbosity}, 
    {STRING_TYPE, "-in", 2048, inputfile}
  };
  arg_expect_args(args, 7);
  arg_ignore_bad_args(1); 
  arg_parse_args(&argc, argv); 
  
  dbg_setverbose(verbosity); 
  
  try {
    rclib::Point<float> datamin, datamax; 
    paraDIS::DataSet dsData; 

    char *datafile = "../paraDIS_data/rs0443.data";
    if (*inputfile) datafile = inputfile; 

    dsData.SetProcNum(procnum,numprocs); 
    dsData.SetDataFile(datafile); 
    dsData.EnableDebugOutput(debugfiles); 
    dsData.SetDebugOutputDir("debuginfo"); 
    system("mkdir -p debuginfo"); 
    dsData.GetBounds(datamin, datamax, datafile); 

    /*!
      restrict the bounds for fun
    */ 
    if (restrictBounds) {
      dsData.TestRestrictSubspace(); 
    }
    
    dsData.ReadData(); 

    /*!
      Does malloc still work? 
    */ 
    vector<int> testarray; 
    testarray.resize(1000000); 

  } catch (string err) {
    cerr <<"Error in main: "<<err<<endl; 
  }
  
  return 0; 
}