MOAB: Mesh Oriented datABase  (version 5.5.0)
scd_test_partn.cpp File Reference
#include "moab/ScdInterface.hpp"
#include "moab/Core.hpp"
#include "TestUtil.hpp"
#include <iostream>
+ Include dependency graph for scd_test_partn.cpp:

Go to the source code of this file.

Functions

void test_sqijk ()
 
int main (int argc, char **argv)
 

Variables

int gdims [6]
 
int np
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 39 of file scd_test_partn.cpp.

40 {
41  if( argc < 2 )
42  {
43  std::cout << "Usage: " << argv[0] << " <#proc> [<imax> [<jmax> <kmax>]]" << std::endl;
44  std::cout << "Using default parameters for autotest purposes." << std::endl;
45  np = 4;
46  gdims[0] = gdims[1] = gdims[2] = 0;
47  gdims[3] = gdims[4] = gdims[5] = 100;
48  }
49  else if( argc < 3 )
50  {
51  np = atoi( argv[1] );
52  gdims[0] = gdims[1] = gdims[2] = 0;
53  gdims[3] = gdims[4] = gdims[5] = 100;
54  }
55  else if( argc < 4 )
56  {
57  np = atoi( argv[1] );
58  gdims[0] = gdims[1] = gdims[2] = 0;
59  gdims[3] = gdims[4] = gdims[5] = atoi( argv[2] );
60  }
61  else if( argc < 6 )
62  {
63  np = atoi( argv[1] );
64  gdims[0] = gdims[1] = gdims[2] = 0;
65  gdims[3] = atoi( argv[2] );
66  gdims[4] = atoi( argv[3] );
67  gdims[5] = atoi( argv[4] );
68  }
69 
70  // test partition method
72 }

References gdims, np, RUN_TEST, and test_sqijk().

◆ test_sqijk()

void test_sqijk ( )

Definition at line 15 of file scd_test_partn.cpp.

16 {
17  Core moab;
18  ScdInterface* scd;
19  ErrorCode rval = moab.Interface::query_interface( scd );CHECK_ERR( rval );
20  int ldims[6];
21  ScdParData par_data;
22  std::copy( gdims, gdims + 6, par_data.gDims );
23  for( int i = 0; i < 3; i++ )
24  par_data.gPeriodic[i] = 0;
25  par_data.partMethod = ScdParData::SQIJK;
26 
27  std::cout << "gDims = (" << par_data.gDims[0] << "," << par_data.gDims[1] << "," << par_data.gDims[2] << ")--("
28  << par_data.gDims[3] << "," << par_data.gDims[4] << "," << par_data.gDims[5] << ")" << std::endl;
29 
30  int lperiodic[3], pijk[3];
31 
32  rval = ScdInterface::compute_partition( np, 0, par_data, ldims, lperiodic, pijk );CHECK_ERR( rval );
33 
34  std::cout << "#proc in 3 directions = (" << pijk[0] << "," << pijk[1] << "," << pijk[2] << ")" << std::endl;
35  std::cout << "local dims are (" << ldims[0] << "," << ldims[1] << "," << ldims[2] << ")--(" << ldims[3] << ","
36  << ldims[4] << "," << ldims[5] << ")\n";
37 }

References CHECK_ERR, moab::ScdInterface::compute_partition(), ErrorCode, moab::ScdParData::gDims, gdims, moab::ScdParData::gPeriodic, np, moab::ScdParData::partMethod, and moab::ScdParData::SQIJK.

Referenced by main().

Variable Documentation

◆ gdims

◆ np