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
54 changes: 26 additions & 28 deletions analysis/lintf2_ether/gmx/.cleanup_gmx_analyses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,35 @@

# Cleanup the analysis directory after all analyses have finished.
#
# * Remove *_slurm-* suffix in directory names.
# * Remove *_slurm-[0-9]* suffix in directory names.
# * Move similar analyses into one directory.

gather() {
# Gather output of similar analyses scripts.
root="${1}"
mkdir "${root}" || exit
mv "${root}"_* "${root}"/
cd "${root}"/ || exit
mv "${root}"_*/* ./
rm -r "${root}"_*
cd ../ || exit
local root="${1}"
if [[ -d ${root} ]]; then
echo "WARNING: Directory already exists: '${root}'"
return 0
fi
if [[ -n $(find . -maxdepth 1 -type d -name "${root}*_slurm-[0-9]*" -print -quit) ]]; then
mkdir "${root}/" || exit
mv "${root}"*_slurm-[0-9]*/ "${root}/" || exit
cd "${root}/" || exit
mv "${root}"*_slurm-[0-9]*/* ./ || exit
rm -r "${root:?}"*_slurm-[0-9]*/ || exit
cd ../ || exit
else
echo "WARNING: No directory matching pattern '${root}*_slurm-[0-9]*'"
fi
}

mv energy_slurm-* energy
mv make_ndx_slurm-* make_ndx
mv polystat_slurm-* polystat
mv potential-z_slurm-* potential-z

gather density-z
gather densmap-z
gather msd
gather trjconv

name1=rdf
name2=rdf_slab-z
gather "${name2}"
mkdir "${name1}" || exit
mv "${name1}"_* "${name1}"/
cd "${name1}"/ || exit
mv "${name2}"/ ../
mv "${name1}"_*/* ./
rm -r "${name1}"_*
cd ../ || exit
gather "density-z"
gather "densmap-z"
gather "energy"
gather "make_ndx"
gather "msd"
gather "polystat"
gather "potential-z"
gather "rdf_slab-z"
gather "rdf"
gather "trjconv"
168 changes: 66 additions & 102 deletions analysis/lintf2_ether/mdt/.cleanup_mdt_analyses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,120 +2,84 @@

# Cleanup the analysis directory after all analyses have finished.
#
# * Remove *_slurm-* suffix in directory names.
# * Remove *_slurm-[0-9]* suffix in directory names.
# * Move similar analyses into one directory.

gather() {
# Gather output of similar analyses scripts.
root="${1}"
mkdir "${root}" || exit
mv "${root}"_* "${root}"/
cd "${root}"/ || exit
mv "${root}"_*/* ./
rm -r "${root}"_*
cd ../ || exit
local root="${1}"
if [[ -d ${root} ]]; then
echo "WARNING: Directory already exists: '${root}'"
return 0
fi
if [[ -n $(find . -maxdepth 1 -type d -name "${root}*_slurm-[0-9]*" -print -quit) ]]; then
mkdir "${root}/" || exit
mv "${root}"*_slurm-[0-9]*/ "${root}/" || exit
cd "${root}/" || exit
mv "${root}"*_slurm-[0-9]*/* ./ || exit
rm -r "${root:?}"*_slurm-[0-9]*/ || exit
cd ../ || exit
else
echo "WARNING: No directory matching pattern '${root}*_slurm-[0-9]*'"
fi
}

mv create_mda_universe_slurm-* create_mda_universe
mv energy_dist_slurm-* energy_dist
mv subvolume_charge_slurm-* subvolume_charge
gather_cmps() {
# Gather output of similar analyses scripts ordered by compounds
# into sub-directories.
local root="${1}"
local cmps="${2}"

gather discrete-z
gather lifetime_autocorr
# Create "root" directory.
if [[ -d ${root} ]]; then
echo "WARNING: Directory already exists: '${root}'"
return 0
else
mkdir "${root}/" || exit
fi

name=attribute_hist
for cmp in Li NBT OBT OE NTf2 ether; do
gather "${name}"_"${cmp}"
done
mkdir "${name}" || exit
mv "${name}"_* "${name}"/
# Move all "compound" directories to the root directory.
for cmp in ${cmps}; do
if [[ -n $(find . -maxdepth 1 -type d -name "${root}_${cmp}*_slurm-[0-9]*" -print -quit) ]]; then
mv "${root}_${cmp}"*_slurm-[0-9]*/ "${root}/" || exit
fi
done

name=axial_hex_dist
for cmp in 1nn 2nn; do
gather "${name}"_"${cmp}"
done
mkdir "${name}" || exit
mv "${name}"_* "${name}"/
# Check if the root directory is empty.
if [[ -n $(find "${root}/" -prune -empty) ]]; then
echo "WARNING: No directory matching pattern '${root}_<compound>*_slurm-[0-9]*'"
rm -r "${root:?}/" || exit
return 0
fi

name=discrete_hex
for cmp in Li NBT OBT OE; do
gather "${name}"_"${cmp}"
done
mkdir "${name}" || exit
mv "${name}"_* "${name}"/
# Gather all compound analyses.
cd "${root}/" || exit
for cmp in ${cmps}; do
gather "${root}_${cmp}"
done
cd ../ || exit
}

name=renewal_events
for cmp in Li-ether Li-NTf2; do
gather "${name}"_"${cmp}"
done
mkdir "${name}" || exit
mv "${name}"_* "${name}"/
gather "create_mda_universe"
gather "energy_dist"
gather "lifetime_autocorr"
gather "lig_change_at_pos_change_blocks_hist"
gather "lig_change_at_pos_change_blocks"
gather "lig_change_at_pos_change"
gather "subvolume_charge"

name=topo_map
for cmp in Li-OBT Li-OE; do
gather "${name}"_"${cmp}"
done
mkdir "${name}" || exit
mv "${name}"_* "${name}"/
gather_cmps "attribute_hist" "Li NBT OBT OE NTf2 ether"
gather_cmps "axial_hex_dist" "1nn 2nn"
gather_cmps "renewal_events" "Li-ether Li-NTf2"
gather_cmps "topo_map" "Li-OBT Li-OE"

name1=contact_hist
name2=contact_hist_at_pos_change
name3=contact_hist_slab-z
gather "${name2}"
for cmp in Li-OBT Li-OE; do
gather "${name3}"_"${cmp}"
done
mkdir "${name3}" || exit
mv "${name3}"_* "${name3}"/
mkdir "${name1}" || exit
mv "${name1}"_* "${name1}"/
cd "${name1}"/ || exit
mv "${name2}"/ "${name3}"/ ../
mv "${name1}"_*/* ./
rm -r "${name1}"_*
cd ../ || exit
gather_cmps "contact_hist_slab-z" "Li-OBT Li-OE"
gather "contact_hist_at_pos_change"
gather "contact_hist"

name1=msd
name2=msd_at_coord_change
name3=msd_layer
gather "${name2}"
gather "${name3}"
cd "${name3}" || exit
for cmp in ether Li NBT NTf2 OBT OE; do
for file in *_"${cmp}"_slurm-*; do
if [[ -f ${file} ]]; then
mkdir "${name3}"_"${cmp}" || exit
mv ./*_"${cmp}"_* "${name3}"_"${cmp}"/
break
fi
done
done
cd ../ || exit
mkdir "${name1}" || exit
mv "${name1}"_* "${name1}"/
cd "${name1}"/ || exit
mv "${name2}"/ "${name3}"/ ../
mv "${name1}"_*/* ./
rm -r "${name1}"_*
cd ../ || exit
gather_cmps "discrete_hex" "Li NBT OBT OE"
gather "discrete-z"

name1=lig_change_at_pos_change_blocks
name2=lig_change_at_pos_change_blocks_hist
gather "${name2}"
mkdir "${name1}" || exit
mv "${name1}"_* "${name1}"/
cd "${name1}"/ || exit
mv "${name2}"/ ../
mv "${name1}"_*/* ./
rm -r "${name1}"_*
cd ../ || exit
name1=lig_change_at_pos_change
name2=lig_change_at_pos_change_blocks
name3=lig_change_at_pos_change_blocks_hist
mkdir "${name1}" || exit
mv "${name1}"_* "${name1}"/
cd "${name1}"/ || exit
mv "${name2}"/ "${name3}"/ ../
mv "${name1}"_*/* ./
rm -r "${name1}"_*
cd ../ || exit
gather_cmps "msd_layer" "Li NBT OBT OE NTf2 ether"
gather "msd_at_coord_change"
gather "msd"
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_Li.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_Li_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --mem=1G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_NBT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_NBT_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --mem=1G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_NTf2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_NTf2_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=12G
#SBATCH --mem=2G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_OBT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_OBT_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=8G
#SBATCH --mem=2G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_OE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_OE_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=12G
#SBATCH --mem=2G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
2 changes: 1 addition & 1 deletion analysis/lintf2_ether/mdt/attribute_hist_ether.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#SBATCH --output="mdt_attribute_hist_ether_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=16G
#SBATCH --mem=2G
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_Li-O.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=7-00:00:00
#SBATCH --job-name="mdt_contact_hist_Li-O"
#SBATCH --output="mdt_contact_hist_Li-O_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_Li-OBT.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=3-12:00:00
#SBATCH --job-name="mdt_contact_hist_Li-OBT"
#SBATCH --output="mdt_contact_hist_Li-OBT_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_Li-OE.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=3-12:00:00
#SBATCH --job-name="mdt_contact_hist_Li-OE"
#SBATCH --output="mdt_contact_hist_Li-OE_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_O-Li.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=7-00:00:00
#SBATCH --job-name="mdt_contact_hist_O-Li"
#SBATCH --output="mdt_contact_hist_O-Li_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_OBT-Li.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=3-12:00:00
#SBATCH --job-name="mdt_contact_hist_OBT-Li"
#SBATCH --output="mdt_contact_hist_OBT-Li_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
6 changes: 3 additions & 3 deletions analysis/lintf2_ether/mdt/contact_hist_OE-Li.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

#SBATCH --time=2-00:00:00
#SBATCH --time=3-12:00:00
#SBATCH --job-name="mdt_contact_hist_OE-Li"
#SBATCH --output="mdt_contact_hist_OE-Li_slurm-%j.out"
#SBATCH --nodes=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=1G
#SBATCH --cpus-per-task=1
#SBATCH --mem=512M
# The above options are only default values that can be overwritten by
# command-line arguments

Expand Down
Loading