|
DOUG 0.2
|
Module with various helper routines. More...
Functions/Subroutines | |
| subroutine | doug_callme (ival, dval, indi) |
| subroutine | wait_for_debugger () |
| logical | ismaster () |
| logical | isslave () |
| subroutine, private | util_logStreamCreate (stream_type) |
| subroutine | util_profStreamCreate () |
| Creates profiling file stream if specified in command arguments. | |
| subroutine | DOUG_abort (message, err) |
| subroutine | DOUG_quietAbort () |
| subroutine, private | util_initMPI () |
| subroutine | DOUG_Init (init_type) |
| subroutine, private | util_finalizeMPI () |
| subroutine | DOUG_Finalize () |
| subroutine, private | util_parseArgs () |
| subroutine, private | util_printCtrlFileInfo () |
| subroutine, private | util_printVersion () |
| subroutine, private | util_printUsage () |
| subroutine | CtrlData_initFromFile (CtrlFileName) |
| subroutine, private | util_actionOnCtrlArg (word1, word2) |
| subroutine | SharedCtrlData_print (noheader) |
| subroutine | MasterCtrlData_print (noheader) |
| subroutine | CtrlData_print () |
| subroutine | SharedCtrlData_MPItypeCreate () |
| subroutine | SharedCtrlData_Bcast () |
| integer | length (string) |
| subroutine | getword (string, num, wordx) |
| character *(300) | tolower (string) |
| subroutine | FindFreeIOUnit (found, iounit) |
| Finds first free IO unit starting from 7 to 99. | |
| subroutine | WriteSolutionToFile (x) |
| Writes vector x to the solution file. | |
| subroutine | WriteSolutionTextualFormat (iounit, x) |
| Writes the solution to an iounit (which is probably connected to a file) in textual format. | |
| subroutine | WriteSolutionBinaryFormat (iounit, x) |
| Writes the solution to an iounit (which is probably connected to a file) in binary format. | |
| subroutine | quicksort (n, indx) |
| sort integer array using quicksort algorithm | |
| integer | random_integer (mini, maxi) |
| Return random integer in the range [mini,maxi] with even distribution. | |
| subroutine | rand_intarr (n, riarr, mini, maxi) |
| Evaluate array of random integers in the range [mini,maxi] with even distribution. | |
| subroutine | random_permutation (n, inds) |
| Permute randomly the given array. | |
Module with various helper routines.
| subroutine DOUG_utils::CtrlData_initFromFile | ( | character*(*),intent(in),optional | CtrlFileName | ) |
Definition at line 629 of file DOUG_utils.F90.
References globals::D_CtrlFileName, DOUG_abort(), getword(), globals::mctls, globals::sctls, globals::stream, tolower(), and util_actionOnCtrlArg().
Referenced by DOUG_Init().
| subroutine DOUG_utils::CtrlData_print | ( | ) |
Definition at line 1390 of file DOUG_utils.F90.
References MasterCtrlData_print(), SharedCtrlData_print(), and globals::stream.
Referenced by DOUG_Init().
| subroutine DOUG_utils::DOUG_abort | ( | character*(*) | message, |
| integer,optional | err | ||
| ) |
Definition at line 254 of file DOUG_utils.F90.
References ismaster(), and globals::myrank.
Referenced by SpMtx_class::CloseSparseAssembledFile(), CtrlData_initFromFile(), DenseMtx_mod::DenseMtx_mvm(), Distribution_mod::Distribution_NewInit(), ElemMtxs_distribute::ElemMtxsIntf_distAndAssemble(), exchange_strong(), Fact_class::Fact_New(), Fact_class::Fact_solve(), subsolvers::factorise(), Preconditioner_mod::FinePreconditioner_Apply(), Graph_class::Graph_Init(), Graph_class::Graph_New(), Graph_class::Graph_newInit(), Graph_class::Graph_partng(), master_thread::master(), Mesh_class::Mesh_buildDualAdjncy(), Mesh_class::Mesh_buildHash(), Mesh_class::Mesh_findNghbrs(), Mesh_class::Mesh_MapsAndNghbrs(), Mesh_class::Mesh_paramsMPIISEND(), Mesh_class::Mesh_paramsMPIRECV(), Mesh_class::Mesh_readFileCoords(), Mesh_class::Mesh_readFileFreelists(), Mesh_class::Mesh_readFileFreemap(), Mesh_class::Mesh_readFileFreemask(), Mesh_class::Mesh_readFromFile(), pcg_mod::pcg_weigs(), Points2D_class::Points2D_newFill(), Polygon_class::Polygon_sortVerts(), quicksort(), SpMtx_class::ReadInSparseAssembledBulk(), SpMtx_class::ReadInSparseAssembledBulk_TextBinary(), SpMtx_class::ReadInSparseAssembledHeader(), SpMtx_class::ReadInSparseAssembledHeader_TextBinary(), SpMtx_op_Ax::SpMtx_Ax(), SpMtx_arrangement::SpMtx_build_ghost(), SpMtx_arrangement::SpMtx_build_ghost_v01(), SpMtx_arrangement::SpMtx_Build_lggl(), SpMtx_permutation::SpMtx_buildPermMap(), SpMtx_operation::SpMtx_DenseToSparse(), SpMtx_arrangement::SpMtx_distributeWithOverlap(), SpMtx_distribution_mod::SpMtx_exchange(), SpMtx_permutation::SpMtx_getNewToOldPerm(), SpMtx_permutation::SpMtx_getOldToNewPerm(), SpMtx_distribution_mod::SpMtx_localize(), SpMtx_operation::SpMtx_mvm(), SpMtx_util::SpMtx_printInfo(), SpMtx_util::SpMtx_writeLogicalValues(), SpMtx_util::SpMtx_writeMatrix(), util_initMPI(), util_parseArgs(), Vect_mod::Vect_buildDotMap(), Vect_mod::Vect_dot_product(), Vect_mod::Vect_exchangeIntf(), Vect_mod::Vect_permute(), Vect_mod::Vect_ReadFromFile(), Vect_mod::Vect_ReadFromFile_Binary(), and Vect_mod::Vect_ReadFromFile_Text().
| subroutine DOUG_utils::doug_callme | ( | integer | ival, |
| real,intent(inout) | dval, | ||
| integer,dimension(:) | indi | ||
| ) |
Definition at line 76 of file DOUG_utils.F90.
| subroutine DOUG_utils::DOUG_Finalize | ( | ) |
Definition at line 451 of file DOUG_utils.F90.
References globals::D_INIT_TYPE, globals::myrank, globals::stream, and util_finalizeMPI().
| subroutine DOUG_utils::DOUG_Init | ( | integer,intent(in),optional | init_type | ) |
Definition at line 367 of file DOUG_utils.F90.
References controls::controls_init(), CtrlData_initFromFile(), CtrlData_print(), parameters::D_INIT_SERIAL, globals::D_INIT_TYPE, ismaster(), SharedCtrlData_Bcast(), SharedCtrlData_MPItypeCreate(), util_initMPI(), util_logStreamCreate(), util_parseArgs(), and util_profStreamCreate().
| subroutine DOUG_utils::DOUG_quietAbort | ( | ) |
Definition at line 292 of file DOUG_utils.F90.
Referenced by util_parseArgs().
| subroutine DOUG_utils::FindFreeIOUnit | ( | logical,intent(out) | found, |
| integer,intent(out) | iounit | ||
| ) |
Finds first free IO unit starting from 7 to 99.
| found | has a free IO unit been found? |
| iounit | number of free IO unit found |
Definition at line 1575 of file DOUG_utils.F90.
References not, and globals::stream.
Referenced by SpMtx_class::ReadInSparseAssembledHeader_TextBinary(), SpMtx_util::SpMtx_writeLogicalValues(), SpMtx_util::SpMtx_writeMatrix(), Vect_mod::Vect_ReadFromFile_Binary(), Vect_mod::Vect_ReadFromFile_Text(), and WriteSolutionToFile().
| subroutine DOUG_utils::getword | ( | character*(*),intent(in) | string, |
| integer | num, | ||
| character*(*),intent(out) | wordx | ||
| ) |
Definition at line 1518 of file DOUG_utils.F90.
Referenced by CtrlData_initFromFile().
| logical DOUG_utils::ismaster | ( | ) |
Definition at line 112 of file DOUG_utils.F90.
References globals::myrank.
Referenced by DOUG_abort(), DOUG_Init(), Mesh_class::Mesh_dataMPIISENDRECV(), Mesh_class::Mesh_Destroy(), Mesh_class::Mesh_paramsMPIBCAST(), Mesh_class::Mesh_paramsMPIISEND(), pcgRobust_mod::pcg_forRCS(), pcg_mod::pcg_weigs(), Vect_mod::Print_Glob_Vect(), slave_thread::slave(), SpMtx_arrangement::SpMtx_distributeWithOverlap(), SpMtx_util::SpMtx_writeMatrix(), util_initMPI(), util_logStreamCreate(), and Vect_mod::Vect_readAndBroadcastRHS().
| logical DOUG_utils::isslave | ( | ) |
Definition at line 128 of file DOUG_utils.F90.
References globals::myrank.
Referenced by master_thread::master(), Mesh_class::Mesh_dataMPIISENDRECV(), Mesh_class::Mesh_paramsMPIBCAST(), Mesh_class::Mesh_paramsMPIRECV(), SharedCtrlData_Bcast(), and util_logStreamCreate().
| integer DOUG_utils::length | ( | character*(*),intent(in) | string | ) |
Definition at line 1500 of file DOUG_utils.F90.
Referenced by MasterCtrlData_print(), and SharedCtrlData_print().
| subroutine DOUG_utils::MasterCtrlData_print | ( | logical,intent(in),optional | noheader | ) |
Definition at line 1281 of file DOUG_utils.F90.
References controls::ctl_words, controls::DCTL_assembled_mtx_file, controls::DCTL_assembled_mtx_format, controls::DCTL_assembled_rhs_file, controls::DCTL_assembled_rhs_format, controls::DCTL_coords_file, controls::DCTL_cutbal, controls::DCTL_dump_matrix_file, controls::DCTL_dump_matrix_only, controls::DCTL_elemmat_rhs_file, controls::DCTL_freedom_lists_file, controls::DCTL_freedom_mask_file, controls::DCTL_freemap_file, controls::DCTL_info_file, controls::DCTL_maxcie, controls::DCTL_maxnd, controls::DCTL_NWORDS, controls::DCTL_solution_file, controls::DCTL_solution_format, controls::DCTL_start_vec_file, controls::DCTL_start_vec_type, mparameters::DISTRIBUTION_TYPE_ASSEMBLED, mparameters::DISTRIBUTION_TYPE_ELEMENTAL, length(), not, and globals::stream.
Referenced by CtrlData_print(), and master_thread::master().
| subroutine DOUG_utils::quicksort | ( | integer | n, |
| integer,dimension(n) | indx | ||
| ) |
sort integer array using quicksort algorithm
| n | size of the array indx |
| indx | values to be sorted |
Definition at line 1707 of file DOUG_utils.F90.
References DOUG_abort(), and globals::stream.
Referenced by SpMtx_arrangement::SpMtx_build_ghost(), and SpMtx_arrangement::SpMtx_build_ghost_v01().
| subroutine DOUG_utils::rand_intarr | ( | integer,intent(in) | n, |
| integer,dimension(n),intent(out) | riarr, | ||
| integer,intent(in) | mini, | ||
| integer,intent(in) | maxi | ||
| ) |
Evaluate array of random integers in the range [mini,maxi] with even distribution.
Definition at line 1805 of file DOUG_utils.F90.
| integer DOUG_utils::random_integer | ( | integer,intent(in) | mini, |
| integer,intent(in) | maxi | ||
| ) |
Return random integer in the range [mini,maxi] with even distribution.
Definition at line 1792 of file DOUG_utils.F90.
| subroutine DOUG_utils::random_permutation | ( | integer,intent(in) | n, |
| integer,dimension(:),pointer | inds | ||
| ) |
Permute randomly the given array.
Definition at line 1820 of file DOUG_utils.F90.
Referenced by SpMtx_arrangement::SpMtx_roughly_aggregate().
| subroutine DOUG_utils::SharedCtrlData_Bcast | ( | ) |
Definition at line 1480 of file DOUG_utils.F90.
References globals::D_DEBUGLVL, globals::D_MPI_SCTLS_TYPE, globals::D_MSGLVL, isslave(), and globals::sctls.
Referenced by DOUG_Init().
| subroutine DOUG_utils::SharedCtrlData_MPItypeCreate | ( | ) |
Definition at line 1406 of file DOUG_utils.F90.
References globals::D_MPI_SCTLS_TYPE, globals::MPI_rkind, and globals::sctls.
Referenced by DOUG_Init().
| subroutine DOUG_utils::SharedCtrlData_print | ( | logical,intent(in),optional | noheader | ) |
Definition at line 1155 of file DOUG_utils.F90.
References controls::ctl_words, controls::DCTL_coarse_method, controls::DCTL_debug, controls::DCTL_fine_method, controls::DCTL_grid_size, controls::DCTL_initial_guess, controls::DCTL_input_type, controls::DCTL_interpolation_type, controls::DCTL_levels, controls::DCTL_matrix_type, controls::DCTL_maxasize1, controls::DCTL_maxasize2, controls::DCTL_method, controls::DCTL_minasize1, controls::DCTL_minasize2, controls::DCTL_num_iters, controls::DCTL_num_subdomains, controls::DCTL_number_of_blocks, controls::DCTL_NWORDS, controls::DCTL_overlap, controls::DCTL_plotting, controls::DCTL_radius1, controls::DCTL_radius2, controls::DCTL_smoothers, controls::DCTL_solve_maxiters, controls::DCTL_solve_tolerance, controls::DCTL_solver, controls::DCTL_strong1, controls::DCTL_strong2, controls::DCTL_symmnumeric, controls::DCTL_symmstruct, controls::DCTL_verbose, length(), not, and globals::stream.
Referenced by CtrlData_print(), and slave_thread::slave().
| character*(300) DOUG_utils::tolower | ( | character*(*),intent(in) | string | ) |
Definition at line 1550 of file DOUG_utils.F90.
Referenced by CtrlData_initFromFile().
| subroutine,private DOUG_utils::util_actionOnCtrlArg | ( | character*(*),intent(in) | word1, |
| character*(*),intent(in) | word2 | ||
| ) | [private] |
Definition at line 703 of file DOUG_utils.F90.
References controls::ctl_words, globals::D_DEBUGLVL, globals::D_MSGLVL, controls::DCTL_assembled_mtx_file, controls::DCTL_assembled_mtx_format, controls::DCTL_assembled_rhs_file, controls::DCTL_assembled_rhs_format, controls::DCTL_center_type, controls::DCTL_coarse_method, controls::DCTL_coords_file, controls::DCTL_cutbal, controls::DCTL_debug, controls::DCTL_dump_matrix_file, controls::DCTL_dump_matrix_only, controls::DCTL_elemmat_rhs_file, controls::DCTL_fine_method, controls::DCTL_freedom_lists_file, controls::DCTL_freedom_mask_file, controls::DCTL_freemap_file, controls::DCTL_grid_size, controls::DCTL_hanging_nodes, controls::DCTL_info_file, controls::DCTL_initial_guess, controls::DCTL_input_type, controls::DCTL_interpolation_type, controls::DCTL_levels, controls::DCTL_matrix_type, controls::DCTL_maxasize1, controls::DCTL_maxasize2, controls::DCTL_maxcie, controls::DCTL_maxnd, controls::DCTL_method, controls::DCTL_minasize1, controls::DCTL_minasize2, controls::DCTL_num_iters, controls::DCTL_num_subdomains, controls::DCTL_number_of_blocks, controls::DCTL_NWORDS, controls::DCTL_overlap, controls::DCTL_plotting, controls::DCTL_radius1, controls::DCTL_radius2, controls::DCTL_smoothers, controls::DCTL_solution_file, controls::DCTL_solution_format, controls::DCTL_solve_maxiters, controls::DCTL_solve_tolerance, controls::DCTL_solver, controls::DCTL_start_vec_file, controls::DCTL_start_vec_type, controls::DCTL_strong1, controls::DCTL_strong2, controls::DCTL_symmnumeric, controls::DCTL_symmstruct, and controls::DCTL_verbose.
Referenced by CtrlData_initFromFile().
| subroutine,private DOUG_utils::util_finalizeMPI | ( | ) | [private] |
Definition at line 435 of file DOUG_utils.F90.
References globals::D_MPI_WAS_INITED, and not.
Referenced by DOUG_Finalize().
| subroutine,private DOUG_utils::util_initMPI | ( | ) | [private] |
Definition at line 311 of file DOUG_utils.F90.
References DOUG_abort(), ismaster(), globals::myrank, not, and globals::numprocs.
Referenced by DOUG_Init().
| subroutine,private DOUG_utils::util_logStreamCreate | ( | integer,intent(in),optional | stream_type | ) | [private] |
Definition at line 144 of file DOUG_utils.F90.
References ismaster(), isslave(), globals::myrank, or(), and globals::stream.
Referenced by DOUG_Init().
| subroutine,private DOUG_utils::util_parseArgs | ( | ) | [private] |
Definition at line 471 of file DOUG_utils.F90.
References DOUG_abort(), DOUG_quietAbort(), not, globals::stream, util_printCtrlFileInfo(), util_printUsage(), and util_printVersion().
Referenced by DOUG_Init().
| subroutine,private DOUG_utils::util_printCtrlFileInfo | ( | ) | [private] |
Definition at line 571 of file DOUG_utils.F90.
References controls::ctl_words, and globals::stream.
Referenced by util_parseArgs().
| subroutine,private DOUG_utils::util_printUsage | ( | ) | [private] |
Definition at line 605 of file DOUG_utils.F90.
References globals::stream.
Referenced by util_parseArgs().
| subroutine,private DOUG_utils::util_printVersion | ( | ) | [private] |
Definition at line 589 of file DOUG_utils.F90.
References globals::stream.
Referenced by util_parseArgs().
| subroutine DOUG_utils::util_profStreamCreate | ( | ) |
Creates profiling file stream if specified in command arguments.
Definition at line 215 of file DOUG_utils.F90.
References globals::pstream.
Referenced by DOUG_Init().
| subroutine DOUG_utils::wait_for_debugger | ( | ) |
Definition at line 95 of file DOUG_utils.F90.
| subroutine DOUG_utils::WriteSolutionBinaryFormat | ( | integer,intent(in) | iounit, |
| float(kind=rk),dimension(:),intent(in) | x | ||
| ) |
Writes the solution to an iounit (which is probably connected to a file) in binary format.
The format is like this:
n, x(1), x(2), ..., x(n)
| iounit | IO-unit to write to |
| x | vector to write out |
Definition at line 1666 of file DOUG_utils.F90.
References RealKind::rk.
Referenced by WriteSolutionToFile().
| subroutine DOUG_utils::WriteSolutionTextualFormat | ( | integer,intent(in) | iounit, |
| float(kind=rk),dimension(:),intent(in) | x | ||
| ) |
Writes the solution to an iounit (which is probably connected to a file) in textual format.
| iounit | IO-unit to write to |
| x | vector to write out |
Definition at line 1643 of file DOUG_utils.F90.
References RealKind::rk.
Referenced by WriteSolutionToFile().
| subroutine DOUG_utils::WriteSolutionToFile | ( | float(kind=rk),dimension(:),intent(in) | x | ) |
Writes vector x to the solution file.
| x | vector to write out |
Definition at line 1598 of file DOUG_utils.F90.
References FindFreeIOUnit(), globals::mctls, RealKind::rk, globals::stream, WriteSolutionBinaryFormat(), and WriteSolutionTextualFormat().
1.7.3-20110217