Set MPI_HOME.
(environ_cp)
| 1144 | |
| 1145 | |
| 1146 | def set_mpi_home(environ_cp): |
| 1147 | """Set MPI_HOME.""" |
| 1148 | |
| 1149 | default_mpi_home = which('mpirun') or which('mpiexec') or '' |
| 1150 | default_mpi_home = os.path.dirname(os.path.dirname(default_mpi_home)) |
| 1151 | |
| 1152 | def valid_mpi_path(mpi_home): |
| 1153 | exists = ( |
| 1154 | os.path.exists(os.path.join(mpi_home, 'include')) and |
| 1155 | (os.path.exists(os.path.join(mpi_home, 'lib')) or |
| 1156 | os.path.exists(os.path.join(mpi_home, 'lib64')) or |
| 1157 | os.path.exists(os.path.join(mpi_home, 'lib32')))) |
| 1158 | if not exists: |
| 1159 | print( |
| 1160 | 'Invalid path to the MPI Toolkit. %s or %s or %s or %s cannot be found' |
| 1161 | % (os.path.join(mpi_home, 'include'), |
| 1162 | os.path.exists(os.path.join(mpi_home, 'lib')), |
| 1163 | os.path.exists(os.path.join(mpi_home, 'lib64')), |
| 1164 | os.path.exists(os.path.join(mpi_home, 'lib32')))) |
| 1165 | return exists |
| 1166 | |
| 1167 | _ = prompt_loop_or_load_from_env( |
| 1168 | environ_cp, |
| 1169 | var_name='MPI_HOME', |
| 1170 | var_default=default_mpi_home, |
| 1171 | ask_for_var='Please specify the MPI toolkit folder.', |
| 1172 | check_success=valid_mpi_path, |
| 1173 | error_msg='', |
| 1174 | suppress_default_error=True) |
| 1175 | |
| 1176 | |
| 1177 | def set_other_mpi_vars(environ_cp): |
no test coverage detected