[cig-commits] [commit] pluggable: Cleanly separate the subset of model plug-ins which is a dependency of the serial codes. The three plug-in routines called from read_compute_parameters() -- get_model_properties(), get_reference_1d_model_radii(), and reference_1d_model_adjust_time_step() -- must reside in a source file that ends with ".serial.f90" or ".serial.c". The code in "*.serial.*" source files cannot use MPI. (276f696)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 08:54:59 PDT 2014


Repository : ssh://geoshell/specfem3d_globe

On branch  : pluggable
Link       : https://github.com/geodynamics/specfem3d_globe/compare/64e1b38f0c5ebb4056cce0b15d41c0b9f94ab6e5...099a4d330d5b173b21e51ad441f9f429e5d37842

>---------------------------------------------------------------

commit 276f69627f3aae7900c4d3a879d627fcd5e61ee6
Author: Leif Strand <leif at geodynamics.org>
Date:   Fri Feb 27 00:59:07 2009 +0000

    Cleanly separate the subset of model plug-ins which is a dependency of
    the serial codes.  The three plug-in routines called from
    read_compute_parameters() -- get_model_properties(),
    get_reference_1d_model_radii(), and reference_1d_model_adjust_time_step()
    -- must reside in a source file that ends with ".serial.f90" or
    ".serial.c".  The code in "*.serial.*" source files cannot use MPI.


>---------------------------------------------------------------

276f69627f3aae7900c4d3a879d627fcd5e61ee6
 Makefile.in      |  5 +----
 prepare-model.py | 29 +++++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index dce00c0..8786eb0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -221,7 +221,7 @@ xspecfem3D: $(XSPECFEM_OBJECTS)
 	${MPIFCCOMPILE_NO_CHECK} -o xspecfem3D $(XSPECFEM_OBJECTS) $(MPILIBS)
 
 
-SERIAL_LIBS = $(model_OBJECTS) $O/exit_mpi_dummy.o $(LIBSPECFEM)
+SERIAL_LIBS = $(model_SERIAL_OBJECTS) $(LIBSPECFEM)
 
 xconvolve_source_timefunction: $O/convolve_source_timefunction.o
 	${FCCOMPILE_CHECK} -o xconvolve_source_timefunction $O/convolve_source_timefunction.o
@@ -360,9 +360,6 @@ $O/locate_receivers.o: constants.h $S/locate_receivers.f90
 $O/exit_mpi.o: constants.h $S/exit_mpi.f90
 	${MPIFCCOMPILE_CHECK} -c -o $O/exit_mpi.o ${FCFLAGS_f90} $S/exit_mpi.f90
 
-$O/exit_mpi_dummy.o: constants.h $S/MODELS/harness/lib/chino/exit_mpi.f90
-	${FCCOMPILE_CHECK} -c -o $O/exit_mpi_dummy.o ${FCFLAGS_f90} $S/MODELS/harness/lib/chino/exit_mpi.f90
-
 $O/count_number_of_sources.o: constants.h $S/count_number_of_sources.f90
 	${FCCOMPILE_CHECK} -c -o $O/count_number_of_sources.o ${FCFLAGS_f90} $S/count_number_of_sources.f90
 
diff --git a/prepare-model.py b/prepare-model.py
index de242a3..104cd14 100755
--- a/prepare-model.py
+++ b/prepare-model.py
@@ -18,6 +18,8 @@ class CopiedFromPortal:
         path = "model"
 
         directories = []
+        serialFortranSourceFiles = []
+        serialCSourceFiles = []
         fortranSourceFiles = []
         cSourceFiles = []
 
@@ -33,9 +35,15 @@ class CopiedFromPortal:
             elif tarinfo.name.endswith(".f90") or tarinfo.name.endswith(".c"):
                 pathname = os.path.join(path, tarinfo.name)
                 if tarinfo.name.endswith(".f90"):
-                    fortranSourceFiles.append(pathname)
+                    if tarinfo.name.endswith(".serial.f90"):
+                        serialFortranSourceFiles.append(pathname)
+                    else:
+                        fortranSourceFiles.append(pathname)
                 else:
-                    cSourceFiles.append(pathname)
+                    if tarinfo.name.endswith(".serial.c"):
+                        serialCSourceFiles.append(pathname)
+                    else:
+                        cSourceFiles.append(pathname)
                 thisDir = dirname(tarinfo.name) # see bcast_model.c
                 s = tgz.extractfile(tarinfo)
                 f = open(pathname, "w")
@@ -63,12 +71,29 @@ class CopiedFromPortal:
         # Generate the make include file.
         s = open("model.mk", "w")
         print >>s
+        print >>s, "model_SERIAL_OBJECTS = \\"
+        for sourceFile in chain(serialFortranSourceFiles, serialCSourceFiles):
+            base = splitext(basename(sourceFile))[0]
+            print >>s, "\t$O/%s.o \\" % base
+        print >>s, "\t$(empty)"
+        print >>s
         print >>s, "model_OBJECTS = \\"
         for sourceFile in chain(fortranSourceFiles, cSourceFiles):
             base = splitext(basename(sourceFile))[0]
             print >>s, "\t$O/%s.o \\" % base
+        print >>s, "\t$(model_SERIAL_OBJECTS) \\"
         print >>s, "\t$(empty)"
         print >>s
+        for sourceFile in serialFortranSourceFiles:
+            base = splitext(basename(sourceFile))[0]
+            print >>s, "$O/%s.o: constants.h %s" % (base, sourceFile)
+            print >>s, "\t${FCCOMPILE_CHECK} -c -o $O/%s.o ${FCFLAGS_f90} %s" % (base, sourceFile)
+            print >>s
+        for sourceFile in serialCSourceFiles:
+            base = splitext(basename(sourceFile))[0]
+            print >>s, "$O/%s.o: config.h %s" % (base, sourceFile)
+            print >>s, "\t$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $O/%s.o %s" % (base, sourceFile)
+            print >>s
         for sourceFile in fortranSourceFiles:
             base = splitext(basename(sourceFile))[0]
             print >>s, "$O/%s.o: constants.h %s" % (base, sourceFile)



More information about the CIG-COMMITS mailing list