Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion music-config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from predict_rank import predictRank
from music import predictRank
from config import launchedByMusic, supersedeArgv, postponeSetup, \
define, Application, connect, configure, launch
2 changes: 1 addition & 1 deletion music-config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import os

from music.predict_rank import predictRank
from music import predictRank

# This function now defined in predict_rank.py
#
Expand Down
1 change: 1 addition & 0 deletions pymusic/pyconfig.pxi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEF MPI4V2 = True
1 change: 1 addition & 0 deletions src/application_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ namespace MUSIC {
int size = MPI::COMM_WORLD.Get_size ();
int my_rank = MPI::COMM_WORLD.Get_rank ();
int *colors = new int[size];
ApplicationInfo* app = lookup (my_app_label);
colors[my_rank] = lookup (my_app_label)->color ();
MPI::COMM_WORLD.Allgather (MPI::IN_PLACE, 0, MPI::INT, colors, 1, MPI::INT);

Expand Down
2 changes: 2 additions & 0 deletions src/music/setup.hh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ namespace MUSIC {

void init (int& argc, char**& argv);

void init_comm ();

void maybeProcessMusicArgv (int& argc, char**& argv);

void maybePostponedSetup ();
Expand Down
42 changes: 38 additions & 4 deletions src/setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
#if MUSIC_USE_MPI
#include <mpi.h>

#include "music/ioutils.hh"
#include "music/runtime.hh"
#include "music/parse.hh"
#include "music/error.hh"
#include "music/application_mapper.hh"
#include <iostream>
#include <strings.h>
#include <fstream>

Expand All @@ -46,7 +48,6 @@ namespace MUSIC {

}


Setup::Setup (int& argc, char**& argv, int required, int* provided)
: argc_ (argc), argv_ (argv)
{
Expand Down Expand Up @@ -101,8 +102,14 @@ namespace MUSIC {
assert(config.length() > 0);
launchedByMusic_ = true;
if (!config.compare (0, 8, "POSTPONE"))
{
postponeSetup_ = true;
config_ = new Configuration (config);
config_ = new Configuration ();
}
else
{
config_ = new Configuration (config);
}
}
else if (launchedMPMD (argc, argv, config))
{
Expand Down Expand Up @@ -131,6 +138,23 @@ namespace MUSIC {
config_ = new Configuration ();


// Can be moved to configuration.cc or re-written more clean, the current
// form is just for testing
int color;
if (postponeSetup_)
{
std::istringstream env (config);
IOUtils::read (env);
env.ignore();
/* env.ignore(); */
env >> color;
}
else
{
color = config_->Color ();
}


connections_ = new std::vector<Connection*>; // destroyed by runtime
if (launchedByMusic ())
{
Expand All @@ -141,7 +165,9 @@ namespace MUSIC {
argc = argc_;
argv = argv_;
}
comm = MPI::COMM_WORLD.Split (config_->Color (), myRank);
std::cerr << "MUSIC: Comm split color "
<< color << " at rank " << myRank << std::endl;
comm = MPI::COMM_WORLD.Split (color, myRank);
}
else
{
Expand Down Expand Up @@ -263,7 +289,15 @@ namespace MUSIC {
if (postponeSetup_)
{
delete config_;
config_ = new Configuration ();
std::string config (getenv (Configuration::configEnvVarName));
if (!config.compare (0, 8, "POSTPONE"))
{
std::ostringstream oss;
oss << "MUSIC: <proper message>: ";
error0 (oss.str ());
}
std::cout << "Configuration env at this application is " << config << std::endl;
config_ = new Configuration (config);
fullInit ();
}
}
Expand Down