-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add MPI_Init and MPI_Finalize PMPI wrappers
- Loading branch information
1 parent
e6894ca
commit 0be4071
Showing
7 changed files
with
187 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright (c) 2019, Lawrence Livermore National Security, LLC. | ||
* Produced at the Lawrence Livermore National Laboratory. | ||
* | ||
* Copyright 2019, UT-Battelle, LLC. | ||
* | ||
* LLNL-CODE-741539 | ||
* All rights reserved. | ||
* | ||
* This is the license for UnifyCR. | ||
* For details, see https://github.com/LLNL/UnifyCR. | ||
* Please read https://github.com/LLNL/UnifyCR/LICENSE for full license text. | ||
*/ | ||
|
||
#include "pmpi_wrappers.h" | ||
#include "unifycr.h" | ||
#include <mpi.h> | ||
#include <stdio.h> | ||
|
||
int unifycr_mpi_init(int* argc, char*** argv) | ||
{ | ||
int rc, ret; | ||
int rank; | ||
int world_sz = 0; | ||
int app_id = 0; | ||
|
||
//fprintf(stderr, "DEBUG: %s - before PMPI_Init()\n", __func__); | ||
|
||
ret = PMPI_Init(argc, argv); | ||
|
||
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
MPI_Comm_size(MPI_COMM_WORLD, &world_sz); | ||
|
||
//fprintf(stderr, "DEBUG: %s - after PMPI_Init(), rank=%d ret=%d\n", | ||
// __func__, rank, ret); | ||
|
||
rc = unifycr_mount("/unifycr", rank, (size_t)world_sz, app_id); | ||
if (UNIFYCR_SUCCESS != rc) { | ||
fprintf(stderr, "UNIFYCR ERROR: unifycr_mount() failed with '%s'\n", | ||
unifycr_error_enum_description((unifycr_error_e)rc)); | ||
} | ||
|
||
return ret; | ||
} | ||
|
||
int MPI_Init(int* argc, char*** argv) | ||
{ | ||
return unifycr_mpi_init(argc, argv); | ||
} | ||
|
||
int unifycr_mpi_finalize(void) | ||
{ | ||
int rc, ret; | ||
|
||
rc = unifycr_unmount(); | ||
if (UNIFYCR_SUCCESS != rc) { | ||
fprintf(stderr, "UNIFYCR ERROR: unifycr_unmount() failed with '%s'\n", | ||
unifycr_error_enum_description((unifycr_error_e)rc)); | ||
} | ||
|
||
//fprintf(stderr, "DEBUG: %s - before PMPI_Finalize()\n", __func__); | ||
|
||
ret = PMPI_Finalize(); | ||
|
||
//fprintf(stderr, "DEBUG: %s - after PMPI_Finalize(), ret=%d\n", | ||
// __func__, ret); | ||
|
||
return ret; | ||
} | ||
|
||
int MPI_Finalize(void) | ||
{ | ||
return unifycr_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2019, Lawrence Livermore National Security, LLC. | ||
* Produced at the Lawrence Livermore National Laboratory. | ||
* | ||
* Copyright 2019, UT-Battelle, LLC. | ||
* | ||
* LLNL-CODE-741539 | ||
* All rights reserved. | ||
* | ||
* This is the license for UnifyCR. | ||
* For details, see https://github.com/LLNL/UnifyCR. | ||
* Please read https://github.com/LLNL/UnifyCR/LICENSE for full license text. | ||
*/ | ||
|
||
#ifndef UNIFYCR_PMPI_WRAPPERS_H | ||
#define UNIFYCR_PMPI_WRAPPERS_H | ||
|
||
/* MPI_Init PMPI wrapper */ | ||
int unifycr_mpi_init(int* argc, char*** argv); | ||
int MPI_Init(int* argc, char*** argv); | ||
|
||
/* MPI_Finalize PMPI wrapper */ | ||
int unifycr_mpi_finalize(void); | ||
int MPI_Finalize(void); | ||
|
||
#endif /* UNIFYCR_PMPI_WRAPPERS_H */ |
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
Oops, something went wrong.