Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
fail-fast: false
matrix:
gcc_v: [7, 9, 10]
mpich_v: ["3.3.2", "3.4.1"]
mpich_v: ["3.3.2", "3.4.2"]
env:
# To speed-up MPICH build
CFLAGS: -O0
Expand Down
2 changes: 1 addition & 1 deletion dev_scripts/install_mpich.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -euo pipefail

# Path as an optional first parameter
MPICH_DIR="${1-/home/$USER/mpich}"
MPICH_DIR="${1-$HOME/mpich}"
# We take current stable version as default
# (as of 06 Nov 2020).
MPICH_VERSION="${2-"3.3.2"}"
Expand Down
2 changes: 1 addition & 1 deletion dev_scripts/install_openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -euo pipefail

# Path as an optional first parameter
OPENMPI_DIR="${1-/home/$USER/openmpi}"
OPENMPI_DIR="${1-$HOME/openmpi}"
# We take current stable version as default
# (as of 06 Nov 2020)
OPENMPI_VERSION=${2-"4.0"}
Expand Down
7 changes: 6 additions & 1 deletion dev_scripts/install_pfunit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
# Exit script immediately upon error
set -euo pipefail

REPO_DIR="/home/$USER/pfunit"
REPO_DIR="$HOME/pfunit"
if [[ "$#" -eq 1 && ! -z $1 ]];then
REPO_DIR=$1
fi

if [[ -e $REPO_DIR ]];then
echo "ERROR: $REPO_DIR already exists."
exit 1
fi

git clone --recursive https://github.com/Goddard-Fortran-Ecosystem/pFUnit $REPO_DIR && cd $REPO_DIR

mkdir -p build && cd build
Expand Down
2 changes: 1 addition & 1 deletion dev_scripts/install_plumed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -euo pipefail

# Path as an optional first parameter
PLUMED_DIR="${1-/home/$USER/plumed}"
PLUMED_DIR="${1-$HOME/plumed}"
# We take the current stable version as default
# (as of 17 Dec 2020)
PLUMED_VERSION="${2-"2.6.2"}"
Expand Down
3 changes: 2 additions & 1 deletion src/modules.F90
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ end subroutine mass_init
end module mod_system

! module for permanent file handling
! TODO: Move this to a separate file.
module mod_files
implicit none
public
Expand Down Expand Up @@ -612,7 +613,7 @@ subroutine files_init(isbc, phase, ndist, nang, ndih)
write (UCHARGES, *) '# Time_step Bead_index ', (names(i), i=1, natom)

open (UDIP, file=chfiles(UDIP), access=chaccess, action='write')
write (UDIP, *) '# Time |D| Dx Dy Dz'
write (UDIP, *) '# Time Bead_index |D| Dx Dy Dz'
end if

if (isbc == 1) then
Expand Down
5 changes: 2 additions & 3 deletions tests/MINI/input.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
This is a sample input file for ABIN
NOTE: order of input sections matters!!
Very naive steepest descent minimization.

&general
nstep=100,
Expand All @@ -8,6 +7,7 @@ irest=0, ! should we restart from restart.xyz? (ignoring mini.dat), NOT working
pot='mmwater' !not done yet,options should be g09,orca,tera,turbo,molpro,nab,harm,morse,guillot,2dho
ipimd=3, !classical simulation 0, quantum simulation 1
nwalk=1, !number of random walkers
! TODO: Reduce the number of steps to reduce numerical differences between compilers.
nstep=200, !equilibration period,!not properly implemented yet
istage=0, !staging transformation (1), without staging (0)

Expand All @@ -27,4 +27,3 @@ natom=3, !number of atoms
inose=0, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3
temp=298.15, ! initial temperature for Maxwell-Boltzmann sampling [au]
/

2 changes: 0 additions & 2 deletions tests/TERAPI-FAILS/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ check_for_openmpi
# Compile default TC server
$MPICXX $TCSRC -Wall -o $TCEXE

#trap cleanup INT ABRT TERM EXIT

echo "########### SUBTEST 1 ###################"
./test1.sh
echo "########### SUBTEST 2 ###################"
Expand Down
25 changes: 12 additions & 13 deletions tests/TERAPI-FAILS/test1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ set -euo pipefail

source ../test_tc_server_utils.sh

# Rewrite cleanup function from utils sourced above.
function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=1
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX
Expand All @@ -20,28 +30,17 @@ $MPICXX $TCSRC -Wall -o $TCEXE

launch_hydra_nameserver $MPICH_HYDRA

hostname=$HOSTNAME
MPIRUN="$MPIRUN -nameserver $hostname -n 1"
MPIRUN="$MPIRUN -nameserver $HOSTNAME -n 1"

TC_PORT="test1.$$"
ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM -M $TC_PORT"
TC_CMD="./$TCEXE $TC_PORT.1"

trap cleanup INT ABRT TERM EXIT
$MPIRUN $TC_CMD > $TCOUT 2>&1 || true &
tcpid=$!

$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 || true &
abinpid=$!

function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes $abinpid $tcpid
26 changes: 13 additions & 13 deletions tests/TERAPI-FAILS/test2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ set -euo pipefail

source ../test_tc_server_utils.sh

function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=2
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX
TCOUT=${TCOUT}$IDX

launch_hydra_nameserver $MPICH_HYDRA
hostname=$HOSTNAME
MPIRUN="$MPIRUN -nameserver $hostname -n 1"

MPIRUN="$MPIRUN -nameserver $HOSTNAME -n 1"

TC_PORT="test$IDX.$$"
ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM -M $TC_PORT"
TC_CMD="./$TCEXE $TC_PORT.1"

trap cleanup INT ABRT TERM EXIT

$MPIRUN $TC_CMD > $TCOUT 2>&1 || true &
tcpid=$!

$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 || true &
abinpid=$!

function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes $abinpid $tcpid
24 changes: 13 additions & 11 deletions tests/TERAPI-FAILS/test3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
set -euo pipefail
source ../test_tc_server_utils.sh

function cleanup {
kill -9 ${job_pids[@]} > /dev/null 2>&1 || true
grep 'what()' $TCOUT.* > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=3
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX
Expand All @@ -15,11 +24,15 @@ MPIRUN="$MPIRUN -n 1"
ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM"

declare -A job_pids

trap cleanup INT ABRT TERM EXIT

for ((itera=1;itera<=N_TERA_SERVERS;itera++)) {
$MPIRUN ./$TCEXE > $TCOUT.$itera 2>&1 &
job_pids[$itera]=$!
}
sleep 1

# Grep port names from TC outputs, pass to ABIN via a file.
for ((itera=1;itera<=N_TERA_SERVERS;itera++)) {
grep 'port name' $TCOUT.$itera | awk -F"port name: " '{print $2;exit}' > $TC_PORT_FILE.$itera
Expand All @@ -28,15 +41,4 @@ for ((itera=1;itera<=N_TERA_SERVERS;itera++)) {
$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 &
job_pids[$(expr $N_TERA_SERVERS + 1)]=$!

function cleanup {
kill -9 ${job_pids[@]} > /dev/null 2>&1 || true
grep 'what()' $TCOUT.* > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes ${job_pids[@]}
25 changes: 12 additions & 13 deletions tests/TERAPI-FAILS/test4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ set -euo pipefail

source ../test_tc_server_utils.sh

function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=4
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX
Expand All @@ -20,28 +29,18 @@ $MPICXX $TCSRC -Wall -o $TCEXE

launch_hydra_nameserver $MPICH_HYDRA

hostname=$HOSTNAME
MPIRUN="$MPIRUN -nameserver $hostname -n 1"
MPIRUN="$MPIRUN -nameserver $HOSTNAME -n 1"

TC_PORT="test$IDX.$$"
ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM -M $TC_PORT"
TC_CMD="./$TCEXE $TC_PORT.1"

trap cleanup INT ABRT TERM EXIT

$MPIRUN $TC_CMD > $TCOUT 2>&1 || true &
tcpid=$!

$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 || true &
abinpid=$!

function cleanup {
kill -9 $tcpid $abinpid > /dev/null 2>&1 || true
grep 'what()' $TCOUT > TC_ERROR$IDX
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes $abinpid $tcpid
23 changes: 10 additions & 13 deletions tests/TERAPI-FAILS/test5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,26 @@ set -euo pipefail

source ../test_tc_server_utils.sh

function cleanup {
kill -9 $abinpid > /dev/null 2>&1 || true
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=5
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX

launch_hydra_nameserver $MPICH_HYDRA

hostname=$HOSTNAME
#MPIRUN="$MPIRUN -nameserver $hostname -n 1"

TC_PORT="test$IDX.$$"
ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM -M $TC_PORT"

trap cleanup INT ABRT TERM EXIT

$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 || true &
abinpid=$!

function cleanup {
kill -9 $abinpid > /dev/null 2>&1 || true
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes $abinpid
20 changes: 10 additions & 10 deletions tests/TERAPI-FAILS/test6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ set -euo pipefail

source ../test_tc_server_utils.sh

function cleanup {
kill -9 $abinpid > /dev/null 2>&1 || true
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

IDX=6
ABININ=input.in$IDX
ABINOUT=${ABINOUT}$IDX
Expand All @@ -17,17 +25,9 @@ MPIRUN="$MPIRUN -n 1"

ABIN_CMD="$ABINEXE -i $ABININ -x $ABINGEOM"

trap cleanup INT ABRT TERM EXIT

$MPIRUN $ABIN_CMD > $ABINOUT 2>&1 || true &
abinpid=$!

function cleanup {
kill -9 $abinpid > /dev/null 2>&1 || true
if [[ -f ERROR ]];then
mv ERROR ABIN_ERROR$IDX
fi
exit 0
}

trap cleanup INT ABRT TERM EXIT

check_running_processes $abinpid
Loading