Merge heat files into a single directory
Gaspi is still pending.
This commit is contained in:
parent
c36af81f93
commit
788f272760
@ -1,12 +1,93 @@
|
||||
add_library(heat_kernel STATIC common/kernel.c)
|
||||
# --- Common to all ---
|
||||
|
||||
add_library(heat_kernel STATIC kernel.c)
|
||||
target_include_directories(heat_kernel PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_compile_options(heat_kernel PRIVATE
|
||||
-Rpass-analysis=loop-vectorize
|
||||
-ffast-math)
|
||||
|
||||
add_library(heat_common STATIC common/misc.c)
|
||||
add_library(heat_common STATIC misc.c)
|
||||
target_include_directories(heat_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(heat_common PUBLIC m heat_kernel)
|
||||
|
||||
add_subdirectory(smp)
|
||||
add_subdirectory(mpi)
|
||||
# --- SMP based ---
|
||||
|
||||
add_library(heat_smp_common STATIC main_smp.c)
|
||||
target_link_libraries(heat_smp_common PUBLIC heat_common)
|
||||
|
||||
macro(mk_heat_smp NAME SOURCE)
|
||||
mk_bench(${NAME})
|
||||
target_sources(${NAME} PRIVATE ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE heat_smp_common)
|
||||
endmacro()
|
||||
|
||||
# No requisites
|
||||
mk_heat_smp(heat_seq solver_seq.c)
|
||||
|
||||
if(NANOS6_FOUND)
|
||||
macro(mk_heat_nanos6 NAME SOURCE)
|
||||
mk_heat_smp(${NAME} ${SOURCE})
|
||||
target_compile_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
target_link_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
endmacro()
|
||||
|
||||
mk_heat_nanos6(heat_nanos6 solver_ompss2.c)
|
||||
mk_heat_nanos6(heat_nanos6_residual solver_ompss2_residual.c)
|
||||
endif()
|
||||
|
||||
message(STATUS "NODES FOUND = ${NODES_FOUND}")
|
||||
if(NODES_FOUND)
|
||||
macro(mk_heat_nodes NAME SOURCE)
|
||||
mk_heat_smp(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Nodes::nodes)
|
||||
endmacro()
|
||||
|
||||
mk_heat_nodes(heat_nodes solver_ompss2.c)
|
||||
mk_heat_nodes(heat_nodes_residual solver_ompss2_residual.c)
|
||||
endif()
|
||||
|
||||
# --- MPI based ---
|
||||
|
||||
if(MPI_FOUND)
|
||||
add_library(heat_mpi_common STATIC main_mpi.c utils_mpi.c)
|
||||
target_link_libraries(heat_mpi_common PUBLIC heat_common MPI::MPI_C)
|
||||
|
||||
macro(mk_heat_mpi NAME SOURCE)
|
||||
mk_bench(${NAME})
|
||||
target_sources(${NAME} PRIVATE ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE heat_mpi_common)
|
||||
endmacro()
|
||||
mk_heat_mpi(heat_mpi solver_mpi.c)
|
||||
mk_heat_mpi(heat_mpi_nbuffer solver_mpi_nbuffer.c)
|
||||
|
||||
if(NANOS6_FOUND)
|
||||
macro(mk_heat_mpi_nanos6 NAME SOURCE)
|
||||
mk_heat_mpi(${NAME} ${SOURCE})
|
||||
target_compile_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
target_link_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
endmacro()
|
||||
mk_heat_mpi_nanos6(heat_mpi_nanos6_forkjoin solver_mpi_ompss2_forkjoin.c)
|
||||
mk_heat_mpi_nanos6(heat_mpi_nanos6_tasks solver_mpi_ompss2_tasks.c)
|
||||
|
||||
if(TAMPI_FOUND)
|
||||
macro(mk_heat_tampi_nanos6 NAME SOURCE)
|
||||
mk_heat_mpi_nanos6(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Tampi::tampi-c)
|
||||
endmacro()
|
||||
mk_heat_tampi_nanos6(heat_itampi_nanos6_tasks solver_itampi_ompss2_tasks.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NODES_FOUND)
|
||||
macro(mk_heat_mpi_nodes NAME SOURCE)
|
||||
mk_heat_mpi(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Nodes::nodes)
|
||||
endmacro()
|
||||
mk_heat_mpi_nodes(heat_mpi_nodes_forkjoin solver_mpi_ompss2_forkjoin.c)
|
||||
mk_heat_mpi_nodes(heat_mpi_nodes_tasks solver_mpi_ompss2_tasks.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --- GASPI ---
|
||||
|
||||
# TODO
|
||||
|
@ -1,52 +0,0 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/heat.h"
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
HeatConfiguration conf;
|
||||
readConfiguration(argc, argv, &conf);
|
||||
refineConfiguration(&conf, conf.rbs, conf.cbs);
|
||||
if (conf.verbose)
|
||||
printConfiguration(&conf);
|
||||
|
||||
int64_t rows = conf.rows+2;
|
||||
int64_t cols = conf.cols+2;
|
||||
|
||||
initialize(&conf, rows, cols, 0);
|
||||
|
||||
if (conf.warmup)
|
||||
solve(&conf, rows, cols, 1, NULL);
|
||||
|
||||
// Solve the problem
|
||||
double start = getTime();
|
||||
double residual = solve(&conf, rows, cols, conf.timesteps, NULL);
|
||||
double end = getTime();
|
||||
|
||||
int64_t totalElements = conf.rows*conf.cols;
|
||||
double throughput = (totalElements*conf.timesteps)/(end-start);
|
||||
|
||||
#ifdef _OMPSS_2
|
||||
int threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#else
|
||||
int threads = 1;
|
||||
#endif
|
||||
|
||||
fprintf(stderr,"%8s %8s %8s %8s %8s %8s %14s %14s %14s",
|
||||
"rows", "cols", "rbs", "cbs", "threads",
|
||||
"steps", "error", "time", "updates/s\n");
|
||||
fprintf(stdout, "%8ld %8ld %8d %8d %8d %8d %14e %14e %14e\n",
|
||||
conf.rows, conf.cols,
|
||||
conf.rbs, conf.cbs, threads,
|
||||
conf.convergenceTimesteps, residual, end-start, throughput);
|
||||
|
||||
if (conf.generateImage)
|
||||
writeImage(conf.imageFileName, conf.matrix, rows, cols);
|
||||
|
||||
finalize(&conf);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
#ifndef SIMD
|
||||
void computeBlock(const int64_t rows, const int64_t cols,
|
@ -4,8 +4,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
#ifdef TAMPI
|
||||
#include <TAMPI.h>
|
@ -2,7 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
@ -1,48 +0,0 @@
|
||||
if(NOT MPI_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
macro(mk_heat_mpi NAME SOURCE)
|
||||
mk_bench(${NAME})
|
||||
target_sources(${NAME} PRIVATE ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE heat_mpi_common)
|
||||
endmacro()
|
||||
|
||||
macro(mk_heat_mpi_nanos6 NAME SOURCE)
|
||||
mk_heat_mpi(${NAME} ${SOURCE})
|
||||
target_compile_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
target_link_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
endmacro()
|
||||
|
||||
macro(mk_heat_mpi_nodes NAME SOURCE)
|
||||
mk_heat_mpi(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Nodes::wrapper)
|
||||
endmacro()
|
||||
|
||||
macro(mk_heat_tampi_nanos6 NAME SOURCE)
|
||||
mk_heat_mpi_nanos6(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Tampi::tampi-c)
|
||||
endmacro()
|
||||
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
add_library(heat_mpi_common STATIC main.c utils.c)
|
||||
target_link_libraries(heat_mpi_common PUBLIC heat_common MPI::MPI_C)
|
||||
|
||||
mk_heat_mpi(b6_heat_mpi solver_mpi.c)
|
||||
mk_heat_mpi(b6_heat_mpi_nbuffer solver_mpi_nbuffer.c)
|
||||
|
||||
if(NANOS6_FOUND)
|
||||
mk_heat_mpi_nanos6(b6_heat_mpi_nanos6_forkjoin solver_mpi_ompss2_forkjoin.c)
|
||||
mk_heat_mpi_nanos6(b6_heat_mpi_nanos6_tasks solver_mpi_ompss2_tasks.c)
|
||||
endif()
|
||||
|
||||
if(NODES_FOUND)
|
||||
mk_heat_mpi_nodes(b6_heat_mpi_nodes_forkjoin solver_mpi_ompss2_forkjoin.c)
|
||||
mk_heat_mpi_nodes(b6_heat_mpi_nodes_tasks solver_mpi_ompss2_tasks.c)
|
||||
endif()
|
||||
|
||||
if(NANOS6_FOUND AND TAMPI_FOUND)
|
||||
mk_heat_tampi_nanos6(b6_heat_itampi_nanos6_tasks solver_itampi_ompss2_tasks.c)
|
||||
endif()
|
@ -1,33 +0,0 @@
|
||||
macro(mk_heat_smp NAME SOURCE)
|
||||
mk_bench(${NAME})
|
||||
target_sources(${NAME} PRIVATE ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE heat_smp_common)
|
||||
endmacro()
|
||||
|
||||
macro(mk_heat_nanos6 NAME SOURCE)
|
||||
mk_heat_smp(${NAME} ${SOURCE})
|
||||
target_compile_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
target_link_options(${NAME} PRIVATE "-fompss-2=libnanos6")
|
||||
endmacro()
|
||||
|
||||
macro(mk_heat_nodes NAME SOURCE)
|
||||
mk_heat_smp(${NAME} ${SOURCE})
|
||||
target_link_libraries(${NAME} PRIVATE Nodes::wrapper)
|
||||
endmacro()
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
add_library(heat_smp_common STATIC main.c)
|
||||
target_link_libraries(heat_smp_common PUBLIC heat_common)
|
||||
|
||||
mk_heat_smp(b6_heat_seq solver_seq.c)
|
||||
|
||||
if(NANOS6_FOUND)
|
||||
mk_heat_nanos6(b6_heat_nanos6 solver_ompss2.c)
|
||||
mk_heat_nanos6(b6_heat_nanos6_residual solver_ompss2_residual.c)
|
||||
endif()
|
||||
|
||||
if(NODES_FOUND)
|
||||
mk_heat_nodes(b6_heat_nodes solver_ompss2.c)
|
||||
mk_heat_nodes(b6_heat_nodes_residual solver_ompss2_residual.c)
|
||||
endif()
|
@ -1,8 +1,8 @@
|
||||
#include <mpi.h>
|
||||
#include <TAMPI.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
const char *
|
||||
summary(void)
|
@ -1,7 +1,7 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
int
|
||||
mpi_level(void)
|
@ -1,7 +1,7 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
typedef struct {
|
||||
MPI_Request send;
|
@ -1,7 +1,7 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
int
|
||||
mpi_level(void)
|
@ -1,7 +1,7 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
static int serial;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
typedef struct {
|
||||
MPI_Request send;
|
@ -1,7 +1,7 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
|
||||
static int serial;
|
@ -1,4 +1,4 @@
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
const char *
|
||||
summary(void)
|
@ -1,7 +1,7 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
const char *
|
||||
summary(void)
|
@ -1,4 +1,4 @@
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
const char *
|
||||
summary(void)
|
@ -1,4 +1,4 @@
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
const char *
|
||||
summary(void)
|
@ -2,7 +2,7 @@
|
||||
#include <TAMPI.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
|
||||
static inline void send(const double *data, int nelems, int dst, int tag)
|
@ -2,7 +2,7 @@
|
||||
#include <TAMPI.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
|
||||
static inline void fence(MPI_Win win)
|
@ -4,8 +4,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common/heat.h"
|
||||
#include "utils_mpi.h"
|
||||
#include "heat.h"
|
||||
|
||||
int rank;
|
||||
int nranks;
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <mpi.h>
|
||||
|
||||
#include "common/heat.h"
|
||||
#include "heat.h"
|
||||
|
||||
extern int rank;
|
||||
extern int nranks;
|
Loading…
Reference in New Issue
Block a user