Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ! ---------------------------------------------
  2. !-----------MPI-------------
  3.          call MPI_Barrier( MPI_COMM_WORLD, ierror)
  4.       if (myid.ne.master) then
  5.          call MPI_SEND(Energy, count, MPI_DOUBLE_PRECISION, master, tag,
  6.      & MPI_COMM_WORLD, ierror)
  7.                 print*, 'node', myid, 'sent number is ',
  8.      & Energy
  9. !         call MPI_RECV(New_or_not, count, MPI_INTEGER, master, tag,
  10. !     & MPI_COMM_WORLD, status, ierror)
  11.       !endif
  12.       else
  13.         do current_id= num_of_procs - 1, 0, -1
  14.             if (current_id.gt.master) then
  15.                 call MPI_RECV(
  16.      &            Energy_current, count, MPI_DOUBLE_PRECISION,
  17.      &            current_id, tag,
  18.      &            MPI_COMM_WORLD, status, ierror)
  19.                   print*, 'node', myid, 'received number from ',
  20.      &            current_id ,' is ',
  21.      & Energy_current
  22.             else
  23.                 Energy_current = Energy
  24.             endif
  25. ! --- !!!!!!!!!!!!!!!!! Lets find out novelty of the Energy value ---
  26.            New_or_not = 1
  27.            do st = 1, N_States
  28.             if (dabs(Energy - Spectrum(st)).lt.1.d-5) then
  29.              New_or_not = 0
  30.              exit
  31.             endif !Not new
  32.            enddo !st
  33. ! -------------------------------------------------  
  34. ! --- Perform the gained state analysis --------        
  35.            if (New_or_not.eq.1) then
  36.                 call State_Analysis
  37.      &          (Energy_current, N_Spins, Conf, S_Value, Hmag_Dir,
  38.      &          Lessened_output, Write_State_or_not,
  39.      &          N_States, N_Steps, Spectrum )
  40.            endif
  41. ! ----------------------------------------------
  42.            if (current_id.gt.master) then
  43.                call MPI_SEND
  44.      &          (New_or_not, count,
  45.      &          MPI_INTEGER, master, tag,
  46.      &          MPI_COMM_WORLD, ierror)
  47.            endif
  48.         enddo
  49.       endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement