diff --git a/HEN_HOUSE/makefiles/beam_makefile b/HEN_HOUSE/makefiles/beam_makefile index 5809e5143..ef8375e2f 100644 --- a/HEN_HOUSE/makefiles/beam_makefile +++ b/HEN_HOUSE/makefiles/beam_makefile @@ -114,13 +114,17 @@ $(FORTRAN_FILE).$(FEXT): $(SOURCES) sources.make @$(MORTRAN_EXE) -d $(MORTRAN_DATA) -f $(SOURCES) -o7 $@ \ -o8 $(FORTRAN_FILE).mortlst +#******************************************************************************* +# #PARALLEL_EGS - Disable PJOB functionality for BEAMnrc libraries due to +# locking problems when used from dosxyznrc parallel execution +#******************************************************************************* library: $(LIB_FILE) $(LIB_FILE): $(LIB_FORTRAN_FILE).$(FOBJE) - $(F77_LINK) $(SHLIB_FLAGS) $(FCFLAGS) $(OPTLEVEL_F) $(FOUT)$@ $(LIB_FORTRAN_FILE).$(FOBJE) $(BEAM_EXTRA_OBJECTS) $(FLIBS) $(SHLIB_LIBS) + $(F77_LINK) $(SHLIB_FLAGS) $(FCFLAGS) -D_NOPJOB $(OPTLEVEL_F) $(FOUT)$@ $(LIB_FORTRAN_FILE).$(FOBJE) $(BEAM_EXTRA_OBJECTS) $(FLIBS) $(SHLIB_LIBS) $(LIB_FORTRAN_FILE).$(FOBJE): $(LIB_FORTRAN_FILE).$(FEXT) - $(F77) -c $(FCFLAGS) $(OPTLEVEL_F) $(FOUT)$@ $(LIB_FORTRAN_FILE).$(FEXT) + $(F77) -c $(FCFLAGS) -D_NOPJOB $(OPTLEVEL_F) $(FOUT)$@ $(LIB_FORTRAN_FILE).$(FEXT) $(LIB_FORTRAN_FILE).$(FEXT): $(LIB_SOURCES) sources.make @echo "Mortran compilation for $@" @@ -154,15 +158,22 @@ noopt: debug: @$(MAKE) WHAT=_debug OPTLEVEL_F="$(FDEBUG)" OPTLEVEL_C="$(CDEBUG)" +#******************************************************************************* +# #PARALLEL_EGS - Build a optimized user code with MPI support +#******************************************************************************* +mpi: + @$(MAKE) -s WHAT=_mpi F77=mpif90 FCFLAGS="$(FCFLAGS) -D_MPI" + clean: @echo "$(REMOVE) mortjob.mortran $(FORTRAN_FILE).$(FEXT) $(FORTRAN_FILE).mortlst" @$(REMOVE) mortjob.mortran $(FORTRAN_FILE).$(FEXT) $(FORTRAN_FILE).mortlst @$(MAKE) -s WHAT=_debug execlean @$(MAKE) -s WHAT=_noopt execlean + @$(MAKE) -s WHAT=_mpi execlean @$(MAKE) -s WHAT= execlean execlean: @echo "$(REMOVE) $(EXE_FILE)" $(REMOVE) $(EXE_FILE) -.PHONY: opt noopt debug clean execlean +.PHONY: opt noopt debug mpi clean execlean diff --git a/HEN_HOUSE/makefiles/standard_makefile b/HEN_HOUSE/makefiles/standard_makefile index 0c752d0be..b5f98347d 100644 --- a/HEN_HOUSE/makefiles/standard_makefile +++ b/HEN_HOUSE/makefiles/standard_makefile @@ -154,7 +154,7 @@ opt: # Build a user code without optimization noopt: - @$(MAKE) -s WHAT=_noopt OPTLEVEL_F= OPTLEVEL_C= + @$(MAKE) -s WHAT=_mpi OPTLEVEL_F= OPTLEVEL_C= # @($(MAKE) -s WHAT=_noopt OPTLEVEL_F= OPTLEVEL_C= && echo $(ok_message)) || echo $(failed_message) # Build a user code for debugging @@ -162,12 +162,19 @@ debug: @$(MAKE) -s WHAT=_debug OPTLEVEL_F="$(FDEBUG)" OPTLEVEL_C="$(CDEBUG)" #@($(MAKE) -s WHAT=_debug OPTLEVEL_F="$(FDEBUG)" OPTLEVEL_C="$(CDEBUG)" && echo $(ok_message)) || echo $(failed_message) +#******************************************************************************* +# #PARALLEL_EGS - Build a optimized user code with MPI support +#******************************************************************************* +mpi: + @$(MAKE) -s WHAT=_mpi F77=mpif90 FCFLAGS="$(FCFLAGS) -D_MPI" + # Clean-up the user code directory. clean: @echo "$(REMOVE) mortjob.mortran $(FORTRAN_FILE).$(FEXT) $(FORTRAN_FILE).mortlst" @$(REMOVE) mortjob.mortran $(FORTRAN_FILE).$(FEXT) $(FORTRAN_FILE).mortlst @$(MAKE) -s WHAT=_debug execlean @$(MAKE) -s WHAT=_noopt execlean + @$(MAKE) -s WHAT=_mpi execlean @$(MAKE) -s WHAT= execlean @echo $(ok_message) @@ -180,4 +187,4 @@ execlean: # execlean have no list of prerequisits so that make can determine whether # they need to be remade, we declare them as phony. # -.PHONY: opt noopt debug clean execlean +.PHONY: opt noopt debug mpi clean execlean diff --git a/HEN_HOUSE/src/egs_utilities.mortran b/HEN_HOUSE/src/egs_utilities.mortran index a5ebe0085..aed1e5bbb 100644 --- a/HEN_HOUSE/src/egs_utilities.mortran +++ b/HEN_HOUSE/src/egs_utilities.mortran @@ -1513,6 +1513,12 @@ IF( arg(l-5:l) = '_debug' ) [ IF( arg(l-5:l) = '_noopt' ) [ arg(l-5:l) = ' '; l = l-5; ] +"******************************************************************************* +" #PARALLEL_EGS - Added IF sentence when user code is compiled with MPI. +"******************************************************************************* +IF( arg(l-3:l) = '_mpi' ) [ + arg(l-3:l) = ' '; l = l - 4; +] l1 = len(ucode); IF( l > l1 ) [ $egs_fatal(*,' user code name is too long (',l,' chars)');