Browse Source

Clear out old files

Adam Kelly 5 years ago
parent
commit
14098a081d
8 changed files with 0 additions and 136 deletions
  1. 0 24
      CMakeLists.txt
  2. 0 14
      example.c
  3. 0 30
      tangle/CMakeLists.txt
  4. 0 8
      tangle/include/tangle.h
  5. 0 16
      tangle/src/CMakeLists.txt
  6. 0 9
      tangle/src/cpu.c
  7. 0 21
      tangle/src/mpi.c
  8. 0 14
      tangle/src/omp.c

+ 0 - 24
CMakeLists.txt

@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 3.9)
-
-project(tangle_project)
-
-# EDIT HERE 
-
-set(USER_SOURCE "example.c")
-set(OUTPUT_EXE "example")
-
-option(DISTRIBUTED "Use MPI" OFF)
-option(MULTITHREADED "Use OpenMP" ON)
-
-# END EDIT
-
-if (NOT DEFINED ${TANGLE_LIB_PATH})
-    set(TANGLE_DIR "tangle")
-    add_subdirectory(${TANGLE_DIR})
-    set(TANGLE_LIB_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TANGLE_DIR}")
-    set(TANGLE_LIB_EXACT "${TANGLE_LIB_PATH}/libtangle.so")
-endif()
-
-
-add_executable(${OUTPUT_EXE} ${USER_SOURCE})
-target_link_libraries(${OUTPUT_EXE} tangle)

+ 0 - 14
example.c

@@ -1,14 +0,0 @@
-#include "tangle.h"
-
-#include <stdio.h>
-// #include "mpi.h"
-
-int main() {
-  // MPI_Init(NULL, NULL);
-
-  count_to(10); 
-
-  // MPI_Finalize();
-
-  return 0;
-}

+ 0 - 30
tangle/CMakeLists.txt

@@ -1,30 +0,0 @@
-# option(DISTRIBUTED "Use MPI" OFF)
-# option(MULTITHREADED "Use OpenMP" OFF)
-
-if (DISTRIBUTED)
-    find_package(MPI REQUIRED)
-    include_directories(${MPI_INCLUDE_PATH})
-elseif (MULTITHREADED)
-    find_package(OpenMP REQUIRED)
-endif()
-
-
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
-
-
-add_subdirectory(src)
-message("Tangle Source: ${TANGLE_SRC}")
-add_library(tangle SHARED ${TANGLE_SRC})
-
-# Header files & linking
-target_include_directories(tangle PRIVATE src PUBLIC include)
-
-
-if (DISTRIBUTED)
-    target_link_libraries(tangle ${MPI_C_LIBRARIES})
-    add_compile_definitions(_DISTRIBUTED)
-elseif (MULTITHREADED)
-    target_link_libraries(tangle PUBLIC OpenMP::OpenMP_CXX)
-    add_compile_definitions(_MULTITHREADED)
-
-endif()

+ 0 - 8
tangle/include/tangle.h

@@ -1,8 +0,0 @@
-// The outward facing API for Tangle
-
-#ifndef __TANGLE_H
-#define __TANGLE_H
-
-void count_to(int i);
-
-#endif

+ 0 - 16
tangle/src/CMakeLists.txt

@@ -1,16 +0,0 @@
-if (DISTRIBUTED)
-    set(TANGLE_SRC
-        ${CMAKE_CURRENT_SOURCE_DIR}/mpi.c
-        PARENT_SCOPE
-    )
-elseif (MULTITHREADED)
-    set(TANGLE_SRC
-        ${CMAKE_CURRENT_SOURCE_DIR}/omp.c
-        PARENT_SCOPE
-    )
-else()
-    set(TANGLE_SRC
-        ${CMAKE_CURRENT_SOURCE_DIR}/cpu.c
-        PARENT_SCOPE
-    )
-endif()

+ 0 - 9
tangle/src/cpu.c

@@ -1,9 +0,0 @@
-#include "tangle.h"
-
-#include <stdio.h>
-
-void count_to(int i) {
-  for (int j = 1; j <= i; j++) {
-    printf("%d\n", j);
-  }
-}

+ 0 - 21
tangle/src/mpi.c

@@ -1,21 +0,0 @@
-#include "tangle.h"
-
-#include <stdio.h>
-#include "mpi.h"
-
-void count_to(int i) {
-    int rank;
-    int size;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    printf("Hai from %d\n", rank);
-
-    for (int j = 1; j <= i; j++) {
-        if (j % size == rank) {
-            printf("%d\n", j);
-        }
-        MPI_Barrier(MPI_COMM_WORLD);
-    }
-}

+ 0 - 14
tangle/src/omp.c

@@ -1,14 +0,0 @@
-#include "tangle.h"
-#include <stdio.h>
-#include <omp.h>
-
-void count_to(int i) {
-  #pragma omp parallel num_threads(2)
-  {
-    int i = omp_get_thread_num();
-
-    for (int j = 1; j <= i; j++) {
-        printf("MP %d: %d\n", i, j);
-    }
-  }
-}