mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Make sopt/popt aliases for ssmp/psmp with OMP_NUM_THREADS=1
This commit is contained in:
parent
1e4446c2b1
commit
2902a7cc55
2 changed files with 18 additions and 2 deletions
11
Makefile
11
Makefile
|
|
@ -126,9 +126,18 @@ $(EXE_NAMES) all toolversions extversions extclean libcp2k cp2k_shell exts $(EXT
|
|||
|
||||
# stage 2: Store the version target in $(ONEVERSION),
|
||||
# Call make recursively with $(ORIG_TARGET) as target.
|
||||
$(VERSION) :
|
||||
$(filter-out sopt, popt, $(VERSION)) :
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION=$@
|
||||
|
||||
sopt:
|
||||
@+echo "Version sopt is now an alias for ssmp with OMP_NUM_THREADS=1."
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION="ssmp"
|
||||
cd $(EXEDIR); ln -sf cp2k.ssmp cp2k.sopt
|
||||
popt:
|
||||
@+echo "Version popt is now an alias for psmp with OMP_NUM_THREADS=1."
|
||||
@+$(MAKE) --no-print-directory -f $(MAKEFILE) $(ORIG_TARGET) ORIG_TARGET="" VERSION="" ONEVERSION="psmp"
|
||||
cd $(EXEDIR); ln -sf cp2k.psmp cp2k.popt
|
||||
|
||||
else
|
||||
|
||||
# stage 3: Include arch-file, create dirs, and run makedep.py for given $(ONEVERSION).
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
! **************************************************************************************************
|
||||
PROGRAM cp2k
|
||||
|
||||
USE OMP_LIB, ONLY: omp_set_num_threads
|
||||
USE cp2k_info, ONLY: compile_revision,&
|
||||
cp2k_flags,&
|
||||
cp2k_version,&
|
||||
|
|
@ -98,7 +99,7 @@ PROGRAM cp2k
|
|||
ALLOCATE (initial_variables(2, 1:0))
|
||||
|
||||
! get command and strip path
|
||||
CALL GET_COMMAND(command, status=ierr)
|
||||
CALL GET_COMMAND_ARGUMENT(0, command, status=ierr)
|
||||
CPASSERT(ierr == 0)
|
||||
l = LEN_TRIM(command)
|
||||
DO i = l, 1, -1
|
||||
|
|
@ -116,6 +117,12 @@ PROGRAM cp2k
|
|||
command_line_error = .TRUE.
|
||||
END IF
|
||||
|
||||
! check if binary was invoked as sopt or popt alias
|
||||
l = LEN_TRIM(command)
|
||||
IF (command(l - 4:l) == ".sopt" .OR. command(l - 4:l) == ".popt") THEN
|
||||
CALL omp_set_num_threads(1)
|
||||
ENDIF
|
||||
|
||||
i_arg = 0
|
||||
arg_loop: DO WHILE (i_arg < COMMAND_ARGUMENT_COUNT())
|
||||
i_arg = i_arg + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue