[MOAB-dev] r3014 - MOAB/trunk/parallel
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Wed Jul 15 17:42:45 CDT 2009
Author: tautges
Date: 2009-07-15 17:42:45 -0500 (Wed, 15 Jul 2009)
New Revision: 3014
Modified:
MOAB/trunk/parallel/ReadParallel.cpp
MOAB/trunk/parallel/mbparallelcomm_test.cpp
Log:
<re-commit of earlier today's commit>
Added handling of PRINT_PARALLEL read option; this option tells ReadParallel
to print information about shared entities after parallel read is done.
Added -p option to mbparallelcomm_test to turn on above option.
Modified: MOAB/trunk/parallel/ReadParallel.cpp
===================================================================
--- MOAB/trunk/parallel/ReadParallel.cpp 2009-07-15 22:42:16 UTC (rev 3013)
+++ MOAB/trunk/parallel/ReadParallel.cpp 2009-07-15 22:42:45 UTC (rev 3014)
@@ -23,7 +23,7 @@
enum ParallelActions {PA_READ=0, PA_BROADCAST, PA_DELETE_NONLOCAL,
PA_CHECK_GIDS_SERIAL, PA_GET_FILESET_ENTS,
PA_RESOLVE_SHARED_ENTS,
- PA_EXCHANGE_GHOSTS};
+ PA_EXCHANGE_GHOSTS, PA_PRINT_PARALLEL};
const char *ParallelActionsNames[] = {
"PARALLEL READ",
"PARALLEL BROADCAST",
@@ -31,7 +31,8 @@
"PARALLEL CHECK_GIDS_SERIAL",
"PARALLEL GET_FILESET_ENTS",
"PARALLEL RESOLVE_SHARED_ENTS",
- "PARALLEL EXCHANGE_GHOSTS"
+ "PARALLEL EXCHANGE_GHOSTS",
+ "PARALLEL PRINT_PARALLEL"
};
const char* ReadParallel::parallelOptsNames[] = { "NONE", "BCAST", "BCAST_DELETE",
@@ -88,6 +89,11 @@
result = opts.get_null_option("CPUTIME");
if (MB_SUCCESS == result) cputime = true;
+ // see if we need to report times
+ bool print_parallel = false;
+ result = opts.get_null_option("PRINT_PARALLEL");
+ if (MB_SUCCESS == result) print_parallel = true;
+
// get ghosting options
std::string ghost_str;
int bridge_dim, ghost_dim = -1, num_layers;
@@ -182,8 +188,9 @@
if (-2 != resolve_dim) pa_vec.push_back(PA_RESOLVE_SHARED_ENTS);
if (-1 != ghost_dim) pa_vec.push_back(PA_EXCHANGE_GHOSTS);
+
+ if (print_parallel) pa_vec.push_back(PA_PRINT_PARALLEL);
-
return load_file(file_names, num_files, file_set, parallel_mode,
partition_tag_name,
partition_tag_vals, distrib, pa_vec, opts,
@@ -358,6 +365,14 @@
break;
//==================
+ case PA_PRINT_PARALLEL:
+ if (debug)
+ std::cout << "Printing parallel information." << std::endl;
+
+ tmp_result = myPcomm->list_entities(0, -1);
+ break;
+
+//==================
default:
return MB_FAILURE;
}
Modified: MOAB/trunk/parallel/mbparallelcomm_test.cpp
===================================================================
--- MOAB/trunk/parallel/mbparallelcomm_test.cpp 2009-07-15 22:42:16 UTC (rev 3013)
+++ MOAB/trunk/parallel/mbparallelcomm_test.cpp 2009-07-15 22:42:45 UTC (rev 3014)
@@ -47,7 +47,8 @@
MBErrorCode read_file(MBInterface *mbImpl, std::vector<std::string> &filenames,
const char *tag_name, int tag_val, int distrib,
- int parallel_option, int resolve_shared, int with_ghosts, int use_mpio);
+ int parallel_option, int resolve_shared, int with_ghosts,
+ int use_mpio, bool print_parallel);
MBErrorCode test_packing(MBInterface *mbImpl, const char *filename);
@@ -88,12 +89,16 @@
return 1;
}
- int npos = 1, tag_val, distrib, with_ghosts = 1, resolve_shared = 1, use_mpio = 0;
+ int npos = 1, tag_val, distrib, with_ghosts = 1, resolve_shared = 1,
+ use_mpio = 0;
+ bool print_parallel = false;
const char *tag_name;
std::vector<std::string> filenames;
int parallel_option = 0;
int num_files;
+ if (!strcmp(argv[npos], "-p")) print_parallel = true;
+
while (npos != argc) {
MBErrorCode tmp_result;
int nshared = -1;
@@ -128,7 +133,8 @@
tmp_result = read_file(mbImpl, filenames, tag_name, tag_val,
distrib, parallel_option,
- resolve_shared, with_ghosts, use_mpio);
+ resolve_shared, with_ghosts, use_mpio,
+ print_parallel);
if (MB_SUCCESS != tmp_result) {
result = tmp_result;
std::cerr << "Couldn't read mesh; error message:" << std::endl;
@@ -159,7 +165,7 @@
filenames.push_back(std::string(argv[npos++]));
tmp_result = read_file(mbImpl, filenames, tag_name, tag_val,
distrib, parallel_option, resolve_shared,
- with_ghosts, use_mpio);
+ with_ghosts, use_mpio, print_parallel);
if (MB_SUCCESS != tmp_result) {
result = tmp_result;
std::cerr << "Couldn't read mesh; error message:" << std::endl;
@@ -291,7 +297,7 @@
std::vector<std::string> &filenames,
const char *tag_name, int tag_val,
int distrib, int parallel_option, int resolve_shared,
- int with_ghosts, int use_mpio)
+ int with_ghosts, int use_mpio, bool print_parallel)
{
std::ostringstream options;
switch (parallel_option) {
@@ -328,6 +334,9 @@
options << ";CPUTIME";
+ if (print_parallel)
+ options << ";PRINT_PARALLEL";
+
std::vector<MBEntityHandle> filesets(filenames.size());
std::vector<MBParallelComm*> pcs(filenames.size());
std::vector<ReadParallel*> rps(filenames.size());
More information about the moab-dev
mailing list