Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jinmerge #58

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0cc8bd8
New branch for CUDA integration. Tracker item 2180
jinthagerman Jan 24, 2011
d17fe30
Initial commit of cuda integration. Makefiles are hacked to together …
jinthagerman Jan 24, 2011
5d014f3
Updated cellml to opencmiss field mapping calls. Tracker item 2180
jinthagerman Jan 24, 2011
c885973
Backup commit. Getting random segment violations
jinthagerman Jan 28, 2011
10aeb73
Fixed a few bugs in FieldIOImportFields. No Tracker Item
jinthagerman Feb 1, 2011
7557b3f
CMGUI heart mesh files added. Tracker item 2180
jinthagerman Feb 1, 2011
1664975
Added code to read vtk files for an unstructered tet mesh plus merge …
jinthagerman Feb 2, 2011
5707beb
Implemented VTK reading in MonodomainCUDA example. Getting Segment vi…
jinthagerman Feb 3, 2011
75ea90c
Bug fixes.
chrispbradley Feb 3, 2011
831e52b
VTK importing properly into example. No Tracker Item
jinthagerman Feb 3, 2011
61394cc
Changes made to Monodomain files. Tracker item 2180
jinthagerman Feb 7, 2011
e1d5515
Updated CUDA example, changed to fitzhugh nagumo for simplicity. See …
jinthagerman Feb 9, 2011
7fa1775
Fixed broken working copy of branch. Commit with merges no significan…
jinthagerman Mar 17, 2011
fff10dd
Merge repo changes with branch and made a few minor changes. No relat…
jinthagerman Apr 4, 2011
35468ae
Added cuda parameter setting methods to opencmiss. Merged changes als…
jinthagerman Apr 11, 2011
4678f1e
Rewrote partitioning algorithm as it was far too fragile. Added CLI t…
jinthagerman Apr 15, 2011
80d8467
Fixed issues with recent changes to field variables. No relevant Trac…
jinthagerman Apr 18, 2011
b6c3629
Further optimisations and fixes to partitioning algorithm. Added FHN …
jinthagerman Apr 19, 2011
fb3328a
Added per-time step solver timing data dump and total solve timing re…
jinthagerman Apr 20, 2011
7c52a10
Changed some WRITEs to write_string_value to clean up output. Added h…
jinthagerman Apr 20, 2011
102334e
CUDA changes.
chrispbradley Jun 14, 2011
9584a63
Initialise pointers bug fix.
chrispbradley Oct 17, 2011
5175b07
More uninitialised pointers.
chrispbradley Oct 18, 2011
3fcb2e1
OpenMPI include path corrections.
chrispbradley Oct 18, 2011
24e3f1f
Uninitialised pointer.
chrispbradley Oct 18, 2011
3c478c8
Merge branch 'master' of https://github.com/OpenCMISS/cm
chrispbradley Nov 10, 2011
e72f935
Moving MPI to its own repository.
chrispbradley Nov 22, 2011
d7014fe
Makefile merge.
chrispbradley Nov 23, 2011
ef3d356
Merge branch 'master' of https://github.com/OpenCMISS/cm
chrispbradley Nov 27, 2011
a0ceb30
Remove nodal from FieldML input parameters.
chrispbradley Nov 27, 2011
e6cfb55
Fix typo.
chrispbradley Nov 27, 2011
bc06e26
Fix more typos.
chrispbradley Nov 27, 2011
d0bd65c
Merge branch 'jin' of https://github.com/chrispbradley/cm
chrispbradley Dec 1, 2011
2e9dd33
Error message for fopen problems.
chrispbradley Dec 2, 2011
4a03384
Tidy ups
chrispbradley Dec 3, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ExampleMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
ifndef GLOBAL_ROOT
$(error GLOBAL_ROOT is not setup)
else
GLOBAL_CM_ROOT := $(GLOBAL_ROOT)
GLOBAL_CM_ROOT := $(GLOBAL_ROOT)
endif

ifndef OPENCMISSEXAMPLES_ROOT
Expand Down Expand Up @@ -142,11 +142,11 @@ $(EXE_DIR) :

$(EXECUTABLE) : $(OBJECTS) $(OPENCMISS_LIBRARY)
$(EXE_LINK) -o $@ $(OBJECTS) $(OPENCMISS_LIBRARY) $(ELFLAGS) $(EXTERNAL_LIBRARIES)
# $(EXE_LINK) -o $@ $(OBJECTS) $(OPENCMISS_LIBRARY) $(ELFLAGS) $(EXTERNAL_LIBRARIES) -L/people/vbud003/NVIDIA_GPU_Computing_SDK/C/lib -L/people/vbud003/NVIDIA_GPU_Computing_SDK/C/common/lib/linux -L/people/vbud003/NVIDIA_GPU_Computing_SDK/shared//lib -lcudart -L/people/vbud003/NVIDIA_GPU_Computing_SDK/C/lib -L/people/vbud003/NVIDIA_GPU_Computing_SDK/C/common/lib/linux -L/people/vbud003/NVIDIA_GPU_Computing_SDK/shared//lib -L/usr/local/cuda/lib64/ -lcudart -lcutil_x86_64 -lshrutil_x86_64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this line should be deleted now that the libraries are included in $(EXTERNAL_LIBRARIES) from MakefileCommon.inc


$(OPENCMISS_LIBRARY) :
( cd $(GLOBAL_CM_ROOT); $(MAKE) )


# Place the list of dependencies for the objects here.
#
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -215,13 +215,14 @@ help:
@echo "Options: (The former is the default unless specified.)"
@echo
@echo " (DEBUG=|OPT=)"
@echo " MPI=(mpich2|intel|openmpi|mvapich2|cray)"
@echo " MPI=(mpich2|intel|openmpi)"
@echo " PROF=(true|)"
@echo " MPIPROF=(true|)"
@echo " ABI=(32|64)"
@echo " COMPILER=(intel|gnu|ibm|cray)"
@echo " USECELLML=(false|true)"
@echo " USEFIELDML=(false|true)"
@echo " USEFIELDML=(true|false)"
@echo " USECUDA=(false|true)"
@echo
@echo "Available targets: "
@echo
Expand Down
31 changes: 25 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ main: preliminaries \

PREPROCESSED_OBJECTS =

.SUFFIXES: .f90 .c .cu

$(OBJECT_DIR)/%.o : $(SOURCE_DIR)/%.f90 $(OBJECT_DIR)/.directory
( cd $(OBJECT_DIR) && $(FC) -o $@ $(FFLAGS) $(FPPFLAGS) -c $< )

$(OBJECT_DIR)/%.o : $(SOURCE_DIR)/%.c $(OBJECT_DIR)/.directory
( cd $(OBJECT_DIR) && $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< )

$(OBJECT_DIR)/%.o : $(SOURCE_DIR)/%.cu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also depend on $(OBJECT_DIR)/.directory

( cd $(OBJECT_DIR) ; $(NVCC) -o $@ $(NVCCFLAGS) $(NVCCPPFLAGS) -c $< )

$(PREPROCESSED_OBJECTS) : $(OBJECT_DIR)/%.o : $(SOURCE_DIR)/%.f90 $(OBJECT_DIR)/.directory
( m4 --prefix-builtins $< > $(subst .o,-expanded.f90,$@) && cd $(OBJECT_DIR) && $(FC) -o $@ $(FFLAGS) $(FPPFLAGS) -c $(subst .o,-expanded.f90,$@) )

Expand All @@ -125,6 +130,12 @@ else
FIELDML_OBJECT = #
endif

ifeq ($(USECUDA),true)
CUDA_OBJECT = $(OBJECT_DIR)/external_dae_solver_routines.o
else
CUDA_OBJECT = $(OBJECT_DIR)/external_dae_solver_routines_dummy.o
endif

#ifeq ($(COMPILER),intel) # TODO: temporarily disable intel build for opencmiss.f90 and etc.
# FIELDML_OBJECT = #
# MOD_INCLUDE := #
Expand Down Expand Up @@ -180,7 +191,6 @@ OBJECTS = $(OBJECT_DIR)/advection_diffusion_equation_routines.o \
$(OBJECT_DIR)/equations_matrices_routines.o \
$(OBJECT_DIR)/equations_set_constants.o \
$(OBJECT_DIR)/equations_set_routines.o \
$(OBJECT_DIR)/external_dae_solver_routines.o \
$(OBJECT_DIR)/field_routines.o \
$(OBJECT_DIR)/field_IO_routines.o \
$(OBJECT_DIR)/finite_elasticity_routines.o \
Expand Down Expand Up @@ -233,6 +243,8 @@ OBJECTS = $(OBJECT_DIR)/advection_diffusion_equation_routines.o \
$(OBJECT_DIR)/trees.o \
$(OBJECT_DIR)/types.o \
$(OBJECT_DIR)/util_array.o \
$(OBJECT_DIR)/vtk_import_routines.o \
$(CUDA_OBJECT) \
$(FIELDML_OBJECT) \
$(PREPROCESSED_OBJECTS)

Expand Down Expand Up @@ -444,6 +456,8 @@ $(OBJECT_DIR)/cmiss_cellml_dummy.o : $(SOURCE_DIR)/cmiss_cellml_dummy.f90

$(OBJECT_DIR)/cmiss_fortran_c.o : $(SOURCE_DIR)/cmiss_fortran_c.f90

$(OBJECT_DIR)/cmiss_fortran_c.o : $(SOURCE_DIR)/cmiss_fortran_c.f90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it's been copied accidentally from above?


$(OBJECT_DIR)/cmiss_mpi.o : $(SOURCE_DIR)/cmiss_mpi.f90 \
$(OBJECT_DIR)/base_routines.o \
$(OBJECT_DIR)/constants.o \
Expand Down Expand Up @@ -874,8 +888,10 @@ $(OBJECT_DIR)/equations_set_routines.o : $(SOURCE_DIR)/equations_set_routines.f9
$(OBJECT_DIR)/timer_f.o \
$(OBJECT_DIR)/types.o

$(OBJECT_DIR)/external_dae_solver_routines.o : $(SOURCE_DIR)/external_dae_solver_routines.c \
$(SOURCE_DIR)/external_dae_solver_routines.h
$(OBJECT_DIR)/external_dae_solver_routines.o : $(SOURCE_DIR)/external_dae_solver_routines.cu \
$(SOURCE_DIR)/external_dae_solver_routines.h

$(OBJECT_DIR)/external_dae_solver_routines_dummy.o : $(SOURCE_DIR)/external_dae_solver_routines_dummy.c

$(OBJECT_DIR)/field_routines.o : $(SOURCE_DIR)/field_routines.f90 \
$(OBJECT_DIR)/base_routines.o \
Expand Down Expand Up @@ -912,7 +928,8 @@ $(OBJECT_DIR)/field_IO_routines.o : $(SOURCE_DIR)/field_IO_routines.f90 \
$(OBJECT_DIR)/mesh_routines.o \
$(OBJECT_DIR)/node_routines.o \
$(OBJECT_DIR)/strings.o \
$(OBJECT_DIR)/types.o
$(OBJECT_DIR)/types.o \
$(OBJECT_DIR)/vtk_import_routines.o

$(OBJECT_DIR)/finite_elasticity_routines.o : $(SOURCE_DIR)/finite_elasticity_routines.f90 \
$(OBJECT_DIR)/base_routines.o \
Expand Down Expand Up @@ -1404,7 +1421,6 @@ $(OBJECT_DIR)/Poiseuille_equations_routines.o : $(SOURCE_DIR)/Poiseuille_equatio
$(OBJECT_DIR)/timer_f.o \
$(OBJECT_DIR)/types.o


$(OBJECT_DIR)/Poisson_equations_routines.o : $(SOURCE_DIR)/Poisson_equations_routines.f90 \
$(OBJECT_DIR)/base_routines.o \
$(OBJECT_DIR)/basis_routines.o \
Expand Down Expand Up @@ -1511,7 +1527,7 @@ $(OBJECT_DIR)/solver_routines.o : $(SOURCE_DIR)/solver_routines.f90 \
$(OBJECT_DIR)/constants.o \
$(OBJECT_DIR)/distributed_matrix_vector.o \
$(OBJECT_DIR)/equations_set_constants.o \
$(OBJECT_DIR)/external_dae_solver_routines.o \
$(CUDA_OBJECT) \
$(OBJECT_DIR)/field_routines.o \
$(OBJECT_DIR)/kinds.o \
$(OBJECT_DIR)/input_output.o \
Expand Down Expand Up @@ -1622,6 +1638,9 @@ $(OBJECT_DIR)/util_array.o : $(SOURCE_DIR)/util_array.f90 \
$(OBJECT_DIR)/base_routines.o \
$(OBJECT_DIR)/types.o

$(OBJECT_DIR)/vtk_import_routines.o : $(SOURCE_DIR)/vtk_import_routines.c \
$(SOURCE_DIR)/vtk_import_routines.h

# ----------------------------------------------------------------------------
#
# SWIG bindings to other languages
Expand Down
2 changes: 2 additions & 0 deletions src/analytic_analysis_routines.f90
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ SUBROUTINE ANALYTIC_ANALYSIS_OUTPUT(FIELD,FILENAME,ERR,ERROR,*)
LOCAL_STRING="Field "//TRIM(NUMBER_TO_VSTRING(FIELD%USER_NUMBER,"*",ERR,ERROR))//" : "//FIELD%LABEL
IF(ERR/=0) GOTO 999
CALL WRITE_STRING(OUTPUT_ID,LOCAL_STRING,ERR,ERROR,*999)
NULLIFY(NUMERICAL_VALUES)
NULLIFY(ANALYTIC_VALUES)
!Loop over the variables
DO var_idx=1,FIELD%NUMBER_OF_VARIABLES
variable_type=FIELD%VARIABLES(var_idx)%VARIABLE_TYPE
Expand Down
32 changes: 23 additions & 9 deletions src/cmiss_cellml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ SUBROUTINE CELLML_CREATE_FINISH(CELLML,ERR,ERROR,*)
!Check that we have set up the models
IF(CELLML%NUMBER_OF_MODELS>0) THEN
DO model_idx=1,CELLML%NUMBER_OF_MODELS
write(*,*) 'model_idx = ',model_idx
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'model_idx = ',model_idx,ERR,ERROR,*999)
ENDIF
CELLML_MODEL => CELLML%MODELS(model_idx)%PTR
!CALL CELLML_MODEL_DEFINITION_SET_SAVE_TEMP_FILES(CELLML_MODEL%PTR,1)
ERROR_CODE = CELLML_MODEL_DEFINITION_INSTANTIATE(CELLML_MODEL%PTR)
Expand Down Expand Up @@ -2734,8 +2736,11 @@ SUBROUTINE CELLML_STATE_FIELD_CREATE_FINISH(CELLML,ERR,ERROR,*)
& TRIM(NUMBER_TO_VSTRING(state_component_idx,"*",ERR,ERROR))//"."
CALL FLAG_ERROR(LOCAL_ERROR,ERR,ERROR,*999)
ENDIF
WRITE(*,*) '(single model) Initial value for state variable: ',state_component_idx,'; type: ',&
& CELLML_VARIABLE_TYPE,'; value = ',INITIAL_VALUE
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING_TWO_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'(single model) Initial value for state variable: ', &
& state_component_idx,'; type: ',CELLML_VARIABLE_TYPE,ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'value = ',INITIAL_VALUE,ERR,ERROR,*999)
ENDIF
CALL FIELD_COMPONENT_VALUES_INITIALISE(CELLML%STATE_FIELD%STATE_FIELD,FIELD_U_VARIABLE_TYPE, &
& FIELD_VALUES_SET_TYPE,state_component_idx,INITIAL_VALUE,ERR,ERROR,*999)
ENDDO !state_component_idx
Expand Down Expand Up @@ -2765,8 +2770,11 @@ SUBROUTINE CELLML_STATE_FIELD_CREATE_FINISH(CELLML,ERR,ERROR,*)
& TRIM(NUMBER_TO_VSTRING(state_component_idx,"*",ERR,ERROR))//"."
CALL FLAG_ERROR(LOCAL_ERROR,ERR,ERROR,*999)
ENDIF
WRITE(*,*) '(multiple models) Initial value for state variable: ',state_component_idx,'; type: ',&
& CELLML_VARIABLE_TYPE,'; value = ',INITIAL_VALUE
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING_TWO_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'(multiple models) Initial value for state variable: '&
&,state_component_idx,'; type: ', CELLML_VARIABLE_TYPE,ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'value = ',INITIAL_VALUE,ERR,ERROR,*999)
ENDIF !\todo make diagnostic output
CALL CELLML_FIELD_VARIABLE_SOURCE_DOF_SET_CONSTANT(STATE_VARIABLE,FIELD_VALUES_SET_TYPE,source_dof_idx, &
& state_component_idx,INITIAL_VALUE,ERR,ERROR,*999)
ENDDO !state_component_idx
Expand Down Expand Up @@ -3607,8 +3615,11 @@ SUBROUTINE CELLML_PARAMETERS_FIELD_CREATE_FINISH(CELLML,ERR,ERROR,*)
& TRIM(NUMBER_TO_VSTRING(parameter_component_idx,"*",ERR,ERROR))//"."
CALL FLAG_ERROR(LOCAL_ERROR,ERR,ERROR,*999)
ENDIF
WRITE(*,*) '(single model) Initial value for parameter variable: ',parameter_component_idx,'; type: ',&
& CELLML_VARIABLE_TYPE,'; value = ',INITIAL_VALUE
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING_TWO_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'(single model) Initial value for state variable: ', &
& parameter_component_idx,'; type: ', CELLML_VARIABLE_TYPE,ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'value = ',INITIAL_VALUE,ERR,ERROR,*999)
ENDIF
CALL FIELD_COMPONENT_VALUES_INITIALISE(CELLML%PARAMETERS_FIELD%PARAMETERS_FIELD,FIELD_U_VARIABLE_TYPE, &
& FIELD_VALUES_SET_TYPE,parameter_component_idx,INITIAL_VALUE,ERR,ERROR,*999)
ENDDO !parameter_component_idx
Expand Down Expand Up @@ -3638,8 +3649,11 @@ SUBROUTINE CELLML_PARAMETERS_FIELD_CREATE_FINISH(CELLML,ERR,ERROR,*)
& TRIM(NUMBER_TO_VSTRING(parameter_component_idx,"*",ERR,ERROR))//"."
CALL FLAG_ERROR(LOCAL_ERROR,ERR,ERROR,*999)
ENDIF
WRITE(*,*) '(multiple models) Initial value for parameter variable: ',parameter_component_idx,'; type: ',&
& CELLML_VARIABLE_TYPE,'; value = ',INITIAL_VALUE
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING_TWO_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'(multiple models) Initial value for state variable: '&
&, parameter_component_idx,'; type: ', CELLML_VARIABLE_TYPE,ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,'value = ',INITIAL_VALUE,ERR,ERROR,*999)
ENDIF !\todo make diagnostic output
CALL CELLML_FIELD_VARIABLE_SOURCE_DOF_SET_CONSTANT(PARAMETERS_VARIABLE,FIELD_VALUES_SET_TYPE, &
& source_dof_idx, parameter_component_idx,INITIAL_VALUE,ERR,ERROR,*999)
ENDDO !parameter_component_idx
Expand Down
Loading