-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce additional statistics layer
Introduce a new "mt" (Multi-Threaded) layer for statistics to abstract multi-threaded isolation logic from the upper layers as well as from the single-threaded statistics collection. NOTE: this commit only introduces the layer and internally a 1-to-1 bypass to a single-threaded layer is performed. Signed-off-by: Artem Polyakov <[email protected]>
- Loading branch information
Showing
11 changed files
with
245 additions
and
36 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,98 @@ | ||
#include "mpiP-stats.h" | ||
#include "mpiP-mt-stats.h" | ||
|
||
int mpiPi_stats_mt_init(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_init(&stat->st_stat); | ||
} | ||
void mpiPi_stats_mt_fini(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_fini(&stat->st_stat); | ||
} | ||
|
||
void mpiPi_stats_mt_cs_gather(mpiPi_mt_stat_t *stat, | ||
int *ac, callsite_stats_t ***av ) | ||
{ | ||
mpiPi_stats_thr_cs_gather(&stat->st_stat, ac, av); | ||
} | ||
|
||
void mpiPi_stats_mt_cs_upd (mpiPi_mt_stat_t *stat, | ||
unsigned op, unsigned rank, void **pc, | ||
double dur, double sendSize, double ioSize, | ||
double rmaSize) | ||
{ | ||
mpiPi_stats_thr_cs_upd(&stat->st_stat, | ||
op, rank, pc, dur, | ||
sendSize, ioSize, rmaSize); | ||
} | ||
|
||
void mpiPi_stats_mt_cs_lookup(mpiPi_mt_stat_t *stat, | ||
callsite_stats_t *task_stats, | ||
callsite_stats_t **task_lookup, | ||
callsite_stats_t *dummy_buf, | ||
int initMax) | ||
{ | ||
mpiPi_stats_thr_cs_lookup(&stat->st_stat, task_stats, task_lookup, | ||
dummy_buf, initMax); | ||
} | ||
|
||
void mpiPi_stats_mt_coll_upd(mpiPi_mt_stat_t *stat, | ||
int op, double dur, double size, | ||
MPI_Comm * comm) | ||
{ | ||
mpiPi_stats_thr_coll_upd(&stat->st_stat, op, dur, size, comm); | ||
} | ||
|
||
void mpiPi_stats_mt_coll_gather(mpiPi_mt_stat_t *stat, double **_outbuf) | ||
{ | ||
mpiPi_stats_thr_coll_gather(&stat->st_stat, _outbuf); | ||
} | ||
|
||
void mpiPi_stats_mt_cs_reset(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_cs_reset(&stat->st_stat); | ||
} | ||
|
||
void mpiPi_stats_mt_coll_binstrings(mpiPi_mt_stat_t *stat, | ||
int comm_idx, char *comm_buf, | ||
int size_idx, char *size_buf) | ||
{ | ||
mpiPi_stats_thr_coll_binstrings(&stat->st_stat, | ||
comm_idx, comm_buf, | ||
size_idx, size_buf); | ||
} | ||
|
||
void mpiPi_stats_mt_pt2pt_upd (mpiPi_mt_stat_t *stat, | ||
int op, double dur, double size, | ||
MPI_Comm * comm) | ||
{ | ||
mpiPi_stats_thr_pt2pt_upd(&stat->st_stat, op, dur, size, comm); | ||
} | ||
|
||
void mpiPi_stats_mt_pt2pt_gather(mpiPi_mt_stat_t *stat, double **_outbuf) | ||
{ | ||
mpiPi_stats_thr_pt2pt_gather(&stat->st_stat, _outbuf); | ||
} | ||
|
||
void mpiPi_stats_mt_pt2pt_binstrings(mpiPi_mt_stat_t *stat, | ||
int comm_idx, char *comm_buf, | ||
int size_idx, char *size_buf) | ||
{ | ||
mpiPi_stats_thr_pt2pt_binstrings(&stat->st_stat, comm_idx, comm_buf, | ||
size_idx, size_buf); | ||
} | ||
|
||
int mpiPi_stats_mt_exit(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_exit(&stat->st_stat); | ||
} | ||
|
||
int mpiPi_stats_mt_enter(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_enter(&stat->st_stat); | ||
} | ||
|
||
int mpiPi_stats_mt_is_on(mpiPi_mt_stat_t *stat) | ||
{ | ||
mpiPi_stats_thr_is_on(&stat->st_stat); | ||
} |
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,118 @@ | ||
#ifndef MPIPMTSTATS_H | ||
#define MPIPMTSTATS_H | ||
|
||
#include "mpiP-stats.h" | ||
|
||
/* Per-thread MPI status */ | ||
typedef struct { | ||
union { | ||
mpiPi_thread_stat_t st_stat; | ||
}; | ||
} mpiPi_mt_stat_t; | ||
|
||
int mpiPi_stats_mt_init(mpiPi_mt_stat_t *stat); | ||
void mpiPi_stats_mt_fini(mpiPi_mt_stat_t *stat); | ||
void mpiPi_stats_mt_cs_gather(mpiPi_mt_stat_t *stat, | ||
int *ac, callsite_stats_t ***av ); | ||
void mpiPi_stats_mt_cs_upd (mpiPi_mt_stat_t *stat, | ||
unsigned op, unsigned rank, void **pc, | ||
double dur, double sendSize, double ioSize, | ||
double rmaSize); | ||
#define MPIPI_CALLSITE_MIN2MAX 1 | ||
#define MPIPI_CALLSITE_MIN2ZERO 0 | ||
void mpiPi_stats_mt_cs_lookup(mpiPi_mt_stat_t *stat, | ||
callsite_stats_t *task_stats, | ||
callsite_stats_t **task_lookup, | ||
callsite_stats_t *dummy_buf, | ||
int initMax); | ||
|
||
void mpiPi_stats_mt_coll_upd(mpiPi_mt_stat_t *stat, | ||
int op, double dur, double size, | ||
MPI_Comm * comm); | ||
void mpiPi_stats_mt_coll_gather(mpiPi_mt_stat_t *stat, double **_outbuf); | ||
void mpiPi_stats_mt_cs_reset(mpiPi_mt_stat_t *stat); | ||
void mpiPi_stats_mt_coll_binstrings(mpiPi_mt_stat_t *stat, | ||
int comm_idx, char *comm_buf, | ||
int size_idx, char *size_buf); | ||
|
||
void mpiPi_stats_mt_pt2pt_upd (mpiPi_mt_stat_t *stat, | ||
int op, double dur, double size, | ||
MPI_Comm * comm); | ||
void mpiPi_stats_mt_pt2pt_gather(mpiPi_mt_stat_t *stat, double **_outbuf); | ||
void mpiPi_stats_mt_pt2pt_binstrings(mpiPi_mt_stat_t *stat, | ||
int comm_idx, char *comm_buf, | ||
int size_idx, char *size_buf); | ||
|
||
int mpiPi_stats_mt_exit(mpiPi_mt_stat_t *stat); | ||
int mpiPi_stats_mt_enter(mpiPi_mt_stat_t *stat); | ||
int mpiPi_stats_mt_is_on(mpiPi_mt_stat_t *stat); | ||
|
||
#endif // MPIPMTSTATS_H | ||
|
||
/* | ||
<license> | ||
Copyright (c) 2019, Mellanox Technologies Inc. | ||
Written by Artem Polyakov | ||
All rights reserved. | ||
This file is part of mpiP. For details, see http://llnl.github.io/mpiP. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the disclaimer below. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the disclaimer (as noted below) in | ||
the documentation and/or other materials provided with the | ||
distribution. | ||
* Neither the name of the UC/LLNL nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF | ||
THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
Additional BSD Notice | ||
1. This notice is required to be provided under our contract with the | ||
U.S. Department of Energy (DOE). This work was produced at the | ||
University of California, Lawrence Livermore National Laboratory under | ||
Contract No. W-7405-ENG-48 with the DOE. | ||
2. Neither the United States Government nor the University of | ||
California nor any of their employees, makes any warranty, express or | ||
implied, or assumes any liability or responsibility for the accuracy, | ||
completeness, or usefulness of any information, apparatus, product, or | ||
process disclosed, or represents that its use would not infringe | ||
privately-owned rights. | ||
3. Also, reference herein to any specific commercial products, | ||
process, or services by trade name, trademark, manufacturer or | ||
otherwise does not necessarily constitute or imply its endorsement, | ||
recommendation, or favoring by the United States Government or the | ||
University of California. The views and opinions of authors expressed | ||
herein do not necessarily state or reflect those of the United States | ||
Government or the University of California, and shall not be used for | ||
advertising or product endorsement purposes. | ||
</license> | ||
*/ |
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
Empty file.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.