Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Vahid9

    Increasing double loop efficiency

    I replaced the double loop with DGEMM in my code. The DGEMM is run inside three other loops and the whole code is run in parallel across 4 nodes of 64 cores each. When using the double DO loop, the total run time is 7h19m. With DGEMM replacing the double loop, the runtime is 3h34m, a...
  2. Vahid9

    Increasing double loop efficiency

    I will try both cases using 1) the two do loops, and 2) DGEMM, to see which is faster. It may well be that they are similar in speed. Thanks, Vahid
  3. Vahid9

    Increasing double loop efficiency

    Thanks mikrom for your response. Out of curiosity, wouldn't it be more efficient to define A as a column matrix, B as a row matrix and set K=1? Wouldn't this involve fewer calculations? Vahid
  4. Vahid9

    Increasing double loop efficiency

    I have the following double loop; DO i=1,100 DO j=1,100 S(i,j)= S(i,j)+ALPHA*exp[(real(i)/b1)**2]*exp[(real(j)/b2)**2] ENDDO ENDDO Here, S is a 100x100 symmetric REAL array, ALPHA, b1, and b2 are REAL constants. I am hoping to incorporate LAPACK dgemm or some other library function...
  5. Vahid9

    Preventing the addition of C-style comments in gfortran compilation

    Thanks for the link. In addition, I also added the tag "-nostdinc" to CPP. Now the code compiles. Cheers, Vahid
  6. Vahid9

    Preventing the addition of C-style comments in gfortran compilation

    ...The codes includes about 50 files. When I issue "make", the compilation crashes because somehow the following lines get added to .f files. /* Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can...
  7. Vahid9

    Printing in a fortran MPI/OpenMP environment

    If I do not know the printout is of the master node or both nodes, I am not sure how to define success here.
  8. Vahid9

    Printing in a fortran MPI/OpenMP environment

    This is likely a very simple question. I am running a fortran code compiled in hybrid openmp/openmpi. The code runs on 2 nodes (128 processors) with 32 MPI processes and 4 threads/MPI process. I am attempting to verify that a variable involved in the calculations on all the MPI processes and...
  9. Vahid9

    Broadcasting a REAL number to another file

    With trial and error, I managed to resolve the issue. By broadcast I meant broadcast across nodes so that all the nodes running the code can see the parameter. I had to make the parameter global by adding a SAVE statement. Anyhow, the issue is resolved but thank you xwb for taking the time to...
  10. Vahid9

    Broadcasting a REAL number to another file

    Hi, I am modifying a large code called Perturbo. Here I attempt to describe what the problem is with a simple example. I understand that this information may not be enough. The code has a module file called polar_dispersion.f90. I would like to broadcast the value of a REAL called conc (not...
  11. Vahid9

    Do loop in ascending and descending order

    Thank you Salgerman. Your solution is far more elegant than mine. I need to remove the duplicate lines but that is easy. Best wishes, Vahid
  12. Vahid9

    Do loop in ascending and descending order

    Hello, I found a not-so-elegant way to do this: For a 2-d grid, I use the following: n=0 do n2=nstart(2),nmax(2) if (MOD(n2,2)==0) then do n3=nstart(3),nmax(3) n=n+1 k(2,n)=n2-1...
  13. Vahid9

    Do loop in ascending and descending order

    ...nstart(3),tmp(3),k(3,npts) nmax(1)=4; nmax(2)=4; nmax(3)=4 nstart(1)=1; nstart(2)=1; nstart(3)=1 ntot=nmax(1)*nmax(2)*nmax(3) do n1=nstart(1),nmax(1) do n2=nstart(2),nmax(2) do n3=nstart(3),nmax(3)...
  14. Vahid9

    Reading files inside many numbered folders

    Thanks xwb. It worked. I just had to use i5.5 instead of i5 in the format statement to get the leading zeros. Best wishes, Vahid
  15. Vahid9

    Reading files inside many numbered folders

    ...the content of a.dat, save the necessary information to an array and then move on to the next folder. I declared a CHARACTER as such: CHARACTER(*), PARAMETER :: fileplace ="/home/vahid/scratch/K" The I run a DO loop over the folders: DO f=1,100 OPEN(unit=100,'(a,i5,a)')...
  16. Vahid9

    NaN output outside but not inside DO loop

    Thanks Mikrom. The NaN seem to be related to compiling with ifort which is the compiler I used. When I compile with gfortran, I get the same result as yours. Best wishes, Vahid
  17. Vahid9

    NaN output outside but not inside DO loop

    ...kb = 1.3806488e-23 ! J/K REAL, PARAMETER :: qq = 1.60217657e-19 ! eV REAL, PARAMETER :: bohr_2_cm = 5.2917721067e-9 kT = kb*temp/qq ! eV EVmax=6.28 EVmin=-5.83 ECmax=21.47 ECmin=6.8 V=262.8707 PRINT*, "Enter DOS file...
  18. Vahid9

    Transfer of data from inside a subroutine to main program

    Thank you Mikrom. The interface made it work. Best wishes, Vahid
  19. Vahid9

    Transfer of data from inside a subroutine to main program

    Hi Bill and Mikrom, Thank you for your responses. I have not used common blocks in the past and so I will look into it. I tried using "contains" before. The actual code has several other subroutines and using "contains" results in a lot of other errors which without the subroutine f(r), those...
  20. Vahid9

    Transfer of data from inside a subroutine to main program

    ...to be able to use r(i) inside the subroutine. Program Test IMPLICIT NONE real,dimension(1) :: r CALL f(r) write(*,*) r subroutine f(r) implicit none integer :: i real, intent(out) :: r(i) do i = 1, 10 r = 2*i...

Part and Inventory Search

Back
Top