Skip to content

Commit f8e13ee

Browse files
committed
cleanup debugging prints
1 parent bad1556 commit f8e13ee

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

src/fpm_meta.f90

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module fpm_meta
9494
public :: MPI_TYPE_NAME
9595

9696
!> Debugging information
97-
logical, parameter, private :: verbose = .true.
97+
logical, parameter, private :: verbose = .false.
9898

9999
integer, parameter, private :: LANG_FORTRAN = 1
100100
integer, parameter, private :: LANG_C = 2
@@ -572,24 +572,23 @@ logical function msmpi_init(this,compiler,error) result(found)
572572
! Check that the runtime is installed
573573
bindir = ""
574574
call get_absolute_path(get_env('MSMPI_BIN'),bindir,error)
575-
576-
print *, '+ bindir=',bindir
577-
print *, '+ windir=',windir
575+
if (verbose) print *, '+ %MSMPI_BIN%=',bindir
578576

579577
! In some environments, variable %MSMPI_BIN% is missing (i.e. in GitHub Action images).
580578
! Do a second attempt: search for the default location
581579
if (len_trim(bindir)<=0 .or. allocated(error)) then
582-
print *, '+ MSMPI_BIN path does not exist, searching C:\Program Files\Microsoft MPI\Bin\....'
580+
if (verbose) print *, '+ %MSMPI_BIN% empty, searching C:\Program Files\Microsoft MPI\Bin\ ...'
583581
call get_absolute_path('C:\Program Files\Microsoft MPI\Bin\mpiexec.exe',bindir,error)
584582
endif
585583

586584
! Do a third attempt: search for mpiexec.exe in PATH location
587585
if (len_trim(bindir)<=0 .or. allocated(error)) then
586+
if (verbose) print *, '+ C:\Program Files\Microsoft MPI\Bin\ not found. searching %PATH%...'
588587

589588
call get_mpi_runner(runner_path,verbose,error)
590589

591590
if (.not.allocated(error)) then
592-
print *, '+ searching location of mpi runner, ',windir
591+
if (verbose) print *, '+ mpiexec found: ',runner_path%s
593592
call find_command_location(runner_path%s,bindir,verbose=verbose,error=error)
594593
endif
595594

@@ -731,18 +730,12 @@ subroutine find_command_location(command,path,echo,verbose,error)
731730
return
732731
end if
733732

734-
print *, '+ get temp filename...'
735-
736733
tmp_file = get_temp_filename()
737734

738-
print *, '+ get temp filename... '//tmp_file
739-
740735
! On Windows, we try both commands because we may be on WSL
741736
do try=merge(1,2,get_os_type()==OS_WINDOWS),2
742737
search_command = search(try)//command
743-
print *, '+ attempt ',try,': ',search_command
744738
call run(search_command, echo=echo, exitstat=stat, verbose=verbose, redirect=tmp_file)
745-
print *, 'after run, stat=',stat
746739
if (stat==0) exit
747740
end do
748741
if (stat/=0) then
@@ -756,7 +749,6 @@ subroutine find_command_location(command,path,echo,verbose,error)
756749
if (stat == 0)then
757750
do
758751
call getline(iunit, line, stat)
759-
print *, 'get line, stat=',stat
760752
if (stat /= 0) exit
761753
if (len(screen_output)>0) then
762754
screen_output = screen_output//new_line('a')//line
@@ -774,7 +766,6 @@ subroutine find_command_location(command,path,echo,verbose,error)
774766
! Only use the first instance
775767
length = index(screen_output,new_line('a'))
776768

777-
print *, '+ get line length: ',length
778769
multiline: if (length>1) then
779770
fullpath = screen_output(1:length-1)
780771
else
@@ -787,7 +778,6 @@ subroutine find_command_location(command,path,echo,verbose,error)
787778

788779
! Extract path only
789780
length = index(fullpath,command,BACK=.true.)
790-
print *, 'extract fullpath, length=',length
791781
if (length<=0) then
792782
call fatal_error(error,'full path to command ('//command//') does not include command name')
793783
return
@@ -800,11 +790,7 @@ subroutine find_command_location(command,path,echo,verbose,error)
800790
if (allocated(error)) return
801791

802792
! On Windows, be sure to return a path with no spaces
803-
if (get_os_type()==OS_WINDOWS) then
804-
print *, 'get dos path'
805-
path = get_dos_path(path,error)
806-
print *, 'dos path = ',path
807-
end if
793+
if (get_os_type()==OS_WINDOWS) path = get_dos_path(path,error)
808794

809795
if (allocated(error) .or. .not.is_dir(path)) then
810796
call fatal_error(error,'full path ('//path//') to command ('//command//') is not a directory')
@@ -1195,7 +1181,7 @@ subroutine run_mpi_wrapper(wrapper,args,verbose,exitcode,cmd_success,screen_outp
11951181

11961182
! Empty command
11971183
if (len_trim(wrapper)<=0) then
1198-
if (verbose) print *, '+ <EMPTY COMMAND>'
1184+
if (echo_local) print *, '+ <EMPTY COMMAND>'
11991185
if (present(exitcode)) exitcode = 0
12001186
if (present(cmd_success)) cmd_success = .true.
12011187
if (present(screen_output)) screen_output = string_t("")

0 commit comments

Comments
 (0)