Skip to content

Commit e013589

Browse files
committed
Merge branch 'amkrajewski-main'
2 parents 53aac6c + 1f51fe8 commit e013589

File tree

6 files changed

+126
-9
lines changed

6 files changed

+126
-9
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: MacOS (M1)
2+
3+
on:
4+
push:
5+
paths:
6+
- 'tests/**'
7+
- 'src/**'
8+
- 'Makefile'
9+
- 'requirements.txt'
10+
- '.github/workflows/testingOnPush_Apple.yaml'
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
runs-on: macos-14
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install gfortran and other dependencies with Homebrew
21+
run: brew install gcc make openblas netcdf netcdf-fortran open-mpi
22+
23+
- name: Install Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install Python dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
33+
- name: Run serial compilation with gfortran
34+
run: |
35+
make compiler=gfortran
36+
37+
- name: Run tests with gfortran
38+
run: |
39+
make compiler=gfortran tests
40+
cd tests
41+
../tests.run
42+
43+
- name: Run parallel compilation with mpifort
44+
run: |
45+
make compiler=mpifort
46+
47+
- name: Run tests with mpifort with 1 process
48+
run: |
49+
make compiler=mpifort tests
50+
cd tests
51+
mpirun -np 1 ../tests.run
52+
53+
- name: Run tests with mpifort with 4 processes
54+
run: |
55+
make compiler=mpifort tests
56+
cd tests
57+
mpirun -np 4 ../tests.run
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Ubuntu (x86_64)
2+
3+
on:
4+
push:
5+
paths:
6+
- 'tests/**'
7+
- 'src/**'
8+
- 'Makefile'
9+
- 'requirements.txt'
10+
- '.github/workflows/testingOnPush_Ubuntu.yaml'
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install gfortran and other dependencies with apt
21+
run: sudo apt-get install -y gfortran make libopenblas-dev libnetcdf-dev libnetcdff-dev mpich
22+
23+
- name: Install Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install Python dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
33+
- name: Run serial compilation with gfortran
34+
run: |
35+
make compiler=gfortran
36+
37+
- name: Run tests with gfortran
38+
run: |
39+
make compiler=gfortran tests
40+
cd tests
41+
../tests.run
42+
43+
- name: Run parallel compilation with mpifort
44+
run: |
45+
make compiler=mpifort
46+
47+
- name: Run tests with mpifort with 1 process
48+
run: |
49+
make compiler=mpifort tests
50+
cd tests
51+
mpirun -np 1 ../tests.run
52+
53+
- name: Run tests with mpifort with 4 processes
54+
run: |
55+
make compiler=mpifort tests
56+
cd tests
57+
mpirun -np 4 ../tests.run

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ INCDIR=include
7070
ifeq ($(SYSTEM),Darwin)
7171
FFLAGS += $(shell nf-config --fflags)
7272
LDFLAGS += $(shell nf-config --flibs) \
73-
$(shell nc-config --libs)
74-
-lnetcdf -lnetcdff
73+
$(shell nc-config --libs) \
74+
-lnetcdf -lnetcdff
7575
else
7676
FFLAGS +=$(shell nf-config --fflags)
7777
LDFLAGS += $(shell nf-config --flibs) \

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# BraWl
22

3+
[![Ubuntu (x86_64)](https://github.com/ChrisWoodgate/BraWl/actions/workflows/testingOnPush_Ubuntu.yaml/badge.svg)](https://github.com/ChrisWoodgate/BraWl/actions/workflows/testingOnPush_Ubuntu.yaml)
4+
[![License: MIT](https://img.shields.io/badge/License-LGPLv3-yellow.svg)](https://opensource.org/license/lgpl-3-0)
5+
36
`BraWl` — a package for performing lattice-based atomistic simulations of alloys with an internal energy given by a Bragg-Williams Hamiltonian. The package implements a range of conventional and enhanced sampling techniques, including Metropolis-Hastings Monte Carlo, Nested Sampling, and Wang-Landau sampling. This `README` contains key information and installation instructions, while developer documentation can be found at: [https://chriswoodgate.github.io/BraWl/](https://chriswoodgate.github.io/BraWl/)
47

58
Copyright (C) The Authors 2019-2025. Released under the GNU Lesser General Public License, version 3.

src/io.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ subroutine write_info(point)
8989
write(6,'(72("-"))')
9090
! Start the clock
9191
call cpu_time(t_stop)
92-
write(6,'(20x,"Execution time",1x,f9.1 " seconds")') t_stop-t_start
92+
write(6,'(20x,"Execution time",1x,f9.1,1x," seconds")') t_stop-t_start
9393
endif
9494

9595
write(6,'(72("="),/)' )

src/metropolis.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ subroutine metropolis_simulated_annealing(setup, metropolis, my_rank)
388388

389389
! Dump grids as xyz files if needed
390390
if (metropolis%write_final_config_xyz) then
391-
write(xyz_file, '(A11 I4.4 A12 I4.4 F2.1 A4)') 'configs/proc_', &
391+
write(xyz_file, '(A13,I4.4,A12,I4.4,F2.1,A4)') 'configs/proc_', &
392392
my_rank, '_config_at_T_', int(temp), temp-int(temp),'.xyz'
393393

394394
! Write xyz file
@@ -397,7 +397,7 @@ subroutine metropolis_simulated_annealing(setup, metropolis, my_rank)
397397

398398
! Dump grids as NetCDF files if needed
399399
if (metropolis%write_final_config_nc) then
400-
write(grid_file, '(A11 I4.4 A11 I4.4 F2.1 A3)') 'configs/proc_', my_rank, '_grid_at_T_', &
400+
write(grid_file, '(A13,I4.4,A11,I4.4,F2.1,A3)') 'configs/proc_', my_rank, '_grid_at_T_', &
401401
int(temp), temp-int(temp), '.nc'
402402
! Write grid to file
403403
call ncdf_grid_state_writer(trim(grid_file), ierr, config, setup)
@@ -427,22 +427,22 @@ subroutine metropolis_simulated_annealing(setup, metropolis, my_rank)
427427
! Write energy diagnostics
428428
if (metropolis%calculate_energies) then
429429
write(diagnostics_file, '(A,I4.4,A)') 'energies/proc_', my_rank, &
430-
'energy_diagnostics.dat'
430+
'_energy_diagnostics.dat'
431431
call diagnostics_writer(trim(diagnostics_file), temperature, &
432432
energies_of_T, C_of_T, acceptance_of_T)
433433
end if
434434

435435
! Write radial densities
436436
if (metropolis%calculate_asro) then
437-
write(radial_file, '(A,I3.3,A)') 'asro/proc_', my_rank, '_rho_of_T.nc'
437+
write(radial_file, '(A,I4.4,A)') 'asro/proc_', my_rank, '_rho_of_T.nc'
438438
! Write the radial densities to file
439439
call ncdf_radial_density_writer(trim(radial_file), rho_of_T, &
440440
shells, temperature, energies_of_T, setup)
441441
end if
442442

443443
! Write radial densities
444444
if (metropolis%calculate_alro) then
445-
write(alro_file, '(A22 I3.3 A12)') 'alro/proc_', my_rank, '_rho_of_T.nc'
445+
write(alro_file, '(A22,I4.4,A12)') 'alro/proc_', my_rank, '_rho_of_T.nc'
446446
! Write the radial densities to file
447447
call ncdf_order_writer(trim(alro_file), ierr, order_of_T, temperature, setup)
448448
end if
@@ -618,7 +618,7 @@ subroutine metropolis_decorrelated_samples(setup, metropolis, my_rank)
618618
! Get the energy of this configuration
619619
current_energy = setup%full_energy(config)
620620

621-
write(xyz_file, '(A11 I3.3 A8 I4.4 A6 I4.4 F2.1 A4)') &
621+
write(xyz_file, '(A,I4.4,A8,I4.4,A6,I4.4,F2.1,A4)') &
622622
'configs/proc_', my_rank, '_config_', &
623623
int(i/metropolis%n_sample_steps_asro), '_at_T_', int(temp),&
624624
temp-int(temp),'.xyz'

0 commit comments

Comments
 (0)