Skip to content
Snippets Groups Projects
Commit 0b1b122b authored by lykos98's avatar lykos98
Browse files

added flag to turn on and off mpi thread funneled, implemented H2, no...

added flag to turn on and off mpi thread funneled, implemented H2, no guarantee for binary equality of results for now
parent 85c70c3c
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 2.4)
project(dadp)
set(CMAKE_C_COMPILER "mpicc")
add_compile_options("-O3")
add_compile_options("-g")
add_compile_options("-fopenmp")
link_libraries("-lm")
link_libraries("-fopenmp")
include_directories(${PROJECT_SOURCE_DIR}/include)
add_executable(main src/main/main.c src/tree/tree.c src/common/common.c src/tree/kdtreeV2.c src/tree/heap.c)
CC=mpicc CC=mpicc
CFLAGS=-O3 -g CFLAGS=-O3 -g -fopenmp
LDFLAGS=-lm -fopenmp LDFLAGS=-lm
all: main all: main
......
#!/bin/bash #!/bin/bash
#SBATCH --nodes=2 #SBATCH --nodes=1
#SBATCH --ntasks-per-node=2 #SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=18 #SBATCH --cpus-per-task=18
#SBATCH --time=01:00:00 #SBATCH --time=01:00:00
...@@ -26,6 +26,7 @@ rm bb/* ...@@ -26,6 +26,7 @@ rm bb/*
#time mpirun -n ${SLURM_NTASKS} --map-by ppr:1:node:PE=${SLURM_CPUS_PER_TASK} main #time mpirun -n ${SLURM_NTASKS} --map-by ppr:1:node:PE=${SLURM_CPUS_PER_TASK} main
time mpirun -n ${SLURM_NTASKS} --mca orte_base_help_aggregate 0 --map-by ppr:1:socket:PE=${SLURM_CPUS_PER_TASK} main time mpirun -n ${SLURM_NTASKS} --mca orte_base_help_aggregate 0 --map-by ppr:1:socket:PE=${SLURM_CPUS_PER_TASK} main
#time mpirun -n ${SLURM_NTASKS} --mca orte_base_help_aggregate 0 --map-by core main
#time mpirun -n ${SLURM_NTASKS} main #time mpirun -n ${SLURM_NTASKS} main
#time python3 check.py #time python3 check.py
......
#!/bin/bash
#SBATCH --nodes=8
#SBATCH --ntasks-per-node=36
#SBATCH --cpus-per-task=1
#SBATCH --time=01:00:00
#SBATCH --job-name=dADP-test
#SBATCH --account=ulearn
#SBATCH --partition=pleiadi
#SBATCH --output=out_pleiadi
#SBATCH --error=err_pleiadi
#SBATCH --mem=230G
cd $SLURM_SUBMIT_DIR
module restore dev_pleiadi
source /u/ftomba/my_envs/dadac-dev/bin/activate
make clean
make
#export PSM2_MQ_SENDREQS_MAX=268435456
#export PSM2_MQ_RECVREQS_MAX=268435456
rm bb/*
time mpirun -n ${SLURM_NTASKS} --mca orte_base_help_aggregate 0 --map-by core main
#time python3 check.py
...@@ -35,6 +35,9 @@ typedef struct datapoint_info_t { ...@@ -35,6 +35,9 @@ typedef struct datapoint_info_t {
#define CHECK_ALLOCATION(x) if(!x){printf("[!!!] %d rank encountered failed allocation at line %s ", ctx -> mpi_rank, __LINE__ ); exit(1);}; #define CHECK_ALLOCATION(x) if(!x){printf("[!!!] %d rank encountered failed allocation at line %s ", ctx -> mpi_rank, __LINE__ ); exit(1);};
#define CHECK_ALLOCATION_NO_CTX(x) if(!x){printf("[!!!] Failed allocation at line %d ", __LINE__ ); exit(1);}
#define MY_MALLOC(n) ({void* p = calloc(n,1); CHECK_ALLOCATION_NO_CTX(p); p; })
#define DB_PRINT(...) printf(__VA_ARGS__) #define DB_PRINT(...) printf(__VA_ARGS__)
#ifdef NDEBUG #ifdef NDEBUG
#undef DB_PRINT(...) #undef DB_PRINT(...)
...@@ -64,6 +67,7 @@ typedef struct datapoint_info_t { ...@@ -64,6 +67,7 @@ typedef struct datapoint_info_t {
(clock_gettime(CLOCK_MONOTONIC,&__end), \ (clock_gettime(CLOCK_MONOTONIC,&__end), \
(double)(__end.tv_sec - __start.tv_sec) + (__end.tv_nsec - __start.tv_nsec)/1e9) (double)(__end.tv_sec - __start.tv_sec) + (__end.tv_nsec - __start.tv_nsec)/1e9)
#define LOG_WRITE(sec_name,time) { \ #define LOG_WRITE(sec_name,time) { \
MPI_Barrier(ctx -> mpi_communicator); \
if(time > 0) \ if(time > 0) \
{ \ { \
double max, min, avg; \ double max, min, avg; \
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
#include "../common/common.h" #include "../common/common.h"
#include "../tree/tree.h" #include "../tree/tree.h"
//
#ifdef THREAD_FUNNELED
#define THREAD_LEVEL MPI_THREAD_FUNNELED #define THREAD_LEVEL MPI_THREAD_FUNNELED
#else
#define THREAD_LEVEL MPI_THREAD_MULTIPLE
#endif
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if defined (_OPENMP) #if defined (_OPENMP)
...@@ -50,6 +56,12 @@ int main(int argc, char** argv) { ...@@ -50,6 +56,12 @@ int main(int argc, char** argv) {
mpi_printf(&ctx,"Running pure MPI code\n"); mpi_printf(&ctx,"Running pure MPI code\n");
#endif #endif
#if defined (THREAD_FUNNELED)
mpi_printf(&ctx,"/!\\ Code build with MPI_THREAD_FUNNELED level\n");
#else
mpi_printf(&ctx,"/!\\ Code build with MPI_THREAD_MULTIPLE level\n");
#endif
/* /*
* Mock reading some files, one for each processor * Mock reading some files, one for each processor
*/ */
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment