-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for Adiak integration, cmake changes, and smoketest_adiak
- Loading branch information
Aliza Lisan
committed
Jul 30, 2024
1 parent
9050909
commit 18e5b0a
Showing
7 changed files
with
235 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(adiak_DIR "/g/g92/lisan1/PFA/Adiak/install/lib/cmake/adiak") | ||
|
||
find_package(adiak REQUIRED) | ||
|
||
message(STATUS "Building Adiak smoketest (PERFFLOWASPECT_WITH_ADIAK == ON)") | ||
|
||
if(adiak_FOUND) | ||
message(STATUS "Adiak found: ${adiak_FOUND}") | ||
message(STATUS "Adiak include directories: ${adiak_INCLUDE_DIRS}") | ||
message(STATUS "Adiak library directories: ${adiak_LIBRARY_DIRS}") | ||
message(STATUS "Adiak libraries: ${adiak_LIBRARIES}") | ||
else() | ||
message(FATAL_ERROR "Adiak not found.") | ||
endif() | ||
|
||
include_directories(${adiak_INCLUDE_DIRS}) | ||
link_directories(${adiak_LIBRARY_DIRS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#include <adiak.hpp> | ||
#include <mpi.h> | ||
#include <iostream> | ||
#include <math.h> | ||
|
||
using namespace std; | ||
|
||
#define MASTER 0 //main process | ||
|
||
__attribute__((annotate("@critical_path()"))) | ||
int foo(const string &str) | ||
{ | ||
printf("foo\n"); | ||
int temp = 0; | ||
int temp1[10000] = {25}; | ||
int temp2[10000] = {22}; | ||
int temp3[10000] = {0}; | ||
for (int i = 0; i < 10000; i++) | ||
{ | ||
temp = temp + 1; | ||
temp3[i] = temp1[i] * temp2[i]; | ||
for (int j = i + 1; j < 10000; j++) | ||
{ | ||
temp3[j] = temp3[j] / 3; | ||
} | ||
} | ||
if (str == "hello") | ||
{ | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
__attribute__((annotate("@critical_path()"))) | ||
int main(int argc, char* argv[]) | ||
{ | ||
int taskid, numProcs; | ||
|
||
MPI_Init(&argc, &argv); | ||
MPI_Comm adk_comm = MPI_COMM_WORLD; | ||
MPI_Comm_size(MPI_COMM_WORLD, &numProcs); | ||
MPI_Comm_rank(MPI_COMM_WORLD, &taskid); | ||
|
||
adiak_init(&adk_comm); | ||
adiak_collect_all(); | ||
|
||
//main process code | ||
if (taskid == MASTER) | ||
{ | ||
cout << "taskid: " << taskid << '\n'; | ||
foo("hello"); | ||
} | ||
|
||
//worker process code | ||
if (taskid != MASTER) | ||
{ | ||
cout << "taskid: " << taskid << '\n'; | ||
foo("hello"); | ||
} | ||
|
||
adiak_fini(); | ||
MPI_Finalize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters