Skip to content

Commit

Permalink
Add Purkinje support for MPI batch simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
bergolho committed Nov 30, 2023
1 parent ad78a7f commit fbdc11a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if [ -n "$COMPILE_MPI" ]; then
DYNAMIC_DEPS="$DYNAMIC_DEPS $MPI_LIBRARIES"
EXTRA_LIB_PATH="$EXTRA_LIB_PATH $CUDA_LIBRARY_PATH $MPI_LIBRARY_PATH $LIBRARY_OUTPUT_DIRECTORY"

COMPILE_EXECUTABLE "MonoAlg3D_batch" "$SRC_FILES" "$HDR_FILES" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $CUDA_MATH_LIBRARY_PATH $EXTRA_LIB_PATH" "$INCLUDE_P"
COMPILE_EXECUTABLE "MonoAlg3D_batch" "$SRC_FILES" "$HDR_FILES" "$STATIC_DEPS" "$DYNAMIC_DEPS" "$CUDA_LIBRARY_PATH $CUDA_MATH_LIBRARY_PATH $EXTRA_LIB_PATH" "-I$MPI_INCLUDE_PATH"
fi

fi
Expand Down
32 changes: 31 additions & 1 deletion src/utils/batch_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ void configure_new_parameters(struct changed_parameters *changed, struct user_op
free(options->model_file_path);
options->model_file_path = strdup(changed[n].value);
}
} else if (strcmp(ODE_PURKINJE_SECTION, changed[n].section) == 0) {
if (strcmp("dt", changed[n].name) == 0) {
options->dt_ode = float_value;
//TODO: this is deprecated
} else if (strcmp("gpu_id", changed[n].name) == 0) {
options->gpu_id = (int) float_value;
} else if (strcmp("library_file", changed[n].name) == 0) {
free(options->model_file_path);
options->model_file_path = strdup(changed[n].value);
}
}

if (strcmp(EXTRA_DATA_SECTION, changed[n].section) == 0) {
Expand All @@ -55,7 +65,13 @@ void configure_new_parameters(struct changed_parameters *changed, struct user_op
if (options->domain_config) {
set_or_overwrite_common_data(options->domain_config, changed[n].name, changed[n].value, NULL, NULL);
}
} else if (strcmp(MATRIX_ASSEMBLY_SECTION, changed[n].section) == 0) {
} else if (strcmp(PURKINJE_SECTION, changed[n].section) == 0) {

if (options->purkinje_config) {
set_or_overwrite_common_data(options->purkinje_config, changed[n].name, changed[n].value, NULL, NULL);
}
}
else if (strcmp(MATRIX_ASSEMBLY_SECTION, changed[n].section) == 0) {
if (options->assembly_matrix_config) {
set_or_overwrite_common_data(options->assembly_matrix_config, changed[n].name, changed[n].value, NULL, NULL);
}
Expand All @@ -64,6 +80,11 @@ void configure_new_parameters(struct changed_parameters *changed, struct user_op
if (options->linear_system_solver_config) {
set_or_overwrite_common_data(options->linear_system_solver_config, changed[n].name, changed[n].value, NULL, NULL);

}
} else if (strcmp(LINEAR_SYSTEM_SOLVER_PURKINJE_SECTION, changed[n].section) == 0) {
if (options->purkinje_linear_system_solver_config) {
set_or_overwrite_common_data(options->purkinje_linear_system_solver_config, changed[n].name, changed[n].value, NULL, NULL);

}
} else if (strncmp(changed[n].section, STIM_SECTION, strlen(STIM_SECTION)) == 0) {

Expand All @@ -74,6 +95,15 @@ void configure_new_parameters(struct changed_parameters *changed, struct user_op

}

} else if (strncmp(changed[n].section, STIM_PURKINJE_SECTION, strlen(STIM_PURKINJE_SECTION)) == 0) {

struct config *sc = (struct config *) shget(options->stim_configs, changed[n].section);
if (sc) {
set_or_overwrite_common_data(sc, changed[n].name, changed[n].value, NULL, NULL);
shput(options->stim_configs, changed[n].section, sc);

}

}

}
Expand Down

0 comments on commit fbdc11a

Please sign in to comment.