253444c6d0
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler 1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release 1. The mpi module has been re-implemented and is significantly "mo' bettah" 1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk. == More details == Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7. Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey: * Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort) * The Fortran J3 committee * Tobias Burnus/gfortran * Tony !Goetz/Absoft * Terry !Donte/Oracle * ...and probably others whom I'm forgetting :-( There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax. Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time. As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory: {{{ ompi/mpi/fortran/ base/ - glue code mpif-h/ - what used to be ompi/mpi/f77 use-mpi-tkr/ - what used to be ompi/mpi/f90 use-mpi-ignore-tkr/ - new mpi module implementation use-mpi-f08/ - new mpi_f08 module implementation }}} There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version. Other things that were done: * ompi_info grew a few new output fields to describe what level of Fortran support is included * Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added * The old Fortran MPI libraries were renamed: * libmpi_f77 -> libmpi_mpifh * libmpi_f90 -> libmpi_usempi * The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example: {{{ shell$ ./configure CC=icc CXX=icpc FC=ifort ... }}} All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches). I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed. This commit was SVN r26283.
215 строки
5.9 KiB
C
215 строки
5.9 KiB
C
/*
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2011 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
#include "ompi_config.h"
|
|
#include <stdio.h>
|
|
|
|
#include "ompi/mpi/c/bindings.h"
|
|
#include "ompi/info/info.h"
|
|
#include "ompi/runtime/params.h"
|
|
#include "ompi/communicator/communicator.h"
|
|
#include "orte/mca/snapc/snapc.h"
|
|
|
|
#include "ompi/mpiext/cr/c/mpiext_cr_c.h"
|
|
|
|
static const char FUNC_NAME[] = "OMPI_CR_Quiesce_start";
|
|
|
|
int OMPI_CR_Quiesce_start(MPI_Comm commP, MPI_Info *info)
|
|
{
|
|
int ret = MPI_SUCCESS;
|
|
MPI_Comm comm = MPI_COMM_WORLD; /* Currently ignore provided comm */
|
|
orte_snapc_base_request_op_t *datum = NULL;
|
|
int my_rank;
|
|
|
|
/* argument checking */
|
|
if (MPI_PARAM_CHECK) {
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
}
|
|
|
|
/*
|
|
* Setup the data structure for the operation
|
|
*/
|
|
datum = OBJ_NEW(orte_snapc_base_request_op_t);
|
|
datum->event = ORTE_SNAPC_OP_QUIESCE_START;
|
|
datum->is_active = true;
|
|
|
|
MPI_Comm_rank(comm, &my_rank);
|
|
if( 0 == my_rank ) {
|
|
datum->leader = ORTE_PROC_MY_NAME->vpid;
|
|
} else {
|
|
datum->leader = -1; /* Unknown from non-root ranks */
|
|
}
|
|
|
|
/*
|
|
* All processes must make this call before it can start
|
|
*/
|
|
MPI_Barrier(comm);
|
|
|
|
/*
|
|
* Leader sends the request
|
|
*/
|
|
OPAL_CR_ENTER_LIBRARY();
|
|
ret = orte_snapc.request_op(datum);
|
|
/*ret = ompi_crcp_base_quiesce_start(info);*/
|
|
if( OMPI_SUCCESS != ret ) {
|
|
OBJ_RELEASE(datum);
|
|
OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OTHER,
|
|
FUNC_NAME);
|
|
}
|
|
|
|
OPAL_CR_EXIT_LIBRARY();
|
|
|
|
datum->is_active = false;
|
|
OBJ_RELEASE(datum);
|
|
|
|
/*
|
|
* (Old) info logic
|
|
*/
|
|
/*ompi_info_set((ompi_info_t*)*info, "target", cur_datum.target_dir);*/
|
|
|
|
return ret;
|
|
}
|
|
|
|
/*****************
|
|
* Local Functions
|
|
******************/
|
|
#if 0
|
|
/* Info keys:
|
|
*
|
|
* - crs:
|
|
* none = (Default) No CRS Service
|
|
* default = Whatever CRS service MPI chooses
|
|
* blcr = BLCR
|
|
* self = app level callbacks
|
|
*
|
|
* - cmdline:
|
|
* Command line to restart the process with.
|
|
* If empty, the user must manually enter it
|
|
*
|
|
* - target:
|
|
* Absolute path to the target directory.
|
|
*
|
|
* - handle:
|
|
* first = Earliest checkpoint directory available
|
|
* last = Most recent checkpoint directory available
|
|
* [global:local] = handle provided by the MPI library
|
|
*
|
|
* - restarting:
|
|
* 0 = not restarting
|
|
* 1 = restarting
|
|
*
|
|
* - checkpointing:
|
|
* 0 = No need to prepare for checkpointing
|
|
* 1 = MPI should prepare for checkpointing
|
|
*
|
|
* - inflight:
|
|
* default = message
|
|
* message = Drain inflight messages at the message level
|
|
* network = Drain inflight messages at the network level (if possible)
|
|
*
|
|
* - user_space_mem:
|
|
* 0 = Memory does not need to be managed
|
|
* 1 = Memory must be in user space (i.e., not on network card
|
|
*
|
|
*/
|
|
static int extract_info_into_datum(ompi_info_t *info, orte_snapc_base_quiesce_t *datum)
|
|
{
|
|
int info_flag = false;
|
|
int max_crs_len = 32;
|
|
bool info_bool = false;
|
|
char *info_char = NULL;
|
|
|
|
info_char = (char *) malloc(sizeof(char) * (OPAL_PATH_MAX+1));
|
|
|
|
/*
|
|
* Key: crs
|
|
*/
|
|
ompi_info_get(info, "crs", max_crs_len, info_char, &info_flag);
|
|
if( info_flag) {
|
|
datum->crs_name = strdup(info_char);
|
|
}
|
|
|
|
/*
|
|
* Key: cmdline
|
|
*/
|
|
ompi_info_get(info, "cmdline", OPAL_PATH_MAX, info_char, &info_flag);
|
|
if( info_flag) {
|
|
datum->cmdline = strdup(info_char);
|
|
}
|
|
|
|
/*
|
|
* Key: handle
|
|
*/
|
|
ompi_info_get(info, "handle", OPAL_PATH_MAX, info_char, &info_flag);
|
|
if( info_flag) {
|
|
datum->handle = strdup(info_char);
|
|
}
|
|
|
|
/*
|
|
* Key: target
|
|
*/
|
|
ompi_info_get(info, "target", OPAL_PATH_MAX, info_char, &info_flag);
|
|
if( info_flag) {
|
|
datum->target_dir = strdup(info_char);
|
|
}
|
|
|
|
/*
|
|
* Key: restarting
|
|
*/
|
|
ompi_info_get_bool(info, "restarting", &info_bool, &info_flag);
|
|
if( info_flag ) {
|
|
datum->restarting = info_bool;
|
|
} else {
|
|
datum->restarting = false;
|
|
}
|
|
|
|
/*
|
|
* Key: checkpointing
|
|
*/
|
|
ompi_info_get_bool(info, "checkpointing", &info_bool, &info_flag);
|
|
if( info_flag ) {
|
|
datum->checkpointing = info_bool;
|
|
} else {
|
|
datum->checkpointing = false;
|
|
}
|
|
|
|
/*
|
|
* Display all values
|
|
*/
|
|
OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
|
|
"crcp:bkmrk: %s extract_info: Info('crs' = '%s')",
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
(NULL == datum->crs_name ? "Default (none)" : datum->crs_name)));
|
|
OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
|
|
"crcp:bkmrk: %s extract_info: Info('cmdline' = '%s')",
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
(NULL == datum->cmdline ? "Default ()" : datum->cmdline)));
|
|
OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
|
|
"crcp:bkmrk: %s extract_info: Info('checkpointing' = '%c')",
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
(datum->checkpointing ? 'T' : 'F')));
|
|
OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
|
|
"crcp:bkmrk: %s extract_info: Info('restarting' = '%c')",
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
(datum->restarting ? 'T' : 'F')));
|
|
|
|
if( NULL != info_char ) {
|
|
free(info_char);
|
|
info_char = NULL;
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
|
}
|
|
#endif
|