| 1398 | } |
| 1399 | |
| 1400 | void validate_newEnvDeploymentMode(int isDistrib, int isGpuAccel, int isMultithread, const char* caller) { |
| 1401 | |
| 1402 | // deployment flags must be boolean or auto |
| 1403 | tokenSubs vars = {{"${AUTO_DEPLOYMENT_FLAG}", modeflag::USE_AUTO}}; |
| 1404 | assertThat(isDistrib == 0 || isDistrib == 1 || isDistrib == modeflag::USE_AUTO, report::INVALID_OPTION_FOR_ENV_IS_DISTRIB, vars, caller); |
| 1405 | assertThat(isGpuAccel == 0 || isGpuAccel == 1 || isGpuAccel == modeflag::USE_AUTO, report::INVALID_OPTION_FOR_ENV_IS_GPU_ACCEL, vars, caller); |
| 1406 | assertThat(isMultithread == 0 || isMultithread == 1 || isMultithread == modeflag::USE_AUTO, report::INVALID_OPTION_FOR_ENV_IS_MULTITHREAD, vars, caller); |
| 1407 | |
| 1408 | // if a deployment is forced (i.e. not auto), assert that the backend binaries are compiled correctly |
| 1409 | if (isDistrib == 1) |
| 1410 | assertThat(comm_isMpiCompiled(), report::CANNOT_DISTRIB_ENV_WITHOUT_MPI_COMMPILATION, caller); |
| 1411 | |
| 1412 | if (isMultithread == 1) |
| 1413 | assertThat(cpu_isOpenmpCompiled(), report::CANNOT_MULTITHREAD_ENV_WITHOUT_OPENMP_COMPILATION, caller); |
| 1414 | |
| 1415 | if (isGpuAccel == 1) { |
| 1416 | assertThat(gpu_isGpuCompiled(), report::CANNOT_GPU_ACCEL_ENV_WITH_GPU_COMPILATION, caller); |
| 1417 | |
| 1418 | // additionally require GPUs are runtime discoverable |
| 1419 | assertThat(gpu_isGpuAvailable(), report::CANNOT_GPU_ACCEL_ENV_WITH_NO_AVAILABLE_GPUS, caller); |
| 1420 | } |
| 1421 | |
| 1422 | // note we do not require that when (isDistrib && isGpuAccel), the MPI is CUDA-aware and that |
| 1423 | // the GPU is MPI-supporting. We have a runtime fallback to route through CPU memory in that situation. |
| 1424 | |
| 1425 | // note we do not here check whether, when distributed, a power-of-2 number of nodes are used, |
| 1426 | // because that requires we first initialise MPI, which we wish the caller to explicitly perform |
| 1427 | } |
| 1428 | |
| 1429 | void validate_newEnvDistributedBetweenPower2Nodes(const char* caller) { |
| 1430 |
no test coverage detected