forked from sstsimulator/sst-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Pull Request sstsimulator#2335 from mjleven/sst-elements/checkp…
…oint Automatically Merged using SST Pull Request AutoTester PR Title: b'Checkpoint' PR Author: mjleven
- Loading branch information
Showing
6 changed files
with
109 additions
and
27 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
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
58 changes: 58 additions & 0 deletions
58
src/sst/elements/vanadis/tests/small/misc/checkpoint/checkpoint.c
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,58 @@ | ||
// Copyright 2009-2023 NTESS. Under the terms | ||
// of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Copyright (c) 2009-2023, NTESS | ||
// All rights reserved. | ||
// | ||
// Portions are copyright of other developers: | ||
// See the file CONTRIBUTORS.TXT in the top level directory | ||
// of the distribution for more information. | ||
// | ||
// This file is part of the SST software package. For license | ||
// information, see the LICENSE file in the top level directory of the | ||
// distribution. | ||
|
||
#include <sys/syscall.h> /* Definition of SYS_* constants */ | ||
#include <unistd.h> | ||
|
||
#include <omp.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main(int argc, char* argv[]) { | ||
|
||
setvbuf(stdout, NULL, _IONBF ,0); | ||
|
||
omp_lock_t lock; | ||
omp_init_lock(&lock); | ||
|
||
int nthreads, tid; | ||
char* tmp = getenv("OMP_NUM_THREADS"); | ||
printf("OMP_NUM_THREADS %s\n", tmp ? tmp: "not set"); | ||
|
||
/* Fork a team of threads giving them their own copies of variables */ | ||
#pragma omp parallel private(nthreads, tid) | ||
{ | ||
/* Obtain thread number */ | ||
tid = omp_get_thread_num(); | ||
|
||
syscall(500); | ||
|
||
/* Only master thread does this */ | ||
if (tid == 0) | ||
{ | ||
nthreads = omp_get_num_threads(); | ||
omp_set_lock( &lock ); | ||
printf("Number of threads = %d\n", nthreads); | ||
omp_unset_lock( &lock ); | ||
} | ||
|
||
omp_set_lock( &lock ); | ||
printf("Hello World from thread = %d\n", tid); | ||
omp_unset_lock( &lock ); | ||
|
||
} /* All threads join master thread and disband */ | ||
|
||
printf("exit\n"); | ||
} |
Binary file added
BIN
+1.1 MB
src/sst/elements/vanadis/tests/small/misc/checkpoint/riscv64/checkpoint
Binary file not shown.