Skip to content

Commit

Permalink
Removing assembly files
Browse files Browse the repository at this point in the history
Compilation of AVX code with ICC is is now possible
  • Loading branch information
j.m.o.rantaharju committed Oct 8, 2018
1 parent d13a61d commit 855f2b8
Show file tree
Hide file tree
Showing 22 changed files with 84 additions and 15,073 deletions.
9,978 changes: 0 additions & 9,978 deletions AVX512_patch

This file was deleted.

2 changes: 0 additions & 2 deletions README-AVX512
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ DESCRIPTION

The extension is enabled with the -DAVX521 flag in CFLAGS in the Makefiles.

To enable assembly versions pre-compiled for Skylake Xeon Scalable CPUs also include -DAVX512_ASM in CFLAGS.



AUTHORS
Expand Down
2 changes: 1 addition & 1 deletion devel/dirac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ LIBPATH = $(MPI_HOME)/lib

CFLAGS = -std=c89 -pedantic -fstrict-aliasing \
-Wall -Wno-long-long -Wstrict-prototypes \
-O2 -DAVX512
-O2 -DAVX512 -DAVX -DPM

LFLAGS = $(CFLAGS)

Expand Down
27 changes: 3 additions & 24 deletions devel/linalg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FLAGS = flags lat_parms dfl_parms

LATTICE = bcnds uidx geometry

LINALG = cmatrix_dble liealg salg salg_dble valg valg_dble
LINALG = cmatrix_dble liealg salg salg_dble valg valg_dble salg_avx512 salg_dble_avx512

RANDOM = ranlux ranlxs ranlxd gauss

Expand All @@ -42,9 +42,6 @@ VFLDS = vflds vinit
MODULES = $(FLAGS) $(LATTICE) $(RANDOM) $(LINALG) $(UTILS) \
$(UFLDS) $(SFLDS) $(SU3FCTS) $(VFLDS)

AVX512_MODULES = salg_avx512 salg_dble_avx512

AVX512_ASM_MODULES = salg_avx512_asm salg_dble_avx512_asm

# Logging option (-mpilog or -mpitrace or -mpianim)

Expand Down Expand Up @@ -76,7 +73,7 @@ LIBPATH = $(MPI_HOME)/lib

CFLAGS = -std=c89 -pedantic -fstrict-aliasing \
-Wall -Wno-long-long -Wstrict-prototypes \
-O2 -DAVX512
-O2 -DAVX512 -DAVX -DPM

LFLAGS = $(CFLAGS)

Expand All @@ -87,17 +84,6 @@ SHELL=/bin/bash
CC=mpicc
CLINKER=$(CC)

#Check CFLAGS to find which AVX512 flags are active
ifneq (,$(findstring AVX512_ASM,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_ASM_MODULES)
else
ifneq (,$(findstring AVX512,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_MODULES)
else
MODULES= $(STD_MODULES)
endif
endif

PGMS= $(MAIN) $(MODULES)

-include $(addsuffix .d,$(PGMS))
Expand All @@ -109,14 +95,7 @@ $(addsuffix .d,$(PGMS)): %.d: %.c Makefile


# rule to compile source programs
$(addsuffix .o,$(MAIN) $(STD_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# pattern to compile files in the avx512 directiories
$(addsuffix .o,$(AVX512_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

$(addsuffix .o,$(AVX512_ASM_MODULES)): %.o: %.s Makefile
$(addsuffix .o,$(MAIN) $(MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# rule to link object files
Expand Down
36 changes: 6 additions & 30 deletions devel/sw_term/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,25 @@ FLAGS = flags lat_parms dfl_parms

LATTICE = bcnds uidx ftidx geometry

LINALG = salg_dble liealg cmatrix_dble
LINALG = salg_dble liealg cmatrix_dble salg_dble_avx512

RANDOM = ranlux ranlxs ranlxd gauss

SFLDS = sflds

SU3FCTS = chexp su3prod su3ren cm3x3 random_su3

SW_TERM = pauli pauli_dble swflds sw_term
SW_TERM = pauli pauli_dble swflds sw_term pauli_avx512 pauli_dble_avx512

TCHARGE = ftcom ftensor

UFLDS = plaq_sum shift uflds udcom

UTILS = endian error hsum mutils utils wspace

STD_MODULES = $(FLAGS) $(LATTICE) $(LINALG) $(RANDOM) $(UFLDS) \
MODULES = $(FLAGS) $(LATTICE) $(LINALG) $(RANDOM) $(UFLDS) \
$(SU3FCTS) $(UTILS) $(SFLDS) $(TCHARGE) $(SW_TERM)

AVX512_MODULES = salg_dble_avx512 \
pauli_avx512 pauli_dble_avx512

AVX512_ASM_MODULES = salg_dble_avx512_asm \
pauli_avx512_asm pauli_dble_avx512_asm

# Logging option (-mpilog or -mpitrace or -mpianim)

LOGOPTION =
Expand All @@ -62,7 +56,7 @@ MDIR = ../../modules
VPATH = .:$(MDIR)/flags:$(MDIR)/lattice:$(MDIR)/linalg:$(MDIR)/random:\
$(MDIR)/uflds:$(MDIR)/su3fcts:$(MDIR)/utils:$(MDIR)/sflds:\
$(MDIR)/tcharge:$(MDIR)/sw_term:\
$(MDIR)/linalg/avx512:$(MDIR)/sw_term/avx512
$(MDIR)/linalg/avx512:$(MDIR)/sw_term/avx512


# additional include directories
Expand All @@ -81,7 +75,7 @@ LIBPATH = $(MPI_HOME)/lib

CFLAGS = -std=c89 -pedantic -fstrict-aliasing \
-Wall -Wno-long-long -Wstrict-prototypes \
-O2 -DAVX512
-O2 -DAVX512 -DAVX -DPM

LFLAGS = $(CFLAGS)

Expand All @@ -91,17 +85,6 @@ SHELL=/bin/bash
CC=mpicc
CLINKER=$(CC)

#Check CFLAGS to find which AVX512 flags are active
ifneq (,$(findstring AVX512_ASM,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_ASM_MODULES)
else
ifneq (,$(findstring AVX512,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_MODULES)
else
MODULES= $(STD_MODULES)
endif
endif

PGMS= $(MAIN) $(MODULES)

-include $(addsuffix .d,$(PGMS))
Expand All @@ -113,14 +96,7 @@ $(addsuffix .d,$(PGMS)): %.d: %.c Makefile


# rule to compile source programs
$(addsuffix .o,$(MAIN) $(STD_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# pattern to compile files in the avx512 directiories
$(addsuffix .o,$(AVX512_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

$(addsuffix .o,$(AVX512_ASM_MODULES)): %.o: %.s Makefile
$(addsuffix .o,$(MAIN) $(MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# rule to link object files
Expand Down
38 changes: 8 additions & 30 deletions main/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BLOCK = block blk_grid map_u2blk map_sw2blk map_s2blk

DFL = dfl_geometry dfl_subspace ltl_gcr dfl_sap_gcr dfl_modes

DIRAC = Dw_dble Dw Dw_bnd
DIRAC = Dw_dble Dw Dw_bnd Dw_avx512 Dw_dble_avx512

FLAGS = flags action_parms dfl_parms force_parms hmc_parms lat_parms \
mdint_parms rat_parms rw_parms sap_parms solver_parms
Expand All @@ -36,7 +36,8 @@ FORCES = force0 force1 force2 force3 force4 force5 \

LATTICE = bcnds uidx ftidx geometry

LINALG = salg salg_dble valg valg_dble liealg cmatrix_dble cmatrix
LINALG = salg salg_dble valg valg_dble liealg cmatrix_dble cmatrix \
salg_avx512 salg_dble_avx512

LINSOLV = cgne mscg fgcr fgcr4vd

Expand All @@ -54,7 +55,7 @@ SFLDS = sflds scom sdcom Pbnd Pbnd_dble

SU3FCTS = chexp su3prod su3ren cm3x3 random_su3

SW_TERM = pauli pauli_dble swflds sw_term
SW_TERM = pauli pauli_dble swflds sw_term pauli_avx512 pauli_dble_avx512

TCHARGE = ftcom ftensor tcharge ym_action

Expand All @@ -74,12 +75,6 @@ STD_MODULES = $(ARCHIVE) $(BLOCK) $(DFL) $(DIRAC) $(FLAGS) $(FORCES) \
$(UFLDS) $(UPDATE) $(UTILS) $(VFLDS) $(WFLOW)


AVX512_MODULES = Dw_avx512 Dw_dble_avx512 salg_avx512 salg_dble_avx512 \
pauli_avx512 pauli_dble_avx512

AVX512_ASM_MODULES = Dw_avx512_asm Dw_dble_avx512_asm salg_avx512_asm \
salg_dble_avx512_asm pauli_avx512_asm pauli_dble_avx512_asm


# Logging option (-mpilog or -mpitrace or -mpianim)

Expand All @@ -93,10 +88,10 @@ MDIR = ../modules
VPATH = .:$(MDIR)/flags:$(MDIR)/lattice:$(MDIR)/archive:$(MDIR)/linalg:\
$(MDIR)/random:$(MDIR)/uflds:$(MDIR)/mdflds:$(MDIR)/su3fcts:\
$(MDIR)/utils:$(MDIR)/forces:$(MDIR)/sflds:$(MDIR)/dirac:\
$(MDIR)/sw_term:$(MDIR)/tcharge:$(MDIR)/block:$(MDIR)/sap:\
$(MDIR)/linsolv:$(MDIR)/dfl:$(MDIR)/vflds:$(MDIR)/little:\
$(MDIR)/sw_term:$(MDIR)/tcharge:$(MDIR)/block:$(MDIR)/sap:\
$(MDIR)/linsolv:$(MDIR)/dfl:$(MDIR)/vflds:$(MDIR)/little:\
$(MDIR)/update:$(MDIR)/wflow:$(MDIR)/ratfcts:\
$(MDIR)/linalg/avx512:$(MDIR)/dirac/avx512:$(MDIR)/sw_term/avx512
$(MDIR)/linalg/avx512:$(MDIR)/dirac/avx512:$(MDIR)/sw_term/avx512



Expand All @@ -116,7 +111,7 @@ LIBPATH = $(MPI_HOME)/lib

CFLAGS = -std=c89 -pedantic -fstrict-aliasing \
-Wall -Wno-long-long -Wstrict-prototypes \
-O2 -DAVX512
-O2 -DAVX512 -DAVX -DPM

LFLAGS = $(CFLAGS)

Expand All @@ -128,7 +123,6 @@ LFLAGS = $(CFLAGS)
#
# -DCGNE_DBG -DFGCR_DBG -FGCR4VD_DBG -DMSCG_DBG
# -DDFL_MODES_DBG -DMDINT_DBG -DRWRAT_DBG
# -DAVX512 -DAVX512_ASM
#
# Add these (or some of these) to CFLAGS if debugging output is desired.

Expand All @@ -140,15 +134,7 @@ CLINKER=$(CC)


#Check CFLAGS to find which AVX512 flags are active
ifneq (,$(findstring AVX512_ASM,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_ASM_MODULES)
else
ifneq (,$(findstring AVX512,$(CFLAGS)))
MODULES= $(STD_MODULES) $(AVX512_MODULES)
else
MODULES= $(STD_MODULES)
endif
endif

PGMS= $(MAIN) $(MODULES)

Expand All @@ -159,18 +145,10 @@ PGMS= $(MAIN) $(MODULES)
$(addsuffix .d,$(PGMS)): %.d: %.c Makefile
@ $(GCC) -ansi $< -MM $(addprefix -I,$(INCPATH)) -o $@


# rule to compile source programs
$(addsuffix .o,$(MAIN) $(STD_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# pattern to compile files in the avx512 directiories
$(addsuffix .o,$(AVX512_MODULES)): %.o: %.c Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

$(addsuffix .o,$(AVX512_ASM_MODULES)): %.o: %.s Makefile
$(CC) $< -c $(CFLAGS) $(LOGOPTION) $(addprefix -I,$(INCPATH))

# rule to link object files
$(MAIN): %: %.o $(addsuffix .o,$(MODULES)) Makefile
$(CLINKER) $< $(addsuffix .o,$(MODULES)) $(LFLAGS) $(LOGOPTION) \
Expand Down
4 changes: 4 additions & 0 deletions modules/dirac/avx512/Dw_avx512.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* See ../Dw.c for more details and alternative implementations
*******************************************************************************/

#ifdef AVX512

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Expand Down Expand Up @@ -215,3 +217,5 @@ void deo_avx512(int *piup, int *pidn, su3 *u, spinor *pl, float ceo, spin_t *rs)
_avx512_dirac_combine_f_4( a3, b3 );
_avx512_write_4_halfspinor_f_reverse_dn( a1, a2, a3, &(*sm).c3.c1.re, &(*sp).c3.c1.re, &(*sm2).c3.c1.re, &(*sp2).c3.c1.re );
}

#endif
Loading

0 comments on commit 855f2b8

Please sign in to comment.